mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
modified thumbnail url pattern to make it shorter, and save some bandwidth when displaying very long file lists (and it also looks prettier :D)
git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@37 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -7,14 +7,25 @@
|
||||
<p class="n">..</p>
|
||||
<p class="i"><?=$lang->parent_dir?></p>
|
||||
</a>
|
||||
</li><? $n = 1; foreach ($dlist->list as $key => $item): $info = ($item['type'] == 'file') ? $item[$config->tpl_file_info] : $item[$config->tpl_folder_info] ; $thumbnail = (Icon::is_image($item['ext']) && $config->thumbnails) ? ", '".Icon::get_thumbnail_url($item['name'], $config->tpl_preview_width, $config->tpl_preview_height)."'" : '' ; ?>
|
||||
</li><?
|
||||
$n = 1;
|
||||
foreach ($dlist->list as $key => $item):
|
||||
$info = ($item['type'] == 'file') ? $item[$config->tpl_file_info] : $item[$config->tpl_folder_info] ;
|
||||
if ( Icon::is_image($item['ext']) && $config->thumbnails ) {
|
||||
$thumbnail = ", '".Icon::get_thumbnail_url($item['name'], $config->tpl_preview_width, $config->tpl_preview_height)."'";
|
||||
} else $thumbnail = '';
|
||||
?>
|
||||
<li>
|
||||
<a href="<?=rawurlencode($item['name'])?><? if($item['type'] == 'dir') echo '/'; ?>" onmouseover="iP(<?=$n.$thumbnail?>)" onmouseout="o()">
|
||||
<p class="p"><img src="<?=Icon::get_url($item['name'], 'large', $item['type'], true)?>" alt="" /></p>
|
||||
<p class="n"><?=Path::breakFilename($item['name'], $config->tpl_file_maxlength, $config->tpl_wordbreak)?></p>
|
||||
<p class="i"><?=$info?></p>
|
||||
<span id="p<?=$n?>"><div class="name"><?=$item['name']?></div>
|
||||
<?
|
||||
if ( !empty($fields['size']) && $item['type'] == 'file' ) {
|
||||
echo $lang->size.': '.$item['size'];
|
||||
if (!preg_match('/bytes/i', $item['size'])) echo ' ('.number_format($item['size_raw']).' bytes)';
|
||||
if (strpos($item['size'], 'bytes') === false)
|
||||
echo ' ('.number_format($item['size_raw']).' bytes)';
|
||||
echo '<br />';
|
||||
}
|
||||
if ( !empty($fields['mtime']) && $item['type'] == 'file' ) echo $lang->mtime.': '.$item['mtime'].'<br />';
|
||||
@@ -27,9 +38,6 @@
|
||||
if ( !empty($fields['group_id']) ) echo $lang->group_id.': '.$item['group_id'].'<br />';
|
||||
?>
|
||||
</span>
|
||||
<p class="p"><img src="<?=Icon::get_url($item['name'], 'large', $item['type'], true)?>" alt="" /></p>
|
||||
<p class="n"><?=Path::breakFilename($item['name'], $config->tpl_file_maxlength, $config->tpl_wordbreak)?></p>
|
||||
<p class="i"><?=$info?></p>
|
||||
</a>
|
||||
</li><? $n++; endforeach; ?>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user