⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tpl_myfiles.php

📁 一款文件上传程序
💻 PHP
字号:
<!-- tpl_myfiles.php -->
<script type="text/javascript" src="templates/default2/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?>';
<?php reset ( $user_files ); while ( list ( $i, $file ) = each ( $user_files ) ) : ?>
_aF('<?=addslashes($file['name'])?>','<?=$file['size']?>','<?=$file['date_string']?>','<?=addslashes($file['file_url'])?>','<?=addslashes($file['link_url'])?>','<?=addslashes($file['thumb_url'])?>','<?=addslashes($file['resize_url'])?>','<?=addslashes($file['rename_url'])?>','<?=addslashes($file['download_url'])?>','<?=$file['form_name']?>',<?=$file['date']?>,<?=$file['size_raw']?>,<?=(int)$file['is_image']?>);
<?php endwhile; ?>

    function setUpdateObj ( )
    {
        var x = new quickUpdateDesc ( '<?=$current_folder_path?>', '<?=addslashes($current_folder_description)?>', getObj ( 'current_folder_description' ), 70 );
    }
    addLoadEvent ( setUpdateObj );
-->
</script>


<!-- LEFT SIDE -->
<div style="float: left; width: 23%; overflow: hidden; color: #a0a0a0;">
    <!-- Folders -->
    <img src="templates/default2/images/folder2.gif" alt="" class="img1" /> <a href="folders.php" class="special" style="font-weight:bold;">Folders</a>
    &nbsp;(<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 ( '&nbsp; &nbsp;', $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/default2/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;">
		<?=htmlentities($current_folder_description==''?'No description':(strlen($current_folder_description)>70?substr($current_folder_description,0,70).'...':$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"> &nbsp; &nbsp;Rename</option>
		<option value="delete"> &nbsp; &nbsp;Delete</option>
		<option value="img_tags"> &nbsp; &nbsp;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 ( '&nbsp;&nbsp;&nbsp;', $folder['level'] ); ?>
		<option value="move_<?=$folder['path']?>" <?=$folder['is_gallery']?'style="color:green;"':''?>>&nbsp; &nbsp;<?=$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>&nbsp;
		<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>
		&nbsp; &nbsp;
		<strong class="s2">Sort:</strong>&nbsp;
		<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>
<script type="text/javascript">
<!--
if ( files.length ) myFilesSort ( 'date' );
-->
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -