1
jtrag
List Links In Alphabetical Order???
  • 2003/6/4 23:38

  • jtrag

  • Just popping in

  • Posts: 1

  • Since: 2003/6/4 1


Is there a way I can get the links module to list the links in alphabetical order? I don't like the way it lists them by "last modified". I basically want all the links in the links section to be put in alphabetical order automatically. Thanks in advance for any help!
If you want to visit my site it is: AutomotiveMechanic.net

2
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/8 10:31

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


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

please advise ... somebody ....

3
limecity
Re: List Links In Alphabetical Order???
  • 2004/6/8 10:50

  • limecity

  • Friend of XOOPS

  • Posts: 1602

  • Since: 2003/7/6 0


have u seen Myreviews module?
it got link list there..

maybe the developer could help~

4
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/8 10:55

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


10x limecity

I'll download it and see the code ( might learn something )

5
riaanvdb
Re: List Links In Alphabetical Order???
  • 2004/6/9 7:01

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Quote:

limecity wrote:
have u seen Myreviews module?
it got link list there..

maybe the developer could help~

Hi all,

I use a function called letters() that I got from the new downloads module catz is working on. Then just call it in the top part of your code. You must create a viewlist.php file with what you want to display and the order you want to display it in. Very easy implementation that add value to your module. (Thanks Catz)

Grotmis
Riaan
CraftsOnline
myReviews module developer
function letters()
{
    
$letterchoice "[  ";
    
$alphabet = array ("0""1""2""3""4""5""6""7""8""9""A""B""C""D""E""F""G""H""I""J""K""L""M""N""O""P""Q""R""S""T""U""V""W""X""Y""Z");
    
$num count($alphabet) - 1;
    
$counter 0;
    while (list(, 
$ltr) = each($alphabet)) {
        
$letterchoice .= "<a href='viewlist.php?list=$ltr'>$ltr</a>";
        if (
$counter == round($num 2))
            
$letterchoice .= " ]<br>[ ";
        elseif (
$counter != $num)
            
$letterchoice .= "&nbsp;|&nbsp;";
        
$counter++;
    }
    
$letterchoice .= " ]";
    return 
$letterchoice;
}


6
tzvook
Re: List Links In Alphabetical Order???
  • 2004/6/9 7:48

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


10x riaan
yep, catz responsible to some of the good things in here
I'm new to smarty and XOOPS module dev, so let me understand some things :

you mean that I need to put the "letters" function on top of the module's "index.php"
then to call it in the template file as
<{$letters}>

and to create a "viewlist.php" with your database calls...

Did I got it right

7
riaanvdb
Re: List Links In Alphabetical Order???
  • 2004/6/9 8:05

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Quote:

tzvook wrote:
you mean that I need to put the "letters" function on top of the module's "index.php"
then to call it in the template file as
<{$letters}>

and to create a "viewlist.php" with your database calls...

Did I got it right

That sounds about right, remember to pass the $letters var to smarty, something like:
$letters letters();
$xoopsTpl->assign('letters'$letters);

I am not currently using smarty, but will be doing that in the near future. I think the new mydownloads mod in beta is using smarty with this function, check that out as well.

Grotmis
Riaan

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


9
Shine
Re: List Links In Alphabetical Order???
  • 2004/6/9 13:03

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


I think it can be done much easier.
Open the index.php...approx. line 93 you'll see:
$result $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where l.status>0 and l.lid=t.lid ORDER BY date DESC",


As you can see in the last line the ORDER is done by DATE. You'll need to change this into title.

Next you have to open up include/functions.php
Aprox. line 49 you'll see
//Reusable Link Sorting Functions
with a bunch op sort options
By default you'll see
default:
        
$orderby "date DESC";
        break;

This you have to change into title

Upload, update the module and it should be allright.

Grtz., Shine

10
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

Login

Who's Online

198 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

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

Latest GitHub Commits