Hacks

„Browse in alphabetical order“ in the lexicon and national characters

Zirafka  08-Jan-2010 15:17 6694 Reads   11 Comment(s) 
If you want the module "Lexicon" show national characters in the block „Browse in alphabetical order“, you have a problem. The solution is simple:

In file INCLUDE/FUNCTION.PHP search:

function lx_alphaArray ()
    {
    global 
$xoopsUser$xoopsDB$xoopsModule;
    
$alpha = array();
    for (
$a 65$a < (65+26); $a++ )
        {
        
$letterlinks = array();
        
$initial chr($a);
        
$sql $xoopsDB -> query "SELECT * FROM " $xoopsDB -> prefix "lxentries") . " WHERE init = '$initial' " );
        
$howmany $xoopsDB -> getRowsNum$sql );
        
$letterlinks['total'] = $howmany;
        
$letterlinks['id'] = chr($a);
        
$letterlinks['linktext'] = chr($a);

        
$alpha['initial'][] = $letterlinks;
        }
    return 
$alpha;
    }


And replace:

function lx_alphaArray (){

        global 
$xoopsUser$xoopsDB$xoopsModule;
        
$pismenka = array("A","B","C","D","E","F","G","H","CH","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
        
$alpha = array();

    for (
$a 0$a count($pismenka); $a++ )
       {
                                                                     
        
$letterlinks = array();
        
$initial =  $pismenka[$a];
        
$sql $xoopsDB -> query "SELECT * FROM " $xoopsDB -> prefix "lxentries") . " WHERE init = '$initial' " );
        
$howmany $xoopsDB -> getRowsNum$sql );
        
$letterlinks['total'] = $howmany;
        
$letterlinks['id'] =  $pismenka[$a];
        
$letterlinks['linktext'] =  $pismenka[$a];

        
$alpha['initial'][] = $letterlinks;
        }


    return 
$alpha;
    }



Array $pismenka[] include list of characters, who module use, simply use your national characters.

Hack is tested in Xoops 2.4.2 and 2.4.2 in UTF-8.

That’s all, Happy Xoopsing

Rating 0/5
Rating: 0/5 (0 votes)
Voting is disabled!


Login

Who's Online

100 user(s) are online (6 user(s) are browsing Publisher)


Members: 0


Guests: 100


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

Categories