📄 profile.php
字号:
<?php
class profile
{
var $output = "";
var $page_title = "";
var $nav = array( );
var $html = "";
var $parser = "";
var $member = array( );
var $m_group = array( );
var $jump_html = "";
var $links = array( );
var $bio = "";
var $notes = "";
var $size = "m";
var $lib;
function profile( )
{
global $ibforums;
global $DB;
global $std;
global $print;
require( "./sources/lib/post_parser.php" );
$this->parser = new post_parser( );
if ( $ibforums->input['CODE'] == "" )
{
$ibforums->input['CODE'] = 0;
}
$ibforums->lang = $std->load_words( $ibforums->lang, "lang_profile", $ibforums->lang_id );
$this->html = $std->load_template( "skin_profile" );
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
$this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
$this->member = $ibforums->member;
$this->m_group = $ibforums->member;
switch ( $ibforums->input['CODE'] )
{
case "03" :
$this->view_profile( );
break;
default :
$this->view_profile( );
break;
}
$print->add_output( "{$this->output}" );
$print->do_output( array(
"TITLE" => $this->page_title,
"JS" => 1,
NAV => $this->nav
) );
}
function view_profile( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$info = array( );
if ( $ibforums->member['g_mem_info'] != 1 )
{
$std->error( array( "LEVEL" => 1, "MSG" => "no_permission" ) );
}
$id = preg_replace( "/^(\\d+)\$/", "\\1", $ibforums->input['MID'] );
if ( empty( $id ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "incorrect_use" ) );
}
$DB->query( "SELECT m.*, g.g_id, g.g_title as group_title FROM ibf_members m, ibf_groups g WHERE m.id='{$id}' and m.mgroup=g.g_id" );
$member = $DB->fetch_row( );
if ( empty( $member['id'] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "incorrect_use" ) );
}
$member['password'] = "";
$DB->query( "SELECT id, read_perms FROM ibf_forums" );
$forum_ids = array( "0" );
while ( $r = $DB->fetch_row( ) )
{
if ( $r['read_perms'] == "*" )
{
$forum_ids[] = $r['id'];
}
else if ( preg_match( "/(^|,)".$this->member['mgroup']."(,|\$)/", $r['read_perms'] ) )
{
$forum_ids[] = $r['id'];
}
}
$forum_id_str = implode( ",", $forum_ids );
$percent = 0;
$DB->query( "SELECT DISTINCT(p.forum_id), f.name, COUNT(p.author_id) as f_posts FROM ibf_posts p, ibf_forums f "."WHERE p.forum_id IN ({$forum_id_str}) AND p.author_id='".$member['id']."' AND p.forum_id=f.id GROUP BY p.forum_id ORDER BY f_posts DESC" );
$favourite = $DB->fetch_row( );
$DB->query( "SELECT COUNT(pid) as total_posts FROM ibf_posts WHERE author_id='".$member['id']."'" );
$total_posts = $DB->fetch_row( );
$DB->query( "SELECT TOTAL_TOPICS, TOTAL_REPLIES FROM ibf_stats" );
$stats = $DB->fetch_row( );
$board_posts = $stats['TOTAL_TOPICS'] + $stats['TOTAL_REPLIES'];
if ( 0 < $total_posts['total_posts'] )
{
$percent = round( $favourite['f_posts'] / $total_posts['total_posts'] * 100 );
}
if ( $member['posts'] )
{
$info['posts_day'] = round( $member['posts'] / ( ( time( ) - $member['joined'] ) / 86400 ), 1 );
$info['total_pct'] = sprintf( "%.2f", $member['posts'] / $board_posts * 100 );
}
if ( $member['posts'] < $info['posts_day'] )
{
$info['posts_day'] = $member['posts'];
}
if ( $ibforums->vars['show_lastv_P'] == 1 )
{
$info['last_activity'] = $std->get_date( $member['last_activity'], "LASTV" );
}
else if ( $ibforums->vars['show_lastv_P'] == 0 )
{
$info['last_activity'] = "<i>Disabled</i>";
}
else
{
$info['last_activity'] = "";
}
$info['posts'] = $member['posts'] ? $member['posts'] : 0;
$info['name'] = $member['name'];
$info['mid'] = $member['id'];
$info['fav_forum'] = $favourite['name'];
$info['fav_id'] = $favourite['forum_id'];
$info['fav_posts'] = $favourite['f_posts'];
$info['percent'] = $percent;
$info['group_title'] = $member['group_title'];
$info['board_posts'] = $board_posts;
$info['joined'] = $std->get_date( $member['joined'], "LONG" );
$info['member_title'] = $member['title'] ? $member['title'] : $ibforums->lang['no_info'];
$info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $ibforums->lang['no_info'];
$info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $ibforums->lang['no_info'];
$info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $ibforums->lang['no_info'];
$info['location'] = $member['location'] ? $member['location'] : $ibforums->lang['no_info'];
$info['interests'] = $member['interests'] ? $member['interests'] : $ibforums->lang['no_info'];
$info['msn_name'] = $member['msnname'] ? $member['msnname'] : $ibforums->lang['no_info'];
if ( $member['posts'] < 1 )
{
$level = 0;
}
else
{
$level = floor( pow( log10( $member['posts'] ), 3 ) ) + 1;
}
$avg_ppd = 5;
$bonus_redux = 3;
$posts_per_day = $member['posts'] / max( 1, round( ( time( ) - $member['joined'] ) / 86400 ) );
if ( $level < 1 )
{
$hp = "0 / 0";
$hp_percent = 0;
}
else
{
$max_hp = floor( pow( $level, 0.25 ) * pow( 10, pow( $level + 2, 0.333333 ) ) / 1.5 );
if ( $avg_ppd <= $posts_per_day )
{
[exception occured]
================================
Exception code[ C0000005 ]
Compiler[ 00385D60 ]
Executor[ 00386268 ]
OpArray[ 00964898 ]
File< D:\MYOA08\php-de\data001\bbs2\sources\Profile.php >
Class< profile >
Function< view_profile >
Stack[ 00145AB0 ]
Step[ 7 ]
Offset[ 369 ]
LastOffset[ 1002 ]
369 DIV [-] 0[0] $Tmp_0 - $Tmp_1 - $Tmp_2
================================
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -