原创: oytktk(靖飒)
演示~:
http://www.huasa.org/bbs/viewthread.php?tid=3953&fpage=1
演示图片:
后台升级数据库!
- INSERT INTO `cdb_settings` (`variable`, `value`) VALUES ('readuseron', '1');
复制代码
修改方法:
admin\settings.php
查找:
- showsetting('settings_vtonlinestatus', 'settingsnew[vtonlinestatus]', $settings['vtonlinestatus'], 'radio');
复制代码
下面加上:
- showsetting('是否显示正在浏览贴子的会员:', 'settingsnew[readuseron]', $settings['readuseron'], 'radio');
复制代码
查找
- 'maxavatarsize', 'maxavatarpixel', 'maxpolloptions', 'smcols'
复制代码
后面加上:
viewthread.php
查找:
- include template('viewthread');
复制代码
上面加:
- if($readuseron == 1) {
- $readsome=0;
- $whosonlinestatus = 0;
- $onlineinfo = explode("\t", $onlinerecord);
- $detailstatus = ((!isset($_COOKIE['onlinedetail']) && $onlineinfo[0] < 500) || ($_COOKIE['onlinedetail'] || $showoldetails == 'yes')) && $showoldetails != 'no';
- if($detailstatus) {
- updatesession();
- @include language('actions');
- $whosonline = array();
- $forumname = strip_tags($forum['name']);
- $query = $db->query("SELECT username FROM $table_sessions WHERE tid='$tid' AND invisible='0' AND uid>'0'");
- if($db->num_rows($query)) {
- $whosonlinestatus = 1;
- while($online = $db->fetch_array($query)) {
- $readsome=1;
- $whosonline[] = $online;
- }
- }
- unset($online);
- }
- } else {
- $whosonlinestatus = 0;
- }
复制代码
viewthread模板:
查找:
- <!--{if $fastpost && $allowpostreply}-->
复制代码
(如果有多处请找到最后一处!)
上面加:
- <!--{if $readuseron}-->
- <table border="0" cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder" bgcolor="{BORDERCOLOR}">
- <tr class="header"><td width="100%">正在阅读本贴的会员</font></a></td></tr>
- <tbody id="onlinestatus" style="$collapse[onlinestatus]"><tr><td bgcolor="{ALTBG2}" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
- <table cellspacing="0" cellpadding="0" border="0" width="98%" align="center">
- <tr><td nowrap>
- <!--{if $readsome }-->
- <!--{loop $whosonline $key $online}-->
- <!--{if $key % 7 == 0}--></td></tr><tr><td width="15%" nowrap><!--{else}--></td><td width="15%" nowrap><!--{/if}-->
- <a href="viewpro.php?username=$online[username]">$online[username]</a>
- <!--{/loop}-->
- <!--{else}-->
- 只有游客正在浏览本贴!
- <!--{/if}-->
- </td></tr></table></td></tr><tr class="catend"><td> </td></tr></tbody></table>
- <br>
- <!--{/if}-->
复制代码
后台,显示设置,是否显示正在浏览贴子的会员: 是 否 , 选是就OK了
[ 本帖最后由 oytktk 于 2007-8-24 08:41 编辑 ] |