1
Wheeler
wfdownloads - Alphabet Nav 2 (Browse Downloads by alphabetical listing)
  • 2005/2/6 2:54

  • Wheeler

  • Not too shy to talk

  • Posts: 145

  • Since: 2004/10/29


For those of us who customize our modules, this is a different layout of the alphabet navigation menu for wfdownloads. It is more of a square and fits nicely in a narrow column.

The changes must be made to this code from "/modules/wfdownloads/include/functions.php"
function wfd_letters()
{
    global 
$xoopsModule;

    
$letterchoice "<div>" _MD_WFD_BROWSETOTOPIC "</div>";
    
$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='" XOOPS_URL "/modules/wfdownloads/viewcat.php?list=$ltr'>$ltr</a>";
        if (
$counter == round($num 2))
            
$letterchoice .= " ]<br />[ ";
        elseif (
$counter != $num)
            
$letterchoice .= "&nbsp;|&nbsp;";
        
$counter++;
    } 
    
$letterchoice .= " ]";
    return 
$letterchoice;
}


Now replace it with this code
function wfd_letters()
{
    global 
$xoopsModule;

    
$alphabet array_merge(range('A''Z'), range('0''9'));

    
$letterchoice "<b>" _MD_WFD_BROWSETOTOPIC "</b>";

    for (
$i 0$cnt count($alphabet); $i $cnt$i++) 
    {
       if (
== ($i 9) && (strlen($letterchoice) > 2)) 
           
$letterchoice .= '<br>|';
       
$letterchoice .= " <a href='" XOOPS_URL "/modules/wfdownloads/viewcat.php?list={$alphabet[$i]}'>{$alphabet[$i]}</a> |";
    }

    return 
$letterchoice;
}


It works like a charm! This is what it should look like.
Quote:
Browse Downloads by alphabetical listing
| 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 | 0 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |


Enjoy!

2
irmtfan
Re: wfdownloads - Alphabet Nav 2 (Browse Downloads by alphabetical listing)
  • 2005/2/6 5:14

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


cogradulation Wheeler , finally you do it.
i hope the wf-projetcs developer members see this thread and your hack find a way to the next version
thanks for your great hack

3
Wheeler
Re: wfdownloads - Alphabet Nav 2 (Browse Downloads by alphabetical listing)
  • 2005/2/6 6:11

  • Wheeler

  • Not too shy to talk

  • Posts: 145

  • Since: 2004/10/29


I edited my post above with better code for you to paste. There was some messy code posted for about an hour. If you tried the hack and it did not work, please try it again.

4
Bender
Re: wfdownloads - Alphabet Nav 2 (Browse Downloads by alphabetical listing)
  • 2005/2/6 9:36

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Quote:

irmtfan wrote:
i hope the wf-projetcs developer members see this thread and your hack find a way to the next version
thanks for your great hack



Yeah sometimes we do see things However you could always post a link on our feature request forum to make sure we do.

Nice work. While i see the advantage of it i am not sure if it is for everyone the prefered display mode. For example for people browsing with really low resolutions (certainly not me but they are there) it would push other things two lines down.

5
Wheeler
Re: wfdownloads - Alphabet Nav 2 (Browse Downloads by alphabetical listing)
  • 2005/2/6 16:41

  • Wheeler

  • Not too shy to talk

  • Posts: 145

  • Since: 2004/10/29


I will gather most of my bug fixes and hacks of wfdownloads and post them at your site. Sorry about that.

Things like this menu are not for everybody. It is more of an option. It should not go in the next release. Although I have some that should.

I think new code and ways of doing things can still open new doors. Yes it moves things around, but that is the point, to customize a module used on many websites.

Login

Who's Online

178 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 178


more...

Donat-O-Meter

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

Latest GitHub Commits