Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -1,28 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| 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 $
|
||||
| > $Date: 2006-09-26 17:13:44 +0100 (Tue, 26 Sep 2006) $
|
||||
| > $Revision: 575 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > FORUMS CLASS
|
||||
@@ -34,6 +24,12 @@
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class forum_functions
|
||||
{
|
||||
|
||||
@@ -80,7 +76,7 @@ class forum_functions
|
||||
$this->forum_cache = array();
|
||||
$this->forum_by_id = array();
|
||||
|
||||
foreach( $this->ipsclass->cache['forum_cache'] as $i => $f )
|
||||
foreach( $this->ipsclass->cache['forum_cache'] as $f )
|
||||
{
|
||||
if ( $this->strip_invisible )
|
||||
{
|
||||
@@ -91,11 +87,6 @@ class forum_functions
|
||||
continue;
|
||||
}
|
||||
|
||||
//if ( $f['status'] < 1 )
|
||||
//{
|
||||
// $hide_parents .= $f['id'].',';
|
||||
// continue;
|
||||
//}
|
||||
|
||||
if ( $f['show_perms'] != '*' )
|
||||
{
|
||||
@@ -123,7 +114,7 @@ class forum_functions
|
||||
|
||||
function forums_remove_childless_parents()
|
||||
{
|
||||
foreach ( $this->forum_cache['root'] as $id => $forum_data )
|
||||
foreach ( $this->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
if ( ! is_array( $this->forum_cache['root'][ $forum_data['id'] ] ) )
|
||||
{
|
||||
@@ -147,8 +138,6 @@ class forum_functions
|
||||
{
|
||||
$this->ipsclass->cache['moderators'] = array();
|
||||
|
||||
define( "IN_ACP", 1 );
|
||||
|
||||
require_once( ROOT_PATH.'sources/action_admin/moderator.php' );
|
||||
$this->mod = new ad_moderator();
|
||||
$this->mod->ipsclass =& $this->ipsclass;
|
||||
@@ -158,7 +147,7 @@ class forum_functions
|
||||
|
||||
if ( count($this->ipsclass->cache['moderators']) )
|
||||
{
|
||||
foreach( $this->ipsclass->cache['moderators'] as $i => $r )
|
||||
foreach( $this->ipsclass->cache['moderators'] as $r )
|
||||
{
|
||||
$this->mod_cache[ $r['forum_id'] ][ $r['mid'] ] = array( 'name' => $r['members_display_name'],
|
||||
'memid' => $r['member_id'],
|
||||
@@ -243,13 +232,15 @@ class forum_functions
|
||||
// Blah-de-blah
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function forums_check_access($fid, $prompt_login=0, $in='forum')
|
||||
function forums_check_access($fid, $prompt_login=0, $in='forum', $lofi=0)
|
||||
{
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
if ( $this->ipsclass->check_perms( $this->forum_by_id[$fid]['show_perms'] ) == TRUE )
|
||||
{
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['read_perms']) == TRUE )
|
||||
$this->forum_by_id[$fid]['read_perms'] = isset( $this->forum_by_id[$fid]['read_perms'] ) ? $this->forum_by_id[$fid]['read_perms'] : '';
|
||||
|
||||
if ( $this->ipsclass->check_perms( $this->forum_by_id[$fid]['read_perms'] ) == TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
@@ -258,7 +249,7 @@ class forum_functions
|
||||
//-----------------------------------------
|
||||
// Can see topics?
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( $this->forum_by_id[$fid]['permission_showtopic'] )
|
||||
{
|
||||
$this->read_topic_only = 1;
|
||||
@@ -269,18 +260,20 @@ class forum_functions
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Custom error?
|
||||
//-----------------------------------------
|
||||
if ( ! $lofi )
|
||||
{
|
||||
$this->forums_custom_error($fid);
|
||||
}
|
||||
|
||||
$this->forums_custom_error($fid);
|
||||
|
||||
$deny_access = 1;
|
||||
$deny_access = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->forums_custom_error($fid);
|
||||
if ( ! $lofi )
|
||||
{
|
||||
$this->forums_custom_error($fid);
|
||||
}
|
||||
|
||||
$deny_access = 1;
|
||||
}
|
||||
@@ -288,11 +281,10 @@ class forum_functions
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// custom error
|
||||
//-----------------------------------------
|
||||
|
||||
$this->forums_custom_error($fid);
|
||||
if ( ! $lofi )
|
||||
{
|
||||
$this->forums_custom_error($fid);
|
||||
}
|
||||
|
||||
$deny_access = 1;
|
||||
}
|
||||
@@ -302,29 +294,51 @@ class forum_functions
|
||||
// Do we have permission to even see the password page?
|
||||
//-----------------------------------------
|
||||
|
||||
if ($deny_access == 0)
|
||||
if ( $deny_access == 0 )
|
||||
{
|
||||
if ( $this->forum_by_id[$fid]['password'] AND $this->forum_by_id[$fid]['sub_can_post'] )
|
||||
$group_exempt = 0;
|
||||
|
||||
if ( isset($this->forum_by_id[$fid]['password']) AND $this->forum_by_id[$fid]['password'] AND $this->forum_by_id[$fid]['sub_can_post'] )
|
||||
{
|
||||
if ( $this->forums_compare_password( $fid ) == TRUE )
|
||||
if ( isset($this->forum_by_id[$fid]['password_override']) )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $prompt_login == 1 )
|
||||
if( in_array( $this->ipsclass->member['mgroup'], explode(",", $this->forum_by_id[$fid]['password_override']) ) )
|
||||
{
|
||||
$this->forums_show_login( $fid );
|
||||
$group_exempt = 1;
|
||||
$deny_access = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $group_exempt == 0 )
|
||||
{
|
||||
if ( $this->forums_compare_password( $fid ) == TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $prompt_login == 1 && !$lofi )
|
||||
{
|
||||
$this->forums_show_login( $fid );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($deny_access == 1)
|
||||
if ( $deny_access == 1 && ! $lofi )
|
||||
{
|
||||
$this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') );
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
|
||||
}
|
||||
else if ( $deny_access == 1 && $lofi )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,15 +360,54 @@ class forum_functions
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get all forums for loaded permission level
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Get all forum IDs we're allowed to view
|
||||
*
|
||||
* @return array Array of forum ids
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
function forums_get_all_allowed_forum_ids( $type='show_perms' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_ids = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Go get 'em...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $this->forum_by_id ) and count( $this->forum_by_id ) )
|
||||
{
|
||||
foreach( $this->forum_by_id as $data )
|
||||
{
|
||||
if ( ! $this->forums_quick_check_access( $data['id'], $type ) )
|
||||
{
|
||||
$forum_ids[ $data['id'] ] = $data['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
return $forum_ids;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Quick check
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function forums_quick_check_access($fid)
|
||||
function forums_quick_check_access( $fid, $type='show_perms' )
|
||||
{
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[$fid]['show_perms']) == TRUE )
|
||||
if ( $this->ipsclass->check_perms( $this->forum_by_id[$fid][ $type ] ) === TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
@@ -363,17 +416,31 @@ class forum_functions
|
||||
// Do we have permission to even see the password page?
|
||||
//-----------------------------------------
|
||||
|
||||
if ($deny_access == 0)
|
||||
if ( $deny_access == 0 )
|
||||
{
|
||||
if ($this->forum_by_id[$fid]['password'])
|
||||
$group_exempt = 0;
|
||||
|
||||
if (isset($this->forum_by_id[$fid]['password']) AND $this->forum_by_id[$fid]['password'])
|
||||
{
|
||||
if ( $this->forums_compare_password( $fid ) == TRUE )
|
||||
if ( isset($this->forum_by_id[$fid]['password_override']) )
|
||||
{
|
||||
$deny_access = 0;
|
||||
if ( in_array( $this->ipsclass->member['mgroup'], explode(",", $this->forum_by_id[$fid]['password_override']) ) )
|
||||
{
|
||||
$group_exempt = 1;
|
||||
$deny_access = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$deny_access = 1;
|
||||
|
||||
if ( $group_exempt == 0 )
|
||||
{
|
||||
if ( $this->forums_compare_password( $fid ) == TRUE )
|
||||
{
|
||||
$deny_access = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deny_access = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -397,7 +464,7 @@ class forum_functions
|
||||
|
||||
if ( ! $this->ipsclass->compiled_templates['skin_global'] )
|
||||
{
|
||||
$this->load_template('skin_global');
|
||||
$this->ipsclass->load_template('skin_global');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -433,10 +500,10 @@ class forum_functions
|
||||
$this->html = new skin_forum();
|
||||
}
|
||||
|
||||
if (empty($this->ipsclass->member['id']))
|
||||
/*if (empty($this->ipsclass->member['id']))
|
||||
{
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) );
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->output = $this->ipsclass->compiled_templates['skin_forum']->forum_password_log_in( $fid );
|
||||
|
||||
@@ -460,6 +527,25 @@ class forum_functions
|
||||
|
||||
function forums_get_parents($root_id, $ids=array())
|
||||
{
|
||||
// Stop endless loop setting cat as it's own parent?
|
||||
if( in_array( $root_id, $ids ) )
|
||||
{
|
||||
$cnt = 0;
|
||||
|
||||
foreach( $ids as $id )
|
||||
{
|
||||
if( $id == $root_id )
|
||||
{
|
||||
$cnt++;
|
||||
|
||||
if( $cnt > 1 )
|
||||
{
|
||||
return $ids;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->forum_by_id[ $root_id ]['parent_id'] and $this->forum_by_id[ $root_id ]['parent_id'] != 'root' )
|
||||
{
|
||||
$ids[] = $this->forum_by_id[ $root_id ]['parent_id'];
|
||||
@@ -478,9 +564,9 @@ class forum_functions
|
||||
|
||||
function forums_get_children( $root_id, $ids=array() )
|
||||
{
|
||||
if ( is_array( $this->forum_cache[ $root_id ] ) )
|
||||
if ( isset($this->forum_cache[ $root_id ]) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $id => $forum_data )
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
$ids[] = $forum_data['id'];
|
||||
|
||||
@@ -500,9 +586,9 @@ class forum_functions
|
||||
|
||||
function forums_calc_children($root_id, $forum_data=array(), $done_pass=0)
|
||||
{
|
||||
if ( is_array( $this->forum_cache[ $root_id ] ) )
|
||||
if ( isset($this->forum_cache[ $root_id ]) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $id => $data )
|
||||
foreach( $this->forum_cache[ $root_id ] as $data )
|
||||
{
|
||||
if ($data['last_post'] > $forum_data['last_post'])
|
||||
{
|
||||
@@ -510,7 +596,8 @@ class forum_functions
|
||||
$forum_data['fid'] = $data['id'];
|
||||
$forum_data['last_id'] = $data['last_id'];
|
||||
$forum_data['last_title'] = $data['last_title'];
|
||||
$forum_data['password'] = $data['password'];
|
||||
$forum_data['password'] = isset($data['password']) ? $data['password'] : '';
|
||||
$forum_data['password_override'] = isset($data['password_override']) ? $data['password_override'] : '';
|
||||
$forum_data['last_poster_id'] = $data['last_poster_id'];
|
||||
$forum_data['last_poster_name'] = $data['last_poster_name'];
|
||||
$forum_data['status'] = $data['status'];
|
||||
@@ -521,7 +608,7 @@ class forum_functions
|
||||
// this topic?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $data['_db_row']['marker_last_cleared'] > $forum_data['_db_row']['marker_last_cleared'] )
|
||||
if ( isset($data['_db_row']['marker_last_cleared']) AND $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'];
|
||||
}
|
||||
@@ -531,6 +618,8 @@ class forum_functions
|
||||
// Sort out forum marker
|
||||
//-----------------------------------------
|
||||
|
||||
$data['_db_row']['marker_unread'] = isset($data['_db_row']['marker_unread']) ? $data['_db_row']['marker_unread'] : 0;
|
||||
$forum_data['_db_row']['marker_unread'] = isset($forum_data['_db_row']['marker_unread']) ? $forum_data['_db_row']['marker_unread'] : 0;
|
||||
$forum_data['_db_row']['marker_unread'] += $data['_db_row']['marker_unread'];
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -538,8 +627,12 @@ class forum_functions
|
||||
// Takes care of rows not in the DB yet
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $data['_db_row']['marker_unread'] )
|
||||
if ( !isset($data['_db_row']['marker_unread']) OR !$data['_db_row']['marker_unread'] )
|
||||
{
|
||||
$data['_db_row']['marker_last_cleared'] = isset($data['_db_row']['marker_last_cleared']) ? $data['_db_row']['marker_last_cleared'] : 0;
|
||||
|
||||
$this->ipsclass->member['members_markers']['board'] = isset($this->ipsclass->member['members_markers']['board']) ? $this->ipsclass->member['members_markers']['board'] : '';
|
||||
|
||||
$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 )
|
||||
@@ -564,7 +657,7 @@ class forum_functions
|
||||
$forum_data['posts'] += $data['posts'];
|
||||
$forum_data['topics'] += $data['topics'];
|
||||
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or $this->ipsclass->member['_moderator'][ $data['id'] ]['post_q'] == 1 )
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or ( isset($this->ipsclass->member['_moderator'][ $data['id'] ]['post_q']) AND $this->ipsclass->member['_moderator'][ $data['id'] ]['post_q'] == 1 ) )
|
||||
{
|
||||
$forum_data['queued_posts'] += $data['queued_posts'];
|
||||
$forum_data['queued_topics'] += $data['queued_topics'];
|
||||
@@ -615,19 +708,23 @@ class forum_functions
|
||||
|
||||
function forums_forum_jump($html=0, $override=0, $remove_redirects=0)
|
||||
{
|
||||
foreach( $this->forum_cache['root'] as $id => $forum_data )
|
||||
$jump_string = "";
|
||||
|
||||
foreach( $this->forum_cache['root'] as $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 ( $forum_data['sub_can_post'] or ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array($this->forum_cache[ $forum_data['id'] ]) AND count($this->forum_cache[ $forum_data['id'] ]) ) )
|
||||
{
|
||||
$forum_data['redirect_on'] = isset($forum_data['redirect_on']) ? $forum_data['redirect_on'] : 0;
|
||||
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$selected = "";
|
||||
|
||||
if ($html == 1 or $override == 1)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
@@ -638,9 +735,9 @@ class forum_functions
|
||||
|
||||
$depth_guide = $this->depth_guide;
|
||||
|
||||
if ( is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
if ( array_key_exists( $forum_data['id'], $this->forum_cache ) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
@@ -673,19 +770,19 @@ class forum_functions
|
||||
|
||||
function forums_forum_jump_internal($root_id, $jump_string="", $depth_guide="",$html=0, $override=0, $remove_redirects=0)
|
||||
{
|
||||
if ( is_array( $this->forum_cache[ $root_id ] ) )
|
||||
if ( isset($this->forum_cache[ $root_id ]) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $id => $forum_data )
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$selected = "";
|
||||
|
||||
if ($html == 1 or $override == 1)
|
||||
{
|
||||
$selected = "";
|
||||
|
||||
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
@@ -710,9 +807,15 @@ class forum_functions
|
||||
|
||||
function forums_format_lastinfo($forum_data)
|
||||
{
|
||||
$show_subforums = 1;
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->check_perms($this->forum_by_id[ $forum_data['id'] ]['read_perms']) != TRUE )
|
||||
$show_subforums = 1;
|
||||
$this->ipsclass->input['f'] = isset($this->ipsclass->input['f']) ? intval($this->ipsclass->input['f']) : 0;
|
||||
$this->ipsclass->vars['disable_subforum_show'] = intval( $this->ipsclass->vars['disable_subforum_show'] );
|
||||
|
||||
if ( $this->ipsclass->check_perms( $this->forum_by_id[ $forum_data['id'] ]['read_perms'] ) !== TRUE )
|
||||
{
|
||||
$show_subforums = 0;
|
||||
}
|
||||
@@ -732,7 +835,7 @@ class forum_functions
|
||||
|
||||
$forum_data['last_topic'] = $this->ipsclass->lang['f_none'];
|
||||
|
||||
$forum_data['full_last_title'] = $forum_data['last_title'];
|
||||
$forum_data['full_last_title'] = isset($forum_data['last_title']) ? $forum_data['last_title'] : '';
|
||||
|
||||
if (isset($forum_data['last_title']) and $forum_data['last_id'])
|
||||
{
|
||||
@@ -742,7 +845,7 @@ class forum_functions
|
||||
|
||||
$forum_data['last_title'] = $this->ipsclass->txt_truncate($forum_data['last_title'], 30);
|
||||
|
||||
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 ) )
|
||||
if ( ( isset($forum_data['password']) AND $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'] = $this->ipsclass->lang['f_protected'];
|
||||
}
|
||||
@@ -781,16 +884,12 @@ class forum_functions
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or $this->ipsclass->member['_moderator'][ $forum_data['id'] ]['post_q'] == 1 )
|
||||
if ( $this->ipsclass->member['g_is_supmod'] or ( isset($this->ipsclass->member['_moderator'][ $forum_data['id'] ]['post_q']) AND $this->ipsclass->member['_moderator'][ $forum_data['id'] ]['post_q'] == 1 ) )
|
||||
{
|
||||
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'] );
|
||||
$forum_data['_queued_info'] = $this->ipsclass->compiled_templates['skin_boards']->show_queued_info( intval($forum_data['queued_posts']), intval($forum_data['queued_topics']) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,7 +906,7 @@ class forum_functions
|
||||
{
|
||||
$sub = 0;
|
||||
|
||||
if ( count($forum_data['subforums']) )
|
||||
if ( isset($forum_data['subforums']) AND count($forum_data['subforums']) )
|
||||
{
|
||||
$sub = 1;
|
||||
}
|
||||
@@ -817,11 +916,12 @@ class forum_functions
|
||||
# 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'];
|
||||
|
||||
$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 ];
|
||||
$this->ipsclass->member['members_markers']['board'] = isset( $this->ipsclass->member['members_markers']['board']) ? $this->ipsclass->member['members_markers']['board'] : ( isset($this->ipsclass->forum_read[ 0 ]) ? $this->ipsclass->forum_read[ 0 ] : 0 );
|
||||
$this->ipsclass->forum_read[ $fid ] = isset($this->ipsclass->forum_read[ $fid ]) ? $this->ipsclass->forum_read[ $fid ] : 0;
|
||||
$forum_data['_db_row']['marker_last_cleared'] = isset($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 ];
|
||||
$ctime = isset($this->ipsclass->forum_read[ $fid ]) ? $this->ipsclass->forum_read[ $fid ] : 0;
|
||||
|
||||
$rtime = $rtime > $ctime ? $rtime : $ctime;
|
||||
|
||||
@@ -830,7 +930,7 @@ class forum_functions
|
||||
// row... and there are no unread topics
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $forum_data['_db_row'] ) )
|
||||
if ( isset($forum_data['_db_row']) AND 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'];
|
||||
}
|
||||
@@ -853,7 +953,7 @@ class forum_functions
|
||||
$sub_cat_img = '_CAT';
|
||||
}
|
||||
|
||||
if ( $forum_data['password'] AND $sub == 0 )
|
||||
if ( isset($forum_data['password']) AND $forum_data['password'] AND $sub == 0 )
|
||||
{
|
||||
return $forum_data['last_post'] && $forum_data['last_post'] > $rtime ? "<{C_ON_RES}>" : "<{C_OFF_RES}>";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user