📄 tpl_myfiles1.php
字号:
<?php
// 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 ) )
{
$temp [] = sprintf ( "['%s','%s','%s','%s','%s',%d,'%s','%s','%s','%s',%s,%s,'%s','%s']",
addslashes($file['thumb_url']), // 0
$file['file_url'], // 1
'',
$file['size'], // 3
$file['date_string'], // 4
$file['is_image'], // 5
addslashes($file['resize_url']), // 6
addslashes($file['rename_url']), // 7
addslashes($file['form_name']), // 8
'',
$file['size_raw'], // 10
$file['date'], // 11
addslashes ( $file['full_name'] ), // 12
addslashes ( $file['download_url'] ) // 13
);
}
$javascript_array = '[' . implode ( $temp, ",\n" ) . ']';
// end php
?>
<script type="text/javascript" src="templates/default/myfiles.js"></script>
<script type="text/javascript">
<!--
var current_folder = '<?=$current_folder_path?>';
var current_folder_is_gallery = <?=(int)$current_folder_is_gallery?>;
var current_folder_total_size = '<?=$current_folder_size?>';
var func = function ()
{
var t = new Table ( getObj ( 'my_files_container' ) );
<?php reset ( $user_files ); while ( list ( , $file ) = each ( $user_files ) ) : ?>
t.add('<?=addslashes($file['full_name'])?>','<?=$file['size']?>','<?=$file['date_string']?>','<?=$file['size']?>');
<?php endwhile; ?>
t.render();
}
addLoadEvent ( func );
-->
</script>
<!-- LEFT SIDE -->
<div style="float: left; width: 23%; overflow: hidden; color: #a0a0a0;">
<!-- Folders -->
<img src="templates/default/images/folder2.gif" alt="" class="img1" /> <a href="folders.php" class="special" style="font-weight:bold;">Folders</a>
(<a href="folders.php?action=create" class="special">New</a>)
<ul style="line-height: 1.6em; margin-top: 3px;">
<?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']?>" <?=$folder['is_gallery']?'class="special_green"':'class="special"'?>><?=$folder['name']=='<MAIN_FOLDER>'?'Main Folder':str_slice($folder['name'],20)?> (<?=$folder['files']?>)</a></li>
<?php /* End folders loop */ endwhile; ?>
<li><span style="color:#808080;cursor:pointer;" onclick="go('myfiles.php?action=refresh');">Refresh file list</span></li>
</ul>
<!-- statistics -->
<div style="margin-top:10px;">
<div style="font-size:0.8em; margin-top: 2px;color:#666666;">
Space: <?=$total_file_size?> / <?=$max_file_storage=='0.0B'?'Unlimited':$max_file_storage?>
<div style="margin-bottom:3px;width: 130px; overflow: hidden; border: 1px solid #bbbbbb;padding:1px;">
<div style="width: <?=$space_usage_percentage>100?100:($space_usage_percentage+1)?>%; 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' ) : ?>
Bandwidth: <?=$bandwidth_used?> / <?=intval($max_bandwidth)==0?'Unlimited':$max_bandwidth?>
<div style="width: 130px; overflow: hidden; border: 1px solid #bbbbbb;padding:1px;">
<div style="width: <?=$bandwidth_usage_percentage>100?100:($bandwidth_usage_percentage+1)?>%; 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%;">
<div style="padding:0px;padding-bottom:5px;margin:0px;margin-bottom:6px;line-height:1.4em;color:#808080;">
<div style="float:left;">
<img src="templates/default/images/<?=$current_folder_is_public?'folder3.gif':'folder4.gif'?>" class="img1" alt="" style="cursor:pointer;" onmousedown="togFolderPublic(this,'<?=$current_folder_is_public?'folder4.gif':'folder3.gif'?>','<?=$current_folder_tog_url?>');" />
<span class="link" style="font-weight:bold;" onclick="go('<?=$current_folder_upload_url?>');"><?=$current_folder==''? 'Main Folder' : $current_folder?></span><br />
<span id="current_folder_description" style="padding: 2px;cursor:text;" onclick="quickUpdateDescription('current_folder_description','<?=$current_folder_path?>');" onmouseover="this.style.backgroundColor='#FFFFE6';" onmouseout="this.style.backgroundColor='';">
<?=$current_folder_description==''?'No description':htmlentities($current_folder_description);?>
</span>
</div>
<div style="float:right;">
<span class="link" onclick="go('<?=$current_folder_upload_url?>');">Upload</span> -
<span class="link" onclick="go('<?=$current_folder_properties_url?>');">Properties</span>
</div>
<div class="spacer"></div>
</div>
<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" />
<input type="hidden" name="move_to" value="" id="myfiles_form_move_to" />
<?php /* If there are files in the current folder, show this menu*/ if ( count ( $user_files ) ) : ?>
<div style="background-color:#F5FFE6;border-bottom: 1px solid #DCE6CF; padding: 10px 7px 10px 10px; margin: 0px 0px 5px 0px; -moz-border-radius:6px;">
<select onchange="processMyFilesAction(this);return false;" onmouseover="prepareMyFilesAction(this);">
<option value="" style="color:#a0a0a0;">Selected files actions...</option>
<option value="rename"> Rename</option>
<option value="delete"> Delete</option>
<option value="img_tags"> Generate URL and [IMG] tag</option>
<option disabled="disabled" style="color:#a0a0a0;">Move to...</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="move_<?=$folder['path']?>" <?=$folder['is_gallery']?'style="color:green;"':''?>> <?=$folder['spaces']?><?=$folder['name']=='<MAIN_FOLDER>'?'Main Folder':str_slice($folder['name'],40)?></option>
<?php /* End folders loop */ endwhile; ?>
</select>
<div style="margin-top: 8px; color: #888888;" onmousedown="return false;">
<strong class="s2">Select:</strong>
<span class="link" id="select_all" onmousedown="checkFiles('all');" title="Select all files">All</span>,
<span class="link" id="select_none" onmousedown="checkFiles('none');" title="Unselect all">None</span>,
<span class="link" id="select_images" onmousedown="checkFiles('images');" title="Select only images">Images</span>,
<span class="link" id="select_nonimages" onmousedown="checkFiles('nonimages');" title="Select non-images files">Non-images</span>,
<span class="link" id="select_invert" onmousedown="checkFiles('invert');" title="Invert the current selection">Invert selection</span>
<strong class="s2">Sort:</strong>
<span class="link" id="sort_type" onmousedown="myFilesSort('ext');" title="Sort the files by name">Type</span>,
<span class="link" id="sort_name" onmousedown="myFilesSort('name');" title="Sort the files by name">Name</span>,
<span class="link" id="sort_size" onmousedown="myFilesSort('size');" title="Sort the files by name">Size</span>,
<span class="link" id="sort_date" onmousedown="myFilesSort('date');" title="Sort the files by name">Date</span>
</div>
</div>
<div id="error_message_box" style="text-align:center; margin-bottom: 5px;display:none;">
You did not select any files.
</div>
<div id="my_files_container"><!-- generate files table here --></div>
<?php /* There are no files */ else:?>
<p style="-moz-border-radius:5px;padding:10px;margin:10px 0px 10px 0px;text-align:center;background-color:#FAFFE6;color:#2F331F;">
This folder is empty. <a href="<?=$current_folder_upload_url?>" class="special">Click here</a> to upload files into this folder.
</p>
<?php /* Endif for file list */ endif; ?>
<!-- end files list -->
</form>
</div>
<div class="spacer"><!-- --></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -