Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,132 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Moderator actions
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class digestLibrary
|
||||
{
|
||||
/**
|
||||
* Digest time
|
||||
*
|
||||
* @var string daily|weekly
|
||||
*/
|
||||
public $digest_time = 'daily';
|
||||
|
||||
/**
|
||||
* Digest type
|
||||
*
|
||||
* @var string topic|forum
|
||||
*/
|
||||
public $digest_type = 'topic';
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* Check for class_forums */
|
||||
if( ! $this->registry->isClassLoaded( 'class_forums' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->strip_invisible = 0;
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
|
||||
/* Load language files */
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_emails', 'public_email_content' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the digest
|
||||
* @param string Frequency (daily/weekly)
|
||||
* @param string Type (topic/forum)
|
||||
* @return @e void
|
||||
*/
|
||||
public function runDigest( $frequency='daily', $type='topic' )
|
||||
{
|
||||
if ( $type == 'topic' )
|
||||
{
|
||||
$this->_sendTopicDigest( $frequency );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_sendForumDigest( $frequency );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the digest
|
||||
* @param string Frequency (daily/weekly)
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _sendTopicDigest( $frequency )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
$_like = classes_like::bootstrap( 'forums','topics' );
|
||||
|
||||
$_like->sendDigestNotifications( ( $frequency == 'daily' ) ? 'daily' : 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the digest
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _sendForumDigest( $frequency )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
$_like = classes_like::bootstrap( 'forums', 'forums' );
|
||||
|
||||
$_like->sendDigestNotifications( ( $frequency == 'daily' ) ? 'daily' : 'weekly' );
|
||||
}
|
||||
}
|
||||
+468
-468
@@ -1,469 +1,469 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Admin forum functions library
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 26th January 2004
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forum_functions extends class_forums
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $html;
|
||||
|
||||
/**
|
||||
* Type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = "";
|
||||
|
||||
/**
|
||||
* How many printed
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $printed = 0;
|
||||
|
||||
/**
|
||||
* Cached skin id -> names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $skins = array();
|
||||
|
||||
/**
|
||||
* Need descriptions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $need_desc = array();
|
||||
|
||||
/**
|
||||
* Build forum children
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param string $temp_html
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
public function forumBuildChildren( $root_id, $temp_html="", $depth_guide="" )
|
||||
{
|
||||
if ( isset( $this->forum_cache[ $root_id ] ) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
|
||||
$temp_html = $this->forumBuildChildren( $forum_data['id'], $temp_html, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $temp_html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build forum
|
||||
*
|
||||
* @param integer $r
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
public function renderForum( $r, $depth_guide="" )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$desc = "";
|
||||
$mod_string = "";
|
||||
|
||||
$r['skin_id'] = isset( $r['skin_id'] ) ? $r['skin_id'] : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Manage forums?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->type == 'manage' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Show main forums...
|
||||
//-----------------------------------------
|
||||
|
||||
$children = $this->forumsGetChildren( $r['id'] );
|
||||
|
||||
$sub = array();
|
||||
$subforums = "";
|
||||
$count = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build sub-forums link
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count($children) )
|
||||
{
|
||||
$r['name'] = "<a href='{$this->settings['base_url']}f={$r['id']}'>" . $r['name'] . "</a>";
|
||||
|
||||
foreach ( $children as $cid )
|
||||
{
|
||||
$count++;
|
||||
|
||||
$cfid = $cid;
|
||||
|
||||
if ( $count == count( $children ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Last subforum, link to parent
|
||||
// forum...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !isset($children[ $count - 2 ]) OR ! $cfid = $children[ $count - 2 ] )
|
||||
{
|
||||
$cfid = $r['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$sub[] = "<a href='{$this->settings['base_url']}f={$this->forum_by_id[$cid]['parent_id']}'>".$this->forum_by_id[$cid]['name']."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $sub ) )
|
||||
{
|
||||
$subforums = '<fieldset class="subforums"><legend>' . $this->lang->words['acp_subforum_legend'] . '</legend>' . implode( ", ", $sub ) . '</fieldset>';
|
||||
}
|
||||
|
||||
$desc = "{$r['description']}{$subforums}";
|
||||
|
||||
//-----------------------------------------
|
||||
// Moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$r['_modstring'] = "";
|
||||
$r['_mods'] = array();
|
||||
|
||||
foreach( $this->moderators as $data )
|
||||
{
|
||||
$forum_ids = explode( ',', IPSText::cleanPermString( $data['forum_id'] ) );
|
||||
|
||||
foreach( $forum_ids as $forum_id )
|
||||
{
|
||||
if ( $forum_id == $r['id'] )
|
||||
{
|
||||
if ($data['is_group'] == 1)
|
||||
{
|
||||
$data['_fullname'] = $this->lang->words['fc_group_prefix'] . $data['group_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['_fullname'] = $data['members_display_name'];
|
||||
}
|
||||
|
||||
$data['randId'] = substr( str_replace( array( ' ', '.' ), '', uniqid( microtime(), true ) ), 0, 10 );
|
||||
$data['forum_id'] = $forum_id;
|
||||
|
||||
$r['_mods'][] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $r['_mods'] ) )
|
||||
{
|
||||
$r['_modstring'] = $this->html->renderModeratorEntry( $r['_mods'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print
|
||||
//-----------------------------------------
|
||||
|
||||
$this->skins[$r['skin_id']] = !empty($this->skins[ $r['skin_id'] ] ) ? $this->skins[ $r['skin_id'] ] : '';
|
||||
|
||||
return $this->html->renderForumRow( $desc, $r, $depth_guide, $this->skins[ $r['skin_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Category
|
||||
*
|
||||
* @param string $content
|
||||
* @param array $r
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumShowCat( $content, $r )
|
||||
{
|
||||
$this->printed++;
|
||||
|
||||
$no_root = count( $this->forum_cache['root'] );
|
||||
|
||||
$this->registry->output->html .= $this->html->forumWrapper( $content, $r );
|
||||
}
|
||||
|
||||
/**
|
||||
* List all forums
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumsListForums()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->html )
|
||||
{
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_forums' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Manage forums
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->type == 'manage' )
|
||||
{
|
||||
foreach( $this->caches['skinsets'] as $id => $data )
|
||||
{
|
||||
$this->skins[ $id ] = $data['set_name'];
|
||||
}
|
||||
}
|
||||
|
||||
$temp_html = "";
|
||||
$fid = intval( $this->request['f'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show root forums
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $fid )
|
||||
{
|
||||
$seen_count = 0;
|
||||
$total_items = 0;
|
||||
|
||||
if( is_array($this->forum_cache[ 'root' ]) AND count($this->forum_cache[ 'root' ]) )
|
||||
{
|
||||
foreach( $this->forum_cache[ 'root' ] as $forum_data )
|
||||
{
|
||||
$cat_data = $forum_data;
|
||||
$depth_guide = "";
|
||||
$temp_html = "";
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
if( !$temp_html )
|
||||
{
|
||||
$temp_html = $this->html->renderNoForums( $cat_data['id'] );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->forumShowCat( $temp_html, $cat_data );
|
||||
unset($temp_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show per ID forums
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$cat_data = array();
|
||||
$depth_guide = "";
|
||||
|
||||
if ( is_array( $this->forum_cache[ $fid ] ) )
|
||||
{
|
||||
$cat_data = $this->forum_by_id[ $fid ];
|
||||
$depth_guide = "";
|
||||
|
||||
foreach( $this->forum_cache[ $fid ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
if( !$temp_html )
|
||||
{
|
||||
$temp_html = $this->html->renderNoForums( $cat_data['id'] );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->forumShowCat( $temp_html, $this->forum_by_id[ $fid ] );
|
||||
unset( $temp_html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get descriptions?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] and count( $this->need_desc ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'id,description', 'from' => 'forums', 'where' => 'id IN('.implode( ',', $this->need_desc ) .')' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->html = str_replace( "<!--DESCRIPTION:{$r['id']}-->", $r['description'], $this->registry->output->html );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Jump
|
||||
*
|
||||
* @param bool $restrict
|
||||
* @return array
|
||||
*/
|
||||
public function adForumsForumList( $restrict=0 )
|
||||
{
|
||||
if ( $restrict != 1 )
|
||||
{
|
||||
$jump_array[] = array( '-1', 'Make Root (Category)' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$jump_array = array();
|
||||
}
|
||||
|
||||
foreach( $this->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $forum_data['name'] );
|
||||
|
||||
$depth_guide = $this->depth_guide;
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'] );
|
||||
|
||||
$jump_array = $this->forumsForumListInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum List Helper
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $jump_array
|
||||
* @param string $depth_guide
|
||||
* @return array
|
||||
*/
|
||||
protected function forumsForumListInternal( $root_id, $jump_array=array(), $depth_guide="" )
|
||||
{
|
||||
if( isset($this->forum_cache[ $root_id ] ) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'] );
|
||||
|
||||
$jump_array = $this->forumsForumListInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function adForumsForumData()
|
||||
{
|
||||
foreach( $this->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $forum_data['name'];
|
||||
$forum_data['root_forum'] = 1;
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$depth_guide = $this->depth_guide;
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$jump_array = $this->forumsForumDataInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Data Helper
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $jump_array
|
||||
* @param string $depth_guide
|
||||
* @return array
|
||||
*/
|
||||
public function forumsForumDataInternal( $root_id, $jump_array=array(), $depth_guide="" )
|
||||
{
|
||||
if ( isset( $this->forum_cache[ $root_id ]) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$jump_array = $this->forumsForumDataInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Admin forum functions library
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 26th January 2004
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forum_functions extends class_forums
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $html;
|
||||
|
||||
/**
|
||||
* Type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = "";
|
||||
|
||||
/**
|
||||
* How many printed
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $printed = 0;
|
||||
|
||||
/**
|
||||
* Cached skin id -> names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $skins = array();
|
||||
|
||||
/**
|
||||
* Need descriptions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $need_desc = array();
|
||||
|
||||
/**
|
||||
* Build forum children
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param string $temp_html
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
public function forumBuildChildren( $root_id, $temp_html="", $depth_guide="" )
|
||||
{
|
||||
if ( isset( $this->forum_cache[ $root_id ] ) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
|
||||
$temp_html = $this->forumBuildChildren( $forum_data['id'], $temp_html, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $temp_html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build forum
|
||||
*
|
||||
* @param integer $r
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
public function renderForum( $r, $depth_guide="" )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$desc = "";
|
||||
$mod_string = "";
|
||||
|
||||
$r['skin_id'] = isset( $r['skin_id'] ) ? $r['skin_id'] : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Manage forums?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->type == 'manage' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Show main forums...
|
||||
//-----------------------------------------
|
||||
|
||||
$children = $this->forumsGetChildren( $r['id'] );
|
||||
|
||||
$sub = array();
|
||||
$subforums = "";
|
||||
$count = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build sub-forums link
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count($children) )
|
||||
{
|
||||
$r['name'] = "<a href='{$this->settings['base_url']}f={$r['id']}'>" . $r['name'] . "</a>";
|
||||
|
||||
foreach ( $children as $cid )
|
||||
{
|
||||
$count++;
|
||||
|
||||
$cfid = $cid;
|
||||
|
||||
if ( $count == count( $children ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Last subforum, link to parent
|
||||
// forum...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !isset($children[ $count - 2 ]) OR ! $cfid = $children[ $count - 2 ] )
|
||||
{
|
||||
$cfid = $r['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$sub[] = "<a href='{$this->settings['base_url']}f={$this->forum_by_id[$cid]['parent_id']}'>".$this->forum_by_id[$cid]['name']."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $sub ) )
|
||||
{
|
||||
$subforums = '<fieldset class="subforums"><legend>' . $this->lang->words['acp_subforum_legend'] . '</legend>' . implode( ", ", $sub ) . '</fieldset>';
|
||||
}
|
||||
|
||||
$desc = "{$r['description']}{$subforums}";
|
||||
|
||||
//-----------------------------------------
|
||||
// Moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$r['_modstring'] = "";
|
||||
$r['_mods'] = array();
|
||||
|
||||
foreach( $this->moderators as $data )
|
||||
{
|
||||
$forum_ids = explode( ',', IPSText::cleanPermString( $data['forum_id'] ) );
|
||||
|
||||
foreach( $forum_ids as $forum_id )
|
||||
{
|
||||
if ( $forum_id == $r['id'] )
|
||||
{
|
||||
if ($data['is_group'] == 1)
|
||||
{
|
||||
$data['_fullname'] = $this->lang->words['fc_group_prefix'] . $data['group_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['_fullname'] = $data['members_display_name'];
|
||||
}
|
||||
|
||||
$data['randId'] = substr( str_replace( array( ' ', '.' ), '', uniqid( microtime(), true ) ), 0, 10 );
|
||||
$data['forum_id'] = $forum_id;
|
||||
|
||||
$r['_mods'][] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $r['_mods'] ) )
|
||||
{
|
||||
$r['_modstring'] = $this->html->renderModeratorEntry( $r['_mods'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print
|
||||
//-----------------------------------------
|
||||
|
||||
$this->skins[$r['skin_id']] = !empty($this->skins[ $r['skin_id'] ] ) ? $this->skins[ $r['skin_id'] ] : '';
|
||||
|
||||
return $this->html->renderForumRow( $desc, $r, $depth_guide, $this->skins[ $r['skin_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Category
|
||||
*
|
||||
* @param string $content
|
||||
* @param array $r
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumShowCat( $content, $r )
|
||||
{
|
||||
$this->printed++;
|
||||
|
||||
$no_root = count( $this->forum_cache['root'] );
|
||||
|
||||
$this->registry->output->html .= $this->html->forumWrapper( $content, $r );
|
||||
}
|
||||
|
||||
/**
|
||||
* List all forums
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumsListForums()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->html )
|
||||
{
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_forums' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Manage forums
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->type == 'manage' )
|
||||
{
|
||||
foreach( $this->caches['skinsets'] as $id => $data )
|
||||
{
|
||||
$this->skins[ $id ] = $data['set_name'];
|
||||
}
|
||||
}
|
||||
|
||||
$temp_html = "";
|
||||
$fid = intval( $this->request['f'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show root forums
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $fid )
|
||||
{
|
||||
$seen_count = 0;
|
||||
$total_items = 0;
|
||||
|
||||
if( is_array($this->forum_cache[ 'root' ]) AND count($this->forum_cache[ 'root' ]) )
|
||||
{
|
||||
foreach( $this->forum_cache[ 'root' ] as $forum_data )
|
||||
{
|
||||
$cat_data = $forum_data;
|
||||
$depth_guide = "";
|
||||
$temp_html = "";
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
if( !$temp_html )
|
||||
{
|
||||
$temp_html = $this->html->renderNoForums( $cat_data['id'] );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->forumShowCat( $temp_html, $cat_data );
|
||||
unset($temp_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show per ID forums
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$cat_data = array();
|
||||
$depth_guide = "";
|
||||
|
||||
if ( is_array( $this->forum_cache[ $fid ] ) )
|
||||
{
|
||||
$cat_data = $this->forum_by_id[ $fid ];
|
||||
$depth_guide = "";
|
||||
|
||||
foreach( $this->forum_cache[ $fid ] as $forum_data )
|
||||
{
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] )
|
||||
{
|
||||
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
|
||||
$this->need_desc[] = $forum_data['id'];
|
||||
}
|
||||
|
||||
$temp_html .= $this->renderForum( $forum_data, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
if( !$temp_html )
|
||||
{
|
||||
$temp_html = $this->html->renderNoForums( $cat_data['id'] );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->forumShowCat( $temp_html, $this->forum_by_id[ $fid ] );
|
||||
unset( $temp_html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get descriptions?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['forum_cache_minimum'] AND $this->settings['forum_cache_minimum'] and count( $this->need_desc ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'id,description', 'from' => 'forums', 'where' => 'id IN('.implode( ',', $this->need_desc ) .')' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->html = str_replace( "<!--DESCRIPTION:{$r['id']}-->", $r['description'], $this->registry->output->html );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Jump
|
||||
*
|
||||
* @param bool $restrict
|
||||
* @return array
|
||||
*/
|
||||
public function adForumsForumList( $restrict=0, $disableCats=FALSE, $exclude=array() )
|
||||
{
|
||||
if ( $restrict != 1 )
|
||||
{
|
||||
$jump_array[] = array( '-1', $this->lang->words['make_root_category'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$jump_array = array();
|
||||
}
|
||||
|
||||
foreach( $this->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $forum_data['name'], 'disabled' => ( ( $disableCats AND !$forum_data['sub_can_post'] ) or in_array( $forum_data['id'], $exclude ) ) );
|
||||
|
||||
$depth_guide = $this->depth_guide;
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'], 'disabled' => ( ( $disableCats AND !$forum_data['sub_can_post'] ) or in_array( $forum_data['id'], $exclude ) ) );
|
||||
|
||||
$jump_array = $this->forumsForumListInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide, $disableCats, $exclude );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum List Helper
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $jump_array
|
||||
* @param string $depth_guide
|
||||
* @return array
|
||||
*/
|
||||
protected function forumsForumListInternal( $root_id, $jump_array=array(), $depth_guide="", $disableCats=FALSE, $exclude=array() )
|
||||
{
|
||||
if( isset($this->forum_cache[ $root_id ] ) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'], 'disabled' => ( ( $disableCats AND !$forum_data['sub_can_post'] ) or in_array( $forum_data['id'], $exclude ) ) );
|
||||
|
||||
$jump_array = $this->forumsForumListInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide, $disableCats, $exclude );
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function adForumsForumData()
|
||||
{
|
||||
foreach( $this->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $forum_data['name'];
|
||||
$forum_data['root_forum'] = 1;
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$depth_guide = $this->depth_guide;
|
||||
|
||||
if ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$jump_array = $this->forumsForumDataInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Forum Data Helper
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $jump_array
|
||||
* @param string $depth_guide
|
||||
* @return array
|
||||
*/
|
||||
public function forumsForumDataInternal( $root_id, $jump_array=array(), $depth_guide="" )
|
||||
{
|
||||
if ( isset( $this->forum_cache[ $root_id ]) AND is_array( $this->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
foreach( $this->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
|
||||
|
||||
$jump_array[ $forum_data['id'] ] = $forum_data;
|
||||
|
||||
$jump_array = $this->forumsForumDataInternal( $forum_data['id'], $jump_array, $depth_guide . $this->depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $jump_array;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,81 +1,81 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Forum hook gateway
|
||||
* Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
|
||||
* Last Updated: $Date: 2011-08-08 04:56:34 -0400 (Mon, 08 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://hatynka.in
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 9375 $
|
||||
*/
|
||||
class forums_hookGateway
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Method constructor
|
||||
*
|
||||
* @param object Registry Object
|
||||
* @return @e void
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows board index popular tags
|
||||
*
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'sources/classes/tags/cloud.php', 'classes_tags_cloud' );
|
||||
$cloud = new $classToLoad();
|
||||
|
||||
$cloud->setSkinGroup('boards');
|
||||
$cloud->setSkinTemplate('hookTagCloud');
|
||||
|
||||
return $cloud->render( $cloud->getCloudData( array('limit' => 50 ) ) );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Forum hook gateway
|
||||
* Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
class forums_hookGateway
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Method constructor
|
||||
*
|
||||
* @param object Registry Object
|
||||
* @return @e void
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows board index popular tags
|
||||
*
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'sources/classes/tags/cloud.php', 'classes_tags_cloud' );
|
||||
$cloud = new $classToLoad();
|
||||
|
||||
$cloud->setSkinGroup('boards');
|
||||
$cloud->setSkinTemplate('hookTagCloud');
|
||||
|
||||
return $cloud->render( $cloud->getCloudData( array('limit' => 50 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Posting display formatting methods
|
||||
* Last Updated: $Date: 2011-09-29 22:09:09 -0400 (Thu, 29 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-07-09 12:56:26 -0400 (Mon, 09 Jul 2012) $
|
||||
* </pre>
|
||||
* File Created By: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9570 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 11047 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -60,7 +60,7 @@ class classPostForms extends classPost
|
||||
// Set up
|
||||
//-----------------------------------------
|
||||
|
||||
$extraData = array();
|
||||
$extraData = array( 'isHtml' => 0 );
|
||||
$errors = '';
|
||||
|
||||
$this->setIsAjax( TRUE );
|
||||
@@ -164,7 +164,15 @@ class classPostForms extends classPost
|
||||
$extraData['_loadJs'] = true;
|
||||
$extraData['smilies'] = $this->editor->fetchEmoticons();
|
||||
}
|
||||
|
||||
|
||||
$extraData['htmlStatus'] = $this->_originalPost['post_htmlstate'];
|
||||
|
||||
/* Set HTML status */
|
||||
if ( $this->_canHtml( $this->getForumData('id') ) && $this->_originalPost['post_htmlstate'] )
|
||||
{
|
||||
$extraData['isHtml'] = true;
|
||||
}
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('editors')->ajaxEditBox( $postContent, $this->getPostID(), $errors, $extraData );
|
||||
|
||||
return $html;
|
||||
@@ -356,6 +364,12 @@ class classPostForms extends classPost
|
||||
|
||||
$postContent = $this->_checkMultiQuote( $postContent );
|
||||
|
||||
/* Set HTML status */
|
||||
if ( $this->_canHtml( $this->getForumData('id') ) && $this->_originalPost['post_htmlstate'] )
|
||||
{
|
||||
$this->editor->setIsHtml( true );
|
||||
}
|
||||
|
||||
/* Set content in editor */
|
||||
$this->editor->setContent( $postContent );
|
||||
|
||||
@@ -391,8 +405,26 @@ class classPostForms extends classPost
|
||||
$_statusMsg[] = $this->registry->getClass('class_forums')->ppdStatusMessage;
|
||||
}
|
||||
|
||||
$_statusMsg[] = $this->registry->getClass('class_forums')->fetchPostModerationStatusMessage( $this->getAuthor(), $this->getForumData(), $topic, $formType );
|
||||
|
||||
$modAll = FALSE;
|
||||
switch( intval( $this->getForumData('preview_posts') ) )
|
||||
{
|
||||
case 1:
|
||||
$modAll = TRUE;
|
||||
break;
|
||||
case 2:
|
||||
if ( $formType == 'new' )
|
||||
{
|
||||
$modAll = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ( $formType == 'reply' )
|
||||
{
|
||||
$modAll = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load attachments so we get some stats
|
||||
//-----------------------------------------
|
||||
@@ -411,7 +443,7 @@ class classPostForms extends classPost
|
||||
$output .= $this->registry->getClass('output')->getTemplate('post')->postFormTemplate( array( 'title' => $titleText,
|
||||
'captchaHTML' => $this->_generateGuestCaptchaHTML(),
|
||||
'checkBoxes' => $this->_generateCheckBoxes( $formType, isset( $topic['tid'] ) ? $topic['tid'] : 0, $this->getForumData('id') ),
|
||||
'editor' => $this->editor->show( 'Post', array( 'autoSaveKey' => $autoSaveKey, 'height' => 350 ) ),
|
||||
'editor' => $this->editor->show( 'Post', array( 'autoSaveKey' => $autoSaveKey, 'height' => 350, 'warnInfo' => 'full', 'modAll' => $modAll ) ),
|
||||
'buttonText' => $buttonText,
|
||||
'uploadForm' => ( $this->can_upload ) ? $this->registry->getClass('output')->getTemplate('post')->uploadForm( $this->post_key, 'post', $class_attach->attach_stats, $this->getPostID(), $this->getForumData('id') ) : "",
|
||||
'topicSummary' => $this->_generateTopicSummary( $topic['tid'] ),
|
||||
@@ -424,7 +456,8 @@ class classPostForms extends classPost
|
||||
'seoTopic' => $topic['title_seo'],
|
||||
'seoForum' => $this->getForumData('name_seo'),
|
||||
'statusMsg' => $_statusMsg,
|
||||
'tagBox' => $tagBox
|
||||
'tagBox' => $tagBox,
|
||||
'socialShareOff' => ( $formType != 'new' ) ? 1 : $this->getForumData('disable_sharelinks')
|
||||
),
|
||||
array( 'doCode' => $doCode,
|
||||
'p' => $this->getPostID(),
|
||||
@@ -519,7 +552,7 @@ class classPostForms extends classPost
|
||||
protected function _afterPostCompile( $postContent, $formType )
|
||||
{
|
||||
$postContent = $postContent ? $postContent : $this->_originalPost['post'];
|
||||
|
||||
|
||||
if ( $formType == 'edit' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
@@ -588,27 +621,27 @@ class classPostForms extends classPost
|
||||
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' );
|
||||
|
||||
$this->DB->build( array( 'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.topic_id=' . $topicID . ' AND ' . $_queued,
|
||||
'order' => 'pid DESC',
|
||||
'limit' => array( 0, 10 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.members_display_name, m.member_group_id, m.mgroup_others, m.member_id, m.members_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'f.use_ibc',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=t.forum_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.topic_id=' . $topicID . ' AND ' . $_queued,
|
||||
'order' => 'p.pid DESC',
|
||||
'limit' => array( 0, 10 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.members_display_name, m.member_group_id, m.mgroup_others, m.member_id, m.members_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'f.use_ibc',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=t.forum_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
|
||||
$post_query = $this->DB->execute();
|
||||
@@ -617,7 +650,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
$row['author'] = $row['members_display_name'] ? $row['members_display_name'] : $row['author_name'];
|
||||
|
||||
$row['date'] = $this->registry->getClass( 'class_localization')->getDate( $row['post_date'], 'LONG' );
|
||||
$row['date'] = $this->registry->getClass('class_localization')->getDate( $row['post_date'], 'LONG' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse the post
|
||||
@@ -631,21 +664,7 @@ class classPostForms extends classPost
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
|
||||
$row['post'] = IPSText::truncate( IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] ), 1000 );
|
||||
|
||||
/* Bit crude */
|
||||
$od = substr_count( $row['post'], '<div' );
|
||||
$cd = substr_count( $row['post'], '</div>' );
|
||||
|
||||
if ( $od > $cd )
|
||||
{
|
||||
for( $i = 0 ; $i < $od ; $i++ )
|
||||
{
|
||||
$row['post'] .= "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
$posts[ $row['pid'] ] = $row;
|
||||
$row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['post'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Are we giving this bloke a good ignoring?
|
||||
@@ -657,14 +676,16 @@ class classPostForms extends classPost
|
||||
{
|
||||
if ( ! strstr( $this->settings['cannot_ignore_groups'], ','.$row['member_group_id'].',' ) )
|
||||
{
|
||||
$posts[ $row['pid'] ]['_ignored'] = 1;
|
||||
$row['_ignored'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$posts[ $row['pid'] ] = $row;
|
||||
|
||||
$attach_pids[] = $row['pid'];
|
||||
}
|
||||
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('post')->topicSummary( $posts );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -690,14 +711,15 @@ class classPostForms extends classPost
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
$this->class_attach->attach_post_key = '';
|
||||
$this->class_attach->attach_post_key = '';
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $attach_pids );
|
||||
}
|
||||
|
||||
return $content;
|
||||
// We need 0 and html values to avoid string offest errors
|
||||
return is_array($content) ? $content : array( 0 => array( 'html' => $content ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -719,8 +741,8 @@ class classPostForms extends classPost
|
||||
$return = array(
|
||||
'sig' => 'checked="checked"',
|
||||
'emo' => 'checked="checked"',
|
||||
'html' => array(),
|
||||
'tra' => ( $this->getAuthor('auto_track') OR $this->getSettings('enableTracker') ) ? 'checked="checked"' : ''
|
||||
'html' => null,
|
||||
'tra' => ( ( $this->getAuthor('auto_track') and !$topicID ) OR $this->getSettings('enableTracker') ) ? 'checked="checked"' : ''
|
||||
);
|
||||
|
||||
if ( ! $this->getSettings('enableSignature') )
|
||||
@@ -733,11 +755,9 @@ class classPostForms extends classPost
|
||||
$return['emo'] = "";
|
||||
}
|
||||
|
||||
if ( $this->registry->class_forums->forum_by_id[ $forumID ]['use_html'] and $this->getAuthor('g_dohtml') )
|
||||
if ( $this->_canHtml( $forumID ) )
|
||||
{
|
||||
$options_array[ $this->getSettings('post_htmlstatus') ] = ' selected="selected"';
|
||||
|
||||
$return['html'] = $options_array;
|
||||
$return['html'] = ( $this->getSettings('post_htmlstatus') ) ? ' checked="checked"' : '';
|
||||
}
|
||||
|
||||
if ( $type == 'reply' )
|
||||
@@ -758,10 +778,19 @@ class classPostForms extends classPost
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if user can HTML
|
||||
* @param int $forumId
|
||||
*/
|
||||
protected function _canHtml( $forumId )
|
||||
{
|
||||
return ( $this->registry->class_forums->forum_by_id[ $forumId ]['use_html'] and $this->getAuthor('g_dohtml') );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates mod options dropdown
|
||||
*
|
||||
@@ -796,7 +825,7 @@ class classPostForms extends classPost
|
||||
}
|
||||
else if ( $this->getAuthor('member_id') != 0 )
|
||||
{
|
||||
if ( $this->moderator['mid'] != "" )
|
||||
if ( isset($this->moderator['mid']) && $this->moderator['mid'] != "" )
|
||||
{
|
||||
if ($this->moderator['close_topic'])
|
||||
{
|
||||
@@ -823,7 +852,9 @@ class classPostForms extends classPost
|
||||
else
|
||||
{
|
||||
// Guest
|
||||
return "";
|
||||
return array( 'dropDownOptions' => $html,
|
||||
'canSetOpenTime' => 0,
|
||||
'canSetCloseTime' => 0 );
|
||||
}
|
||||
|
||||
if ( !($can_pin == 0 and $can_close == 0 and $can_move == 0) )
|
||||
@@ -920,7 +951,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
# Bug 23258 - add on TZ as we take this off when saving time
|
||||
$date = IPSTime::unixstamp_to_human( $topic['topic_open_time'] + $this->registry->class_localization->getTimeOffset() );
|
||||
$mytimes['open_date'] = sprintf("%02d.%02d.%04d", $date['day'], $date['month'], $date['year'] );
|
||||
$mytimes['open_date'] = sprintf("%02d/%02d/%04d", $date['month'], $date['day'], $date['year'] );
|
||||
$mytimes['open_time'] = sprintf("%02d:%02d" , $date['hour'] , $date['minute'] );
|
||||
}
|
||||
}
|
||||
@@ -931,7 +962,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
# Bug 23258 - add on TZ as we take this off when saving time
|
||||
$date = IPSTime::unixstamp_to_human( $topic['topic_close_time'] + $this->registry->class_localization->getTimeOffset() );
|
||||
$mytimes['close_date'] = sprintf("%02d.%02d.%04d", $date['day'], $date['month'], $date['year'] );
|
||||
$mytimes['close_date'] = sprintf("%02d/%02d/%04d", $date['month'], $date['day'], $date['year'] );
|
||||
$mytimes['close_time'] = sprintf("%02d:%02d" , $date['hour'] , $date['minute'] );
|
||||
}
|
||||
}
|
||||
@@ -959,7 +990,7 @@ class classPostForms extends classPost
|
||||
*/
|
||||
protected function _generateGuestCaptchaHTML()
|
||||
{
|
||||
if ( ! $this->getAuthor('member_id') AND $this->settings['guest_captcha'] )
|
||||
if ( ! $this->getAuthor('member_id') AND $this->settings['guest_captcha'] AND $this->settings['bot_antispam_type'] != 'none' )
|
||||
{
|
||||
$captchaHTML = $this->registry->getClass('class_captcha')->getTemplate();
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user