📄 boards.php
字号:
$print->do_output( array(
"TITLE" => $ibforums->vars['board_name'].$cp,
"JS" => 0,
"NAV" => $this->nav
) );
}
function process_all_cats( )
{
global $std;
global $DB;
global $ibforums;
foreach ( $this->cats as $cat_id => $cat_data )
{
if ( !$cat_data['state'] )
{
}
else
{
foreach ( $this->forums as $forum_id => $forum_data )
{
if ( $forum_data['category'] == $cat_id )
{
$temp_html .= $this->process_forum( $forum_id, $forum_data );
}
}
if ( $temp_html != "" )
{
$this->output .= $this->html->catheader_expanded( $cat_data );
$this->output .= $temp_html;
$this->output .= $this->html->end_this_cat( );
}
unset( $temp_html );
}
}
$this->output .= $this->html->end_all_cats( );
}
function show_single_cat( )
{
global $std;
global $DB;
global $ibforums;
$cat_id = $ibforums->input['c'];
if ( !is_array( $this->cats[$cat_id] ) )
{
$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
}
$cat_data = $this->cats[$cat_id];
if ( !$cat_data['state'] )
{
$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
}
foreach ( $this->forums as $forum_id => $forum_data )
{
if ( $forum_data['category'] == $cat_id )
{
$temp_html .= $this->process_forum( $forum_id, $forum_data );
}
}
if ( $temp_html != "" )
{
$this->output .= $this->html->catheader_expanded( $cat_data );
$this->output .= $temp_html;
$this->output .= $this->html->end_this_cat( );
}
else
{
$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
}
unset( $temp_html );
$this->output .= $this->html->end_all_cats( );
}
function process_forum( $forum_id = "", $forum_data = "" )
{
global $std;
global $ibforums;
if ( $forum_data['subwrap'] == 1 )
{
$printed_children = 0;
$can_see_root = FALSE;
if ( isset( $this->children[$forum_data['id']] ) && 0 < count( $this->children[$forum_data['id']] ) )
{
if ( $forum_data['sub_can_post'] == 1 )
{
if ( $forum_data['read_perms'] == "*" )
{
$forum_data['fid'] = $forum_data['id'];
$newest = $forum_data;
$can_see_root = TRUE;
}
else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $forum_data['read_perms'] ) )
{
$forum_data['fid'] = $forum_data['id'];
$newest = $forum_data;
$can_see_root = TRUE;
}
else
{
$newest = array( );
}
}
foreach ( $this->children[$forum_data['id']] as $idx => $data )
{
if ( $data['read_perms'] != "*" && !preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $data['read_perms'] ) )
{
continue;
}
if ( isset( $data['last_title'] ) && $data['last_id'] != "" && $ibforums->vars['index_news_link'] == 1 && !empty( $ibforums->vars['news_forum_id'] ) && $ibforums->vars['news_forum_id'] == $data['id'] )
{
$this->news_topic_id = $data['last_id'];
$this->news_forum_id = $data['id'];
$this->news_title = $data['last_title'];
}
if ( $newest['last_post'] < $data['last_post'] )
{
$newest['last_post'] = $data['last_post'];
$newest['fid'] = $data['id'];
$newest['last_id'] = $data['last_id'];
$newest['last_title'] = $data['last_title'];
$newest['password'] = $data['password'];
$newest['last_poster_id'] = $data['last_poster_id'];
$newest['last_poster_name'] = $data['last_poster_name'];
$newest['status'] = $data['status'];
}
$newest['posts'] += $data['posts'];
$newest['topics'] += $data['topics'];
++$printed_children;
}
if ( $printed_children < 1 && $can_see_root != TRUE )
{
return "";
}
if ( 30 < strlen( $newest['last_title'] ) )
{
$newest['last_title'] = str_replace( "!", "!", $newest['last_title'] );
$newest['last_title'] = str_replace( """, "\"", $newest['last_title'] );
$newest['last_title'] = substr( $newest['last_title'], 0, 27 )."...";
$newest['last_title'] = preg_replace( "/&(#(\\d+;?)?)?\\.\\.\\.\$/", "...", $newest['last_title'] );
}
if ( $newest['password'] != "" )
{
$newest['last_topic'] = $ibforums->lang['f_protected'];
}
else if ( $newest['last_title'] != "" )
{
$newest['last_topic'] = "<a href='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$newest['fid']}&t={$newest['last_id']}&view=getlastpost'>{$newest['last_title']}</a>";
}
else
{
$newest['last_topic'] = $ibforums->lang['f_none'];
}
if ( isset( $newest['last_poster_name'] ) )
{
$newest['last_poster'] = $newest['last_poster_id'] ? "<a href='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$newest['last_poster_id']}'>{$newest['last_poster_name']}</a>" : $newest['last_poster_name'];
}
else
{
$newest['last_poster'] = $ibforums->lang['f_none'];
}
$newest['img_new_post'] = $std->forum_new_posts( $newest, 1 );
$newest['last_post'] = $std->get_date( $newest['last_post'], "LONG" );
if ( $ibforums->vars['number_format'] != "none" )
{
$ibforums->vars['number_format'] = $ibforums->vars['number_format'] == "space" ? " " : $ibforums->vars['number_format'];
$newest['posts'] = number_format( $newest['posts'], 0, "", $ibforums->vars['number_format'] );
$newest['topics'] = number_format( $newest['topics'], 0, "", $ibforums->vars['number_format'] );
}
foreach ( $newest as $k => $v )
{
if ( $k == "id" )
{
}
else
{
$forum_data[$k] = $v;
}
}
$forum_data['moderator'] = $this->get_moderators( $forum_id );
return $this->html->forumrow( $forum_data );
}
else
{
return "";
}
}
else
{
if ( $forum_data['read_perms'] != "*" && !preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|\$)/", $forum_data['read_perms'] ) )
{
return "";
}
$forum_data['img_new_post'] = $std->forum_new_posts( $forum_data );
$forum_data['last_post'] = $std->get_date( $forum_data['last_post'], "LONG" );
$forum_data['last_topic'] = $ibforums->lang['f_none'];
if ( isset( $forum_data['last_title'] ) && $forum_data['last_id'] != "" )
{
if ( $ibforums->vars['index_news_link'] == 1 && !empty( $ibforums->vars['news_forum_id'] ) && $ibforums->vars['news_forum_id'] == $forum_data['id'] )
{
$this->news_topic_id = $forum_data['last_id'];
$this->news_forum_id = $forum_data['id'];
$this->news_title = $forum_data['last_title'];
}
$forum_data['last_title'] = str_replace( "!", "!", $forum_data['last_title'] );
$forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] );
if ( 30 < strlen( $forum_data['last_title'] ) )
{
$forum_data['last_title'] = substr( $forum_data['last_title'], 0, 27 )."...";
$forum_data['last_title'] = preg_replace( "/&(#(\\d+;?)?)?\\.\\.\\.\$/", "...", $forum_data['last_title'] );
}
if ( $forum_data['password'] != "" )
{
$forum_data['last_topic'] = $ibforums->lang['f_protected'];
}
else
{
$forum_data['last_topic'] = "<a href='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$forum_data['id']}&t={$forum_data['last_id']}&view=getlastpost'>{$forum_data['last_title']}</a>";
}
}
if ( isset( $forum_data['last_poster_name'] ) )
{
$forum_data['last_poster'] = $forum_data['last_poster_id'] ? "<a href='{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}</a>" : $forum_data['last_poster_name'];
}
else
{
$forum_data['last_poster'] = $ibforums->lang['f_none'];
}
$forum_data['moderator'] = $this->get_moderators( $forum_data['id'] );
if ( $ibforums->vars['number_format'] != "none" )
{
$ibforums->vars['number_format'] = $ibforums->vars['number_format'] == "space" ? " " : $ibforums->vars['number_format'];
$forum_data['posts'] = number_format( $forum_data['posts'], 0, "", $ibforums->vars['number_format'] );
$forum_data['topics'] = number_format( $forum_data['topics'], 0, "", $ibforums->vars['number_format'] );
}
return $this->html->forumrow( $forum_data );
}
}
function get_moderators( $forum_id = "" )
{
global $ibforums;
global $std;
global $DB;
$mod_string = "";
if ( $forum_id == "" )
{
return "";
}
if ( isset( $this->mods[$forum_id] ) )
{
$mod_string = $ibforums->lang['forum_leader']." ";
if ( is_array( $this->mods[$forum_id] ) )
{
foreach ( $this->mods[$forum_id] as $moderator )
{
if ( $moderator['isg'] == 1 )
{
$mod_string .= "<a href='{$ibforums->base_url}&act=Members&max_results=30&filter={$moderator['gid']}&sort_order=asc&sort_key=name&st=0'>{$moderator['gname']}</a>, ";
}
else
{
$mod_string .= "<a href='{$ibforums->base_url}&act=Profile&CODE=03&MID={$moderator['id']}'>{$moderator['name']}</a>, ";
}
}
$mod_string = preg_replace( "!,\\s+\$!", "", $mod_string );
}
else if ( $moderator['isg'] == 1 )
{
$mod_string .= "<a href='{$ibforums->base_url}&act=Members&max_results=30&filter={$this->mods[$forum_id]['gid']}&sort_order=asc&sort_key=name&st=0'>{$this->mods[$forum_id]['gname']}</a>, ";
}
else
{
$mod_string .= "<a href='{$ibforums->base_url}&act=Profile&CODE=03&MID={$this->mods[$forum_id]['id']}'>{$this->mods[$forum_id]['name']}</a>";
}
}
return $mod_string;
}
}
$idx = new boards( );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -