Menu

PageList alphabetized incorrectly

Help
2004-11-11
2013-03-07
  • Nobody/Anonymous

    For some reason, my alphabet must be wrong... my Pagelist goes thusly:

    CD
    Cookie
    Linux
    Sandbox
    Popup
    Popup Blocker
    RAID
    Welcome
    Wiki

    It's mostly right, but S is wrong. How do I fix this?

     
    • Nobody/Anonymous

      we have the same problem with C listing first and G between B and D

       
    • Nobody/Anonymous

      Problem is that pagelist.php sorts the files by the base64 filename. To correct this you replace this:

      asort($filelist);
      reset($filelist);
      $j=$i;
      while (list($i) = each($filelist)) {
        $show_page=base64_decode($filelist[$i]);
        $show_page=str_replace("<","&lt;",$show_page);
        $show_page=str_replace(">","&gt;",$show_page);
        print "<a href=\&quot;index.php?page=".rawurlencode(utf8_encode(base64_decode($filelist[$i])))."\&quot;>".$show_page."</a><br>\n";
      }

      With this:

      $j=$i;

      while(list($i) = each($filelist)){
        $filelist[$i] = base64_decode($filelist[$i]);
        $filelist[$i] = str_replace("<","&lt;",$filelist[$i]);
        $filelist[$i] = str_replace(">","&gt;",$filelist[$i]);
      }

      asort($filelist);
      reset($filelist);

      while (list($i) = each($filelist)) {
        print "<a href=\&quot;index.php?page=".rawurlencode(utf8_encode($filelist[$i]))."\&quot;>".$filelist[$i]."</a><br>\n";
      }

      This code will decode the base64 filnames before sorting them. This way it should list the files more
      correctly.
      Good luck!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.