pliku class_forums.php czy index.php
plik class_forums.php
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
|
| =============================================
|
|
+---------------------------------------------------------------------------
| > $Date: 2007-12-17 18:07:20 -0500 (Mon, 17 Dec 2007) $
| > $Revision: 1149 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > FORUMS CLASS
| > Module written by Matt Mecham
| > Date started: 26th January 2004
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
+--------------------------------------------------------------------------
*/
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
{
var $forum_cache = array();
var $forum_by_id = array();
var $forum_built = array();
var $template_bit = "";
var $depth_guide = "--";
var $return = "";
var $this_forum = array();
var $strip_invisible = 0;
var $mod_cache = array();
var $mod_cache_got = 0;
var $read_topic_only = 0;
/*-------------------------------------------------------------------------*/
// register_class
// ------------------
// Register a $this-> class with this module
/*-------------------------------------------------------------------------*/
function register_class()
{
//NO LONGER NEEDED
}
/*-------------------------------------------------------------------------*/
// forums_init
// ------------------
// Grab all forums and stuff into array
/*-------------------------------------------------------------------------*/
function forums_init()
{
if ( ! is_array( $this->ipsclass->cache['forum_cache'] ) )
{
$this->ipsclass->update_forum_cache();
}
$hide_parents = ',';
$this->forum_cache = array();
$this->forum_by_id = array();
foreach( $this->ipsclass->cache['forum_cache'] as $f )
{
if ( $this->strip_invisible )
{
if ( strstr( $hide_parents, ','. $f['parent_id'] .',' ) )
{
// Don't show any children of hidden parents
$hide_parents .= $f['id'].',';
continue;
}
if ( $f['show_perms'] != '*' )
{
if ( $this->ipsclass->check_perms($f['show_perms']) != TRUE )
{
$hide_parents .= $f['id'].',';
continue;
}
}
}
if ( $f['parent_id'] < 1 )
{
$f['parent_id'] = 'root';
}
$f['fid'] = $f['id'];
$this->forum_cache[ $f['parent_id'] ][ $f['id'] ] = $f;
$this->forum_by_id[ $f['id'] ] = &$this->forum_cache[ $f['parent_id'] ][ $f['id'] ];
}
}