mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
dList v2.2.3 beta
- started keeping track of version numbers properly - added finnish translation - edited multiple things in simple template - added file/folder hiding by the use of regular expressions - updated most main parts of dlist git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@19 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -52,8 +52,10 @@ $do_sort_reverse = false;
|
||||
|
||||
//>Section> do_readdir
|
||||
if ( $do_readdir ) {
|
||||
|
||||
//>Section> readdir.start
|
||||
$dlist = new dirList();
|
||||
|
||||
//>Section> readdir.options
|
||||
if ( $do_sort_items ) {
|
||||
$dlist->sort_by = $do_sort_by;
|
||||
@@ -61,9 +63,20 @@ if ( $do_readdir ) {
|
||||
} else $dlist->sort_items = false;
|
||||
if ($config->show_hidden) $dlist->show_hidden = true;
|
||||
if ( !$config->smartdate ) $dlist->use_smartdate = false;
|
||||
$dlist->dir_url = DIR_URL;
|
||||
|
||||
//>Section> readdir.filter_out
|
||||
if ( !empty($config->filter_out) ) $dlist->filter_out = '/'.implode('|', $config->filter_out).'/i';
|
||||
|
||||
//>Section> readdir.hide_self
|
||||
$alt_string = ( empty($config->alt_urls) ) ? '' : '|^'.str_replace('/', '\/', implode('$|^', $config->alt_urls)).'$' ;
|
||||
$dlist->hide_self = '/^'.str_replace('/', '\/', DLIST_URL).'$'.$alt_string.'/i';
|
||||
|
||||
//>Section> readdir.read
|
||||
$dlist->read(DIR_PATH);
|
||||
|
||||
//>Section> do_readdir.end
|
||||
|
||||
}
|
||||
|
||||
//==========================
|
||||
@@ -72,6 +85,5 @@ if ( $do_readdir ) {
|
||||
|
||||
|
||||
|
||||
|
||||
//_END;
|
||||
?>
|
||||
@@ -34,8 +34,8 @@ class Icon {
|
||||
$icons_path = ICONS_PATH.$size.'/';
|
||||
$icons_url = ICONS_URL.$size.'/';
|
||||
if ( $type == 'file' ) {
|
||||
if ( preg_match("/jpg|jpeg|png/", $ext) && $thumbnail ) {
|
||||
return DLIST_URL.'thumb.php?src='.urlencode(DIR_URL.$file).'&w=48&h=48';
|
||||
if ( preg_match("/jpg|jpeg|jpe|png/i", $ext) && $thumbnail && $config->thumbnails ) {
|
||||
return DLIST_URL.'thumb.php?src='.rawurlencode(DIR_URL.$file).'&w=48&h=48';
|
||||
} elseif ( file_exists($icons_path.$ext.$config->icons_ext) ) {
|
||||
return $icons_url.$ext.$config->icons_ext;
|
||||
} else {
|
||||
|
||||
@@ -49,6 +49,7 @@ foreach( $language_files as $key => $value ) {
|
||||
if ( !isset($local_names[$language]) ) {
|
||||
execHandler::write2file($config->path_cache.'/local_names.ini', "\n".$language.'='.$lang->_language, 'at');
|
||||
}
|
||||
// sort($installed_languages);
|
||||
|
||||
//>Section> warning:10
|
||||
if ( $lang->_version < $config->req_lang_ver ) {
|
||||
@@ -79,12 +80,18 @@ define('LANG_VER', $lang->_version);
|
||||
|
||||
|
||||
//>After> core.readdir.options
|
||||
//TODO add date formatting options to language files
|
||||
$dlist->lang_tomorrow = $lang->sd_tomorrow;
|
||||
$dlist->lang_today = $lang->sd_today;
|
||||
$dlist->lang_yesterday = $lang->sd_yesterday;
|
||||
$dlist->lang_2_days_ago = $lang->sd_2_days_ago;
|
||||
$dlist->lang_3_days_ago = $lang->sd_3_days_ago;
|
||||
|
||||
if ( !empty($lang->standard_date_format) ) $dlist->standard_date_format = $lang->standard_date_format;
|
||||
if ( !empty($lang->sd_format) ) $dlist->smartdate = $lang->sd_format;
|
||||
if ( !empty($lang->sd_date) ) $dlist->smartdate_date = $lang->sd_date;
|
||||
if ( !empty($lang->sd_time) ) $dlist->smartdate_time = $lang->sd_time;
|
||||
|
||||
|
||||
|
||||
//_END;
|
||||
|
||||
@@ -38,6 +38,45 @@ class Path {
|
||||
} else return false;
|
||||
}
|
||||
|
||||
//>Section> path.stats
|
||||
function stats ($files=0, $folders=0, $totalsize=false) {
|
||||
global $lang;
|
||||
if ( !empty($folders) ) {
|
||||
$r_folders = ( $folders > 1 ) ? str_replace('%n', $folders, $lang->stats_folders) : str_replace('%n', $folders, $lang->stats_folder) ;
|
||||
}
|
||||
if ( !empty($files) ) {
|
||||
$r_files = ( $files > 1 ) ? str_replace('%n', $files, $lang->stats_files) : str_replace('%n', $files, $lang->stats_file) ;
|
||||
if ( !empty($totalsize) ) {
|
||||
$r_files = str_replace('%f', $r_files, $lang->stats_totalsize);
|
||||
$r_files = str_replace('%s', $totalsize, $r_files);
|
||||
}
|
||||
}
|
||||
if ( !empty($r_folders) && !empty($r_files) ) {
|
||||
$return = str_replace('%d', $r_folders, $lang->stats_template);
|
||||
return str_replace('%f', $r_files, $return);
|
||||
} elseif ( !empty($r_folders) ) {
|
||||
return $r_folders;
|
||||
} elseif ( !empty($r_files) ) {
|
||||
return $r_files;
|
||||
}
|
||||
}
|
||||
|
||||
//>Section> path_wordwrap
|
||||
function wordbreak ($input, $length, $break=" ") {
|
||||
if (preg_match("/(.*)\.(.*)/", $input, $preg) ) {
|
||||
$words = explode(' ', $preg[1]);
|
||||
$ext = '.'.$preg[2];
|
||||
} else {
|
||||
$words = explode(' ', $input);
|
||||
$ext = '';
|
||||
}
|
||||
|
||||
foreach( $words as $key => $value ) {
|
||||
$words[$key] = wordwrap($value, $length, $break, 1);
|
||||
}
|
||||
return implode(' ', $words).$ext;
|
||||
}
|
||||
|
||||
//>Section> path_class.end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user