11
riaanvdb
Re: List Links In Alphabetical Order???
  • 2004/6/9 15:23

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Hi tzvook, did you create the viewlist.php file from your (index.php or list.php or somthingsomething.php your list file) or did you copy it from somehere else? Secondly if you are using smarty did you create a template for the viewlist.php file and are you pointing to it? Did you update the module in admin after you included the template in the xoops_version.php file of your module? Does this make sense?

Grotmis
Riaan

12
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.

13
riaanvdb
Re: List Links In Alphabetical Order???
  • 2004/6/9 19:00

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Quote:

tzvook wrote:
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.

Copy the template of the viewcats file and use that as your starting point. Rename it make the changes, add it to xoops_version and away you go. Have fun with it.

Grotmis
Riaan

14
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

15
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

// $Id: topten.php,v 1.7 2003/03/25 11:08:22 buennagel Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
// ------------------------------------------------------------------------- //
//  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("/",» "
,$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>



<
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 Directorydiv>
<
br /><br /><br />

<{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>

  
  <{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}>
  

table>
<
br />
<{/foreach}>




I probably made a lot of mess in the code

16
albania
Re: List Links In Alphabetical Order???
  • 2004/6/10 15:05

  • albania

  • Just popping in

  • Posts: 23

  • Since: 2004/6/5 1


Me to
I'm looking for xdir alphabetical order
albania

Quote:

tzvook wrote:
I wonder if somebody has this hack (I need it for the Xdirectory which is built on the original linkes module)

please advise ... somebody ....

17
riaanvdb
Re: List Links In Alphabetical Order???
  • 2004/6/10 15:13

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Hi tzvook, I have been cruel long enough, send me the zipped module to my e-mail and I will sort it for you.

Grotmis
Riaan

18
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

19
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?

20
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

Login

Who's Online

353 user(s) are online (248 user(s) are browsing Support Forums)


Members: 0


Guests: 353


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