fbiwbi
|
分享:
▼
x0
|
[PHP][讨论] Online status in topics 在线状态文字版
转贴:这个MOD可以在文章旁边的发表人资料内加入发表人上线或离线的状态 也是很简单的MOD看看大家要不要来用用看
代码:
# #----- open [ viewtopic.php] -------- #
# #----- [ 寻找下面这段] ------ #
// // Go ahead and pull all data for this topic // $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id AND p.post_id = pt.post_id $limit_posts_time ORDER BY p.post_time $post_time_order LIMIT $start, ".$board_config['posts_per_page'];
# #----- [ 替换为 ] ------ #
// // Go ahead and pull all data for this topic // $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_allow_viewonline, u.user_session_time, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id AND p.post_id = pt.post_id $limit_posts_time ORDER BY p.post_time $post_time_order LIMIT $start, ".$board_config['posts_per_page'];
# #----- [ 寻找下面这段 (约一千多行的地方) ] ------ #
'POSTER_FROM' => $poster_from, 'POSTER_AVATAR' => $poster_avatar,
# #----- [ 在下面add ] ----- #
"POSTER_ONLINE" => (($postrow[$i]['user_session_time'] >= ( time() - 300 )) && ($postrow[$i]['user_allow_viewonline'])) ? '<span style="color:' . $theme['fontcolor2'] . '">Online</span>' : '<span style="color:' . $theme['fontcolor3'] . '">Offline</span>',
# #----- [ 关闭 viewtopic.php ] -------- #
# #----- open [ viewtopic_body.tpl ] -------- #
#----- [ 寻找这行 ] -----
{postrow.POSTER_FROM}</span><br />
#----- [ 替换为 ] -----
{postrow.POSTER_FROM}<br /> {postrow.POSTER_ONLINE}</span><br /> # #----- [ 关闭 viewtopic_body.tpl ] -------- # 上传所有修改过的档案
[ 此文章被fbiwbi在2005-05-29 21:37重新编辑 ]
|