Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Order filepath into serchnew.php  (Read 4164 times)

0 Members and 1 Guest are viewing this topic.

Andrea76

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Order filepath into serchnew.php
« on: February 20, 2006, 12:05:36 pm »

This is the part of code that i think to must modify but i don't be able to do...  :-\

function display_dir_tree($folder, $ident)
{
    global $CONFIG, $PHP_SELF, $lang_search_new_php;
    $dir_path = $CONFIG['fullpath'] . $folder;


    if (!is_readable($dir_path)) return;

    $dir = opendir($dir_path);
    while ($file = readdir($dir)) {
        if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file,0,1) != "." && strpos($file,"'") == FALSE && $file != substr($CONFIG['userpics'],0,strlen($CONFIG['userpics'])-1)  && $file != "edit" ) {
            $start_target = $folder . $file;
            $dir_path = $CONFIG['fullpath'] . $folder . $file;

            $warnings = '';
            if (!is_writable($dir_path)) $warnings .= $lang_search_new_php['dir_ro'];
            if (!is_readable($dir_path)) $warnings .= $lang_search_new_php['dir_cant_read'];

            if ($warnings) $warnings = '&nbsp;&nbsp;&nbsp;<b>' . $warnings . '<b>';

            echo <<<EOT
                        <tr>
                                <td class="tableb">
                                        $ident<img src="images/folder.gif" alt="" />&nbsp;<a href= "$PHP_SELF?startdir=$start_target">$file</a>$warnings
                                </td>
                        </tr>
EOT;
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    closedir($dir);
}

How can I sort the list by filepath?  ???
The list is randon and not by foldername!!! :o
Please help me! :'(

PS in this code I find a modify of GAUGAU ... is he the magic codifyer?  ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Order filepath into serchnew.php
« Reply #1 on: February 20, 2006, 10:18:52 pm »

I'm the editor of the line that has the comment only. Coppermine is a team effort, with the basics of the code you're refering to being done by Gregory Demar.
Cpg1.4.x has a browsable batch-add interface with alphabetical sorting, I suggest upgrading instead of trying cpg1.3.x
Logged
Pages: [1]   Go Up
 

Page created in 0.064 seconds with 19 queries.