561
tzvook
solution for xdirectory blank contact page
  • 2004/6/15 13:19

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


If your UNIX server register_globals is off and you try to click on the Xdirectory "Email" button you get a blank page.
I spent today 2 hours to find out how can my local (XP pro box) comunicate with the "contact.php" and why my UNIX server does not ............
In the end the solution was so simple ( like always ) - it was simply a mattar of register_globals off

so to help you guys not spending 2 hours for nothing, the solution (at least my solution) is to use an .htaccess file in Xdirectory's root dir

one line of code should be in the file:
php_flag register_globals on


About the question if it's safe enough? ... enough for me
but I'll be happy to hear some opinions about it.

keep Xooping !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



562
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/13 8:24

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi
I sent the files again and also put them zipped @ a tmp location for download.

10x so very much

Tzvook



563
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/11 20:49

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Hi riaanvdb

Did you got the files?



564
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/10 21:03

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

riaanvdb wrote:
Hi tzvook, I have been cruel long enough



Quote:

send me the zipped module to my e-mail and I will sort it for you.


10x Riaan
file is on it's way



565
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/10 12:34

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Here is the code I got so far (remember I'm not a coder)

The viewlist.php

<?php
// $Id: topten.php,v 1.7 2003/03/25 11:08:22 buennagel Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>  &nbs ... nbsp;   //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//    Hacks provided by: Adam Frick                                             //
//     e-mail: africk69@yahoo.com                                                 //
//    Purpose: Create a yellow-page like business directory for XOOPS using      //
//    the mylinks module as the foundation.                                     //
// ------------------------------------------------------------------------- //
include "header.php";
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$mytree = new XoopsTree($xoopsDB->prefix("xdir_cat"),"cid","pid");
$xoopsOption['template_main'] = 'xdir_viewlist.html';
include 
XOOPS_ROOT_PATH."/header.php";
//generates top 10 charts by rating and hits for each main category

$list $HTTP_GET_VARS['list'];

// Tzvook //
$letters letters();
$xoopsTpl->assign('letters'$letters);




if(isset(
$rate)){
    
$sort _MD_RATING;
    
$sortDB "title";
}else{
    
$sort _MD_HITS;
    
$sortDB "title";
}
$xoopsTpl->assign('lang_sortby' ,$sort);
$xoopsTpl->assign('lang_rank' _MD_RANK);
$xoopsTpl->assign('lang_title' _MD_TITLE);
$xoopsTpl->assign('lang_category' _MD_CATEGORY);
$xoopsTpl->assign('lang_hits' _MD_HITS);
$xoopsTpl->assign('lang_rating' _MD_RATING);
$xoopsTpl->assign('lang_vote' _MD_VOTE);
$arr=array();

$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("xdir_cat")." WHERE title LIKE '$list%' AND status>0");
list(
$numrows) = $xoopsDB->fetchRow($result);

$XDlisting = array();
while(list(
$cid$ctitle)=$xoopsDB->fetchRow($result)){
    
$XDlisting[$e]['title'] = sprintf(_MD_TOP10$myts->htmlSpecialChars($ctitle));
    
$query "select lid, cid, title, hits, rating, votes from ".$xoopsDB->prefix("xdir_links")." where status>0 and (cid=$cid";
    
// get all child cat ids for a given cat id
    
$arr=$mytree->getAllChildId($cid);
    
$size count($arr);
    for(
$i=0;$i<$size;$i++){
        
$query .= " or cid=".$arr[$i]."";
    }
    
$query .= ") order by ".$sortDB." ASC";
    
$result2 $xoopsDB->query($query,10,0);
    
$rank 1;
    while(list(
$lid,$lcid,$ltitle,$hits,$rating,$votes)=$xoopsDB->fetchRow($result2)){
        
$catpath $mytree->getPathFromId($lcid"title");
        
$catpathsubstr($catpath1);
        
$catpath str_replace("/"," <span class='fg2'>»</span> ",$catpath);
        
$XDlisting[$e]['links'][] = array('id' => $lid'cid' => $cid'rank' => $rank'title' => $myts->htmlSpecialChars($ltitle), 'category' => $catpath'hits' => $hits'rating' => number_format($rating2), 'votes' => $votes);
        
$rank++;
    }
    
$e++;
}
$xoopsTpl->assign('XDlisting'$XDlisting);
include 
XOOPS_ROOT_PATH.'/footer.php';
?>



my xdir_viewlist.html template:


<br>
<
center>

<!--  
Tzvook -->

<
p>
<
div align 'center' class = 'itemPermaLink'><{$letters}></div><br />
</
center>
<
br>

<
br /><br />

<
div style="margin-top: 2px;text-align: center;font-size: 20px;font-weight: bold;">Business Directory</div>
<
br /><br /><br />
<!-- 
Start XDlisting loop -->
<{foreach 
item=XDlisting from=$XDlistings}>
<
table class="outer">
  <
tr>
    <
th colspan="6"><{$XDlisting.title}> (<{$lang_sortby}>)</th>
  </
tr>
  <
tr>
    <
td class="head" width='7%'><{$lang_rank}></td>
    <
td class="head" width='28%'><{$lang_title}></td>
    <
td class="head" width='40%'><{$lang_category}></td>
    <
td class="head" width='8%' align='center'><{$lang_hits}></td>
    <
td class="head" width='9%' align='center'><{$lang_rating}></td>
    <
td class="head" width='8%' align='right'><{$lang_vote}></td>
  </
tr>

  <!-- 
Start links loop -->
  <{foreach 
item=link from=$XDlisting.links}>

  <
tr>
    <
td class="even"><{$link.rank}></td>
    <
td class="odd"><a href='singlelink.php?cid=<{$link.cid}>&lid=<{$link.id}>'><{$link.title}></a></td>
    <
td class="even"><{$link.category}></td>
    <
td class="odd" align='center'><{$link.hits}></td>
    <
td class="even" align='center'><{$link.rating}></td>
    <
td class="odd" align='right'><{$link.votes}></td>
  </
tr>

  <{/foreach}>
  <!-- 
End links loop-->

</
table>
<
br />
<{/foreach}>
<!-- 
End XDlisting loop -->




I probably made a lot of mess in the code



566
tzvook
Re: xdirectory in spanish
  • 2004/6/10 11:32

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


hello Builderb , all ...

If somebody has the Xdir with the alphabetic order file, please post the files here.
I'm trying to do it myself, but no sucsess for now, and this one is quite urgent for me (keeping me from uploading a site to the net)

10x



567
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/9 19:06

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


... I'm @ home now, hope it'll look so easy tommorow @ work



568
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/9 18:50

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


yep Riaan, I created it from the viewcats.php file, but didn't use a template file.
Do you have something in mind ?

It probably was done before, due to the nature of the module - it's a "must" feature.



569
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/9 13:47

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


10x Shine , but I probably didn't explained it right:
I need it to have a "yello pages" style listing - not just alpabetic order.
It's the most important thing for a "yellow pages" module

I implemented the alphabetic menu into the index.php (originaly cats function) like riaanvdb suggested ... so far so good...
Now - the alphabetic Navbar leads to "viewlist.php" which needs to give listing results only the requested letter, ordered by alphabetic order....

my problem is with that file (I'm working on it the whole day now, but not being a php expert I still don't have a clue )

help is certainly needed here, I'm quite lost



570
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/9 11:12

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


hi riaanvdb
I tried to implement this, but no results yet:
When I put the function @ the function.php XOOPS gives me a blank page ...





TopTop
« 1 ... 54 55 56 (57) 58 59 60 »



Login

Username:
Password:

Lost Password? Register now!

Who's Online

74 user(s) are online (53 user(s) are browsing Support Forums)


Members: 0


Guests: 74


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits