Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -1,16 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v2.0.0
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2004 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-12-01 16:45:12 +0000 (Thu, 01 Dec 2005) $
|
||||
| > $Revision: 88 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > FORUMS CLASS
|
||||
@@ -28,7 +40,7 @@ class forum_functions
|
||||
var $forum_cache = array();
|
||||
var $forum_by_id = array();
|
||||
var $forum_built = array();
|
||||
var $class = "";
|
||||
|
||||
var $template_bit = "";
|
||||
var $depth_guide = "--";
|
||||
var $return = "";
|
||||
@@ -44,9 +56,9 @@ class forum_functions
|
||||
// Register a $this-> class with this module
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function register_class(&$class)
|
||||
function register_class()
|
||||
{
|
||||
$this->class = $class;
|
||||
//NO LONGER NEEDED
|
||||
}
|
||||
|
||||
|
||||
@@ -58,16 +70,17 @@ class forum_functions
|
||||
|
||||
function forums_init()
|
||||
{
|
||||
global $DB, $std, $ibforums;
|
||||
|
||||
if ( ! is_array( $ibforums->cache['forum_cache'] ) )
|
||||
if ( ! is_array( $this->ipsclass->cache['forum_cache'] ) )
|
||||
{
|
||||
$std->update_forum_cache();
|
||||
$this->ipsclass->update_forum_cache();
|
||||
}
|
||||
|
||||
$hide_parents = ',';
|
||||
|
||||
foreach( $ibforums->cache['forum_cache'] as $i => $f )
|
||||
$this->forum_cache = array();
|
||||
$this->forum_by_id = array();
|
||||
|
||||
foreach( $this->ipsclass->cache['forum_cache'] as $i => $f )
|
||||
{
|
||||
if ( $this->strip_invisible )
|
||||
{
|
||||
@@ -86,7 +99,7 @@ class forum_functions
|
||||
|
||||
if ( $f['show_perms'] != '*' )
|
||||
{
|
||||
if ( $std->check_perms($f['show_perms']) != TRUE )
|
||||
if ( $this->ipsclass->check_perms($f['show_perms']) != TRUE )
|
||||
{
|
||||
$hide_parents .= $f['id'].',';
|
||||
continue;
|
||||
@@ -128,33 +141,26 @@ class forum_functions
|
||||
|
||||
function forums_get_moderator_cache()
|
||||
{
|
||||
global $DB, $ibforums, $std;
|
||||
|
||||
$this->can_see_queued = array();
|
||||
|
||||
if ( ! is_array( $ibforums->cache['moderators'] ) )
|
||||
if ( ! is_array( $this->ipsclass->cache['moderators'] ) )
|
||||
{
|
||||
$ibforums->cache['moderators'] = array();
|
||||
$this->ipsclass->cache['moderators'] = array();
|
||||
|
||||
$DB->simple_construct( array( 'select' => "*",
|
||||
'from' => 'moderators'
|
||||
) );
|
||||
define( "IN_ACP", 1 );
|
||||
|
||||
$DB->simple_exec();
|
||||
require_once( ROOT_PATH.'sources/action_admin/moderator.php' );
|
||||
$this->mod = new ad_moderator();
|
||||
$this->mod->ipsclass =& $this->ipsclass;
|
||||
|
||||
while ( $i = $DB->fetch_row() )
|
||||
{
|
||||
$ibforums->cache['moderators'][ $i['mid'] ] = $i;
|
||||
}
|
||||
|
||||
$std->update_cache( array( 'name' => 'moderators', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
$this->mod->rebuild_moderator_cache();
|
||||
}
|
||||
|
||||
if ( count($ibforums->cache['moderators']) )
|
||||
if ( count($this->ipsclass->cache['moderators']) )
|
||||
{
|
||||
foreach( $ibforums->cache['moderators'] as $i => $r )
|
||||
foreach( $this->ipsclass->cache['moderators'] as $i => $r )
|
||||
{
|
||||
$this->mod_cache[ $r['forum_id'] ][ $r['mid'] ] = array( 'name' => $r['member_name'],
|
||||
$this->mod_cache[ $r['forum_id'] ][ $r['mid'] ] = array( 'name' => $r['members_display_name'],
|
||||
'memid' => $r['member_id'],
|
||||
'id' => $r['mid'],
|
||||
'isg' => $r['is_group'],
|
||||
@@ -176,8 +182,6 @@ class forum_functions
|
||||
|
||||
function forums_get_moderators($forum_id="")
|
||||
{
|
||||
global $DB, $ibforums;
|
||||
|
||||
if ( ! $this->mod_cache_got )
|
||||
{
|
||||
$this->forums_get_moderator_cache();
|
||||
@@ -192,7 +196,7 @@ class forum_functions
|
||||
|
||||
if (isset($this->mod_cache[ $forum_id ] ) )
|
||||
{
|
||||
$mod_string = $ibforums->lang['forum_leader'].' ';
|
||||
$mod_string = $this->ipsclass->lang['forum_leader'].' ';
|
||||
|
||||
if (is_array($this->mod_cache[ $forum_id ]) )
|
||||
{
|
||||
@@ -200,11 +204,16 @@ class forum_functions
|
||||
{
|
||||
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&b=1'>{$moderator['gname']}</a>, ";
|
||||
$mod_string .= "<a href='{$this->ipsclass->base_url}act=Members&max_results=30&filter={$moderator['gid']}&sort_order=asc&sort_key=members_display_name&st=0&b=1'>{$moderator['gname']}</a>, ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mod_string .= "<a href='{$ibforums->base_url}showuser={$moderator['memid']}'>{$moderator['name']}</a>, ";
|
||||
if ( ! $moderator['name'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$mod_string .= "<a href='{$this->ipsclass->base_url}showuser={$moderator['memid']}'>{$moderator['name']}</a>, ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,11 +224,11 @@ class forum_functions
|
||||
{
|
||||
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&b=1'>{$this->mods[$forum_id]['gname']}</a>, ";
|
||||
$mod_string .= "<a href='{$this->ipsclass->base_url}act=Members&max_results=30&filter={$this->mods[$forum_id]['gid']}&sort_order=asc&sort_key=name&st=0&b=1'>{$this->mods[$forum_id]['gname']}</a>, ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mod_string .= "<a href='{$ibforums->base_url}showuser={$this->mods[$forum_id]['memid']}'>{$this->mods[$forum_id]['name']}</a>";
|
||||
$mod_string .= "<a href='{$this->ipsclass->base_url}showuser={$this->mods[$forum_id]['memid']}'>{$this->mods[$forum_id]['name']}</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,13 +245,11 @@ class forum_functions
|
||||
|
||||
function forums_check_access($fid, $prompt_login=0, $in='forum')
|
||||
{
|
||||
global $ibforums, $std;
|
||||
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $std->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
{
|
||||
if ( $std->check_perms($this->forum_by_id[$fid]['read_perms']) == TRUE )
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['read_perms']) == TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
@@ -297,7 +304,7 @@ class forum_functions
|
||||
|
||||
if ($deny_access == 0)
|
||||
{
|
||||
if ($this->forum_by_id[$fid]['password'])
|
||||
if ( $this->forum_by_id[$fid]['password'] AND $this->forum_by_id[$fid]['sub_can_post'] )
|
||||
{
|
||||
if ( $this->forums_compare_password( $fid ) == TRUE )
|
||||
{
|
||||
@@ -317,7 +324,7 @@ class forum_functions
|
||||
|
||||
if ($deny_access == 1)
|
||||
{
|
||||
$std->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,9 +334,7 @@ class forum_functions
|
||||
|
||||
function forums_compare_password( $fid )
|
||||
{
|
||||
global $ibforums, $std;
|
||||
|
||||
$cookie_pass = $std->my_getcookie( 'ipbforumpass_'.$fid );
|
||||
$cookie_pass = $this->ipsclass->my_getcookie( 'ipbforumpass_'.$fid );
|
||||
|
||||
if ( trim($cookie_pass) == md5($this->forum_by_id[$fid]['password']) )
|
||||
{
|
||||
@@ -347,11 +352,9 @@ class forum_functions
|
||||
|
||||
function forums_quick_check_access($fid)
|
||||
{
|
||||
global $ibforums, $std;
|
||||
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $std->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
@@ -386,26 +389,29 @@ class forum_functions
|
||||
|
||||
function forums_custom_error( $fid )
|
||||
{
|
||||
global $ibforums, $std, $DB;
|
||||
|
||||
$tmp = $DB->simple_exec_query( array( 'select' => 'permission_custom_error', 'from' => 'forums', 'where' => "id=".$fid) );
|
||||
$tmp = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'permission_custom_error', 'from' => 'forums', 'where' => "id=".$fid) );
|
||||
|
||||
if ( $tmp['permission_custom_error'] )
|
||||
{
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, "lang_error", $ibforums->lang_id);
|
||||
$this->ipsclass->load_language("lang_error");
|
||||
|
||||
if ( ! $this->ipsclass->compiled_templates['skin_global'] )
|
||||
{
|
||||
$this->load_template('skin_global');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Update session
|
||||
//-----------------------------------------
|
||||
|
||||
$DB->do_shutdown_update( 'sessions', array( 'in_error' => 1 ), "id='{$ibforums->my_session}'" );
|
||||
$this->ipsclass->DB->do_shutdown_update( 'sessions', array( 'in_error' => 1 ), "id='{$this->ipsclass->my_session}'" );
|
||||
|
||||
list($em_1, $em_2) = explode( '@', $ibforums->vars['email_in'] );
|
||||
list($em_1, $em_2) = explode( '@', $this->ipsclass->vars['email_in'] );
|
||||
|
||||
$html = $ibforums->skin_global->Error( $tmp['permission_custom_error'], $em_1, $em_2);
|
||||
$html = $this->ipsclass->compiled_templates['skin_global']->Error( $tmp['permission_custom_error'], $em_1, $em_2);
|
||||
$print = new display();
|
||||
$print->add_output($html);
|
||||
$print->do_output( array('TITLE' => $ibforums->lang['error_title'] ) );
|
||||
$this->ipsclass->print->add_output($html);
|
||||
$this->ipsclass->print->do_output( array('TITLE' => $this->ipsclass->lang['error_title'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,31 +423,29 @@ class forum_functions
|
||||
|
||||
function forums_show_login( $fid )
|
||||
{
|
||||
global $ibforums, $std, $DB, $print;
|
||||
|
||||
if ( ! class_exists( 'skin_forum' ) )
|
||||
{
|
||||
$this->html = $std->load_template('skin_forum');
|
||||
$ibforums->lang = $std->load_words($ibforums->lang, 'lang_forum', $ibforums->lang_id);
|
||||
$this->ipsclass->load_template('skin_forum');
|
||||
$this->ipsclass->load_language('lang_forum');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->html = new skin_forum();
|
||||
}
|
||||
|
||||
if (empty($ibforums->member['id']))
|
||||
if (empty($this->ipsclass->member['id']))
|
||||
{
|
||||
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
|
||||
}
|
||||
|
||||
$this->output = $this->html->forum_password_log_in( $fid );
|
||||
$this->output = $this->ipsclass->compiled_templates['skin_forum']->forum_password_log_in( $fid );
|
||||
|
||||
$print->add_output( $this->output );
|
||||
$this->ipsclass->print->add_output( $this->output );
|
||||
|
||||
$print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->forum_by_id[$fid]['name'],
|
||||
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name']." -> ".$this->forum_by_id[$fid]['name'],
|
||||
'JS' => 0,
|
||||
'NAV' => array(
|
||||
"<a href='".$ibforums->base_url."showforum={$fid}'>{$this->forum_by_id[$fid]['name']}</a>",
|
||||
"<a href='".$this->ipsclass->base_url."showforum={$fid}'>{$this->forum_by_id[$fid]['name']}</a>",
|
||||
),
|
||||
) );
|
||||
|
||||
@@ -496,8 +500,6 @@ class forum_functions
|
||||
|
||||
function forums_calc_children($root_id, $forum_data=array(), $done_pass=0)
|
||||
{
|
||||
global $ibforums;
|
||||
|
||||
if ( is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $id => $data )
|
||||
@@ -512,12 +514,57 @@ class forum_functions
|
||||
$forum_data['last_poster_id'] = $data['last_poster_id'];
|
||||
$forum_data['last_poster_name'] = $data['last_poster_name'];
|
||||
$forum_data['status'] = $data['status'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this forum last post > current last post
|
||||
// and if so, did we clear the marker more recently for
|
||||
// this topic?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $data['_db_row']['marker_last_cleared'] > $forum_data['_db_row']['marker_last_cleared'] )
|
||||
{
|
||||
$forum_data['_db_row']['marker_last_cleared'] = $data['_db_row']['marker_last_cleared'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out forum marker
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_data['_db_row']['marker_unread'] += $data['_db_row']['marker_unread'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Figure out if we have markers
|
||||
// Takes care of rows not in the DB yet
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $data['_db_row']['marker_unread'] )
|
||||
{
|
||||
$test_time = $this->ipsclass->member['members_markers']['board'] > $data['_db_row']['marker_last_cleared'] ? $this->ipsclass->member['members_markers']['board'] : $data['_db_row']['marker_last_cleared'];
|
||||
|
||||
if ( $data['last_post'] > $test_time )
|
||||
{
|
||||
$data['_db_row']['marker_unread'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Copy last cleared date
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $data['_db_row']['marker_unread'] )
|
||||
{
|
||||
$forum_data['_db_row']['marker_last_cleared'] = $data['_db_row']['marker_last_cleared'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Topics and posts
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_data['posts'] += $data['posts'];
|
||||
$forum_data['topics'] += $data['topics'];
|
||||
|
||||
if ( $ibforums->member['g_is_supmod'] or $ibforums->member['_moderator'][ $data['id'] ]['post_q'] == 1 )
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or $this->ipsclass->member['_moderator'][ $data['id'] ]['post_q'] == 1 )
|
||||
{
|
||||
$forum_data['queued_posts'] += $data['queued_posts'];
|
||||
$forum_data['queued_topics'] += $data['queued_topics'];
|
||||
@@ -525,7 +572,7 @@ class forum_functions
|
||||
|
||||
if ( ! $done_pass )
|
||||
{
|
||||
$forum_data['subforums'][ $data['id'] ] = $this->class->html->show_subforum_link($data['id'],$data['name']);
|
||||
$forum_data['subforums'][ $data['id'] ] = $this->ipsclass->compiled_templates['skin_boards']->show_subforum_link($data['id'],$data['name']);
|
||||
}
|
||||
|
||||
$forum_data = $this->forums_calc_children( $data['id'], $forum_data, 1 );
|
||||
@@ -543,9 +590,7 @@ class forum_functions
|
||||
|
||||
function forums_breadcrumb_nav($root_id, $url='showforum=')
|
||||
{
|
||||
global $ibforums;
|
||||
|
||||
$nav_array[] = "<a href='".$ibforums->base_url."$url{$root_id}'>{$this->forum_by_id[$root_id]['name']}</a>";
|
||||
$nav_array[] = "<a href='".$this->ipsclass->base_url."$url{$root_id}'>{$this->forum_by_id[$root_id]['name']}</a>";
|
||||
|
||||
$ids = $this->forums_get_parents( $root_id );
|
||||
|
||||
@@ -555,7 +600,7 @@ class forum_functions
|
||||
{
|
||||
$data = $this->forum_by_id[$id];
|
||||
|
||||
$nav_array[] = "<a href='".$ibforums->base_url."$url{$data['id']}'>{$data['name']}</a>";
|
||||
$nav_array[] = "<a href='".$this->ipsclass->base_url."$url{$data['id']}'>{$data['name']}</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,19 +613,22 @@ class forum_functions
|
||||
// Builds the forum jumpee dunnit
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function forums_forum_jump($html=0, $override=0)
|
||||
function forums_forum_jump($html=0, $override=0, $remove_redirects=0)
|
||||
{
|
||||
global $ibforums;
|
||||
|
||||
foreach( $this->forum_cache['root'] as $id => $forum_data )
|
||||
{
|
||||
if ( $forum_data['sub_can_post'] or ( is_array($this->forum_cache[ $forum_data['id'] ]) and count($this->forum_cache[ $forum_data['id'] ]) ) )
|
||||
{
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($html == 1 or $override == 1)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ($ibforums->input['f'] and $ibforums->input['f'] == $forum_data['id'])
|
||||
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
@@ -594,11 +642,16 @@ class forum_functions
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
|
||||
{
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($html == 1 or $override == 1)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ($ibforums->input['f'] and $ibforums->input['f'] == $forum_data['id'])
|
||||
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
@@ -606,7 +659,10 @@ class forum_functions
|
||||
|
||||
$jump_string .= "<option value=\"{$forum_data['id']}\"".$selected."> |".$depth_guide." ".$forum_data['name']."</option>\n";
|
||||
|
||||
$jump_string = $this->forums_forum_jump_internal( $forum_data['id'], $jump_string, $depth_guide . $this->depth_guide, $html, $override );
|
||||
if( $this->ipsclass->vars['short_forum_jump'] == 0 OR $override == 1 )
|
||||
{
|
||||
$jump_string = $this->forums_forum_jump_internal( $forum_data['id'], $jump_string, $depth_guide . $this->depth_guide, $html, $override, $remove_redirects );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -615,19 +671,22 @@ class forum_functions
|
||||
return $jump_string;
|
||||
}
|
||||
|
||||
function forums_forum_jump_internal($root_id, $jump_string="", $depth_guide="",$html=0, $override=0)
|
||||
function forums_forum_jump_internal($root_id, $jump_string="", $depth_guide="",$html=0, $override=0, $remove_redirects=0)
|
||||
{
|
||||
global $ibforums;
|
||||
|
||||
if ( is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $id => $forum_data )
|
||||
{
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($html == 1 or $override == 1)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ($ibforums->input['f'] and $ibforums->input['f'] == $forum_data['id'])
|
||||
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
@@ -651,11 +710,9 @@ class forum_functions
|
||||
|
||||
function forums_format_lastinfo($forum_data)
|
||||
{
|
||||
global $std, $DB, $ibforums;
|
||||
|
||||
$show_subforums = 1;
|
||||
|
||||
if ( $std->check_perms($this->forum_by_id[ $forum_data['id'] ]['read_perms']) != TRUE )
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[ $forum_data['id'] ]['read_perms']) != TRUE )
|
||||
{
|
||||
$show_subforums = 0;
|
||||
}
|
||||
@@ -664,16 +721,16 @@ class forum_functions
|
||||
|
||||
if ( $forum_data['img_new_post'] == '<{C_ON}>' )
|
||||
{
|
||||
$forum_data['img_new_post'] = $this->class->html->forum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
|
||||
$forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->forum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
|
||||
}
|
||||
else if ( $forum_data['img_new_post'] == '<{C_ON_CAT}>' )
|
||||
{
|
||||
$forum_data['img_new_post'] = $this->class->html->subforum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
|
||||
$forum_data['img_new_post'] = $this->ipsclass->compiled_templates['skin_boards']->subforum_img_with_link($forum_data['img_new_post'], $forum_data['id']);
|
||||
}
|
||||
|
||||
$forum_data['last_post'] = $std->get_date($forum_data['last_post'], 'LONG');
|
||||
$forum_data['last_post'] = $this->ipsclass->get_date($forum_data['last_post'], 'LONG');
|
||||
|
||||
$forum_data['last_topic'] = $ibforums->lang['f_none'];
|
||||
$forum_data['last_topic'] = $this->ipsclass->lang['f_none'];
|
||||
|
||||
$forum_data['full_last_title'] = $forum_data['last_title'];
|
||||
|
||||
@@ -683,28 +740,28 @@ class forum_functions
|
||||
$forum_data['last_title'] = str_replace( "!" , "!", $forum_data['last_title'] );
|
||||
$forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] );
|
||||
|
||||
$forum_data['last_title'] = $std->txt_truncate($forum_data['last_title'], 30);
|
||||
$forum_data['last_title'] = $this->ipsclass->txt_truncate($forum_data['last_title'], 30);
|
||||
|
||||
if ( $forum_data['password'] OR ( $std->check_perms($this->forum_by_id[ $forum_data['fid'] ]['read_perms']) != TRUE AND $this->forum_by_id[ $forum_data['fid'] ]['permission_showtopic'] == 0 ) )
|
||||
if ( $forum_data['password'] OR ( $this->ipsclass->check_perms($this->forum_by_id[ $forum_data['fid'] ]['read_perms']) != TRUE AND $this->forum_by_id[ $forum_data['fid'] ]['permission_showtopic'] == 0 ) )
|
||||
{
|
||||
$forum_data['last_topic'] = $ibforums->lang['f_protected'];
|
||||
$forum_data['last_topic'] = $this->ipsclass->lang['f_protected'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_data['last_unread'] = $this->class->html->forumrow_lastunread_link($forum_data['id'], $forum_data['last_id']);
|
||||
$forum_data['last_topic'] = "<a href='{$ibforums->base_url}showtopic={$forum_data['last_id']}&view=getnewpost' title='{$ibforums->lang['tt_gounread']}: {$forum_data['full_last_title']}'>{$forum_data['last_title']}</a>";
|
||||
$forum_data['last_unread'] = $this->ipsclass->compiled_templates['skin_boards']->forumrow_lastunread_link($forum_data['id'], $forum_data['last_id']);
|
||||
$forum_data['last_topic'] = "<a href='{$this->ipsclass->base_url}showtopic={$forum_data['last_id']}&view=getnewpost' title='{$this->ipsclass->lang['tt_gounread']}: {$forum_data['full_last_title']}'>{$forum_data['last_title']}</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( isset($forum_data['last_poster_name']))
|
||||
{
|
||||
$forum_data['last_poster'] = $forum_data['last_poster_id'] ? "<a href='{$ibforums->base_url}showuser={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}</a>"
|
||||
$forum_data['last_poster'] = $forum_data['last_poster_id'] ? "<a href='{$this->ipsclass->base_url}showuser={$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['last_poster'] = $this->ipsclass->lang['f_none'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -713,22 +770,28 @@ class forum_functions
|
||||
|
||||
$forum_data['moderator'] = $this->forums_get_moderators($forum_data['id']);
|
||||
|
||||
$forum_data['posts'] = $std->do_number_format($forum_data['posts']);
|
||||
$forum_data['topics'] = $std->do_number_format($forum_data['topics']);
|
||||
$forum_data['posts'] = $this->ipsclass->do_number_format($forum_data['posts']);
|
||||
$forum_data['topics'] = $this->ipsclass->do_number_format($forum_data['topics']);
|
||||
|
||||
if ( $ibforums->vars['disable_subforum_show'] == 0 AND $show_subforums == 1 )
|
||||
if ( $this->ipsclass->vars['disable_subforum_show'] == 0 AND $show_subforums == 1 )
|
||||
{
|
||||
if ( is_array( $forum_data['subforums'] ) and count( $forum_data['subforums'] ) )
|
||||
{
|
||||
$forum_data['show_subforums'] = $this->class->html->show_subforum_all_links( implode( ', ', $forum_data['subforums'] ) );
|
||||
$forum_data['show_subforums'] = $this->ipsclass->compiled_templates['skin_boards']->show_subforum_all_links( implode( ', ', $forum_data['subforums'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( $ibforums->member['g_is_supmod'] or $ibforums->member['_moderator'][ $forum_data['id'] ]['post_q'] == 1 )
|
||||
and ( $forum_data['queued_posts'] or $forum_data['queued_topics'] ) )
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or $this->ipsclass->member['_moderator'][ $forum_data['id'] ]['post_q'] == 1 )
|
||||
{
|
||||
$forum_data['_queued_info'] = $this->class->html->show_queued_info( intval($forum_data['queued_posts']), intval($forum_data['queued_topics']) );
|
||||
$forum_data['_queued_img'] = $this->class->html->show_queued_img($forum_data['fid']);
|
||||
if ( $forum_data['queued_posts'] or $forum_data['queued_topics'] )
|
||||
{
|
||||
$forum_data['_queued_info'] = $this->ipsclass->compiled_templates['skin_boards']->show_queued_info( intval($forum_data['queued_posts']), intval($forum_data['queued_topics']) );
|
||||
}
|
||||
|
||||
if ( $this->forum_by_id[ $forum_data['id'] ]['queued_posts'] or $this->forum_by_id[ $forum_data['id'] ]['queued_topics'] )
|
||||
{
|
||||
$forum_data['_queued_img'] = $this->ipsclass->compiled_templates['skin_boards']->show_queued_img( $forum_data['id'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $forum_data;
|
||||
@@ -742,27 +805,39 @@ class forum_functions
|
||||
|
||||
function forums_new_posts($forum_data)
|
||||
{
|
||||
global $ibforums, $std;
|
||||
|
||||
$sub = 0;
|
||||
$sub = 0;
|
||||
|
||||
if ( count($forum_data['subforums']) )
|
||||
{
|
||||
$sub = 1;
|
||||
}
|
||||
|
||||
$rtime = $ibforums->input['last_visit'];
|
||||
|
||||
$fid = $forum_data['fid'] == "" ? $forum_data['id'] : $forum_data['fid'];
|
||||
|
||||
$ftime = $ibforums->forum_read[ $fid ];
|
||||
# Uncomment if you want to clear markers from the last visit.
|
||||
//$rtime = $this->ipsclass->member['last_visit'] > $this->ipsclass->member['members_markers']['board'] ? $this->ipsclass->member['last_visit'] : $this->ipsclass->member['members_markers']['board'];
|
||||
|
||||
if ( $ibforums->forum_read[0] > $ftime )
|
||||
{
|
||||
$ftime = $ibforums->forum_read[0];
|
||||
}
|
||||
$this->ipsclass->member['members_markers']['board'] = $this->ipsclass->member['members_markers']['board'] ? $this->ipsclass->member['members_markers']['board'] : $this->ipsclass->forum_read[ 0 ];
|
||||
$forum_data['_db_row']['marker_last_cleared'] = $forum_data['_db_row']['marker_last_cleared'] ? $forum_data['_db_row']['marker_last_cleared'] : $this->ipsclass->forum_read[ $fid ];
|
||||
|
||||
$rtime = $this->ipsclass->member['members_markers']['board'];
|
||||
$ctime = $this->ipsclass->forum_read[ $fid ];
|
||||
|
||||
$rtime = $rtime > $ctime ? $rtime : $ctime;
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a last cleared date so we have a db
|
||||
// row... and there are no unread topics
|
||||
//-----------------------------------------
|
||||
|
||||
$rtime = $ftime > $rtime ? $ftime : $rtime;
|
||||
if ( is_array( $forum_data['_db_row'] ) )
|
||||
{
|
||||
$rtime = $this->ipsclass->member['members_markers']['board'] > $forum_data['_db_row']['marker_last_cleared'] ? $this->ipsclass->member['members_markers']['board'] : $forum_data['_db_row']['marker_last_cleared'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sub forum?
|
||||
//-----------------------------------------
|
||||
|
||||
if ($sub == 0)
|
||||
{
|
||||
@@ -778,17 +853,14 @@ class forum_functions
|
||||
$sub_cat_img = '_CAT';
|
||||
}
|
||||
|
||||
if ($forum_data['password'] and $sub == 0)
|
||||
if ( $forum_data['password'] AND $sub == 0 )
|
||||
{
|
||||
return $forum_data['last_post'] > $rtime ? "<{C_ON_RES}>"
|
||||
: "<{C_OFF_RES}>";
|
||||
return $forum_data['last_post'] && $forum_data['last_post'] > $rtime ? "<{C_ON_RES}>" : "<{C_OFF_RES}>";
|
||||
}
|
||||
|
||||
return $forum_data['last_post'] > $rtime ? "<{C_ON".$sub_cat_img."}>"
|
||||
: "<{C_OFF".$sub_cat_img."}>";
|
||||
return ( $forum_data['last_post'] && $forum_data['last_post'] > $rtime ) ? "<{C_ON".$sub_cat_img."}>" : "<{C_OFF".$sub_cat_img."}>";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user