=========================
插件名称:[DST]-增加“我的附件” D6.1
适用版本:Discuz!6.1 GBK (2008年4月29日为基础修改)
作 者:小铭铭
说 明:以前是D6.0版本,现升级D6.1版本,可以方便查看自己发表过的附件.
=========================
1.打开jsmenu.htm
找到:
- <li><a href="my.php?item=activities&type=orig&ended=no">{lang my_activities}</a></li>
复制代码 在下面加:
- <li><a href="my.php?item=attachments$extrafid">我的附件</a></li>
复制代码 2.打开my.htm
找到:
- <!--{elseif $item == 'threads'}-->{lang my_threads}
复制代码 后面加上:
- <!--{elseif $item == 'attachments$extrafid'}-->我的附件
复制代码 查找:
- <!--{elseif in_array($item, array('threads', 'posts'))}-->
复制代码 改成:
- <!--{elseif in_array($item, array('threads', 'posts', 'attachments'))}-->
复制代码 查找:
- <li <!--{if $item == 'posts'}--> class="current"<!--{/if}-->><a href="my.php?item=posts$extrafid">{lang my_replys}</a></li>
复制代码 下面加上:
- <li <!--{if $item == 'attachments'}--> class="current"<!--{/if}-->><a href="my.php?item=attachments$extrafid">我的附件</a></li>
复制代码 最后查找:
- <!--{elseif $item == 'posts'}-->
- {template my_posts}
复制代码 下面加上:
- <!--{elseif $item == 'attachments'}-->
- {template my_attachments}
复制代码 3.打开my.php
找到:
- } elseif($item == 'threads') {
复制代码 在上面加:
- } elseif($item == 'attachments') {
- require_once './include/attachment.func.php';
- $query = $db->query("SELECT COUNT(*) FROM {$tablepre}attachments a, {$tablepre}threads t WHERE a.uid='$discuz_uid' $threadadd AND a.tid=t.tid");
- $num = $db->result($query, 0);
- $multipage = multi($num, $tpp, $page, 'my.php?item=attachments'.($srchfid ? "&srchfid=$srchfid" : NULL).$extrafid);
- $query = $db->query("SELECT a.*, t.subject, t.fid FROM {$tablepre}attachments a, {$tablepre}threads t
- WHERE a.uid = '$discuz_uid' $threadadd AND a.tid=t.tid ORDER BY a.dateline DESC LIMIT $start_limit, $tpp");
- while($attach = $db->fetch_array($query)) {
- $attach['dateline'] = gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600);
- $attach['forumname'] = $_DCACHE['forums'][$attach['fid']]['name'];
- $attach['filesize'] = sizecount($attach['filesize']);
- $attachlist[] = $attach;
- }
复制代码 4.请把附件上传到templates/default目录中
5.后台更新.
=========================
效果图:
|