autoindex question.

asmo

New Member
#1
Hello,

From: http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html:
NameWidth=[n | *]
The NameWidth keyword allows you to specify the width of the filename column in bytes.
-NameWidth (or unset) allows mod_autoindex to calculate the best width.
NameWidth=n fixes the column width to n bytes wide.
NameWidth=* grows the column to the necessary width.



But in /usr/local/lib/php/autoindex/default.php it works just with fixed vaules passed to NameWidth, ie:

var $nameWidth = 45;


An attempt to use '*' (var $nameWidth = *; / var $nameWidth = '*';) returns error or malformed index.

Is is possible to set automatically adjusted NameWidth so even the longest file names will not get truncated ?
 

NiteWave

Administrator
#2
tested, change
Code:
        if ( strlen( $name ) > $setting->nameWidth )
        {
            $name = substr( $name, 0, $setting->nameWidth - 3 ). '...';
        }
        $buf .= sprintf( $setting->nameFormat, $name."</A>");
to
Code:
$buf .= $name."</A>";
would meet your requirement.
 
Top