📄 tpl_myfiles2.php
字号:
<?php
// Sorting direction image.
$direction = $sort_order == 'asc' ? '<img src="templates/default/images/arrowup.gif" alt="" />' : '<img src="templates/default/images/arrowdown.gif" alt="" />';
// Sorting indicator
$sort_name = $sort_by == 'name' ? ' ' . $direction : '';
$sort_date = $sort_by == 'date' ? ' ' . $direction : '';
$sort_size = $sort_by == 'size' ? ' ' . $direction : '';
$sort_ext = $sort_by == 'ext' ? ' ' . $direction : '';
// Required to display file icons for different file types
include_once ( 'tpl_icons.php' );
// Generate javascript array of files
reset ( $user_files );
$temp = array ( );
while ( list ( $i, $file ) = each ( $user_files ) )
{
$file['icon'] = tpl_myfiles_get_icon ( $file['ext'] );
$temp [] = sprintf ( "['%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',%s,%s,'%s','%s']",
$file['icon'],
$file['file_url'],
addslashes ( htmlentities ( str_slice ( $file['name'], 35 ) ) ),
$file['size'],
$file['date'],
$file['is_resizeable'],
$file['resize_url'],
$file['rename_url'],
$file['form_name'],
$file['ext'],
$file['size_raw'],
$file['date_raw'],
addslashes ( $file['full_name'] ),
$file['download_url']
);
}
$javascript_array = '[' . implode ( $temp, ",\n" ) . ']';
// end php
?>
<script type="text/javascript">
<!--
var files = <?=$javascript_array?>;
var current_folder = '<?=$current_folder_path?>';
var sort_links = { 'ext' : '<?=$sort_links['ext']?>', 'date' : '<?=$sort_links['date']?>', 'name' : '<?=$sort_links['name']?>', 'size' : '<?=$sort_links['size']?>' }
var current_sort = { 'ext' : '<?=$sort_ext?>', 'date' : '<?=$sort_date?>', 'name' : '<?=$sort_name?>', 'size' : '<?=$sort_size?>' }
-->
</script>
<script type="text/javascript" src="templates/default/myfiles.js"></script>
<!-- LEFT SIDE -->
<div style="float: left; width: 23%; overflow: hidden;">
<!-- Folders -->
<img src="templates/default/images/folder2.gif" alt="" class="img1" /> <a href="folders.php" class="special" style="font-weight:bold;">Folders</a>
<ul style="line-height: 1.6em; margin-top: 3px;">
<li><a href="myfiles.php" class="special">Main Folder (<?=$main_folder_file_count?>)</a></li>
<?php /* Loop through folders and list them */ reset ( $user_folders ); while ( list ( $i, $folder ) = each ( $user_folders ) ) : $folder['spaces'] = str_repeat ( ' ', $folder['level'] ); ?>
<li><?=$folder['spaces']?><a href="<?=$folder['folder_url']?>" class="special"><?=str_slice($folder['name'],20)?> (<?=$folder['files']?>)</a></li>
<?php /* End folders loop */ endwhile; ?>
</ul>
<!-- Tools -->
<div style="margin-top:15px;display:none;">
<img src="templates/default/images/gallery.gif" alt="" class="img1" /> <a href="folders.php" class="special" style="font-weight:bold;">Galleries</a>
</div>
<!-- statistics -->
<div style="margin-top:10px;">
<img src="templates/default/images/stats.gif" alt="" class="img1" /> <strong class="s1">Stats</strong>
<div style="font-size:0.8em; margin-top: 2px;color:#666666;">
Space: <?=$total_file_size?> / <?=$max_file_storage=='0B'?'Unlimited':$max_file_storage?>
<div style="margin-bottom:3px;width: 100px; overflow: hidden; border: 1px solid #808080;padding:1px;">
<div style="width: <?=$space_usage_percentage>100?100:($space_usage_percentage+1)?>px; background-color: <?=$space_usage_percentage>=100?'#BF3030':'#E0E0E0'?>; height: 7px; float: left;"><!-- --></div>
</div>
<?php /* if max bandwidth is not Unlimited */ if ( $max_bandwidth != '0B' ) : ?>
BW: <?=$bandwidth_used?> / <?=intval($max_bandwidth)==0?'Unlimited':$max_bandwidth?>
<div style="width: 100px; overflow: hidden; border: 1px solid #808080;padding:1px;">
<div style="width: <?=$bandwidth_usage_percentage>100?100:($bandwidth_usage_percentage+1)?>px; background-color: <?=$bandwidth_usage_percentage>=100?'#BF3030':'#E0E0E0'?>; height: 7px; float: left;"><!-- --></div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- RIGHT SIDE -->
<div style="float:right; width:75%;">
<form method="post" action="myfiles.php" id="myfiles_form">
<input type="hidden" name="folder" value="<?=$current_folder_path?>" />
<input type="hidden" name="action" value="" id="myfiles_form_action" />
<div>
<a href="<?=$current_folder_upload_url?>" class="special" style="font-weight:bold;"><?=$current_folder==''? 'Main Folder' : $current_folder?></a>
<p class="p2"><?=$current_folder_description==''?'No description':htmlentities($current_folder_description);?></p>
</div>
<?php /* If there are files in the current folder, show this menu*/ if ( count ( $user_files ) ) : ?>
<div id="move_files_select" style="margin:8px 0px 5px 0px; background-color:#F5F5F5;padding:8px 8px 4px 8px;">
<select name="move_to">
<option value="">Main Folder</option>
<?php /* Loop through list of folders */ reset ( $user_folders ); while ( list ( $i, $folder ) = each ( $user_folders ) ) : $folder['spaces'] = str_repeat ( ' ', $folder['level'] ); ?>
<option value="<?=$folder['path']?>">
<?=$folder['spaces']?><?=str_slice($folder['name'],40)?>
</option>
<?php /* End folders loop */ endwhile; ?>
</select>
<input type="button" name="action[move]" value="Move" onclick="myFilesAction('move');" class="blue_button" />
<input type="button" name="action[delete]" value="Delete" onclick="myFilesAction('delete');" class="blue_button" />
<input type="button" name="action[img_tags]" value="[IMG] Tags" onclick="myFilesAction('img_tags');" class="blue_button" />
<div style="margin-top: 8px; color: #888888;" onmousedown="return false;">
<strong class="s2">Select:</strong>
<span class="link" id="select_0" onmousedown="checkFiles(0);">All</span>,
<span class="link" id="select_1" onmousedown="checkFiles(1);">None</span>,
<span class="link" id="select_2" onmousedown="checkFiles(2);">Images</span>,
<span class="link" id="select_3" onmousedown="checkFiles(3);">Non-images</span>,
<span class="link" id="select_4" onmousedown="checkFiles(4);">Invert selection</span>
</div>
</div>
<div id="error_message_box" style="text-align:center; margin-bottom: 5px;display:none;">
You did not select any files.
</div>
<!-- generate files table here -->
<div id="my_files_container"></div>
<p style="padding:5px;border-top:1px solid #f0f0f0;font-size:0.9em;color:#505050;">
There are <?=$current_folder_file_count?> file(s) in this folder, <?=$current_folder_size?> total.
</p>
<?php endif; ?>
<!-- end files list -->
</form>
</div>
<div class="spacer"><!-- --></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -