📄 browsebuddy.php
字号:
<?php
class buddy
{
var $output = "";
var $page_title = "";
var $nav = array( );
var $html = "";
function buddy( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$ibforums->lang = $std->load_words( $ibforums->lang, "lang_buddy", $ibforums->lang_id );
$this->html = $std->load_template( "skin_buddy" );
do
{
$this->splash( );
break;
} while ( !TRUE );
$this->output = str_replace( "<!--CLOSE.LINK-->", $this->html->closelink( ), $this->output );
$print->pop_up_window( $ibforums->lang['page_title'], $this->html->buddy_js( ).$this->output );
}
function splash( )
{
global $ibforums;
global $DB;
global $std;
if ( !$ibforums->member['id'] )
{
$this->output = $this->html->login( );
return;
}
else
{
$allow_forums = array( );
$allow_forums[] = "0";
$DB->query( "SELECT id, read_perms, password FROM ibf_forums" );
while ( $i = $DB->fetch_row( ) )
{
$pass = 1;
if ( $i['password'] != "" )
{
if ( !( $c_pass = $std->my_getcookie( "iBForum".$i['id'] ) ) )
{
$pass = 0;
}
if ( $c_pass == $i['password'] )
{
$pass = 1;
}
else
{
$pass = 0;
}
}
if ( $pass == 1 )
{
if ( $i['read_perms'] == "*" )
{
$allow_forums[] = $i['id'];
}
else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $i['read_perms'] ) )
{
$allow_forums[] = $i['id'];
}
}
}
$forum_string = implode( ",", $allow_forums );
if ( !$ibforums->member['last_visit'] )
{
$ibforums->member['last_visit'] = time( ) - 3600;
}
$DB->query( "SELECT COUNT(pid) as posts FROM ibf_posts WHERE post_date > '".$ibforums->member['last_visit']."' AND queued <> 1 AND forum_id IN({$forum_string})" );
$posts = $DB->fetch_row( );
$posts_total = $posts['posts'] < 1 ? 0 : $posts['posts'];
$DB->query( "SELECT COUNT(tid) as replies FROM ibf_topics WHERE last_post > '".$ibforums->member['last_visit']."' AND approved=1 AND forum_id IN({$forum_string}) AND starter_id='".$ibforums->member['id']."'" );
$topic = $DB->fetch_row( );
$topics_total = $topic['replies'] < 1 ? ucfirst( $ibforums->lang['none'] ) : $topic['replies'];
$text = $ibforums->lang['no_new_posts'];
if ( 0 < $posts_total )
{
$ibforums->lang['new_posts'] = sprintf( $ibforums->lang['new_posts'], $posts_total );
$ibforums->lang['my_replies'] = sprintf( $ibforums->lang['my_replies'], $topics_total );
$ibforums->lang['new_posts'] .= $this->html->append_view( "&act=Search&CODE=getnew" );
if ( 0 < $topic['replies'] )
{
$ibforums->lang['my_replies'] .= $this->html->append_view( "&act=Search&CODE=getreplied" );
}
$text = $this->html->build_away_msg( );
}
$this->output = $this->html->main( $text );
}
}
}
buddy( );
$idx = new buddy( );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -