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

📄 tpl_user_admin.php

📁 一款文件上传程序
💻 PHP
📖 第 1 页 / 共 2 页
字号:

<!-- tpl_user_admin.php -->
<h1><?=$userinfo['username']?>'s account</h1>
<p style="background-color:#FAFAFA;padding:5px;margin-bottom:4px;color:#404040;">
    <strong class="s2">Actions:</strong> &nbsp;
    <?=$action=='user_info' ? 'Info' : '<a href="'.$userinfo['info_url'].'" class="special">Info</a>'?> -
    <?=$action=='edit_user' ? 'Edit' : '<a href="'.$userinfo['edit_url'].'" class="special">Edit</a>'?> -
    <?=$action=='user_files' ? 'Files' : '<a href="'.$userinfo['manage_files_url'].'" class="special">Files</a>'?>
</p>


<?php /* View user info */ if ( $action == 'user_info' ) : ?>
<table id="user_info_tbl1" cellspacing="1" cellpadding="5" style="width: 100%;margin-top:1px;">
    <tr class="color3" skip_alternate="skip_alternate">
        <td colspan="2">
            <strong class="s1">Basic user info</strong>
        </td>
    </tr>
    <tr>
        <td style="width: 150px;">Username</td>
        <td><?=$userinfo['username']?></td>
    </tr>
    <tr>
        <td>Current e-mail</td>
        <td><a href="<?=$userinfo['email_url']?>"><?=$userinfo['email']?></a> (registered with email <?=$userinfo['reg_email']?>)</td>
    </tr>
    <tr>
        <td>Registered on</td>
        <td><?=$userinfo['reg_date']?> with IP address <?=$userinfo['reg_ip']?></td>
    </tr>
    <tr>
        <td style="vertical-align:top;">Last login</td>
        <td><?=$userinfo['last_login_time']?> from <?=$userinfo['last_login_ip']?></td>
    </tr>
    <tr>
        <td>Account level</td>
        <td>
            <?php switch ( $userinfo['level'] )
            {
                case LEVEL_ADMIN: print 'Administrator'; break;
                case LEVEL_MODERATOR: print 'Moderator'; break;
                case LEVEL_NORMAL: print 'Normal user'; break;
                case LEVEL_SUBSCRIBER: print 'General subscriber'; break;
                case LEVEL_DONATOR: print 'Donator'; break;
                case LEVEL_MONTHLY: print 'Monthly subscriber'; break;
                case LEVEL_QUARTERLY: print 'Quarterly subscriber'; break;
                case LEVEL_YEARLY: print 'Yearly subscriber'; break;
            } ?>
        </td>
    </tr>
    <tr>
        <td style="vertical-align:top;">Account info</td>
        <td>
            <?=$userinfo['is_activated'] ? '<span style="color:green;">Activated</span>' : '<span style="color:red;">Not activated</span>' ?> -
            <?=$userinfo['is_approved'] ? '<span style="color:green;">Approved</span>' : '<span style="color:red;">Not approved</span>' ?> -
            <?=$userinfo['is_suspended'] ? '<span style="color:red;">Suspended</span>' : '<span style="color:green;">Not suspended</span>' ?>
        </td>
    </tr>
    <tr>
        <td style="vertical-align:top;">Admin comments</td>
        <td><?=$userinfo['comments']?></tr>
    </tr>
</table>


<table id="user_info_tbl2" cellspacing="1" cellpadding="5" style="width: 100%;margin-top:5px;">
    <tr class="color3" skip_alternate="skip_alternate">
        <td colspan="2">
            <strong class="s1">Space usage</strong>
        </td>
    </tr>
    <tr>
        <td style="width: 150px;">Max file storage</td>
        <td><?=$userinfo['max_storage']?></td>
    </tr>
    <tr>
        <td>Max file size</td>
        <td><?=$userinfo['max_filesize']?></td>
    </tr>
    <tr>
        <td>Allowed filetypes</td>
        <td style="font-size:0.9em;"><?=$userinfo['filetypes']==''?'All file types allowed.':$userinfo['filetypes']?></td>
    </tr>
    <tr>
        <td>File rename permission</td>
        <td><?php switch ( $userinfo['allow_rename'] ) { case 'all': print 'Filename and extension'; break; case 'nameonly': print 'Filename only'; break; case 'norename': default: print 'Cannot rename files'; } ?></td>
    </tr>
    <tr>
        <td>Images only</td>
        <td><?= $userinfo['images_only'] ? 'Images only' : 'Non images allowed' ?></td>
    </tr>
    <tr>
        <td>Watermarking</td>
        <td><?= $userinfo['fl_watermark'] ? 'Watermark images uploaded by this user' : 'Do not watermark' ?></td>
    </tr>
    <tr>
        <td>Folder creation</td>
        <td><?= $userinfo['allow_create_folder'] ? 'Allowed' : 'Not allowed' ?>, <?=$userinfo['max_folders']?> folders max.</td>
    </tr>
</table>


<table id="user_info_tbl3" cellspacing="1" cellpadding="5" style="width: 100%;margin-top:5px;">
    <tr class="color3" skip_alternate="skip_alternate">
        <td colspan="2">
            <strong class="s1">Bandwidth usage</strong>
        </td>
    </tr>
    <tr>
        <td style="width: 150px;">Bandwidth limit</td>
        <td><?=$userinfo['max_bandwidth']?></td>
    </tr>
    <tr>
        <td>Bandwidth used (<a href="<?=$userinfo['bandwidth_reset_url']?>">Reset</a>)</td>
        <td><?=$userinfo['bw_used']?></td>
    </tr>
    <tr>
        <td>Last bandwidth counter reset</td>
        <td><?=$userinfo['bw_last_reset_days']?> days ago on <?=$userinfo['bw_last_reset']?></td>
    </tr>
    <tr>
        <td>Bandwidth counter reset</td>
        <td><?=$userinfo['bw_reset_auto'] ? 'Automatically' : 'Manually by admin' ?></td>
    </tr>
    <tr>
        <td>Bandwidth reset period</td>
        <td>Every <?=$userinfo['bw_reset_period']?> days.</td>
    </tr>
    <tr>
        <td>Transfer rate</td>
        <td><?=$userinfo['bw_xfer_rate']?> KB/s</td>
    </tr>
</table>

<!-- alternating row color -->
<script type="text/javascript">
    alternateRowColor(getObj('user_info_tbl1'),'tr','#F5F5F5','#FBFBFB');
    alternateRowColor(getObj('user_info_tbl2'),'tr','#F5F5F5','#FBFBFB');
    alternateRowColor(getObj('user_info_tbl3'),'tr','#F5F5F5','#FBFBFB');
</script>
<?php endif; ?>







<?php /* Edit user info */ if ( $action == 'edit_user' ) : ?>

<?php /* If settings have been saved, display this little notification */ if ( $saved ) : ?>
<p class="note1" style="text-align:center;">All settings have been saved!</p>
<?php endif; ?>

<p>
    Explainations for these settings are available in the <a href="admin.php?action=user_settings">New Users Settings</a> section.
</p>

<form method="post" action="admin.php">
    <input type="hidden" name="action" value="edit_user" />
    <input type="hidden" name="userid" value="<?=$userinfo['userid']?>" />
    <input type="hidden" name="task" value="save" />

    <fieldset>
        <legend>Basic user info</legend>
        <table id="tbl1" style="width:100%" cellspacing="1" cellpadding="3">
            <tr>
                <td style="width:130px;">New Password</td>
                <td><input type="password" name="userinfo[new_password]" value="" size="50" /> (enter new password to change)</td>
            </tr>
            <tr>
                <td>Email address</td>
                <td><input type="text" name="userinfo[email]" value="<?=$userinfo['email']?>" size="50" /></td>
            </tr>
            <tr>
                <td style="vertical-align:top;">Account info</td>
                <td>
                    <select name="userinfo[level]" style="width:130px;">
                        <option value="null" <?=@!isset($userinfo['level'])||$userinfo['level']=='null'?'selected="selected"':''?>>Any</option>
                        <option value="<?=LEVEL_ADMIN?>" <?=@$userinfo['level']==LEVEL_ADMIN?'selected="selected"':''?>>Admin</option>
                        <option value="<?=LEVEL_MODERATOR?>" <?=@$userinfo['level']==LEVEL_MODERATOR?'selected="selected"':''?>>Moderators</option>
                        <option value="<?=LEVEL_NORMAL?>" <?=@$userinfo['level']!='null'&&@$userinfo['level']=='0'?'selected="selected"':''?>>Normal</option>
                        <option value="<?=LEVEL_SUBSCRIBER?>" <?=@$userinfo['level']==LEVEL_SUBSCRIBER?'selected="selected"':''?>>Normal: Subscriber</option>
                        <option value="<?=LEVEL_DONATOR?>" <?=@$userinfo['level']==LEVEL_DONATOR?'selected="selected"':''?>>Normal: Donator</option>
                        <option value="<?=LEVEL_MONTHLY?>" <?=@$userinfo['level']==LEVEL_MONTHLY?'selected="selected"':''?>>Normal: Monthly subscriber</option>
                        <option value="<?=LEVEL_QUARTERLY?>" <?=@$userinfo['level']==LEVEL_QUARTERLY?'selected="selected"':''?>>Normal: Quaterly subscriber</option>
                        <option value="<?=LEVEL_YEARLY?>" <?=@$userinfo['level']==LEVEL_YEARLY?'selected="selected"':''?>>Normal: Yearly subscriber</option>
                    </select>
                    &nbsp;&nbsp;
                    <input type="checkbox" id="is_activated" value="1" class="chkbox" name="userinfo[is_activated]" <?=$userinfo['is_activated'] ? 'checked="checked"' : ''?> /><label for="is_activated">Activated</label>&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" id="is_suspended" value="1" class="chkbox" name="userinfo[is_suspended]" <?=$userinfo['is_suspended'] ? 'checked="checked"' : ''?> /><label for="is_suspended">Suspended</label>
                </td>
            </tr>
            <tr>
                <td style="vertical-align:top;">Admin comments</td>
                <td>
                    <input type="text" name="userinfo[comments]" size="80" maxlength="100" value="<?=$userinfo['comments']?>" /><br />
                    <span style="font-size:0.9em;">This will not be visible to the user</span>
                </td>
            </tr>
        </table>
    </fieldset>

    <fieldset>
        <legend>Space usage &amp; restrictions</legend>
        <table id="tbl2" style="width:100%" cellspacing="1" cellpadding="3">
            <tr>
                <td style="width:130px;">Max file storage</td>
                <td>
                    <input type="text" name="userinfo[fl_max_storage]" value="<?=$userinfo['fl_max_storage']?>" size="5" id="max_storage" style="text-align:center;" />
                    &nbsp;MB (Enter 0 for unlimited)
                </td>
            </tr>
            <tr>
                <td>Max file size</td>
                <td>
                    <input type="text" name="userinfo[fl_max_filesize]" value="<?=$userinfo['fl_max_filesize']?>" size="5" id="max_filesize" style="text-align:center;" />
                    &nbsp;KB (Enter 0 for unlimited)
                </td>
            </tr>
            <tr>
                <td>Max folders</td>
                <td>
                    <input type="text" name="userinfo[fl_max_folders]" value="<?=$userinfo['fl_max_folders']?>" size="5" id="max_folders" maxlength="3" style="text-align:center"  />
                    folders (Enter 0 for unlimited)
                </td>
            </tr>
            <tr>
                <td>Images only</td>
                <td>
                    <input type="radio" name="userinfo[fl_images_only]" id="images_only1" value="1" <?=$userinfo['fl_images_only']==1?'checked="checked"':''?> style="margin-bottom:-2px; margin-left:-1px;"/>

⌨️ 快捷键说明

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