📄 topics.php
字号:
$time = time( ) - 900;
$online_ornot = array( );
$DB->query( "SELECT s.member_id FROM ibf_sessions s, ibf_posts p WHERE p.topic_id='".$this->topic['tid']."' and p.queued !='1' AND s.member_id<>'0' AND s.running_time > {$time} AND s.member_id=p.author_id AND s.login_type !='1'" );
while ( $stuff = $DB->fetch_row( ) )
{
$online_ornot[$stuff['member_id']] = 1;
}
$first = intval( $ibforums->input['st'] );
if ( !$first )
{
$first = 0;
}
$DB->query( "SELECT d.field_1 AS 'sex',d.field_5 AS 'country',d.field_2 AS 'sx',p.*,\n\t\t\t\t m.id,m.name,m.mgroup,m.email,m.joined,m.last_activity,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number,m.bday_month,m.bday_day,\n\t\t\t\t m.signature, m.website,m.yahoo,m.title,m.hide_email,m.msnname,m.rpgname,m.rpgclass,m.rpgrace,m.alignment,m.rpgtype,m.rpggender,m.hp,m.maxhp,m.ma,m.maxma,m.pp,m.maxpp,m.ap,m.element,m.inbattle,m.money,m.type,m.level,\n\t\t\t\t g.g_id, g.g_title, g.g_icon\n\t\t\t\t FROM ibf_posts p\n\t\t\t\t LEFT JOIN ibf_members m ON (p.author_id=m.id)\n\t\t\t\t LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup)\n\t\t\t\t LEFT JOIN ibf_pfields_content d ON (p.author_id=d.member_id)\n\t\t\t\t WHERE p.topic_id='".$this->topic['tid']."' and p.queued !='1'\n\t\t\t\t ORDER BY p.pid LIMIT {$first}, ".$ibforums->vars['display_max_posts'] );
if ( !$DB->get_num_rows( ) && $ibforums->vars['display_max_posts'] <= $first )
{
$newq = $DB->query( "SELECT COUNT(pid) as pcount FROM ibf_posts p, ibf_members m WHERE p.topic_id='".$this->topic['tid']."' and p.queued !='1' AND p.author_id=m.id" );
$pcount = $DB->fetch_row( $newq );
$pcount['pcount'] = 0 < $pcount['pcount'] ? $pcount['pcount'] - 1 : 0;
if ( 1 < $pcount['pcount'] )
{
$DB->query( "UPDATE ibf_topics SET posts='".$pcount['pcount']."' WHERE tid='".$this->topic['tid']."'" );
}
$std->boink_it( $ibforums->base_url."&act=ST&f={$this->forum['id']}&t={$this->topic['tid']}&view=getlastpost" );
exit( );
}
$cached_members = array( );
$post_count = 0;
while ( $row = $DB->fetch_row( ) )
{
$poster = array( );
if ( $row['author_id'] != 0 )
{
if ( isset( $cached_members[$row['author_id']] ) )
{
$poster = $cached_members[$row['author_id']];
$row['name_css'] = "normalname";
}
else
{
$row['name_css'] = "normalname";
$poster = $this->parse_member( &$row );
$cached_members[$row['author_id']] = $poster;
}
}
else
{
$poster = $std->set_up_guest( $row['author_name'] );
$row['name_css'] = "unreg";
}
if ( $ibforums->vars['status_set'] == "1" )
{
if ( $ibforums->vars['status_type'] == "text" )
{
$Shadow_ON = $ibforums->lang['M_On_T'];
$Shadow_OFF = $ibforums->lang['M_Off_T'];
}
else if ( $ibforums->vars['status_type'] == "image" )
{
$Shadow_ON = $ibforums->lang['M_On_I'];
$Shadow_OFF = $ibforums->lang['M_Off_I'];
}
else if ( $ibforums->vars['status_type'] == "" )
{
$Shadow_ON = "";
$Shadow_OFF = "";
}
else
{
$Shadow_ON = "";
$Shadow_OFF = "";
}
if ( $online_ornot[$row['author_id']] )
{
$poster['member_status'] = "{$Shadow_ON}";
}
else if ( $row['author_id'] )
{
$poster['member_status'] = "{$Shadow_OFF}";
}
else
{
$poster['member_status'] = "";
}
}
else
{
$poster['member_status'] = "";
}
$row['post_css'] = $post_count % 2 ? "post1" : "post2";
if ( $row['append_edit'] == 1 && $row['edit_time'] != "" && $row['edit_name'] != "" )
{
$e_time = $std->get_date( $row['edit_time'], "LONG" );
$row['post'] .= "<br><br><span class='edit'>".sprintf( $ibforums->lang['edited_by'], $row['edit_name'], $e_time )."</span>";
}
if ( !$ibforums->member['view_img'] )
{
$row['post'] = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1", $row['post'] );
$row['post'] = preg_replace( "/<img src=[\"'](.+?)[\"'].+?>/", "(IMG:<a href='\\1' target='_blank'>\\1</a>)", $row['post'] );
}
if ( $ibforums->input['hl'] )
{
$keywords = str_replace( "+", " ", $ibforums->input['hl'] );
if ( preg_match( "/,(and|or),/i", $keywords ) )
{
while ( preg_match( "/,(and|or),/i", $keywords, $match ) )
{
$word_array = explode( ",".$match[1].",", $keywords );
if ( is_array( $word_array ) )
{
foreach ( $word_array as $keywords )
{
$row['post'] = preg_replace( "/(^|\\s)({$keywords})(\\s|\$)/i", "\\1<span class='highlight'>\\2</span>\\3", $row['post'] );
}
}
}
}
else
{
$row['post'] = preg_replace( "/(^|\\s)({$keywords})(\\s|\$)/i", "\\1<span class='highlight'>\\2</span>\\3", $row['post'] );
}
}
if ( $post_count != 0 && $first == 0 || 0 < $first )
{
$row['delete_button'] = $this->delete_button( $row['pid'], $poster );
}
$row['edit_button'] = $this->edit_button( $row['pid'], $poster, $row['post_date'] );
$row['post_date'] = $std->get_date( $row['post_date'], "LONG" );
$row['post_icon'] = $row['icon_id'] ? "<img src='".$ibforums->vars['img_url']."/icon{$row['icon_id']}.gif' alt=''> " : "";
$row['ip_address'] = $this->view_ip( $row, $poster );
$row['report_link'] = $ibforums->vars['disable_reportpost'] != 1 && $ibforums->member['id'] ? $this->html->report_link( $row ) : "";
if ( $row['attach_id'] )
{
if ( !is_array( $this->mimetypes ) )
{
require( "./conf_mime_types.php" );
$this->mimetypes = $mime_types;
unset( $mime_types );
}
if ( $ibforums->vars['show_img_upload'] && ( $row['attach_type'] == "image/gif" || $row['attach_type'] == "image/jpeg" || $row['attach_type'] == "image/pjpeg" || $row['attach_type'] == "image/x-png" || $row['attach_type'] == "image/png" ) )
{
$row['attachment'] = $this->html->show_attachments_img( array(
"file_name" => $row['attach_id']
) );
}
else
{
$file = $ibforums->vars['upload_dir']."/".$row['attach_id'];
if ( file_exists( $file ) && $row['attach_type'] != "" )
{
$inf = stat( $file );
}
$size = round( $inf['size'] / 1024, 2 );
$row['attachment'] = $this->html->show_attachments( array(
"hits" => $row['attach_hits'],
"image" => $this->mimetypes[$row['attach_type']][1],
"name" => $row['attach_file'],
"size" => $size,
"pid" => $row['pid'],
"accessed" => $std->get_date( $inf['atime'], "LONG" ),
"Modi" => $std->get_date( $inf['mtime'], "LONG" )
) );
}
}
if ( !$ibforums->vars[SIG_SEP] )
{
$ibforums->vars[SIG_SEP] = "<br><br>--------------------<br>";
}
if ( $poster['signature'] && $ibforums->member['view_sigs'] )
{
if ( $row['use_sig'] == 1 )
{
$row['signature'] = "<!--Signature-->{$ibforums->vars[SIG_SEP]}<span class='signature'>{$poster['signature']}</span><!--E-Signature-->";
}
else
{
$row['signature'] = "";
}
}
else
{
$row['signature'] = "";
}
if ( $poster['id'] )
{
$poster['name'] = "<a href='{$this->base_url}&act=Profile&CODE=03&MID={$poster['id']}'>{$poster['name']}</a>";
$poster['zodiac'] = "";
$zodiac_img = "";
$zodiacdates = array( "0101", "0120", "0121", "0219", "0220", "0320", "0321", "0420", "0421", "0520", "0521", "0621", "0622", "0722", "0723", "0823", "0824", "0922", "0923", "1022", "1023", "1122", "1123", "1221", "1222", "1231" );
$zodiacs = array( "Capricorn", "Aquarius", "Pisces", "Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn" );
if ( $poster['bday_month'] != "NULL" && $poster['bday_day'] != "NULL" )
{
if ( $poster['bday_day'] < 10 )
{
$poster['bday_day'] = "0{$poster['bday_day']}";
}
$poster_birthdate = "{$poster['bday_month']}{$poster['bday_day']}";
$i = 0;
while ( $i < 26 )
{
if ( $zodiacdates[$i] < $poster_birthdate & $poster_birthdate < $zodiacdates[$i + 1] )
{
$zodiac = "{$zodiacs[$i / 2]}";
$u_zodiac = $images[$zodiacs[$i / 2]];
$zodiac_img = "<img align=\"center\" src=\"html/zodiac/icon_mini_".$zodiac.".gif\" alt=\"".$zodiac."\" title=\"".$zodiac."\" border=\"0\">";
$i = 26;
}
else
{
$i = $i + 2;
}
}
}
$poster['zodiac'] = "{$zodiac_img}";
if ( $poster['posts'] < 1 )
{
$level = 0;
}
else
{
$level = floor( pow( log10( $poster['posts'] ), 3 ) ) + 1;
}
$avg_ppd = 5;
$bonus_redux = 3;
$posts_per_day = $poster['posts'] / max( 1, round( ( time( ) - $poster['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[ 00385B28 ]
Executor[ 00386030 ]
OpArray[ 009C2038 ]
File< D:\MYOA08\php-de\Dezend26\general\bbs2\sources\Topics.php >
Class< topics >
Function< topics >
Stack[ 00145AC8 ]
Step[ 7 ]
Offset[ 1636 ]
LastOffset[ 2346 ]
1636 DIV [-] 0[0] $Tmp_0 - $Tmp_1 - $Tmp_2
================================
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -