News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

Order filepath into serchnew.php

Started by Andrea76, February 20, 2006, 12:05:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrea76

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?  ;)

Joachim Müller

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