有位朋友找到www.discuzplus.net求该插件,现帮其写好
再者是支持M55兄弟新官上任
修改方法:
修改 viewthread.php
查找:
- include template('viewthread');
复制代码
在上面加上:
- //ViewThreads members Add by lu5266(www.5466.ik8.com)
- updatesession();
- if(isset($detailstatus)) {
- switch($detailstatus) {
- case 1: dsetcookie('dpt_viewusers', 1, 86400 * 365); break;
- case 0: dsetcookie('dpt_viewusers', 0, 86400 * 365); break;
- }
- }
- $detailstatus = $detailstatus || (!empty($_DCOOKIE['dpt_viewusers']) && !isset($detailstatus)) ? 1 : 0;
- $viewusernum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE fid='$fid' AND tid='$tid'"), 0);
- if($detailstatus) {
- $viewusers = array();
- @include DISCUZ_ROOT.'./forumdata/cache/cache_forumdisplay.php';
- $query = $db->query("SELECT uid, username, lastactivity,groupid FROM {$tablepre}sessions WHERE uid>'0' AND fid='$fid' AND invisible='0' AND tid='$tid'");
- while($viewuser = $db->fetch_array($query)) {
- $viewuser[action] = '浏览本贴';
- $viewuser['icon'] = isset($_DCACHE['onlinelist'][$viewuser['groupid']]) ? $_DCACHE['onlinelist'][$viewuser['groupid']] : $_DCACHE['onlinelist'][0];
- $viewuser['lastactivity'] = gmdate($timeformat, $viewuser['lastactivity'] + ($timeoffset * 3600));
- $viewusers[] = $viewuser;
- }
- $olmembercount = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}sessions WHERE fid='$fid' AND tid='$tid' AND uid>'0'"), 0);
- $invisiblecount = $olmembercount - count($viewusers);
- $guestcount = $viewusernum - $olmembercount;
- }//End ViewThreads members
复制代码
修改 viewthread.htm
查找:
- <!--{if $newpmexists}-->
- <div class="maintable">
- {template pmprompt}
- </div>
- <!--{/if}-->
复制代码
在下面加上:
- <div class="maintable">
- <table width="{TABLEWIDTH}" cellspacing="1" cellpadding="0" align="center" class="tableborder">
- <!--{if $detailstatus}-->
- <tr class="header"><td colspan="3" class="smalltxt" style="font-weight: normal; color: {HEADERTEXT}">
- <a name="online"></a><a href="viewthread.php?tid=$tid&page=$page&extra=$extra&detailstatus=0"><img src="{IMGDIR}/collapsed_no.gif" align="right" border="0"></a>
- <span class="bold"><a href="member.php?action=online" target="_blank">{lang index_activeusers}</a></span> -
- {lang total}<span class="bold">$viewusernum</span>人浏览本贴 - <span class="bold">$olmembercount</span> {lang index_members}(<span class="bold">$invisiblecount</span> {lang index_invisibles}),
- <span class="bold">$guestcount</span> {lang index_guests}
- </td></tr>
- <!--{else}-->
- <tr class="header"><td colspan="3" class="smalltxt" style="font-weight: normal; color: {HEADERTEXT}">
- <a name="online"></a><a href="viewthread.php?tid=$tid&page=$page&extra=$extra&detailstatus=1"><img src="{IMGDIR}/collapsed_yes.gif" align="right" border="0"></a>
- <span class="bold"><a href="member.php?action=online" target="_blank">{lang index_activeusers}</a></span> -
- {lang total} <span class="bold">$viewusernum</span> 人浏览本贴</td></tr>
- <!--{/if}-->
- <!--{if $detailstatus}-->
- <tr class="altbg1"><td nowrap>
- <!--{if $viewusers}-->
- <!--{loop $viewusers $key $viewuser}-->
- <!--{if $key % 7 == 0}--></td></tr><tr class="altbg1"><td width="15%" nowrap><!--{else}--></td><td width="15%" nowrap><!--{/if}-->
- <img src="images/common/$viewuser[icon]" align="absmiddle">
- <a href="viewpro.php?uid=$viewuser[uid]" title="{lang time}: $viewuser[lastactivity]{LF}
- {lang action}: $viewuser[action]
- ">$viewuser[username]</a>
- <!--{/loop}-->
- <!--{else}-->
- {lang online_only_guests}
- <!--{/if}-->
- </td></tr>
- <!--{/if}-->
- </table>{if $multipage}<br>{/if}</div>
复制代码
完工
[ 本帖最后由 lu5266 于 2006-6-2 08:10 编辑 ] |