Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,19 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Forums application initialization
* Last Updated: $LastChangedDate: 2009-12-01 17:42:17 -0500 (Tue, 01 Dec 2009) $
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: josh $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 5501 $
* @version $Rev: 7003 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -27,7 +28,6 @@ class app_class_forums
/**#@+
* Registry Object Shortcuts
*
* @access protected
* @var object
*/
protected $registry;
@@ -36,13 +36,14 @@ class app_class_forums
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @return void
*/
@@ -64,9 +65,9 @@ class app_class_forums
try
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php" );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
$this->registry->setClass( 'class_forums', new admin_forum_functions( $registry ) );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 0;
}
catch( Exception $error )
@@ -78,8 +79,8 @@ class app_class_forums
{
try
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
$this->registry->setClass( 'class_forums', new class_forums( $registry ) );
$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->getClass('class_forums')->strip_invisible = 1;
}
catch( Exception $error )
@@ -117,7 +118,7 @@ class app_class_forums
'where' => "tid=" . $this->request['t'],
) );
}
$this->registry->getClass('class_forums')->topic_cache = $topic;
$this->request['f'] = $topic['forum_id'];
@@ -132,14 +133,14 @@ class app_class_forums
// Set up moderators
//-----------------------------------------
$this->memberData = $this->registry->getClass('class_forums')->setUpModerator( $this->memberData );
$this->memberData = IPSMember::setUpModerator( $this->memberData );
}
/**
* Do some set up after ipsRegistry::init()
*
* @access public
*/
* Do some set up after ipsRegistry::init()
*
* @return void
*/
public function afterOutputInit()
{
if ( isset( $_GET['showtopic'] ) AND $_GET['showtopic'] != '' AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
@@ -160,11 +161,16 @@ class app_class_forums
/* Add canonical tag */
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showtopic=' . $topic['tid'] . '&st=' . $this->request['st'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' ) );
}
else if ( isset( $_GET['showforum'] ) AND $_GET['showforum'] != '' )
{
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
$_GET['showforum'] = intval($_GET['showforum']);
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['showforum']);
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
if ( IPB_USE_ONLY_ID_FURL )
{
$data['name_seo'] = $data['id'];
@@ -181,6 +187,32 @@ class app_class_forums
if( $data['id'] )
{
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showforum=' . $data['id'] . '&st=' . $this->request['st'] : 'showforum=' . $data['id'], $data['name_seo'], 'showforum' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $data['id'], 'publicNoSession', $data['name_seo'], 'showforum' ) );
}
}
else if ( isset( $_GET['showannouncement'] ) AND $_GET['showannouncement'] != '' )
{
//$announce = $this->DB->buildAndFetch( array( 'select' => 'announce_id, announce_title',
// 'from' => 'announcements',
// 'where' => 'announce_id=' . intval( $_GET['showannouncement'] ) ) );
$announce = $this->caches['announcements'][ intval( $_GET['showannouncement'] ) ];
if ( $announce['announce_id'] )
{
$_seoTitle = $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
$this->registry->getClass('output')->checkPermalink( $_seoTitle );
/* Add canonical tag */
if( $announce['announce_id'] )
{
$this->registry->getClass('output')->addCanonicalTag( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), $_seoTitle, 'showannouncement' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), 'publicNoSession', $_seoTitle, 'showannouncement' ) );
}
}
}
}
@@ -1,106 +1,107 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Group property updater (Forums)
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
*
*/
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 admin_group_form__forums implements admin_group_form
{
/**
* Tab name
* This can be left blank and the application title will
* be used
*
* @access public
* @var string Tab name
*/
public $tab_name = "";
/**
* Returns content for the page.
*
* @access public
* @author Brandon Farber
* @param array Group data
* @param integer Number of tabs used so far
* @return array Array of tabs, content
*/
public function getDisplayContent( $group=array(), $tabsUsed = 2 )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_group_form', 'forums');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
//-----------------------------------------
// Show...
//-----------------------------------------
return array( 'tabs' => $this->html->acp_group_form_tabs( $group, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_group_form_main( $group, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
}
/**
* Process the entries for saving and return
*
* @access public
* @author Brandon Farber
* @return array Array of keys => values for saving
*/
public function getForSave()
{
$return = array(
'g_other_topics' =>ipsRegistry::$request['g_other_topics'],
'g_post_new_topics' =>ipsRegistry::$request['g_post_new_topics'],
'g_reply_own_topics' =>ipsRegistry::$request['g_reply_own_topics'],
'g_reply_other_topics' =>ipsRegistry::$request['g_reply_other_topics'],
'g_edit_posts' =>ipsRegistry::$request['g_edit_posts'],
'g_edit_cutoff' =>ipsRegistry::$request['g_edit_cutoff'],
'g_delete_own_posts' =>ipsRegistry::$request['g_delete_own_posts'],
'g_open_close_posts' =>ipsRegistry::$request['g_open_close_posts'],
'g_delete_own_topics' =>ipsRegistry::$request['g_delete_own_topics'],
'g_post_polls' =>ipsRegistry::$request['g_post_polls'],
'g_vote_polls' =>ipsRegistry::$request['g_vote_polls'],
'g_can_remove' =>ipsRegistry::$request['g_can_remove'] ? intval(ipsRegistry::$request['g_can_remove'] ) : 0,
'g_append_edit' =>ipsRegistry::$request['g_append_edit'],
'g_avoid_q' =>ipsRegistry::$request['g_avoid_q'],
'g_avoid_flood' =>ipsRegistry::$request['g_avoid_flood'],
'g_post_closed' =>ipsRegistry::$request['g_post_closed'],
'g_edit_topic' =>ipsRegistry::$request['g_edit_topic'],
'g_topic_rate_setting' => intval(ipsRegistry::$request['g_topic_rate_setting']),
'g_mod_preview' => ipsRegistry::$request['g_mod_preview'],
'g_mod_post_unit' => intval( ipsRegistry::$request['g_mod_post_unit'] ),
'g_ppd_unit' => intval( ipsRegistry::$request['g_ppd_unit'] ),
'g_ppd_limit' => intval( ipsRegistry::$request['g_ppd_limit'] ),
);
return $return;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Group property updater (Forums)
* Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 6925 $
*
*/
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 admin_group_form__forums implements admin_group_form
{
/**
* Tab name
* This can be left blank and the application title will
* be used
*
* @access public
* @var string Tab name
*/
public $tab_name = "";
/**
* Returns content for the page.
*
* @access public
* @author Brandon Farber
* @param array Group data
* @param integer Number of tabs used so far
* @return array Array of tabs, content
*/
public function getDisplayContent( $group=array(), $tabsUsed = 2 )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_group_form', 'forums');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
//-----------------------------------------
// Show...
//-----------------------------------------
return array( 'tabs' => $this->html->acp_group_form_tabs( $group, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_group_form_main( $group, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
}
/**
* Process the entries for saving and return
*
* @access public
* @author Brandon Farber
* @return array Array of keys => values for saving
*/
public function getForSave()
{
$return = array(
'g_other_topics' =>ipsRegistry::$request['g_other_topics'],
'g_post_new_topics' =>ipsRegistry::$request['g_post_new_topics'],
'g_reply_own_topics' =>ipsRegistry::$request['g_reply_own_topics'],
'g_reply_other_topics' =>ipsRegistry::$request['g_reply_other_topics'],
'g_edit_posts' =>ipsRegistry::$request['g_edit_posts'],
'g_edit_cutoff' =>ipsRegistry::$request['g_edit_cutoff'],
'g_delete_own_posts' =>ipsRegistry::$request['g_delete_own_posts'],
'g_open_close_posts' =>ipsRegistry::$request['g_open_close_posts'],
'g_delete_own_topics' =>ipsRegistry::$request['g_delete_own_topics'],
'g_post_polls' =>ipsRegistry::$request['g_post_polls'],
'g_vote_polls' =>ipsRegistry::$request['g_vote_polls'],
'g_append_edit' =>ipsRegistry::$request['g_append_edit'],
'g_avoid_q' =>ipsRegistry::$request['g_avoid_q'],
'g_avoid_flood' =>ipsRegistry::$request['g_avoid_flood'],
'g_post_closed' =>ipsRegistry::$request['g_post_closed'],
'g_edit_topic' =>ipsRegistry::$request['g_edit_topic'],
'g_topic_rate_setting' => intval(ipsRegistry::$request['g_topic_rate_setting']),
'g_mod_preview' => ipsRegistry::$request['g_mod_preview'],
'g_mod_post_unit' => intval( ipsRegistry::$request['g_mod_post_unit'] ),
'g_ppd_unit' => intval( ipsRegistry::$request['g_ppd_unit'] ),
'g_ppd_limit' => intval( ipsRegistry::$request['g_ppd_limit'] ),
);
return $return;
}
}
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,138 +1,140 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Member property updater (AJAX)
* Last Updated: $Date: 2009-12-01 17:42:17 -0500 (Tue, 01 Dec 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 5501 $
*
*/
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 admin_member_form__forums implements admin_member_form
{
/**
* Tab name
* This can be left blank and the application title will
* be used
*
* @access public
* @var string Tab name
*/
public $tab_name = "";
/**
* Returns sidebar links for this tab
* You may return an empty array or FALSE to not have
* any links show in the sidebar for this block.
*
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
* is added automatically.
*
* The image must be a full URL or blank to use a default image.
*
* Use the format:
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
*
* @access public
* @author Matt Mecham
* @param array Member data
* @return array Array of links
*/
public function getSidebarLinks( $member=array() )
{
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
$array = array();
$array[] = array( 'img' => '',
'url' => 'section=tools&amp;module=tools&amp;do=deleteposts',
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
$array[] = array( 'img' => '',
'url' => 'section=tools&amp;module=tools&amp;do=deletesubscriptions',
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
return $array;
}
/**
* Returns content for the page.
*
* @access public
* @author Matt Mecham
* @param array Member data
* @return array Array of tabs, content
*/
public function getDisplayContent( $member=array() )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
//-----------------------------------------
// Get member data
//-----------------------------------------
// $member = IPSMember::load( $member['member_id'], 'extendedProfile' );
$member['_avatar'] = str_replace( '<img ', '<img id="MF__avatar" ', IPSMember::buildAvatar( $member ) );
//-----------------------------------------
// Show...
//-----------------------------------------
return array( 'tabs' => $this->html->acp_member_form_tabs( $member ), 'content' => $this->html->acp_member_form_main( $member ) );
}
/**
* Process the entries for saving and return
*
* @access public
* @author Brandon Farber
* @return array Multi-dimensional array (core, extendedProfile) for saving
*/
public function getForSave()
{
$return = array( 'core' => array(), 'extendedProfile' => array() );
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
$return['core']['view_avs'] = intval(ipsRegistry::$request['view_avs']);
$return['core']['view_img'] = intval(ipsRegistry::$request['view_img']);
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
return $return;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Member property updater (AJAX)
* Last Updated: $Date: 2010-03-22 22:39:27 -0400 (Mon, 22 Mar 2010) $
* </pre>
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 5986 $
*
*/
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 admin_member_form__forums implements admin_member_form
{
/**
* Tab name
* This can be left blank and the application title will
* be used
*
* @access public
* @var string Tab name
*/
public $tab_name = "";
/**
* Returns sidebar links for this tab
* You may return an empty array or FALSE to not have
* any links show in the sidebar for this block.
*
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
* is added automatically.
*
* The image must be a full URL or blank to use a default image.
*
* Use the format:
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
*
* @access public
* @author Matt Mecham
* @param array Member data
* @return array Array of links
*/
public function getSidebarLinks( $member=array() )
{
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
$array = array();
$array[] = array( 'img' => '',
'url' => 'section=tools&amp;module=tools&amp;do=deleteposts',
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
$array[] = array( 'img' => '',
'url' => 'section=tools&amp;module=tools&amp;do=deletesubscriptions',
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
return $array;
}
/**
* Returns content for the page.
*
* @access public
* @author Matt Mecham
* @param array Member data
* @return array Array of tabs, content
*/
public function getDisplayContent( $member=array(), $tabsUsed=5 )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
//-----------------------------------------
// Get member data
//-----------------------------------------
// $member = IPSMember::load( $member['member_id'], 'extendedProfile' );
$member['_avatar'] = str_replace( '<img ', '<img id="MF__avatar" ', IPSMember::buildAvatar( $member ) );
//-----------------------------------------
// Show...
//-----------------------------------------
return array( 'tabs' => $this->html->acp_member_form_tabs( $member, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_member_form_main( $member, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
}
/**
* Process the entries for saving and return
*
* @access public
* @author Brandon Farber
* @return array Multi-dimensional array (core, extendedProfile) for saving
*/
public function getForSave()
{
$return = array( 'core' => array(), 'extendedProfile' => array() );
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
$return['core']['view_avs'] = intval(ipsRegistry::$request['view_avs']);
$return['core']['view_img'] = intval(ipsRegistry::$request['view_img']);
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
return $return;
}
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,691 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board post attachments plugin
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 7003 $
*/
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 plugin_post extends class_attach
{
/**
* Module type
*
* @var string
*/
public $module = 'post';
/**
* Constructor
*
* @param object ipsRegistry reference
* @return void
*/
public function __construct( ipsRegistry $registry )
{
parent::__construct( $registry );
/* Load and init forums */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
try
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
}
catch( Exception $error )
{
IPS_exception_error( $error );
}
$this->registry->getClass('class_forums')->strip_invisible = 1;
$this->registry->getClass('class_forums')->forumsInit();
$this->memberData = IPSMember::setUpModerator( $this->memberData );
}
}
/**
* Checks the attachment and checks for download / show perms
*
* @param integer Attachment id
* @return array Attachment data
*/
public function getAttachmentData( $attach_id )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$_ok = 0;
if( ! $attach_id )
{
return FALSE;
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_module='{$this->module}' AND a.attach_id={$attach_id}",
'add_join' => array(
array(
'select' => 'p.pid, p.topic_id, p.queued',
'from' => array( 'posts' => 'p' ),
'where' => "p.pid=a.attach_rel_id",
'type' => 'left'
),
array(
'select' => 't.forum_id',
'from' => array( 'topics' => 't' ),
'where' => "t.tid=p.topic_id",
'type' => 'left'
)
)
) );
$attach_sql = $this->DB->execute();
$attach = $this->DB->fetch( $attach_sql );
//-----------------------------------------
// Check..
//-----------------------------------------
if ( ! isset( $attach['pid'] ) OR empty( $attach['pid'] ) )
{
if( $attach['attach_member_id'] != $this->memberData['member_id'] )
{
return FALSE;
}
}
//-----------------------------------------
// Queued post?
//-----------------------------------------
if ( $attach['queued'] )
{
if ( ! ipsRegistry::getClass('class_forums')->canQueuePosts( $attach['forum_id'] ) )
{
return FALSE;
}
}
//-----------------------------------------
// TheWalrus inspired fix for previewing
// the post and clicking the attachment...
//-----------------------------------------
if ( $attach['attach_rel_id'] == 0 AND $attach['attach_member_id'] == $this->memberData['member_id'] )
{
$_ok = 1;
}
else
{
if ( ! ipsRegistry::getClass('class_forums')->forum_by_id[ $attach['forum_id'] ] )
{
//-----------------------------------------
// TheWalrus inspired fix for previewing
// the post and clicking the attachment...
//-----------------------------------------
if ( $attach['attach_rel_id'] == 0 AND $attach['attach_member_id'] == $this->memberData['member_id'] )
{
# We're ok.
}
else
{
return FALSE;
}
}
if ( IPSMember::checkPermissions('read', $attach['forum_id']) === FALSE )
{
return FALSE;
}
if ( IPSMember::checkPermissions('download', $attach['forum_id']) === FALSE )
{
return FALSE;
}
//-----------------------------------------
// Still here?
//-----------------------------------------
$_ok = 1;
}
//-----------------------------------------
// Ok?
//-----------------------------------------
if ( $_ok )
{
return $attach;
}
else
{
return FALSE;
}
}
/**
* Check the attachment and make sure its OK to display
*
* @param array Array of ids
* @param array Array of relationship ids
* @return array Attachment data
*/
public function renderAttachment( $attach_ids, $rel_ids=array(), $attach_post_key=0 )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$rows = array();
$query_bits = array();
$query = '';
$match = 0;
//-----------------------------------------
// Check
//-----------------------------------------
if ( is_array( $attach_ids ) AND count( $attach_ids ) )
{
$query_bits[] = "attach_id IN (" . implode( ",", $attach_ids ) .")";
}
if ( is_array( $rel_ids ) and count( $rel_ids ) )
{
$rel_ids = array_map( 'intval', $rel_ids );
// We need to reset the array - this query bit will return everything we need, but
// if we "OR" join the above query bit with this one, it causes bigger mysql loads
$query_bits = array();
$query_bits[] = "attach_rel_id IN (" . implode( ",", $rel_ids ) . ")";
//$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
$match = 1;
}
if ( $attach_post_key )
{
$query_bits[] = "attach_post_key='".$this->DB->addSlashes( $attach_post_key )."'";
//$query .= " OR attach_post_key='".$this->DB->addSlashes( $attach_post_key )."'";
$match = 2;
}
if( !count($query_bits) )
{
$query = "attach_id IN (-1)";
}
else
{
$query = implode( " OR ", $query_bits );
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='{$this->module}' AND ( {$query} )" ) );
$attach_sql = $this->DB->execute();
//-----------------------------------------
// Loop through and filter off naughty ids
//-----------------------------------------
while( $db_row = $this->DB->fetch( $attach_sql ) )
{
$_ok = 1;
if ( $match == 1 )
{
if ( ! in_array( $db_row['attach_rel_id'], $rel_ids ) )
{
$_ok = 0;
}
}
else if ( $match == 2 )
{
if ( $db_row['attach_post_key'] != $attach_post_key )
{
$_ok = 0;
}
}
//-----------------------------------------
// Ok?
//-----------------------------------------
if ( $_ok )
{
$rows[ $db_row['attach_id'] ] = $db_row;
}
}
//-----------------------------------------
// Return
//-----------------------------------------
return $rows;
}
/**
* Recounts number of attachments for the articles row
*
* @param string Post key
* @param integer Related ID
* @param array Arguments for query
* @return array Returns count of items found
*/
public function postUploadProcess( $post_key, $rel_id, $args=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$cnt = array( 'cnt' => 0 );
//-----------------------------------------
// Check..
//-----------------------------------------
if ( ! $post_key )
{
return 0;
}
$this->DB->build( array( "select" => 'COUNT(*) as cnt', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}'" ) );
$this->DB->execute();
$cnt = $this->DB->fetch();
if ( $cnt['cnt'] )
{
$this->DB->update( 'topics', "topic_hasattach=topic_hasattach+" . $cnt['cnt'], "tid=" . intval( $args['topic_id'] ), false, true );
}
return array( 'count' => $cnt['cnt'] );
}
/**
* Recounts number of attachments for the articles row
*
* @param array Attachment data
* @return boolean
*/
public function attachmentRemovalCleanup( $attachment )
{
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $attachment['attach_id'] )
{
return FALSE;
}
$this->DB->build( array(
'select' => 'p.pid',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid='. intval( $attachment['attach_rel_id'] ),
'add_join' => array(
array(
'select' => 't.forum_id, t.tid',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'inner'
)
)
) );
$this->DB->execute();
$topic = $this->DB->fetch();
if ( isset( $topic['tid'] ) )
{
//-----------------------------------------
// GET PIDS
//-----------------------------------------
$pids = array();
$count = 0;
$this->DB->build( array( 'select' => 'pid', 'from' => 'posts', 'where' => "topic_id={$topic['tid']}" ) );
$this->DB->execute();
while ( $p = $this->DB->fetch() )
{
$pids[] = $p['pid'];
}
//-----------------------------------------
// GET ATTACHMENT COUNT
//-----------------------------------------
if ( count( $pids ) )
{
$this->DB->build( array(
'select' => 'count(*) as cnt',
'from' => 'attachments',
'where' => "attach_rel_module='post' AND attach_rel_id IN(" . implode( ',', $pids ) . ")") );
$this->DB->execute();
$cnt = $this->DB->fetch();
$count = intval( $cnt['cnt'] );
}
$this->DB->update( 'topics', array( 'topic_hasattach' => $count ), "tid=".$topic['tid'] );
}
return TRUE;
}
/**
* Determines if you have permission for bulk attachment removal
* Returns TRUE or FALSE
* IT really does
*
* @param array Ids to check against
* @return boolean
*/
public function canBulkRemove( $attach_rel_ids=array() )
{
return $this->memberData['g_is_supmod'] ? true : false;
}
/**
* Determines if you can remove this attachment
* Returns TRUE or FALSE
* IT really does
*
* @param array Attachment data
* @return boolean
*/
public function canRemove( $attachment )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$ok_to_remove = FALSE;
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $attachment['attach_id'] )
{
return FALSE;
}
//-----------------------------------------
// Allowed to remove?
//-----------------------------------------
if ( $this->memberData['member_id'] == $attachment['attach_member_id'] )
{
$ok_to_remove = TRUE;
}
else if ( $this->memberData['g_is_supmod'] )
{
$ok_to_remove = TRUE;
}
else
{
//-----------------------------------------
// Moderstor? Get forum ID
//-----------------------------------------
if ( $this->memberData['forumsModeratorData'] )
{
$_moderator = $this->memberData['forumsModeratorData'];
$this->DB->build( array(
'select' => 'p.pid',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid='. intval( $attachment['attach_rel_id'] ),
'add_join' => array(
array(
'select' => 't.forum_id, t.tid',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'inner'
)
)
) );
$this->DB->execute();
$topic = $this->DB->fetch();
if ( isset( $topic['forum_id'] ) )
{
if ( isset($_moderator[ $topic['forum_id'] ]['edit_post']) and $_moderator[ $topic['forum_id'] ]['edit_post'] )
{
$ok_to_remove = TRUE;
}
}
}
}
return $ok_to_remove;
}
/**
* Returns an array of the allowed upload sizes in bytes.
* Return 'space_allowed' as -1 to not allow uploads.
* Return 'space_allowed' as 0 to allow unlimited uploads
* Return 'max_single_upload' as 0 to not set a limit
*
* @param string MD5 post key
* @param id Member ID
* @return array [ 'space_used', 'space_left', 'space_allowed', 'max_single_upload' ]
*/
public function getSpaceAllowance( $post_key='', $member_id='' )
{
$max_php_size = IPSLib::getMaxPostSize();
$member_id = intval( $member_id ? $member_id : $this->memberData['member_id'] );
$forum_id = intval( ipsRegistry::$request['forum_id'] ? ipsRegistry::$request['forum_id'] : ipsRegistry::$request['f'] );
$space_left = 0;
$space_used = 0;
$space_allowed = 0;
$max_single_upload = 0;
$space_calculated = 0;
if ( $post_key )
{
//-----------------------------------------
// Check to make sure we're not attempting
// to upload to another's post...
//-----------------------------------------
if ( ! $this->memberData['g_is_supmod'] AND !$this->memberData['is_mod'] )
{
$post = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'posts', 'where' => "post_key='{$post_key}'" ) );
if ( $post['post_key'] AND ( $post['author_id'] != $member_id ) )
{
$space_allowed = -1;
$space_calculated = 1;
}
}
}
//-----------------------------------------
// Generate total space allowed
//-----------------------------------------
$total_space_allowed = ( $this->memberData['g_attach_per_post'] ? $this->memberData['g_attach_per_post'] : $this->memberData['g_attach_max'] ) * 1024;
//-----------------------------------------
// Allowed to attach?
//-----------------------------------------
if ( ! $member_id OR ! $forum_id )
{
$space_allowed = -1;
}
if ( IPSMember::checkPermissions('upload', $forum_id ) !== TRUE )
{
$space_allowed = -1;
}
else if ( ! $space_calculated )
{
//-----------------------------------------
// Generate space allowed figure
//-----------------------------------------
if ( $this->memberData['g_attach_per_post'] )
{
//-----------------------------------------
// Per post limit...
//-----------------------------------------
$_space_used = $this->DB->buildAndFetch( array(
'select' => 'SUM(attach_filesize) as figure',
'from' => 'attachments',
'where' => "attach_post_key='{$post_key}'"
) );
$space_used = intval( $_space_used['figure'] );
}
else
{
//-----------------------------------------
// Global limit...
//-----------------------------------------
$_space_used = $this->DB->buildAndFetch( array(
'select' => 'SUM(attach_filesize) as figure',
'from' => 'attachments',
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
) );
$space_used = intval( $_space_used['figure'] );
}
if ( $this->memberData['g_attach_max'] > 0 )
{
if ( $this->memberData['g_attach_per_post'] )
{
$_g_space_used = $this->DB->buildAndFetch( array(
'select' => 'SUM(attach_filesize) as figure',
'from' => 'attachments',
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
) );
$g_space_used = intval( $_g_space_used['figure'] );
if( intval( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used ) < 0 )
{
$space_used = $g_space_used;
$total_space_allowed = $this->memberData['g_attach_max'] * 1024;
$space_allowed = ( $this->memberData['g_attach_max'] * 1024 ) - $space_used;
$space_allowed = $space_allowed < 0 ? -1 : $space_allowed;
}
else
{
$space_allowed = ( $this->memberData['g_attach_per_post'] * 1024 ) - $space_used;
$space_allowed = $space_allowed < 0 ? -1 : $space_allowed;
}
}
else
{
$space_allowed = ( $this->memberData['g_attach_max'] * 1024 ) - $space_used;
$space_allowed = $space_allowed < 0 ? -1 : $space_allowed;
}
}
else
{
if ( $this->memberData['g_attach_per_post'] )
{
$space_allowed = ( $this->memberData['g_attach_per_post'] * 1024 ) - $space_used;
$space_allowed = $space_allowed < 0 ? -1 : $space_allowed;
}
else
{
# Unlimited
$space_allowed = 0;
}
}
//-----------------------------------------
// Generate space left figure
//-----------------------------------------
$space_left = $space_allowed ? $space_allowed : 0;
$space_left = ($space_left < 0) ? -1 : $space_left;
//-----------------------------------------
// Generate max upload size
//-----------------------------------------
if ( ! $max_single_upload )
{
if ( $space_left > 0 AND $space_left < $max_php_size )
{
$max_single_upload = $space_left;
}
else if ( $max_php_size )
{
$max_single_upload = $max_php_size;
}
}
}
IPSDebug::fireBug( 'info', array( 'Space left: ' . $space_left ) );
IPSDebug::fireBug( 'info', array( 'Max PHP size: ' . $max_php_size ) );
IPSDebug::fireBug( 'info', array( 'Max single file size: ' . $max_single_upload ) );
$return = array( 'space_used' => $space_used, 'space_left' => $space_left, 'space_allowed' => $space_allowed, 'max_single_upload' => $max_single_upload, 'total_space_allowed' => $total_space_allowed );
return $return;
}
/**
* Returns an array of settings:
* 'siu_thumb' = Allow thumbnail creation?
* 'siu_height' = Height of the generated thumbnail in pixels
* 'siu_width' = Width of the generated thumbnail in pixels
* 'upload_dir' = Base upload directory (must be a full path)
*
* You can omit any of these settings and IPB will use the default
* settings (which are the ones entered into the ACP for post thumbnails)
*
* @return boolean
*/
public function getSettings()
{
$this->mysettings = array();
return true;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Core variables extensions
* Defines the reset array, which caches to load, how to recache those caches, and the bitwise array
* Last Updated: $Date: 2009-12-07 21:57:46 -0500 (Mon, 07 Dec 2009) $
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5529 $
* @link http://www.invisionpower.com
* @version $Rev: 6882 $
**/
if ( ! defined( 'IN_IPB' ) )
@@ -37,7 +39,7 @@ if ( ( isset( $_REQUEST['CODE'] ) AND $_REQUEST['CODE'] ) or ( isset( $_REQUEST[
$_LOAD = array();
# BOARD INDEX
if ( ( ! $_GET['section'] AND ! $_GET['module'] ) OR ( $_GET['module'] == 'forums' AND $_GET['section'] == 'boards' ) )
if ( ( ( !isset($_GET['section']) OR ! $_GET['section'] ) AND ( !isset($_GET['module']) OR ! $_GET['module'] ) ) OR ( $_GET['module'] == 'forums' AND $_GET['section'] == 'boards' ) )
{
$_LOAD['chatting'] = 1;
$_LOAD['birthdays'] = 1;
@@ -48,7 +50,7 @@ if ( ( ! $_GET['section'] AND ! $_GET['module'] ) OR ( $_GET['module'] == 'forum
}
# TOPIC
if ( isset( $_GET['showtopic'] ) OR $_GET['module'] == 'forums' AND $_GET['section'] == 'topics' )
if ( isset( $_GET['showtopic'] ) OR ( isset($_GET['module']) AND isset($_GET['section']) AND $_GET['module'] == 'forums' AND $_GET['section'] == 'topics' ) )
{
$_LOAD['badwords'] = 1;
$_LOAD['emoticons'] = 1;
@@ -57,10 +59,11 @@ if ( isset( $_GET['showtopic'] ) OR $_GET['module'] == 'forums' AND $_GET['secti
$_LOAD['ranks'] = 1;
$_LOAD['profilefields'] = 1;
$_LOAD['reputation_levels'] = 1;
$_LOAD['sharelinks'] = 1;
}
# Forum
if ( isset( $_GET['showforum'] ) OR $_GET['module'] == 'forums' AND $_GET['section'] == 'forums' )
if ( isset( $_GET['showforum'] ) OR ( isset($_GET['module']) AND isset($_GET['section']) AND $_GET['module'] == 'forums' AND $_GET['section'] == 'forums' ) )
{
$_LOAD['ranks'] = 1;
$_LOAD['reputation_levels'] = 1;
@@ -71,8 +74,8 @@ if ( isset( $_GET['showforum'] ) OR $_GET['module'] == 'forums' AND $_GET['secti
$_LOAD['bbcode'] = 1;
}
# POST
if ( $_GET['module'] == 'post' )
# POST and RULES
if ( isset($_GET['module']) AND ( $_GET['module'] == 'post' OR $_GET['module'] == 'extras' ) )
{
$_LOAD['badwords'] = 1;
$_LOAD['bbcode'] = 1;
@@ -81,6 +84,15 @@ if ( $_GET['module'] == 'post' )
$_LOAD['reputation_levels'] = 1;
}
# ANNOUNCEMENT
if ( isset( $_GET['showannouncement'] ) OR ( isset($_GET['module']) AND isset($_GET['section']) AND $_GET['module'] == 'forums' AND $_GET['section'] == 'announcements' ) )
{
$_LOAD['badwords'] = 1;
$_LOAD['bbcode'] = 1;
$_LOAD['emoticons'] = 1;
$_LOAD['ranks'] = 1;
$_LOAD['reputation_levels'] = 1;
}
$CACHE['attachtypes'] = array(
'array' => 1,
@@ -124,4 +136,12 @@ $CACHE['announcements'] = array(
// Bitwise Options
//-----------------------------------------
$_BITWISE = array( 'moderators' => array( 'bw_flag_spammers' ) );
$_BITWISE = array( 'moderators' => array( 'bw_flag_spammers',
'bw_mod_soft_delete',
'bw_mod_un_soft_delete',
'bw_mod_soft_delete_see',
'bw_mod_soft_delete_topic',
'bw_mod_un_soft_delete_topic',
'bw_mod_soft_delete_topic_see',
'bw_mod_soft_delete_reason',
'bw_mod_soft_delete_see_post' ) );
@@ -0,0 +1,46 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define data hook locations (Forums)
* Last Updated: $Date: 2010-10-21 09:25:51 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 7009 $
*/
$dataHookLocations = array(
/* POSTING LIBRARY DATA LOCATIONS */
array( 'postAddReply', 'Add Reply' ),
array( 'postAddReplyPoll','Add Reply: Poll' ),
array( 'postAutoMerge', 'Add Reply: Auto merge with previous post' ),
array( 'postAddReplyTopicUpdate', 'Add Reply: Topic Data' ),
array( 'postAddTopic', 'New Topic: Topic Data' ),
array( 'postFirstPost', 'New Topic: First Post' ),
array( 'postAddTopicPoll', 'New Topic: Poll' ),
array( 'editPostAddPoll', 'Edit Post: Added Poll' ),
array( 'editPostUpdatePoll', 'Edit Post: Updated Poll' ),
array( 'editPostUpdateTopicTitle', 'Edit Post: Update Topic Title'),
array( 'editPostData', 'Edit Post: Post Data' ),
array( 'updateForumLastPostData', 'Forum last post update data' ),
array( 'incrementUsersPostCount', 'Increment users post count' ),
/* OUTPUT ARRAYS */
array( 'boardIndexCategories', 'Board Index Output: Categories' ),
array( 'boardIndexOnlineUsers', 'Board Index Output: Active users' ),
array( 'forumViewData', 'Forum View Output' ),
array( 'topicViewQuery', 'Topic View Query: Members Table and Joins' ),
array( 'topicViewPostData', 'Topic View Output: Posts Data' ),
array( 'topicViewForumData', 'Topic View Output: Forum Data' ),
array( 'topicViewTopicData', 'Topic View Output: Topic Data' ),
array( 'topicViewDisplayData', 'Topic View Output: Other Data' ),
);
@@ -1,35 +1,37 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* BBCode Management : Determines if bbcode can be used in this section
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
*
*/
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();
}
/*
* An array of key => value pairs
* When going to parse, the key should be passed to the editor
* to determine which bbcodes should be parsed in the section
*
*/
$BBCODE = array(
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* BBCode Management : Determines if bbcode can be used in this section
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*
*/
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();
}
/*
* An array of key => value pairs
* When going to parse, the key should be passed to the editor
* to determine which bbcodes should be parsed in the section
*
*/
$BBCODE = array(
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
);
@@ -7,10 +7,10 @@
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @license http://www.invisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4136 $
*
@@ -41,19 +41,19 @@ $_SEOTEMPLATES = array(
'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1/$4' ),
'in' => array( 'regex' => "#/forum-(\d+?)?/announcement-(\d+)/#i",
'in' => array( 'regex' => "#/forum-(\d+?)?/announcement-(\d+)/?#i",
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),
'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1/$2' ),
'in' => array( 'regex' => "#/forum/(\d+)/#i",
'in' => array( 'regex' => "#/forum/(\d+)/?#i",
'matches' => array( array( 'showforum', '$1' ) ) ) ),
'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1/$2' ),
'in' => array( 'regex' => "#/topic/(\d+)/#i",
'in' => array( 'regex' => "#/topic/(\d+)/?#i",
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
'act=idx' => array( 'app' => 'forums',
@@ -1,181 +1,214 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* RSS output plugin :: posts
* Last Updated: $Date: 2009-01-05 22:21:54 +0000 (Mon, 05 Jan 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 3572 $
*/
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 furlRedirect_forums
{
/**
* Key type: Type of action (topic/forum)
*
* @access private
* @var string
*/
private $_type = '';
/**
* Key ID
*
* @access private
* @var int
*/
private $_id = 0;
/**
* Constructor
*
*/
function __construct( ipsRegistry $registry )
{
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings =& $registry->fetchSettings();
}
/**
* Set the key ID
* @example furlRedirect_forums::setKey( 'topic', 12 );
*
* @access public
* @param string Type
* @param mixed Value
*/
public function setKey( $name, $value )
{
$this->_type = $name;
$this->_id = $value;
}
/**
* Set up the key by URI
*
* @access public
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
* @return void
*/
public function setKeyByUri( $uri )
{
$uri = str_replace( '&amp;', '&', $uri );
if ( strstr( $uri, '?' ) )
{
list( $_chaff, $uri ) = explode( '?', $uri );
}
foreach( explode( '&', $uri ) as $bits )
{
list( $k, $v ) = explode( '=', $bits );
if ( $k )
{
if ( $k == 'showtopic' )
{
$this->setKey( 'topic', intval( $v ) );
return TRUE;
}
else if ( $k == 'showforum' )
{
$this->setKey( 'forum', intval( $v ) );
return TRUE;
}
}
}
return FALSE;
}
/**
* Return the SEO title
*
* @access public
* @return string The SEO friendly name
*/
public function fetchSeoTitle()
{
switch ( $this->_type )
{
default:
return FALSE;
break;
case 'topic':
return $this->_fetchSeoTitle_topic();
break;
case 'forum':
return $this->_fetchSeoTitle_forum();
break;
}
}
/**
* Return the SEO title for a topic
*
* @access public
* @return string The SEO friendly name
*/
public function _fetchSeoTitle_topic()
{
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
'from' => 'topics',
'where' => 'tid=' . intval( $this->_id ) ) );
if ( $topic['tid'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
{
return FALSE;
}
if ( IPB_USE_ONLY_ID_FURL ) return $topic['tid'];
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
}
return FALSE;
}
/**
* Return the SEO title for a topic
*
* @access public
* @return string The SEO friendly name
*/
public function _fetchSeoTitle_forum()
{
$forum = $this->DB->buildAndFetch( array( 'select' => 'id, name_seo, name',
'from' => 'forums',
'where' => 'id=' . intval( $this->_id ) ) );
if ( $forum['id'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
{
return FALSE;
}
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
}
return FALSE;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* RSS output plugin :: posts
* Last Updated: $Date: 2010-07-10 01:01:06 -0400 (Sat, 10 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 6628 $
*/
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 furlRedirect_forums
{
/**
* Key type: Type of action (topic/forum)
*
* @access private
* @var string
*/
private $_type = '';
/**
* Key ID
*
* @access private
* @var int
*/
private $_id = 0;
/**
* Constructor
*
*/
function __construct( ipsRegistry $registry )
{
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings =& $registry->fetchSettings();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
/**
* Set the key ID
* @example furlRedirect_forums::setKey( 'topic', 12 );
*
* @access public
* @param string Type
* @param mixed Value
*/
public function setKey( $name, $value )
{
$this->_type = $name;
$this->_id = $value;
}
/**
* Set up the key by URI
*
* @access public
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
* @return void
*/
public function setKeyByUri( $uri )
{
$uri = str_replace( '&amp;', '&', $uri );
if ( strstr( $uri, '?' ) )
{
list( $_chaff, $uri ) = explode( '?', $uri );
}
foreach( explode( '&', $uri ) as $bits )
{
list( $k, $v ) = explode( '=', $bits );
if ( $k )
{
if ( $k == 'showtopic' )
{
$this->setKey( 'topic', intval( $v ) );
return TRUE;
}
else if ( $k == 'showforum' )
{
$this->setKey( 'forum', intval( $v ) );
return TRUE;
}
else if( $k == 'showannouncement' )
{
$this->setKey( 'announcement', intval( $v ) );
return TRUE;
}
}
}
return FALSE;
}
/**
* Return the SEO title
*
* @access public
* @return string The SEO friendly name
*/
public function fetchSeoTitle()
{
switch ( $this->_type )
{
default:
return FALSE;
break;
case 'topic':
return $this->_fetchSeoTitle_topic();
break;
case 'forum':
return $this->_fetchSeoTitle_forum();
break;
case 'announcement':
return $this->_fetchSeoTitle_announcement();
break;
}
}
/**
* Return the SEO title for a topic
*
* @access public
* @return string The SEO friendly name
*/
public function _fetchSeoTitle_topic()
{
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
'from' => 'topics',
'where' => 'tid=' . intval( $this->_id ) ) );
if ( $topic['tid'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
{
return FALSE;
}
if ( IPB_USE_ONLY_ID_FURL ) return $topic['tid'];
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
}
return FALSE;
}
/**
* Return the SEO title for a forum
*
* @access public
* @return string The SEO friendly name
*/
public function _fetchSeoTitle_forum()
{
$forum = $this->DB->buildAndFetch( array( 'select' => 'id, name_seo, name',
'from' => 'forums',
'where' => 'id=' . intval( $this->_id ) ) );
if ( $forum['id'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
{
return FALSE;
}
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
}
return FALSE;
}
/**
* Return the SEO title for an announcement
*
* @access public
* @return string The SEO friendly name
*/
public function _fetchSeoTitle_announcement()
{
//$announce = $this->DB->buildAndFetch( array( 'select' => 'announce_id, announce_title',
// 'from' => 'announcements',
// 'where' => 'announce_id=' . intval( $this->_id ) ) );
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
if ( $announce['announce_id'] )
{
return $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
}
return FALSE;
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Sets up SEO templates
* Last Updated: $Date: 2009-03-04 15:08:31 +0000 (Wed, 04 Mar 2009) $
* Last Updated: $Date: 2010-10-27 14:13:29 -0400 (Wed, 27 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4136 $
* @version $Rev: 7057 $
*
*/
@@ -47,25 +49,25 @@ $_SEOTEMPLATES = array(
'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1-#{__title__}/$4' ),
'in' => array( 'regex' => "#/forum-(\d+?)?/announcement-(\d+?)-#i",
'in' => array( 'regex' => '#/forum-(\d+?)?/announcement-(\d+?)-#i',
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),
'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
'in' => array( 'regex' => "#/forum/(\d+?)-#i",
'in' => array( 'regex' => '#^/forum/(\d+?)-#i',
'matches' => array( array( 'showforum', '$1' ) ) ) ),
'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
'in' => array( 'regex' => "#/topic/(\d+?)-#i",
'in' => array( 'regex' => '#^/topic/(\d+?)-#i',
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
'act=idx' => array( 'app' => 'forums',
'allowRedirect' => 0,
'out' => array( '#act=idx(&|$)#i', 'index$1' ),
'in' => array( 'regex' => "#/index(/|$)#i",
'in' => array( 'regex' => '#^/index(/|$|\?)#i',
'matches' => array( array( 'act', 'idx' ) ) ) ),
);
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,203 +1,220 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Forum permissions mappings
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4429 $
**/
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();
}
/**
* Member Synchronization extensions
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4429 $
**/
class forumsMemberSync
{
/**
* Registry reference
*
* @access public
* @var object
*/
public $registry;
/**
* CONSTRUCTOR
*
* @access public
* @return void
**/
public function __construct()
{
$this->registry = ipsRegistry::instance();
}
/**
* This method is run when a member is flagged as a spammer
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onSetAsSpammer( $member )
{
}
/**
* This method is run when a member is un-flagged as a spammer
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onUnSetAsSpammer( $member )
{
}
/**
* This method is run when a new account is created
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onCreateAccount( $member )
{
}
/**
* This method is run when the register form is displayed to a user
*
* @access public
* @return void
**/
public function onRegisterForm()
{
}
/**
* This method is ren when a user successfully logs in
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onLogin( $member )
{
}
/**
* This method is called after a member account has been removed
*
* @access public
* @param string $ids SQL IN() clause
* @return void
**/
public function onDelete( $mids )
{
}
/**
* This method is called after a member's account has been merged into another member's account
*
* @access public
* @param array $member Member account being kept
* @param array $member2 Member account being removed
* @return void
**/
public function onMerge( $member, $member2 )
{
}
/**
* This method is run after a users email address is successfully changed
*
* @param integer $id Member ID
* @param string $new_email New email address
* @return void
**/
public function onEmailChange( $id, $new_email )
{
}
/**
* This method is run after a users password is successfully changed
*
* @access public
* @param integer $id Member ID
* @param string $new_plain_text_pass The new password
* @return void
**/
public function onPassChange( $id, $new_plain_text_pass )
{
}
/**
* This method is run after a users profile is successfully updated
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
* IPSMember::save().
*
* @access public
* @param array $member Array of values that were changed
* @return void
**/
public function onProfileUpdate( $member )
{
}
/**
* This method is run after a users group is successfully changed
*
* @access public
* @param integer $id Member ID
* @param integer $new_group New Group ID
* @return void
**/
public function onGroupChange( $id, $new_group )
{
}
/**
* This method is run after a users display name is successfully changed
*
* @access public
* @param integer $id Member ID
* @param string $new_name New display name
* @return void
**/
public function onNameChange( $id, $new_name )
{
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Forum permissions mappings
* Last Updated: $Date: 2010-04-26 14:40:44 -0400 (Mon, 26 Apr 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 6179 $
**/
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();
}
/**
* Member Synchronization extensions
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 6179 $
**/
class forumsMemberSync
{
/**
* Registry reference
*
* @access public
* @var object
*/
public $registry;
/**
* CONSTRUCTOR
*
* @access public
* @return void
**/
public function __construct()
{
$this->registry = ipsRegistry::instance();
}
/**
* This method is run when a member is flagged as a spammer
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onSetAsSpammer( $member )
{
}
/**
* This method is run when a member is un-flagged as a spammer
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onUnSetAsSpammer( $member )
{
}
/**
* This method is run when a new account is created
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onCreateAccount( $member )
{
}
/**
* This method is run when the register form is displayed to a user
*
* @access public
* @return void
**/
public function onRegisterForm()
{
}
/**
* This method is ren when a user successfully logs in
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onLogin( $member )
{
}
/**
* This method is called after a member account has been removed
*
* @access public
* @param string $ids SQL IN() clause
* @return void
**/
public function onDelete( $mids )
{
}
/**
* This method is called after a member's account has been merged into another member's account
*
* @access public
* @param array $member Member account being kept
* @param array $member2 Member account being removed
* @return void
**/
public function onMerge( $member, $member2 )
{
}
/**
* This method is run after a users email address is successfully changed
*
* @param integer $id Member ID
* @param string $new_email New email address
* @param string $old_email Old email address
* @return void
**/
public function onEmailChange( $id, $new_email, $old_email )
{
}
/**
* This method is run after a users password is successfully changed
*
* @access public
* @param integer $id Member ID
* @param string $new_plain_text_pass The new password
* @return void
**/
public function onPassChange( $id, $new_plain_text_pass )
{
}
/**
* This method is run after a users profile is successfully updated
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
* IPSMember::save().
*
* @access public
* @param array $member Array of values that were changed
* @return void
**/
public function onProfileUpdate( $member )
{
}
/**
* This method is run after a users group is successfully changed
*
* @access public
* @param integer $id Member ID
* @param integer $new_group New Group ID
* @param integer $old_group Old Group ID
* @return void
**/
public function onGroupChange( $id, $new_group, $old_group )
{
}
/**
* This method is run after a users display name is successfully changed
*
* @access public
* @param integer $id Member ID
* @param string $new_name New display name
* @return void
**/
public function onNameChange( $id, $new_name )
{
}
/**
* This method is run when a user logs out
*
* @access public
* @param array $member Array of member data
* @return void
**/
public function onLogOut( $member )
{
}
}
@@ -0,0 +1,48 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the core notification types
* Last Updated: $Date: 2010-04-08 16:37:04 -0400 (Thu, 08 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 6088 $
*
*/
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();
}
/**
* Notification types
*/
class forums_notifications
{
public function getConfiguration()
{
/**
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
*/
$_NOTIFY = array(
array( 'key' => 'new_topic', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newtopic' ),
array( 'key' => 'new_reply', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
array( 'key' => 'post_quoted', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_quoted' ),
// This is defined in ACP forum settings as an email, so it's not mapped to a specific member
//array( 'key' => 'new_topic_queue', 'default' => array( 'email' ), 'disabled' => array() ),
);
return $_NOTIFY;
}
}
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Portal plugin: poll
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 4948 $
* @version $Revision: 5713 $
*
*/
@@ -1,20 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Portal plugin: poll
* Last Updated: $Date: 2009-06-16 08:17:58 -0400 (Tue, 16 Jun 2009) $
* Last Updated: $Date: 2010-10-22 06:13:38 -0400 (Fri, 22 Oct 2010) $
* </pre>
*
* @author $Author: matt $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 4778 $
*
* @version $Revision: 7016 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -28,7 +28,6 @@ class ppi_poll extends public_portal_portal_portal
/**
* Initialize module
*
* @access public
* @return void
*/
public function init()
@@ -38,8 +37,8 @@ class ppi_poll extends public_portal_portal_portal
/**
* Display a poll
*
* @access public
* @return string HTML content to replace tag with
* @todo We need to update the code below to load the furlTemplates file and check against it, then add a fallback on the normal url as a default.
*/
public function poll_show_poll()
{
@@ -89,14 +88,17 @@ class ppi_poll extends public_portal_portal_portal
$this->registry->class_localization->loadLanguageFile( array( 'public_boards', 'public_topic' ), 'forums' );
$this->registry->class_localization->loadLanguageFile( array( 'public_editors' ), 'core' );
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
$this->registry->setClass( 'class_forums', new class_forums( $this->registry ) );
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( $this->registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 1;
$this->registry->getClass('class_forums')->forumsInit();
}
$this->registry->getClass('class_forums')->strip_invisible = 1;
$this->registry->getClass('class_forums')->forumsInit();
require_once( IPSLib::getAppDir( 'forums', 'forums' ) . '/topics.php' );
$topic = new public_forums_forums_topics();
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums', 'forums' ) . '/topics.php', 'public_forums_forums_topics', 'forums' );
$topic = new $classToLoad();
$topic->makeRegistryShortcuts( $this->registry );
$topic->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=" . $tid ) );
@@ -114,5 +116,4 @@ class ppi_poll extends public_portal_portal_portal
return;
}
}
}
}
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Portal plugin: recent topics
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 4948 $
* @version $Revision: 5713 $
*
*/
@@ -1,20 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Portal plugin: recent topics
* Last Updated: $Date: 2009-12-07 21:57:46 -0500 (Mon, 07 Dec 2009) $
* Last Updated: $Date: 2010-11-04 13:30:54 -0400 (Thu, 04 Nov 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 5529 $
*
* @version $Revision: 7093 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -28,7 +28,6 @@ class ppi_recent_topics extends public_portal_portal_portal
/**
* Initialize module
*
* @access public
* @return void
*/
public function init()
@@ -39,7 +38,6 @@ class ppi_recent_topics extends public_portal_portal_portal
/**
* Show the recently started topic titles
*
* @access public
* @return string HTML content to replace tag with
*/
public function recent_topics_discussions_last_x()
@@ -50,86 +48,15 @@ class ppi_recent_topics extends public_portal_portal_portal
$results = array();
$limit = $this->settings['recent_topics_discuss_number'] ? $this->settings['recent_topics_discuss_number'] : 5;
$where_clause = array();
/* Loop through the forums and build a list of forums we're allowed access to */
$forumIdsOk = array();
foreach( $this->registry->class_forums->forum_by_id as $id => $data )
{
/* Can we read? */
if ( ! $this->registry->permissions->check( 'read', $data ) )
{
continue;
}
$results = $this->registry->class_forums->hooks_recentTopics( $limit, false );
/* Can read, but is it password protected, etc? */
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
{
continue;
}
if ( ! $data['can_view_others'] )
{
continue;
}
if ( $data['min_posts_view'] > $this->memberData['posts'] )
{
continue;
}
$forumIdsOk[] = $id;
}
if ( count( $forumIdsOk) )
{
/* Add allowed forums */
$where_clause[] = "t.forum_id IN (" . implode( ",", $forumIdsOk ) . ")";
$this->DB->build( array( 'select' => 't.tid, t.title, t.posts, t.start_date as post_date, t.views, t.title_seo, t.starter_name',
'from' => array( 'topics' => 't' ),
'where' => "t.approved=1 and t.state != 'closed' and (t.state != 'link') " . ( count($where_clause) ? ' AND ' . implode( ' AND ', $where_clause ) : '' ),
'order' => 't.tid DESC',
'limit' => array( 0, $limit ),
'add_join' => array(
array(
'from' => array( 'forums' => 'f' ),
'where' => "f.id=t.forum_id",
'type' => 'left',
),
array(
'select' => 'm.member_id, m.members_display_name, m.members_seo_name',
'from' => array( 'members' => 'm' ),
'where' => "m.member_id=t.starter_id",
'type' => 'left',
),
)
) );
$outer = $this->DB->execute();
while ( $row = $this->DB->fetch($outer) )
{
$row['title_display'] = IPSText::truncate( $row['title'], 30 );
$row['date'] = $this->registry->class_localization->getDate( $row['post_date'], "manual{{$this->settings['csite_article_date']}}" );
if( !$row['member_id'] )
{
$row['members_display_name'] = $this->settings['guest_name_pre'] . $row['starter_name'] . $this->settings['guest_name_suf'];
}
$results[] = $row;
}
}
return $this->registry->getClass('output')->getTemplate('portal')->latestPosts( $results );
return count($results) ? $this->registry->getClass('output')->getTemplate('portal')->latestPosts( $results ) : '';
}
/**
* Show the "news" articles
*
* @access public
* @return string HTML content to replace tag with
*/
public function recent_topics_last_x()
@@ -172,7 +99,7 @@ class ppi_recent_topics extends public_portal_portal_portal
foreach( $this->registry->class_forums->forum_by_id as $id => $data )
{
/* Allowing this forum? */
if ( ! in_array( $id, $forums, $id ) )
if ( ! in_array( $id, $forums ) )
{
continue;
}
@@ -231,7 +158,7 @@ class ppi_recent_topics extends public_portal_portal_portal
/* Fetch all pinned topics to avoid filesort */
$this->DB->build( array( 'select' => 't.tid, t.start_date',
'from' => 'topics t',
'where' => "t.pinned=1 AND t.approved=1 AND t.state != 'link'" . ( count($where_clause) ? ' AND ' . implode( ' AND ', $where_clause ) : '' ),
'where' => "t.pinned=1 AND t.approved=1 AND t.state != 'link' AND " . implode( ' AND ', $where_clause ),
//'order' => 't.tid DESC',
'limit' => array ( $limit ) ) );
@@ -252,7 +179,7 @@ class ppi_recent_topics extends public_portal_portal_portal
$this->DB->build( array( 'select' => 't.tid, t.start_date',
'from' => 'topics t',
'where' => $pinnedWhere . "t.approved=1 AND t.state != 'link'" . ( count($where_clause) ? ' AND ' . implode( ' AND ', $where_clause ) : '' ),
'where' => $pinnedWhere . "t.approved=1 AND t.state != 'link' AND " . implode( ' AND ', $where_clause ),
'order' => 'tid DESC',
'limit' => array ( $limit - count( $pinned ) ) ) );
@@ -428,11 +355,11 @@ class ppi_recent_topics extends public_portal_portal_portal
//-----------------------------------------
// Grab render attach class
//-----------------------------------------
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
$this->class_attach = new class_attach( $this->registry );
$this->class_attach->attach_post_key = '';
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->attach_post_key = '';
ipsRegistry::getClass( 'class_localization' )->loadLanguageFile( array( 'public_topic' ), 'forums' );
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,50 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Config for posts plugin
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 5713 $
*
*/
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();
}
/**
* Plug in name (Default tab name)
*/
$CONFIG['plugin_name'] = 'Replies';
/**
* Language string for the tab
*/
$CONFIG['plugin_lang_bit'] = 'pp_tab_posts';
/**
* Plug in key (must be the same as the main {file}.php name
*/
$CONFIG['plugin_key'] = 'posts';
/**
* Show tab?
*/
$CONFIG['plugin_enabled'] = 1;
/**
* Order
*/
$CONFIG['plugin_order'] = 4;
@@ -0,0 +1,212 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile Plugin Library
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 7023 $
*/
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 profile_posts extends profile_plugin_parent
{
/**
* Attachment object
*
* @var object
*/
protected $attach;
/**
* Feturn HTML block
*
* @param array Member information
* @return string HTML block
*/
public function return_html_block( $member=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$last_x = 5;
$forumIdsOk = array( 0 => 0 );
$date_cut = '';
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! is_array( $member ) OR ! count( $member ) )
{
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
//-----------------------------------------
// Some words
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
//-----------------------------------------
// Can view other member's topics?
//-----------------------------------------
if( !$this->memberData['g_other_topics'] AND $this->memberData['member_id'] != $member['member_id'] )
{
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
$pids = array();
//-----------------------------------------
// And limit by post count...
//-----------------------------------------
$posts = intval($this->memberData['posts']);
//-----------------------------------------
// Will we need to parse attachments?
//-----------------------------------------
$parseAttachments = false;
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
/* Set up joins */
$_post_joins = array( array(
'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'left'
),
array(
'select' => 'm.member_group_id, m.mgroup_others',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left'
) );
/* Cache? */
if ( IPSContentCache::isEnabled() )
{
if ( IPSContentCache::fetchSettingValue('post') )
{
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
}
}
if ( $this->settings['search_ucontent_days'] )
{
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND p.post_date > ' . $date_cut;
}
//-----------------------------------------
// Get last X posts
//-----------------------------------------
if( is_array($forumIdsOk) AND count($forumIdsOk) )
{
$this->DB->build( array(
'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => "p.queued=0 AND t.approved=1 AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 'p.post_date DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins
) );
$o = $this->DB->execute();
while( $row = $this->DB->fetch( $o ) )
{
$pids[ $row['pid'] ] = $row['pid'];
if( $row['topic_hasattach'] )
{
$parseAttachments = true;
}
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
}
else
{
$row['post'] = $row['cache_content'];
}
$row['post'] = IPSLib::memberViewImages( $row['post'] );
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&amp;module=forums&amp;section=findpost&amp;pid='.$row['pid'], $this->lang->words['profile_in_topic'] . $row['title'] );
}
}
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ( $parseAttachments AND !is_object( $this->class_attach ) )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->type = 'post';
$this->class_attach->init();
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
//-----------------------------------------
// Macros...
//-----------------------------------------
$content = $this->registry->output->replaceMacros( $content );
//-----------------------------------------
// Return content..
//-----------------------------------------
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabPosts( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
}
@@ -0,0 +1,50 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Config for topics plugin
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 5713 $
*
*/
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();
}
/**
* Plug in name (Default tab name)
*/
$CONFIG['plugin_name'] = 'Topics';
/**
* Language string for the tab
*/
$CONFIG['plugin_lang_bit'] = 'pp_tab_topics';
/**
* Plug in key (must be the same as the main {file}.php name
*/
$CONFIG['plugin_key'] = 'topics';
/**
* Show tab?
*/
$CONFIG['plugin_enabled'] = 1;
/**
* Order
*/
$CONFIG['plugin_order'] = 3;
@@ -0,0 +1,215 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile Plugin Library
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 7003 $
*/
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 profile_topics extends profile_plugin_parent
{
/**
* Attachment object
*
* @var object
*/
protected $attach;
/**
* Return HTML block
*
* @param array Member information
* @return string HTML block
*/
public function return_html_block( $member=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$last_x = 5;
$forum_ids = array();
$date_cut = '';
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! is_array( $member ) OR ! count( $member ) )
{
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
//-----------------------------------------
// Some words
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
//-----------------------------------------
// Can view other member's topics?
//-----------------------------------------
if( !$this->memberData['g_other_topics'] AND $this->memberData['member_id'] != $member['member_id'] )
{
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
//-----------------------------------------
// And limit by post count...
//-----------------------------------------
$posts = intval($this->memberData['posts']);
//-----------------------------------------
// Will we need to parse attachments?
//-----------------------------------------
$parseAttachments = false;
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
/* Set up joins */
$_post_joins = array( array(
'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 't.topic_firstpost=p.pid',
'type' => 'left'
),
array(
'select' => 'm.member_group_id, m.mgroup_others',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left'
) );
/* Cache? */
if ( IPSContentCache::isEnabled() )
{
if ( IPSContentCache::fetchSettingValue('post') )
{
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
}
}
if ( $this->settings['search_ucontent_days'] )
{
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND t.start_date > ' . $date_cut;
}
//-----------------------------------------
// Get last X posts
//-----------------------------------------
if( is_array($forumIdsOk) AND count($forumIdsOk) )
{
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => "t.starter_id={$member['member_id']} AND t.approved=1 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 't.start_date DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins ) );
$o = $this->DB->execute();
while( $row = $this->DB->fetch( $o ) )
{
//-----------------------------------------
// Ghost topics... BOO
//-----------------------------------------
if( !$row['pid'] )
{
continue;
}
$pids[ $row['pid'] ] = $row['pid'];
if( $row['topic_hasattach'] )
{
$parseAttachments = true;
}
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
}
else
{
$row['post'] = $row['cache_content'];
}
$row['post'] = IPSLib::memberViewImages( $row['post'] );
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&amp;module=forums&amp;section=findpost&amp;pid='.$row['pid'], $row['title'] );
}
}
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ( $parseAttachments AND !is_object( $this->class_attach ) )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->type = 'post';
$this->class_attach->init();
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
//-----------------------------------------
// Macros...
//-----------------------------------------
$content = $this->registry->output->replaceMacros( $content );
//-----------------------------------------
// Return content..
//-----------------------------------------
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabTopics( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
}
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,484 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Report Center :: Posts plugin
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author Based on original "Report Center" by Luke Scott
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class post_plugin
{
/**#@+
* Registry objects
*
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Holds extra data for the plugin
*
* @var array Data specific to the plugin
*/
public $_extra;
/**
* Constructor
*
* @param object Registry object
* @return void
*/
public function __construct( ipsRegistry $registry )
{
//-----------------------------------------
// Make object
//-----------------------------------------
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->lang = $this->registry->class_localization;
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
$app_class_forums = new $classToLoad( $this->registry );
}
/**
* Display the form for extra data in the ACP
*
* @param array Plugin data
* @param object HTML object
* @return string HTML to add to the form
*/
public function displayAdminForm( $plugin_data, &$html )
{
return $html->addRow( $this->lang->words['r_supermod'],
sprintf( $this->lang->words['r_supermod_info'], $this->settings['_base_url'] ),
$this->registry->output->formYesNo('report_supermod', (!isset( $plugin_data['report_supermod'] )) ? 1 : $plugin_data['report_supermod'] )
);
}
/**
* Process the plugin's form fields for saving
*
* @param array Plugin data for save
* @return string Error message
*/
public function processAdminForm( &$save_data_array )
{
$save_data_array['report_supermod'] = intval($this->request['report_supermod']);
return '';
}
/**
* Update timestamp for report
*
* @param array New reports
* @param array New members cache
* @return boolean
*/
public function updateReportsTimestamp( $new_reports, &$new_members_cache )
{
$nmc =& $new_members_cache['report_temp']['post_marker'];
foreach( $new_reports as $report )
{
if( $report['is_new'] == 1 || $report['is_active'] == 1 )
{
$nmc['forum'][ $report['exdat1'] ]['info'] = array( 'id' => $report['id'], 'title' => $report['title'], 'com_id' => $report['com_id'] );
$nmc['topic'][ $report['exdat2'] ]['info'] = array( 'id' => $report['id'], 'title' => $report['title'], 'com_id' => $report['com_id'] );
$nmc['post'][ $report['exdat3'] ]['info'] = array( 'id' => $report['id'], 'title' => $report['title'], 'com_id' => $report['com_id'] );
}
if( $report['is_new'] == 1 )
{
$nmc['forum'][ $report['exdat1'] ]['gfx'] = 1;
$nmc['topic'][ $report['exdat2'] ]['gfx'] = 1;
$nmc['post'][ $report['exdat3'] ]['gfx'] = 1;
}
elseif( $report['is_active'] == 1 )
{
$nmc['forum'][ $report['exdat1'] ]['gfx'] = 2;
$nmc['topic'][ $report['exdat2'] ]['gfx'] = 2;
$nmc['post'][ $report['exdat3'] ]['gfx'] = 2;
}
}
}
/**
* Get report permissions
*
* @param string Type of perms to check
* @param array Permissions data
* @param array group ids
* @param string Special permissions
* @return boolean
*/
public function getReportPermissions( $check, $com_dat, $group_ids, &$to_return )
{
if( ( $this->memberData['g_is_supmod'] == 1 && ( ! isset($this->_extra['report_supermod']) || $this->_extra['report_supermod'] == 1 ) ) )
{
return true;
}
else
{
if ( ! is_array( $this->caches['moderators'] ) )
{
return false;
}
$forum_ids = array();
foreach( $this->caches['moderators'] as $mod )
{
if( $mod['member_id'] == $this->memberData['member_id'] )
{
$these_forums = explode( ',', IPSText::cleanPermString( $mod['forum_id'] ) );
foreach( $these_forums as $forum_id )
{
$forum_ids['exdat1'][] = $forum_id;
}
}
elseif( $mod['is_group'] == 1 && in_array( $mod['group_id'], $group_ids ) == true )
{
$these_forums = explode( ',', IPSText::cleanPermString( $mod['forum_id'] ) );
foreach( $these_forums as $forum_id )
{
$forum_ids['exdat1'][] = $forum_id;
}
}
}
if( count( $forum_ids ) > 0 )
{
$to_return = $forum_ids;
return true;
}
else
{
return false;
}
}
}
/**
* Show the report form for this module
*
* @param array Application data
* @return string HTML form information
*/
public function reportForm( $com_dat )
{
$this->lang->words['report_basic_title'] = $this->lang->words['report_post_title'];
$this->lang->words['report_basic_url_title'] = $this->lang->words['report_post_url_title'];
$this->lang->words['report_basic_enter'] = $this->lang->words['report_post_enter'];
$this->registry->output->setTitle( $this->lang->words['report_basic_title'] );
$this->registry->output->addNavigation( $this->lang->words['report_basic_title'], '' );
$topic_id = intval($this->request['tid']);
$this->_checkAccess( $topic_id );
$extra_data = array(
'topic_id' => intval($topic_id),
'post_id' => intval($this->request['pid']),
'forum_id' => intval($this->topic['forum_id']),
);
$url = $this->registry->output->buildSEOUrl( "showtopic={$extra_data['topic_id']}&amp;view=findpost&amp;p={$extra_data['post_id']}", 'public', $this->topic['title_seo'], 'showtopic' );
//-----------------------------------------
// Title, URL Extra Data (Array)
//-----------------------------------------
return $this->registry->getClass('reportLibrary')->showReportForm( $this->topic['title'], $url, $extra_data );
}
/**
* Get section and link
*
* @param array Report data
* @return array Section/link
*/
public function giveSectionLinkTitle( $report_row )
{
return array(
'title' => $this->registry->class_forums->forum_by_id[ $report_row['exdat1'] ]['name'],
'url' => '/index.php?showforum=' . $report_row['exdat1'],
'seo_title' => $this->registry->class_forums->forum_by_id[ $report_row['exdat1'] ]['name_seo'],
'seo_template' => 'showforum',
);
}
/**
* Process a report and save the data appropriate
*
* @param array Report data
* @return array Data from saving the report
*/
public function processReport( $com_dat )
{
$topic_id = intval($this->request['topic_id']);
$post_id = intval($this->request['post_id']);
$forum_id = intval($this->request['forum_id']);
if( ! $topic_id || ! $post_id )
{
$this->registry->output->showError( 'reports_missing_tidpid', 10168 );
}
$uid = md5( 'topic_' . $topic_id . '_' . $post_id . '_' . $forum_id . '_' . $com_dat['com_id'] );
$url = 'showtopic=' . intval($topic_id) . '&view=findpost&p=' . intval($post_id);
$save_url = str_replace( '&', '&amp;', $url);
$status = array();
$this->DB->build( array( 'select' => 'status, is_new, is_complete',
'from' => 'rc_status',
'where' => "is_new=1 OR is_complete=1",
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
if( $row['is_new'] == 1 )
{
$status['new'] = $row['status'];
}
elseif( $row['is_complete'] == 1 )
{
$status['complete'] = $row['status'];
}
}
$data = $this->DB->buildAndFetch( array(
'select' => 'p.post',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=' . $post_id,
'add_join' => array(
array(
'select' => 't.title_seo',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'left',
),
array(
'select' => 'mem.member_id, mem.members_display_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=p.author_id',
'type' => 'left',
),
)
) );
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 0;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
$message = "[quote name='" . IPSText::getTextClass('bbcode')->makeQuoteSafe( $data['members_display_name'] ) . "']";
$message .= IPSText::getTextClass('bbcode')->preEditParse( $data['post'] );
$message .= "[/quote]\n\n";
$message .= $this->request['message'];
$this->DB->build( array( 'select' => 'id', 'from' => 'rc_reports_index', 'where' => "uid='{$uid}'" ) );
$this->DB->execute();
if( $this->DB->getTotalRows() == 0 )
{
$this->_checkAccess( $topic_id );
$built_report_main = array(
'uid' => $uid,
'title' => $this->topic['title'],
'status' => $status['new'],
'url' => '/index.php?' . $save_url,
'seoname' => $data['title_seo'],
'seotemplate' => 'showtopic',
'rc_class' => $com_dat['com_id'],
'updated_by' => $this->memberData['member_id'],
'date_updated' => time(),
'date_created' => time(),
'exdat1' => $forum_id,
'exdat2' => $topic_id,
'exdat3' => $post_id,
);
$this->DB->insert( 'rc_reports_index', $built_report_main );
$rid = $this->DB->getInsertId();
}
else
{
$the_report = $this->DB->fetch();
$rid = $the_report['id'];
$this->DB->update( 'rc_reports_index', array( 'date_updated' => time(), 'status' => $status['new'], 'seoname' => $data['title_seo'], 'seotemplate' => 'showtopic' ), "id='{$rid}'" );
}
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'reports';
$build_report = array(
'rid' => $rid,
'report' => IPSText::getTextClass('bbcode')->preDbParse( $message ),
'report_by' => $this->memberData['member_id'],
'date_reported' => time(),
);
$this->DB->insert( 'rc_reports', $build_report );
$reports = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'rc_reports', 'where' => "rid='{$rid}'" ) );
$this->DB->update( 'rc_reports_index', array( 'num_reports' => $reports['total'] ), "id='{$rid}'" );
$return_data = array(
'REDIRECT_URL' => $url,
'FORUM_ID' => $forum_id,
'REPORT_INDEX' => $rid,
'SAVED_URL' => '/index.php?' . $save_url,
'REPORT' => $build_report['report'],
'SEOTITLE' => $data['title_seo'],
'TEMPLATE' => 'showtopic',
);
return $return_data;
}
/**
* Where to send user after report is submitted
*
* @param array Report data
* @return void
*/
public function reportRedirect( $report_data )
{
$this->registry->output->redirectScreen( $this->lang->words['report_sending'], $this->settings['base_url'] . $report_data['REDIRECT_URL'], $report_data['SEOTITLE'], $report_data['TEMPLATE'] );
}
/**
* Retrieve list of users to send notifications to
*
* @param string Group ids
* @param array Report data
* @return array Array of users to PM/Email
*/
public function getNotificationList( $group_ids, $report_data )
{
//-----------------------------------------
// Build where for secondary member groups
//-----------------------------------------
$secondaryWhere = array();
if( is_array($group_ids) AND count($group_ids) )
{
foreach( $group_ids as $group_id )
{
$secondaryWhere[] = "m.mgroup_others LIKE '%,{$group_id},%'";
}
}
$this->DB->build( array(
'select' => 'noti.*',
'from' => array( 'rc_modpref' => 'noti' ),
'where' => "(m.member_group_id IN(" . $group_ids . ") " . ( count($secondaryWhere) ? "OR " . implode( ' OR ', $secondaryWhere ) : '' ) . ") AND (g.g_is_supmod=1 OR g.g_access_cp=1 OR moderator.forum_id LIKE '%,{$report_data['FORUM_ID']},%')",
'add_join' => array(
array(
'select' => 'm.member_id as real_member_id, m.members_display_name as name, m.language, m.members_disable_pm, m.email, m.member_group_id',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=noti.mem_id',
),
array(
'select' => 'moderator.member_id, moderator.group_id',
'from' => array( 'moderators' => 'moderator' ),
'where' => 'moderator.member_id=m.member_id OR moderator.group_id=m.member_group_id',
),
array(
'from' => array( 'groups' => 'g' ),
'where' => 'g.g_id=m.member_group_id',
'type' => 'left',
),
)
) );
$this->DB->execute();
$notify = array();
if ( $this->DB->getTotalRows() )
{
while( $r = $this->DB->fetch() )
{
$r['member_id'] = $r['real_member_id'];
$notify[ $r['member_id'] ] = $r;
}
}
return $notify;
}
/**
* Check access to report the topic
*
* @param integer Topic id
* @return void
*/
private function _checkAccess( $tid )
{
if ( ! $this->memberData['member_id'] )
{
$this->registry->output->showError( 'reports_must_be_member', 10169 );
}
//-----------------------------------------
// Needs silly a. alias to keep oracle
// happy
//-----------------------------------------
$this->topic = $this->DB->buildAndFetch( array( 'select' => 'a.*,a.title as topic_title', 'from' => 'topics a', 'where' => "a.tid=" . $tid ) );
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
$this->registry->getClass('class_forums')->forumsInit();
}
$this->registry->getClass('class_forums')->forumsCheckAccess( $this->topic['forum_id'], 0, 'topic', $this->topic );
}
}
@@ -1,47 +1,49 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Reputation configuration for application
* Last Updated: $Date: 2009-11-13 12:11:37 -0500 (Fri, 13 Nov 2009) $
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5402 $
**/
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();
}
$rep_author_config = array(
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
);
/*
* The following config items are for the log viewer in the ACP */
$rep_log_joins = array(
array(
'from' => array( 'posts' => 'p' ),
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
'type' => 'left'
),
array(
'select' => 't.title as repContentTitle, t.tid as repContentID',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
);
$rep_log_where = "p.author_id=%s";
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Reputation configuration for application
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 7007 $
*/
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();
}
$rep_author_config = array(
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
);
/**
* The following config items are for the log viewer in the ACP
*/
$rep_log_joins = array(
array(
'from' => array( 'posts' => 'p' ),
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
'type' => 'left'
),
array(
'select' => 't.title as repContentTitle, t.tid as repContentID',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
);
$rep_log_where = "p.author_id=%s";
$rep_log_link = 'findpost=%d';
@@ -1,138 +1,135 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* RSS output plugin :: posts
* Last Updated: $Date: 2009-07-09 03:49:55 -0400 (Thu, 09 Jul 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 4857 $
*/
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 rss_output_forums
{
/**
* Expiration date
*
* @access private
* @var integer Expiration timestamp
*/
private $expires = 0;
/**
* Grab the RSS links
*
* @access public
* @return array RSS links
*/
public function getRssLinks()
{
$return = array();
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
ipsRegistry::DB()->execute();
while( $r = ipsRegistry::DB()->fetch() )
{
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&amp;module=global&amp;section=rss&amp;type=forums&amp;id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
}
return $return;
}
/**
* Grab the RSS document content and return it
*
* @access public
* @return string RSS document
*/
public function returnRSSDocument()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$rss_export_id = intval( ipsRegistry::$request['id'] );
$rss_data = array();
$to_print = '';
$this->expires = time();
//-----------------------------------------
// Get RSS export
//-----------------------------------------
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
'from' => 'rss_export',
'where' => 'rss_export_id=' . $rss_export_id ) );
//-----------------------------------------
// Got one?
//-----------------------------------------
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
{
//-----------------------------------------
// Correct expires time
//-----------------------------------------
$this->expires += $rss_data['rss_export_cache_time'] * 60;
//-----------------------------------------
// Need to recache?
//-----------------------------------------
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
{
//-----------------------------------------
// Yes
//-----------------------------------------
define( 'IN_ACP', 1 );
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
$app_class_forums = new app_class_forums( ipsRegistry::instance() );
require_once( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php' );
$rss_export = new admin_forums_rss_export();
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
}
else
{
//-----------------------------------------
// No
//-----------------------------------------
return $rss_data['rss_export_cache_content'];
}
}
}
/**
* Grab the RSS document expiration timestamp
*
* @access public
* @return integer Expiration timestamp
*/
public function grabExpiryDate()
{
return $this->expires ? $this->expires : time();
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* RSS output plugin :: posts
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 7003 $
*/
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 rss_output_forums
{
/**
* Expiration date
*
* @var integer Expiration timestamp
*/
private $expires = 0;
/**
* Grab the RSS links
*
* @return array RSS links
*/
public function getRssLinks()
{
$return = array();
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
ipsRegistry::DB()->execute();
while( $r = ipsRegistry::DB()->fetch() )
{
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&amp;module=global&amp;section=rss&amp;type=forums&amp;id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
}
return $return;
}
/**
* Grab the RSS document content and return it
*
* @return string RSS document
*/
public function returnRSSDocument()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$rss_export_id = intval( ipsRegistry::$request['id'] );
$rss_data = array();
$to_print = '';
$this->expires = time();
//-----------------------------------------
// Get RSS export
//-----------------------------------------
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
'from' => 'rss_export',
'where' => 'rss_export_id=' . $rss_export_id ) );
//-----------------------------------------
// Got one?
//-----------------------------------------
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
{
//-----------------------------------------
// Correct expires time
//-----------------------------------------
$this->expires += $rss_data['rss_export_cache_time'] * 60;
//-----------------------------------------
// Need to recache?
//-----------------------------------------
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
{
//-----------------------------------------
// Yes
//-----------------------------------------
define( 'IN_ACP', 1 );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
$app_class_forums = new $classToLoad( ipsRegistry::instance() );
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php', 'admin_forums_rss_export' );
$rss_export = new $classToLoad();
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
}
else
{
//-----------------------------------------
// No
//-----------------------------------------
return $rss_data['rss_export_cache_content'];
}
}
}
/**
* Grab the RSS document expiration timestamp
*
* @return integer Expiration timestamp
*/
public function grabExpiryDate()
{
return $this->expires ? $this->expires : time();
}
}
@@ -0,0 +1,35 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Config file
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5855 $
**/
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();
}
/* Can search with this app */
$CONFIG['can_search'] = 1;
/* Can view new content with this app */
$CONFIG['can_viewNewContent'] = 1;
/* Can fetch active content with this app */
$CONFIG['can_activeContent'] = 1;
/* Can fetch user generated content */
$CONFIG['can_userContent'] = 1;
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,732 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Basic Forum Search
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5861 $
*/
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 search_engine_forums extends search_engine
{
/**
* Constructor
*
* @return void
*/
public function __construct( ipsRegistry $registry )
{
/* Hard limit */
IPSSearchRegistry::set('set.hardLimit', ( ipsRegistry::$settings['search_hardlimit'] ) ? ipsRegistry::$settings['search_hardlimit'] : 200 );
/* Get class forums, used for displaying forum names on results */
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
ipsRegistry::getClass('class_forums')->forumsInit();
}
parent::__construct( $registry );
}
/**
* Perform a search.
* Returns an array of a total count (total number of matches)
* and an array of IDs ( 0 => 1203, 1 => 928, 2 => 2938 ).. matching the required number based on pagination. The ids returned would be based on the filters and type of search
*
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
*
* @return array
*/
public function search()
{
$start = intval( IPSSearchRegistry::get('in.start') );
$perPage = IPSSearchRegistry::get('opt.search_per_page');
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
$post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts');
$search_ids = array();
$groupby = false;
$cType = IPSSearchRegistry::get('contextual.type');
$cId = IPSSearchRegistry::get('contextual.id' );
/* Contextual search */
if ( $cType == 'topic' )
{
$content_title_only = false;
$post_search_only = true;
IPSSearchRegistry::set('opt.searchTitleOnly', false);
IPSSearchRegistry::set('opt.onlySearchPosts', true);
IPSSearchRegistry::set('display.onlyTitles', false);
IPSSearchRegistry::set('opt.noPostPreview', false);
}
/* Permissions */
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
$permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( 0 );
$permissions['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( 0 );
$permissions['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( 0 );
/* Sorting */
switch( $sort_by )
{
default:
case 'date':
$sortKey = 'last_post';
$sortKeyPost = 'post_date';
break;
case 'title':
$sortKeyPost = $sortKey = 'tordinal';
break;
case 'posts':
$sortKeyPost = $sortKey = 'posts';
break;
case 'views':
$sortKeyPost = $sortKey = 'views';
break;
}
/* Limit Results */
$this->sphinxClient->SetLimits( intval($start), intval($perPage) );
/* Loop through the forums and build a list of forums we're allowed access to */
$forumIdsOk = array();
$forumIdsBad = array();
if ( ! empty( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) AND count( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
{
foreach( ipsRegistry::$request['search_app_filters']['forums']['forums'] as $forum_id )
{
if( $forum_id )
{
$data = $this->registry->class_forums->forum_by_id[ $forum_id ];
/* Check for sub forums */
$children = ipsRegistry::getClass( 'class_forums' )->forumsGetChildren( $forum_id );
foreach( $children as $kid )
{
if( ! in_array( $kid, ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
{
if( ! $this->registry->permissions->check( 'read', $this->registry->class_forums->forum_by_id[ $kid ] ) )
{
$forumIdsBad[] = $kid;
continue;
}
/* Can read, but is it password protected, etc? */
if ( ! $this->registry->class_forums->forumsCheckAccess( $kid, 0, 'forum', array(), true ) )
{
$forumIdsBad[] = $kid;
continue;
}
if ( ! $this->registry->class_forums->forum_by_id[ $kid ]['sub_can_post'] OR ! $this->registry->class_forums->forum_by_id[ $kid ]['can_view_others'] )
{
$forumIdsBad[] = $kid;
continue;
}
$forumIdsOk[] = $kid;
}
}
/* Can we read? */
if ( ! $this->registry->permissions->check( 'view', $data ) )
{
$forumIdsBad[] = $forum_id;
continue;
}
/* Can read, but is it password protected, etc? */
if ( ! $this->registry->class_forums->forumsCheckAccess( $forum_id, 0, 'forum', array(), true ) )
{
$forumIdsBad[] = $forum_id;
continue;
}
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] AND !$this->memberData['g_access_cp'] )
{
$forumIdsBad[] = $forum_id;
continue;
}
$forumIdsOk[] = $forum_id;
}
}
}
if ( ! count($forumIdsOk) )
{
$allowTrashCan = ( $cType == 'forum' ) ? true : false;
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( null, array(), $allowTrashCan );
}
/* Add allowed forums */
$forumIdsOk = ( count( $forumIdsOk ) ) ? $forumIdsOk : array( 0 => 0 );
/* Contextual */
if ( $cType == 'forum' AND $cId AND in_array( $cId, $forumIdsOk ) )
{
$this->sphinxClient->SetFilter( 'forum_id', array( $cId ) );
}
else
{
$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );
}
/* Topic contextual */
if ( $cType == 'topic' AND $cId )
{
$this->sphinxClient->SetFilter( 'tid', array( $cId ) );
}
/* Exclude some items */
if ( ! $content_title_only )
{
if ( $permissions['SoftDeleteContent'] AND $permissions['PostSoftDeleteSee'] AND $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,1,2 ) );
}
else if ( $permissions['SoftDeleteContent'] AND $permissions['PostSoftDeleteSee'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,2 ) );
}
else if ( $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,1 ) );
}
else
{
$this->sphinxClient->SetFilter( 'queued', array( 0 ) );
}
}
if ( $permissions['SoftDeleteContent'] AND $permissions['TopicSoftDeleteSee'] AND $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'approved' , array( 0,1 ) );
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0,1 ) );
}
else if ( $permissions['SoftDeleteContent'] AND $permissions['TopicSoftDeleteSee'] )
{
$this->sphinxClient->SetFilter( 'approved', array( 1 ) );
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0,1 ) );
}
else if ( $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0 ) );
$this->sphinxClient->SetFilter( 'approved', array( 0,1 ) );
}
else
{
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0 ) );
$this->sphinxClient->SetFilter( 'approved', array( 1 ) );
}
/* Additional filters */
if ( IPSSearchRegistry::get('opt.pCount') )
{
$this->sphinxClient->SetFilterRange( 'posts', intval( IPSSearchRegistry::get('opt.pCount') ), 1500000000 );
}
if ( IPSSearchRegistry::get('opt.pViews') )
{
$this->sphinxClient->SetFilterRange( 'views', intval( IPSSearchRegistry::get('opt.pViews') ), 1500000000 );
}
/* Date limit */
if ( $this->search_begin_timestamp )
{
if ( ! $this->search_end_timestamp )
{
$this->search_end_timestamp = time() + 100;
}
if ( $content_title_only )
{
$this->sphinxClient->SetFilterRange( 'start_date', $this->search_begin_timestamp, $this->search_end_timestamp );
}
else
{
$this->sphinxClient->SetFilterRange( 'post_date', $this->search_begin_timestamp, $this->search_end_timestamp );
}
}
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') )
{
$groupby = true;
}
if ( $content_title_only )
{
if ( $sort_order == 'asc' )
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKey );
}
else
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKey );
}
if ( $groupby )
{
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group ' . $sort_order );
}
$_s = ( $search_term ) ? '@title ' . $search_term : '';
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
$this->logSphinxWarnings();
}
else
{
if ( $groupby )
{
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group DESC');
}
if ( $sort_order == 'asc' )
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKeyPost );
}
else
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKeyPost );
}
if ( $post_search_only )
{
$_s = ( $search_term ) ? '@post ' . $search_term : '';
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
}
else
{
$_s = ( $search_term AND strstr( $search_term, '"' ) ) ? '@post ' . $search_term . ' | @title ' . $search_term : ( $search_term ? '@(post,title) ' . $search_term : '' );
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
}
$this->logSphinxWarnings();
}
if ( is_array( $result['matches'] ) && count( $result['matches'] ) )
{
foreach( $result['matches'] as $res )
{
$search_ids[] = ( $content_title_only ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
}
}
/* Return it */
return array( 'count' => intval( $result['total_found'] ) > 1000 ? 1000 : $result['total_found'], 'resultSet' => $search_ids );
}
/**
* Perform the search
* Populates $this->_count and $this->_results
*
* @return array
*/
public function viewUserContent( $member )
{
/* Ensure we limit by date */
$this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365;
/* Bit of init */
$time = time() - ( 86400 * intval( $this->settings['search_ucontent_days'] ) );
switch( IPSSearchRegistry::get('in.userMode') )
{
default:
case 'all':
IPSSearchRegistry::set('opt.searchTitleOnly', false );
IPSSearchRegistry::set('display.onlyTitles' , true );
IPSSearchRegistry::set('opt.noPostPreview' , false );
break;
case 'title':
IPSSearchRegistry::set('opt.searchTitleOnly', true );
IPSSearchRegistry::set('display.onlyTitles' , true );
IPSSearchRegistry::set('opt.noPostPreview' , false );
break;
case 'content':
IPSSearchRegistry::set('opt.searchTitleOnly', false );
IPSSearchRegistry::set('display.onlyTitles' , false );
IPSSearchRegistry::set('opt.noPostPreview' , false );
break;
}
/* Init */
$start = IPSSearchRegistry::get('in.start');
$perPage = IPSSearchRegistry::get('opt.search_per_page');
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
/* Limit Results */
$this->sphinxClient->SetLimits( intval($start), intval($perPage) );
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );
$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );
/* what we doing? */
if ( IPSSearchRegistry::get('in.userMode') != 'title' )
{
$this->sphinxClient->SetFilter( 'author_id', array( intval( $member['member_id'] ) ) );
}
else
{
$this->sphinxClient->SetFilter( 'starter_id', array( intval( $member['member_id'] ) ) );
}
if ( $this->settings['search_ucontent_days'] )
{
$this->sphinxClient->SetFilterRange( 'post_date', $time, time() );
}
/* Set up perms */
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
$permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( 0 );
$permissions['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( 0 );
$permissions['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( 0 );
/* Exclude some items */
if ( IPSSearchRegistry::get('in.userMode') != 'title' )
{
if ( $permissions['SoftDeleteContent'] AND $permissions['PostSoftDeleteSee'] AND $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,1,2 ) );
}
else if ( $permissions['SoftDeleteContent'] AND $permissions['PostSoftDeleteSee'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,2 ) );
}
else if ( $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'queued', array( 0,1 ) );
}
else
{
$this->sphinxClient->SetFilter( 'queued', array( 0 ) );
}
}
else
{
if ( $permissions['SoftDeleteContent'] AND $permissions['TopicSoftDeleteSee'] AND $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'approved' , array( 0,1 ) );
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0,1 ) );
}
else if ( $permissions['SoftDeleteContent'] AND $permissions['TopicSoftDeleteSee'] )
{
$this->sphinxClient->SetFilter( 'approved', array( 0 ) );
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0,1 ) );
}
else if ( $permissions['canQueue'] )
{
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0 ) );
$this->sphinxClient->SetFilter( 'approved', array( 0,1 ) );
}
else
{
$this->sphinxClient->SetFilter( 'soft_deleted', array( 0 ) );
$this->sphinxClient->SetFilter( 'approved', array( 1 ) );
}
}
if ( IPSSearchRegistry::get('in.userMode') == 'title' )
{
$this->sphinxClient->SetGroupDistinct ( "tid" );
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, '@group DESC' );
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'last_post' );
$result = $this->sphinxClient->Query( '', 'forums_search_posts_main,forums_search_posts_delta' );
$this->logSphinxWarnings();
}
else
{
if ( IPSSearchRegistry::get('in.userMode') == 'content' )
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'post_date' );
}
else
{
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'post_date' );
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group desc' );
}
$result = $this->sphinxClient->Query( '', 'forums_search_posts_main,forums_search_posts_delta' );
$this->logSphinxWarnings();
}
if ( is_array( $result['matches'] ) && count( $result['matches'] ) )
{
foreach( $result['matches'] as $res )
{
$search_ids[] = ( IPSSearchRegistry::get('opt.searchTitleOnly') ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
}
}
return array( 'count' => intval( $result['total_found'] ) > 1000 ? 1000 : $result['total_found'], 'resultSet' => $search_ids );
}
/**
* Perform the viewNewContent search
* Forum Version
* Populates $this->_count and $this->_results
*
* @return array
*/
public function viewNewContent()
{
$tids = $this->registry->getClass('classItemMarking')->fetchCookieData( 'forums', 'items' );
$oldStamp = $this->registry->getClass('classItemMarking')->fetchOldestUnreadTimestamp( array(), 'forums' );
$check = IPS_UNIX_TIME_NOW - ( 86400 * 90 );
$forumIdsOk = array();
/* Loop through the forums and build a list of forums we're allowed access to */
$bvnp = explode( ',', $this->settings['vnp_block_forums'] );
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
IPSSearchRegistry::set('opt.searchTitleOnly' , true );
IPSSearchRegistry::set('display.onlyTitles' , true );
IPSSearchRegistry::set('opt.noPostPreview' , true );
/* Get list of good forum IDs */
$_forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'], $bvnp );
if ( ! $this->memberData['bw_vnc_type'] )
{
$oldStamp = IPSLib::fetchHighestNumber( array( intval( $this->memberData['_cache']['gb_mark__forums'] ), intval( $this->memberData['last_visit'] ) ) );
$tids = array();
$forumIdsOk = $_forumIdsOk;
}
else
{
foreach( $_forumIdsOk as $id )
{
$lMarked = $this->registry->getClass('classItemMarking')->fetchTimeLastMarked( array( 'forumID' => $id ), 'forums' );
$fData = $this->registry->getClass('class_forums')->forumsFetchData( $id );
if ( $fData['last_post'] > $lMarked )
{
/* Add to tids */
$_tids = $this->registry->getClass('classItemMarking')->fetchReadIds( array( 'forumID' => $id ), 'forums', false );
if ( is_array( $_tids ) )
{
foreach( $_tids as $k => $v )
{
$tids[ $k ] = $v;
}
}
$forumIdsOk[ $id ] = $id;
}
}
if ( intval( $this->memberData['_cache']['gb_mark__forums'] ) > 0 )
{
$oldStamp = $this->memberData['_cache']['gb_mark__forums'];
}
/* Finalize times */
if ( ! $oldStamp OR $oldStamp == IPS_UNIX_TIME_NOW )
{
$oldStamp = intval( $this->memberData['last_visit'] );
}
/* Older than 3 months.. then limit */
if ( $oldStamp < $check )
{
$oldStamp = $check;
}
/* If no forums, we're done */
if ( ! count( $forumIdsOk ) )
{
/* Return it */
return array( 'count' => 0, 'resultSet' => array() );
}
}
/* Set the timestamps */
$this->sphinxClient->SetFilterRange( 'last_post', $oldStamp, time() );
$this->setDateRange( 0, 0 );
/* Force it into filter so that search can pick it up */
ipsRegistry::$request['search_app_filters']['forums']['forums'] = $forumIdsOk;
/* Try and limit the TIDS */
if ( is_array( $tids ) AND count( $tids ) )
{
if ( count( $tids ) > 300 )
{
/* Sort by last read date */
arsort( $tids, SORT_NUMERIC );
$tids = array_slice( $tids, 0, 300 );
}
$this->DB->build( array( 'select' => 'tid, last_post',
'from' => 'topics',
'where' => "tid IN (" . implode( ",", array_keys( $tids ) ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
/* Posted in since last read? */
if ( $row['last_post'] > $tids[ $row['tid'] ] )
{
unset( $tids[ $row['tid'] ] );
}
}
if ( count( $tids ) )
{
$tids = array_keys( $tids );
}
}
/* Set read tids */
if ( count( $tids ) )
{
$this->sphinxClient->SetFilter( 'tid', $tids, TRUE );
}
/* Set up some vars */
IPSSearchRegistry::set('set.resultCutToDate', $oldStamp );
return $this->search();
}
/**
* Perform the search
* Populates $this->_count and $this->_results
*
* @return array
*/
public function viewActiveContent()
{
$seconds = IPSSearchRegistry::get('in.period_in_seconds');
/* Loop through the forums and build a list of forums we're allowed access to */
$bvnp = explode( ',', $this->settings['vnp_block_forums'] );
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
IPSSearchRegistry::set('opt.searchTitleOnly' , true );
IPSSearchRegistry::set('display.onlyTitles' , true );
IPSSearchRegistry::set('opt.noPostPreview' , true );
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'], $bvnp );
/* Force it into filter so that search can pick it up */
ipsRegistry::$request['search_app_filters']['forums']['forums'] = $forumIdsOk;
/* Set the timestamps */
$this->sphinxClient->SetFilterRange( 'last_post', intval( time() - $seconds ), time() );
$this->setDateRange( 0, 0 );
return $this->search();
}
/**
* Remap standard columns (Apps can override )
*
* @param string $column sql table column for this condition
* @return string column
* @return void
*/
public function remapColumn( $column )
{
$column = $column == 'member_id' ? ( IPSSearchRegistry::get('opt.searchTitleOnly') ? 'starter_id' : 'author_id' ) : $column;
$column = $column == 'content_title' ? 'title' : $column;
$column = $column == 'type_id' ? 'forum_id' : $column;
return $column;
}
/**
* Returns an array used in the searchplugin's setCondition method
*
* @param array $data Array of forums to view
* @return array Array with column, operator, and value keys, for use in the setCondition call
*/
public function buildFilterSQL( $data )
{
/* INIT */
$return = array();
/* Set up some defaults */
IPSSearchRegistry::set( 'opt.noPostPreview' , true );
IPSSearchRegistry::set( 'opt.onlySearchPosts', false );
if( isset( $data ) && is_array( $data ) && count( $data ) )
{
foreach( $data as $field => $_data )
{
/* CONTENT ONLY */
if ( $field == 'noPreview' AND $_data['noPreview'] == 0 )
{
IPSSearchRegistry::set( 'opt.noPostPreview', false );
}
/* CONTENT ONLY */
if ( $field == 'contentOnly' AND $_data['contentOnly'] == 1 )
{
IPSSearchRegistry::set( 'opt.onlySearchPosts', true );
}
/* POST COUNT */
if ( $field == 'pCount' AND intval( $_data['pCount'] ) > 0 )
{
IPSSearchRegistry::set( 'opt.pCount', intval( $_data['pCount'] ) );
}
/* TOPIC VIEWS */
if ( $field == 'pViews' AND intval( $_data ) > 0 )
{
IPSSearchRegistry::set( 'opt.pViews', intval( $_data['pViews'] ) );
}
}
return $return;
}
else
{
return '';
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,80 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Returns HTML for the form (optional class, not required)
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5855 $
*/
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 search_form_forums
{
/**
* Construct
*
* @return void
*/
public function __construct()
{
/* Make object */
$this->registry = ipsRegistry::instance();
$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();
}
/**
* Return sort drop down
*
* @return array
*/
public function fetchSortDropDown()
{
$array = array( 'date' => $this->lang->words['s_search_type_0'],
'title' => $this->lang->words['forum_sort_title'],
'posts' => $this->lang->words['forum_sort_posts'],
'views' => $this->lang->words['forum_sort_views'] );
return $array;
}
/**
* Retuns the html for displaying the forum category filter on the advanced search page
*
* @return string Filter HTML
*/
public function getHtml()
{
/* Make sure class_forums is setup */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
}
ipsRegistry::getClass('class_forums')->strip_invisible = 1;
ipsRegistry::getClass('class_forums')->forumsInit();
return array( 'title' => ipsRegistry::$applications['forums']['app_public_title'], 'html' => ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->forumAdvancedSearchFilters( ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1 ) ) );
}
}
@@ -0,0 +1,563 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Formats forum search results
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5855 $
*/
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 search_format_forums extends search_format
{
/**
* Constructor
*
* @return void
*/
public function __construct( ipsRegistry $registry )
{
/* Get class forums, used for displaying forum names on results */
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
ipsRegistry::getClass('class_forums')->forumsInit();
}
parent::__construct( $registry );
/* Set up wrapper */
$this->templates = array( 'group' => 'search', 'template' => 'searchResultsAsForum' );
}
/**
* Parse search results
*
* @param array $r Search result
* @return array $html Blocks of HTML
*/
public function parseAndFetchHtmlBlocks( $rows )
{
/* Forum stuff */
$sub = false;
$isVnc = false;
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
$onlyTitles = IPSSearchRegistry::get('display.onlyTitles');
$noPostPreview = IPSSearchRegistry::get('opt.noPostPreview');
$results = array();
$attachPids = array();
$results = array();
/* loop and process */
foreach( $rows as $id => $data )
{
/* Reset */
$pages = 0;
/* Set up forum */
$forum = $this->registry->getClass('class_forums')->forum_by_id[ $data['forum_id'] ];
$this->last_topic = $data['tid'];
/* Various data */
$data['_last_post'] = $data['last_post'];
$data['_longTitle'] = $data['content_title'];
$data['_shortTitle'] = IPSText::truncate( $data['content_title'], 60 );
$data['last_poster'] = $data['last_poster_id'] ? IPSLib::makeProfileLink( $data['last_poster_name'], $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
$data['starter'] = $data['starter_id'] ? IPSLib::makeProfileLink( $data['starter_name'], $data['starter_id'], $data['seo_first_name'] ) : $this->settings['guest_name_pre'] . $data['starter_name'] . $this->settings['guest_name_suf'];
$data['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $data['last_post'], 'SHORT' );
if ( isset( $data['post_date'] ) )
{
$data['_post_date'] = $data['post_date'];
$data['post_date'] = $this->registry->getClass( 'class_localization')->getDate( $data['post_date'], 'SHORT' );
}
if ( $this->memberData['is_mod'] )
{
$data['posts'] += intval($data['topic_queuedposts']);
}
if ( $data['posts'])
{
if ( (($data['posts'] + 1) % $this->settings['display_max_posts']) == 0 )
{
$pages = ($data['posts'] + 1) / $this->settings['display_max_posts'];
}
else
{
$number = ( ($data['posts'] + 1) / $this->settings['display_max_posts'] );
$pages = ceil( $number);
}
}
if ( $pages > 1 )
{
for ( $i = 0 ; $i < $pages ; ++$i )
{
$real_no = $i * $this->settings['display_max_posts'];
$page_no = $i + 1;
if ( $page_no == 4 and $pages > 4 )
{
$data['pages'][] = array( 'last' => 1,
'st' => ($pages - 1) * $this->settings['display_max_posts'],
'page' => $pages );
break;
}
else
{
$data['pages'][] = array( 'last' => 0,
'st' => $real_no,
'page' => $page_no );
}
}
}
/* For-matt some stuffs */
if ( ! $data['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $data['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $forum['use_html'] and $this->caches['group_cache'][ $data['member_group_id'] ]['g_dohtml'] and $data['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $data['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $forum['use_ibc'];
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $data['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $data['mgroup_others'];
}
else
{
$data['post'] = '<!--cached-' . gmdate( 'r', $data['cache_updated'] ) . '-->' . $data['cache_content'];
}
$data['post'] = IPSText::searchHighlight( IPSText::getTextClass( 'bbcode' )->preDisplayParse( $data['post'] ), $search_term );
/* Has attachments */
if ( $data['topic_hasattach'] )
{
$attachPids[ $data['pid'] ] = $data['post'];
}
$rows[ $id ] = $data;
}
/* Attachments */
if ( count( $attachPids ) )
{
/* Load attachments class */
if ( ! is_object( $this->class_attach ) )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->type = 'post';
$this->class_attach->init();
}
$attachHTML = $this->class_attach->renderAttachments( array( $data['pid'] => $data['post'] ), array_keys( $attachPids ) );
/* Now parse back in the rendered posts */
if( is_array($attachHTML) AND count($attachHTML) )
{
foreach( $attachHTML as $id => $_data )
{
/* Get rid of any lingering attachment tags */
if ( stristr( $_data['html'], "[attachment=" ) )
{
$_data['html'] = IPSText::stripAttachTag( $_data['html'] );
}
$rows[ $id ]['post'] = $_data['html'];
$rows[ $id ]['attachmentHtml'] = $_data['attachmentHtml'];
}
}
}
/* Go through and build HTML */
foreach( $rows as $id => $data )
{
/* Format content */
list( $html, $sub ) = $this->formatContent( $data );
$results[ $id ] = array( 'html' => $html, 'app' => $data['app'], 'type' => $data['type'], 'sub' => $sub );
}
return $results;
}
/**
* Formats the forum search result for display
*
* @param array $search_row Array of data
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
*/
public function formatContent( $data )
{
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
$onlyTitles = IPSSearchRegistry::get('display.onlyTitles');
$noPostPreview = IPSSearchRegistry::get('opt.noPostPreview');
/* Forum Breadcrum */
$data['_forum_trail'] = $this->registry->getClass( 'class_forums' )->forumsBreadcrumbNav( $data['forum_id'] );
/* Is it read? We don't support last_vote in search. */
$is_read = $this->registry->getClass( 'classItemMarking' )->isRead( array( 'forumID' => $data['forum_id'], 'itemID' => $data['tid'], 'itemLastUpdate' => $data['lastupdate'] ? $data['lastupdate'] : $data['updated'] ), 'forums' );
/* Has posted dot */
$show_dots = ( $this->settings['show_user_posted'] AND $this->memberData['member_id'] AND $data['_hasPosted'] ) ? 1 : 0;
/* Icon */
$data['_icon'] = $this->registry->getClass( 'class_forums' )->fetchTopicFolderIcon( $data, $show_dots, $is_read );
$data['_isRead'] = $is_read;
/* Display type */
return array( $this->registry->getClass( 'output' )->getTemplate( 'search' )->topicPostSearchResultAsForum( $data, ( $onlyTitles || $noPostPreview ) ? 1 : 0 ), 0 );
}
/**
* Formats / grabs extra data for results
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
*
* @return array
*/
public function processResults( $ids )
{
/* INIT */
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
$_post_joins = array();
$members = array();
$results = array();
$topicIds = array();
$dots = array();
$sortKey = '';
$sortType = '';
$_sdTids = array();
$_sdPids = array();
/* Set up some basic permissions */
$permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( 0 );
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
$permissions['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( 0 );
$permissions['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( 0 );
$permissions['PostSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeletePosts( 0 );
$permissions['TopicSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeleteTopics( 0 );
/* Got some? */
if ( count( $ids ) )
{
/* Cache? */
if ( IPSContentCache::isEnabled() )
{
if ( IPSContentCache::fetchSettingValue('post') )
{
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
}
if ( IPSContentCache::fetchSettingValue('sig') )
{
$_post_joins[] = IPSContentCache::join( 'sig' , 'p.author_id', 'ccb', 'left', 'ccb.cache_content as cache_content_sig, ccb.cache_updated as cache_updated_sig' );
}
}
/* Sorting */
switch( $sort_by )
{
default:
case 'date':
$sortKey = ( $content_title_only ) ? 'last_post' : 'post_date';
$sortType = 'numerical';
break;
case 'title':
$sortKey = 'title';
$sortType = 'string';
break;
case 'posts':
$sortKey = 'posts';
$sortType = 'numerical';
break;
case 'views':
$sortKey = 'views';
$sortType = 'numerical';
break;
}
/* Set vars */
IPSSearch::$ask = $sortKey;
IPSSearch::$aso = strtolower( $order_dir );
IPSSearch::$ast = $sortType;
/* If we are search in titles only, then the ID array will be TIDs */
if( $content_title_only )
{
$k = 'tid';
$this->DB->build( array(
'select' => "t.*",
'from' => array( 'topics' => 't' ),
'where' => 't.tid IN( ' . implode( ',', $ids ) . ')',
'add_join' => array_merge( array( array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=t.topic_firstpost',
'type' => 'left' ),
array( 'select' => 'm.member_id, m.members_display_name, m.members_seo_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left' ) ), $_post_joins ) ) );
}
/* Otherwise, it's PIDs */
else
{
$k = 'pid';
$this->DB->build( array(
'select' => "p.*",
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid IN( ' . implode( ',', $ids ) . ')',
'add_join' => array_merge( array( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'left' ),
array( 'select' => 'm.member_id, m.members_display_name, m.members_seo_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left' ) ), $_post_joins ) ) );
}
/* Grab data */
$this->DB->execute();
/* Grab the results */
while( $row = $this->DB->fetch() )
{
$_rows[ $row[ $k ] ] = $row;
}
/* Sort */
if ( count( $_rows ) )
{
usort( $_rows, array("IPSSearch", "usort") );
foreach( $_rows as $id => $row )
{
/* Prevent member from stepping on it */
$row['topic_title'] = $row['title'];
/* Got author but no member data? */
if ( ! empty( $row['author_id'] ) )
{
$members[ $row['author_id'] ] = $row['author_id'];
}
/* Topic ids? */
if ( ! empty( $row['topic_id'] ) )
{
$topicIds[ $row['topic_id'] ] = $row['topic_id'];
}
/* If we're using sphinx, check forum permissions again as the 15 minute delta rebuild could expose a moved topic before deltas rebuild.
We don't need to do this for SQL search as the results are delivered live and lets face it, we can do without the load */
if ( $this->settings['search_method'] != 'traditional' )
{
/* Can we read? */
if ( ! $this->registry->permissions->check( 'view', $this->registry->class_forums->forum_by_id[ $row['forum_id'] ] ) )
{
continue;
}
/* Can read, but is it password protected, etc? */
if ( ! $this->registry->class_forums->forumsCheckAccess( $row['forum_id'], 0, 'forum', array(), true ) )
{
continue;
}
}
$row['cleanSearchTerm'] = urlencode($search_term);
$row['topicPrefix'] = $row['pinned'] ? $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap( $this->settings['pre_pinned'] ) : '';
$row['_isVisible'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $row ) == 'visible' ) ? true : false;
$row['_isHidden'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $row ) == 'hidden' ) ? true : false;
$row['_isDeleted'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $row ) == 'sdelete' ) ? true : false;
$row['_p_isVisible'] = ( $this->registry->getClass('class_forums')->fetchHiddenType( $row ) == 'visible' ) ? true : false;
$row['_p_isHidden'] = ( $this->registry->getClass('class_forums')->fetchHiddenType( $row ) == 'hidden' ) ? true : false;
$row['_p_isDeleted'] = ( $this->registry->getClass('class_forums')->fetchHiddenType( $row ) == 'sdelete' ) ? true : false;
/* Hidden and we do not have permission? */
if ( $row['_isHidden'] AND ! $permissions['canQueue'] )
{
continue;
}
/* Is the topic deleted? If so, then the first post will appear as such */
if ( $row['_isDeleted'] AND $permissions['TopicSoftDeleteSee'] )
{
$row['_p_isDeleted'] = true;
$_sdPids[ $row['pid'] ] = $row['pid'];
}
/* Collect TIDS of soft deleted topics */
if ( $row['_isDeleted'] )
{
if ( $permissions['TopicSoftDeleteSee'] )
{
$_sdTids[ $row['tid'] ] = $row['tid'];
}
else
{
continue;
}
}
/* Collect TIDS of soft deleted topics */
if ( $row['_p_isDeleted'] )
{
if ( $permissions['PostSoftDeleteSee'] )
{
$_sdPids[ $row['pid'] ] = $row['pid'];
}
else
{
continue;
}
}
$results[ $row['pid'] ] = $this->genericizeResults( $row );
}
}
/* Need to load members? */
if ( count( $members ) )
{
$mems = IPSMember::load( $members, 'all' );
foreach( $results as $id => $r )
{
if ( ! empty( $r['author_id'] ) AND isset( $mems[ $r['author_id'] ] ) )
{
$mems[ $r['author_id'] ]['m_posts'] = $mems[ $r['author_id'] ]['posts'];
//unset( $mems[ $r['author_id'] ]['posts'] );
unset( $mems[ $r['author_id'] ]['last_post'] );
if ( isset( $r['cache_content_sig'] ) )
{
$mems[ $r['author_id'] ]['cache_content'] = $r['cache_content_sig'];
$mems[ $r['author_id'] ]['cache_updated'] = $r['cache_updated_sig'];
}
$_mem = IPSMember::buildDisplayData( $mems[ $r['author_id'] ], array( 'signature' => 1 ) );
unset( $_mem['cache_content'], $_mem['cache_updated'] );
$results[ $id ]['_realPosts'] = $results[ $id ]['posts'];
$results[ $id ] = array_merge( $results[ $id ], $_mem );
$results[ $id ]['posts'] = $results[ $id ]['_realPosts'];
}
}
}
/* Generate 'dot' folder icon */
if ( $this->settings['show_user_posted'] AND count( $topicIds ) )
{
$this->DB->build( array( 'select' => 'author_id, topic_id',
'from' => 'posts',
'where' => 'queued=0 AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topicIds ) . ')' ) );
$this->DB->execute();
while( $p = $this->DB->fetch() )
{
$dots[ $p['topic_id'] ] = 1;
}
/* Merge into results */
foreach( $results as $id => $r )
{
if ( isset( $dots[ $r['topic_id'] ] ) )
{
$results[ $id ]['_hasPosted'] = 1;
}
}
}
/* Got any deleted items */
if ( count( $_sdTids ) )
{
$sData = IPSDeleteLog::fetchEntries( $_sdTids, 'topic', false );
if ( count( $sData ) )
{
foreach( $results as $id => $data )
{
if ( isset( $_sdTids[ $data['tid'] ] ) )
{
$results[ $id ]['sData'] = $sData[ $data['tid'] ];
$results[ $id ]['permissions'] = $permissions;
}
}
}
}
/* Got any deleted items */
if ( count( $_sdPids ) )
{
$sData = IPSDeleteLog::fetchEntries( $_sdPids, 'post', false );
if ( count( $sData ) )
{
foreach( $results as $id => $data )
{
if ( isset( $_sdPids[ $data['pid'] ] ) AND ! isset( $results[ $id ]['sData']) )
{
$results[ $id ]['sData'] = $sData[ $data['pid'] ];
$results[ $id ]['permissions'] = $permissions;
}
}
}
}
}
return $results;
}
/**
* Reassigns fields in a generic way for results output
*
* @param array $r
* @return array
*/
public function genericizeResults( $r )
{
$r['app'] = 'forums';
$r['content'] = $r['post'];
$r['content_title'] = $r['title'];
$r['updated'] = $r['post_date'];
$r['lastupdate'] = $r['last_post'];
$r['type_2'] = 'topic';
$r['type_id_2'] = $r['tid'];
$r['misc'] = $r['pid'];
return $r;
}
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,399 +0,0 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Formats forum search results
* Last Updated: $Date: 2009-10-29 08:54:35 -0400 (Thu, 29 Oct 2009) $
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5290 $
**/
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 forumsSearchDisplay implements iSearchDisplay
{
/**
* Last topic id completed
*
* @access private
* @var integer Topic id
*/
private $last_topic = 0;
/**
* The search plugin for this app
*
* @access public
* @var object
*/
public $search_plugin;
/**
* Formats the forum search result for display
*
* @access public
* @param array $search_row Array of data from search_index
* @param bool $isVnc Is from view new content
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
**/
public function formatContent( $search_row, $isVnc=false )
{
/* Get class forums, used for displaying forum names on results */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
ipsRegistry::setClass( 'class_forums', new class_forums( ipsRegistry::instance() ) );
ipsRegistry::getClass( 'class_forums' )->forumsInit();
}
/* Array */
$search_row = $this->_buildOutputArray( $search_row );
/* Indent */
$indent = ( $this->last_topic == $search_row['type_id_2'] );
$this->last_topic = $search_row['type_id_2'];
/* Various data */
$search_row['_last_post'] = $search_row['last_post'];
$search_row['_longTitle'] = $search_row['content_title'];
$search_row['_shortTitle'] = IPSText::truncate( $search_row['content_title'], 60 );
$search_row['last_poster'] = $search_row['last_poster_id'] ? IPSLib::makeProfileLink( $search_row['last_poster_name'], $search_row['last_poster_id'], $search_row['seo_last_name'] ) : ipsRegistry::$settings['guest_name_pre'] . $search_row['last_poster_name'] . ipsRegistry::$settings['guest_name_suf'];
$search_row['starter'] = $search_row['starter_id'] ? IPSLib::makeProfileLink( $search_row['starter_name'], $search_row['starter_id'], $search_row['seo_first_name'] ) : $this->settings['guest_name_pre'] . $search_row['starter_name'] . $this->settings['guest_name_suf'];
//$search_row['posts'] = ipsRegistry::getClass('class_localization')->formatNumber( intval($search_row['posts']) );
//$search_row['views'] = ipsRegistry::getClass('class_localization')->formatNumber( intval($search_row['views']) );
$search_row['last_post'] = ipsRegistry::getClass( 'class_localization')->getDate( $search_row['last_post'], 'SHORT' );
if ( isset( $search_row['post_date'] ) )
{
$search_row['_post_date'] = $search_row['post_date'];
$search_row['post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $search_row['post_date'], 'SHORT' );
}
if ( $this->memberData['is_mod'] )
{
$search_row['posts'] += intval($search_row['topic_queuedposts']);
}
if ($search_row['posts'])
{
if ( (($search_row['posts'] + 1) % ipsRegistry::$settings['display_max_posts']) == 0 )
{
$pages = ($search_row['posts'] + 1) / ipsRegistry::$settings['display_max_posts'];
}
else
{
$number = ( ($search_row['posts'] + 1) / ipsRegistry::$settings['display_max_posts'] );
$pages = ceil( $number);
}
}
if ( $pages > 1 )
{
for ( $i = 0 ; $i < $pages ; ++$i )
{
$real_no = $i * ipsRegistry::$settings['display_max_posts'];
$page_no = $i + 1;
if ( $page_no == 4 and $pages > 4 )
{
$search_row['pages'][] = array( 'last' => 1,
'st' => ($pages - 1) * ipsRegistry::$settings['display_max_posts'],
'page' => $pages );
break;
}
else
{
$search_row['pages'][] = array( 'last' => 0,
'st' => $real_no,
'page' => $page_no );
}
}
}
/* Format as a topic */
if( $search_row['type_2'] == 'topic' )
{
/* Forum Breadcrum */
$search_row['_forum_trail'] = ipsRegistry::getClass( 'class_forums' )->forumsBreadcrumbNav( $search_row['forum_id'] );
/* Is it read? We don't support last_vote in search. */
$is_read = ipsRegistry::getClass( 'classItemMarking' )->isRead( array( 'forumID' => $search_row['forum_id'], 'itemID' => $search_row['type_id_2'], 'itemLastUpdate' => $search_row['lastupdate'] ? $search_row['lastupdate'] : $search_row['updated'] ), 'forums' );
/* Has posted dot */
$show_dots = '';
if( ipsRegistry::$settings['show_user_posted'] )
{
if( ipsRegistry::member()->getProperty('member_id') && ( isset( $search_row['_topic_array'][$search_row['type_id_2']] ) && $search_row['_topic_array'][$search_row['type_id_2']] ) )
{
$show_dots = 1;
}
}
/* Icon */
$search_row['_icon'] = ipsRegistry::getClass( 'class_forums' )->fetchTopicFolderIcon( $search_row, $show_dots, $is_read );
$search_row['_isRead'] = $is_read;
/* Display type */
if ( $this->search_plugin->getShowAsForum() !== true )
{
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->topicPostSearchResult( $search_row, $indent, ( $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ) ? 1 : 0 ), $indent );
}
else
{
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->topicPostSearchResultAsForum( $search_row, $indent, ( $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ) ? 1 : 0 ), $indent );
}
}
/* Format as a forum */
else
{
return ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->forumSearchResult( $search_row, ( $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ) ? 1 : 0 );
}
}
/**
* Internal function, used to sort out the pid and title
*
* @access private
* @param array $r Array of data
* @return array Formatted data, ready for output
**/
private function _buildOutputArray( $r )
{
if( $r['misc'] )
{
$_data = unserialize( $r['misc'] );
$r['misc'] = isset( $_data['pid'] ) && $_data['pid'] ? $_data['pid'] : $r['misc'];
$r['content_title'] = isset( $_data['title'] ) && $_data['title'] ? $_data['title'] : $r['content_title'];
}
return $r;
}
/**
* Retuns the html for displaying the forum category filter on the advanced search page
*
* @access public
* @return string Filter HTML
**/
public function getFilterHTML()
{
/* Make sure class_forums is setup */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
ipsRegistry::setClass( 'class_forums', new class_forums( ipsRegistry::instance() ) );
ipsRegistry::getClass( 'class_forums' )->strip_invisible = 1;
ipsRegistry::getClass( 'class_forums' )->forumsInit();
}
return ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->forumAdvancedSearchFilters( ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1 ) );
}
/**
* Returns an array used in the searchplugin's setCondition method
*
* @access public
* @param array $data Array of forums to view
* @return array Array with column, operator, and value keys, for use in the setCondition call
**/
public function buildFilterSQL( $data )
{
$return = array();
if( isset( $data ) && is_array( $data ) && count( $data ) )
{
/* Load class_forums so that we can search sub forums automatically */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/forums/class_forums.php' );
ipsRegistry::setClass( 'class_forums', new class_forums( ipsRegistry::instance() ) );
ipsRegistry::getClass( 'class_forums' )->forumsInit();
}
foreach( $data as $field => $_data )
{
/* FORUMS */
if ( $field == 'forums' && count( $data['forums'] ) )
{
/* Get a list of child ids */
foreach( $data['forums'] as $forum_id )
{
$children = ipsRegistry::getClass( 'class_forums' )->forumsGetChildren( $forum_id );
foreach( $children as $kid )
{
if( ! in_array( $kid, $data['forums'] ) )
{
$data['forums'][] = $kid;
}
}
}
# Handled in searchPlugin::buildWhereStatement
//$return[] = array( 'column' => 'type_id', 'operator' => 'IN', 'value' => implode( ',', $data['forums'] ) );
}
/* CONTENT ONLY */
if ( $field == 'noPreview' AND $data['noPreview'] == 1 )
{
$this->search_plugin->noPostPreview = true;
}
/* CONTENT ONLY */
if ( $field == 'contentOnly' AND $data['contentOnly'] == 1 )
{
$this->search_plugin->onlyPosts = true;
}
/* POST COUNT */
if ( $field == 'pCount' AND intval( $data['pCount'] ) > 0 )
{
$return[] = array( 'column' => 't.posts', 'operator' => '>=', 'value' => intval( $data['pCount'] ) );
}
/* TOPIC VIEWS */
if ( $field == 'pViews' AND intval( $data['pViews'] ) > 0 )
{
$return[] = array( 'column' => 't.views', 'operator' => '>=', 'value' => intval( $data['pViews'] ) );
}
}
return $return;
}
else
{
return '';
}
}
/**
* Modify the search query
*
* @access public
* @param array $query The current unmodified query
* @param bool [$count_only] Set to true if this is a count(*) query
* @return array Search query, modified by the plugin
**/
public function modifySearchQuery( $query, $count_only=false )
{
if( ipsRegistry::$settings['search_method'] == 'sphinx' )
{
$query->SetFilter( 'approved', array( 1 ) );
$query->SetFilter( 'queued' , array( 0 ) );
$query->SetFilter( 'password', array( 0 ) );
if( isset( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) && is_array( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) && count( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
{
/* Load class_forums so that we can search sub forums automatically */
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/forums/class_forums.php' );
ipsRegistry::setClass( 'class_forums', new class_forums( ipsRegistry::instance() ) );
ipsRegistry::getClass( 'class_forums' )->forumsInit();
}
$forum_ids = array();
/* Get a list of child ids */
foreach( ipsRegistry::$request['search_app_filters']['forums']['forums'] as $forum_id )
{
if( $forum_id )
{
$forum_ids[] = intval($forum_id);
//$children = ipsRegistry::getClass( 'class_forums' )->forumsGetChildren( $forum_id );
//foreach( $children as $kid )
//{
// if( ! in_array( $kid, ipsRegistry::$request['search_app_filters']['forums'] ) )
// {
// $forum_ids[] = $kid;
// }
//}
}
}
if( is_array($forum_ids) AND count($forum_ids) )
{
$query->SetFilter( 'forum_id', $forum_ids );
}
}
/* Limit by forum */
$type = ipsRegistry::$request['type'];
$type_id = intval( ipsRegistry::$request['type_id'] );
if( $type && $type_id )
{
$query->SetFilter( 'forum_id', array( $type_id ) );
}
/* Limit by topic */
$type_2 = ipsRegistry::$request['type_2'];
$type_id_2 = intval( ipsRegistry::$request['type_id_2'] );
if( $type_2 && $type_id_2 )
{
$query->SetFilter( 'tid', array( $type_id_2 ) );
}
}
else
{
return $query;
}
}
/**
* Run the search query.
* This allows us to set different indexes
*
* @access public
* @param object $sphinxClient The sphinx client reference
* @param string $search_term The search term
* @param bool $group_results Group posts by topic
* @return array Sphinx result array
**/
public function runSearchQuery( $sphinxClient, $search_term='', $group_results=false )
{
if( ipsRegistry::$settings['search_method'] == 'sphinx' )
{
if( ipsRegistry::$request['content_title_only'] == 1 )
{
return $sphinxClient->Query( $search_term, 'forums_search_topics_main,forums_search_topics_delta' );
}
else
{
if( $group_results )
{
$sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, '@group DESC');
}
if( ipsRegistry::$request['f_content_only'] )
{
return $sphinxClient->Query( $search_term, 'forums_search_posts_main,forums_search_posts_delta' );
}
else
{
return $sphinxClient->Query( $search_term, 'forums_search_posts_main,forums_search_topics_main,forums_search_posts_delta,forums_search_topics_delta' );
}
}
}
else
{
return array();
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1,171 +1,104 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Sphinx template file
* Last Updated: $Date: 2009-08-12 18:07:52 -0400 (Wed, 12 Aug 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5013 $
* @since 3.0.0
*
*/
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();
}
$appSphinxTemplate = <<<EOF
################################# --- FORUM --- ##############################
source forums_search_posts_main : ipb_source_config
{
# Set our forum PID counter
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_posts', (SELECT max(pid) FROM <!--SPHINX_DB_PREFIX-->posts), '', 0, UNIX_TIMESTAMP() )
# Query posts for the main source
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
t.tid, t.forum_id, t.approved, \
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
CASE WHEN pi.authorized_users IS NULL OR pi.authorized_users='' THEN 0 ELSE pi.authorized_users END AS authorized_users, \
CASE WHEN pi.friend_only=0 THEN 0 ELSE p.author_id END AS friend_only, \
CASE WHEN pi.owner_only=0 THEN 0 ELSE p.author_id END AS owner_only, \
CASE WHEN f.password <> '' THEN 1 ELSE 0 END AS password \
FROM <!--SPHINX_DB_PREFIX-->posts p \
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->forums f ON ( t.forum_id=f.id ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=t.forum_id AND pi.perm_type='forum' )
# Fields
sql_attr_bool = queued
sql_attr_bool = approved
sql_attr_uint = search_id
sql_attr_uint = friend_only
sql_attr_uint = forum_id
sql_attr_uint = owner_only
sql_attr_timestamp = post_date
sql_attr_multi = uint perm_view from field
sql_attr_multi = uint authorized_users from field
sql_attr_bool = password
sql_attr_uint = author_id
sql_attr_uint = tid
sql_ranged_throttle = 0
}
source forums_search_topics_main : ipb_source_config
{
# Set our forum PID counter
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_topics', (SELECT max(tid) FROM <!--SPHINX_DB_PREFIX-->topics), '', 0, UNIX_TIMESTAMP() )
# Query posts for the main source
sql_query = SELECT t.tid, t.tid as search_id, t.forum_id, t.approved, t.title, t.last_post, t.last_poster_id as author_id, \
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
CASE WHEN pi.authorized_users IS NULL OR pi.authorized_users='' THEN 0 ELSE pi.authorized_users END AS authorized_users, \
CASE WHEN pi.friend_only=0 THEN 0 ELSE t.last_poster_id END AS friend_only, \
CASE WHEN pi.owner_only=0 THEN 0 ELSE t.last_poster_id END AS owner_only, \
CASE WHEN f.password <> '' THEN 1 ELSE 0 END AS password \
FROM <!--SPHINX_DB_PREFIX-->topics t \
LEFT JOIN <!--SPHINX_DB_PREFIX-->forums f ON ( t.forum_id=f.id ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=t.forum_id AND pi.perm_type='forum' )
# Fields
sql_attr_bool = approved
sql_attr_uint = search_id
sql_attr_uint = friend_only
sql_attr_uint = forum_id
sql_attr_uint = owner_only
sql_attr_timestamp = last_post
sql_attr_multi = uint perm_view from field
sql_attr_multi = uint authorized_users from field
sql_attr_bool = password
sql_attr_uint = author_id
sql_ranged_throttle = 0
}
source forums_search_posts_delta : forums_search_posts_main
{
# Override the base sql_query_pre
sql_query_pre =
# Query posts for the delta source
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
t.tid, t.forum_id, t.approved, t.title, \
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
CASE WHEN pi.authorized_users IS NULL OR pi.authorized_users='' THEN 0 ELSE pi.authorized_users END AS authorized_users, \
CASE WHEN pi.friend_only=0 THEN 0 ELSE p.author_id END AS friend_only, \
CASE WHEN pi.owner_only=0 THEN 0 ELSE p.author_id END AS owner_only, \
CASE WHEN f.password <> '' THEN 1 ELSE 0 END AS password \
FROM <!--SPHINX_DB_PREFIX-->posts p \
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->forums f ON ( t.forum_id=f.id ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=t.forum_id AND pi.perm_type='forum' ) \
WHERE p.pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
}
source forums_search_topics_delta : forums_search_topics_main
{
# Override the base sql_query_pre
sql_query_pre =
# Query posts for the delta source
sql_query = SELECT t.tid, t.tid as search_id, t.forum_id, t.approved, t.title, t.last_post, t.last_poster_id as author_id, \
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
CASE WHEN pi.authorized_users IS NULL OR pi.authorized_users='' THEN 0 ELSE pi.authorized_users END AS authorized_users, \
CASE WHEN pi.friend_only=0 THEN 0 ELSE t.last_poster_id END AS friend_only, \
CASE WHEN pi.owner_only=0 THEN 0 ELSE t.last_poster_id END AS owner_only, \
CASE WHEN f.password <> '' THEN 1 ELSE 0 END AS password \
FROM <!--SPHINX_DB_PREFIX-->topics t \
LEFT JOIN <!--SPHINX_DB_PREFIX-->forums f ON ( t.forum_id=f.id ) \
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=t.forum_id AND pi.perm_type='forum' ) \
WHERE t.tid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_topics' )
}
index forums_search_posts_main
{
source = forums_search_posts_main
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_main
docinfo = extern
mlock = 0
morphology = none
min_word_len = 2
charset_type = sbcs
html_strip = 0
}
index forums_search_posts_delta : forums_search_posts_main
{
source = forums_search_posts_delta
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_delta
}
index forums_search_topics_main
{
source = forums_search_topics_main
path = <!--SPHINX_BASE_PATH-->/forums_search_topics_main
docinfo = extern
mlock = 0
morphology = none
min_word_len = 2
charset_type = sbcs
html_strip = 0
}
index forums_search_topics_delta : forums_search_topics_main
{
source = forums_search_topics_delta
path = <!--SPHINX_BASE_PATH-->/forums_search_topics_delta
}
EOF;
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Sphinx template file
* Last Updated: $Date: 2010-10-28 12:07:41 -0400 (Thu, 28 Oct 2010) $
* </pre>
*
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 7063 $
* @since 3.0.0
*
*/
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();
}
$appSphinxTemplate = <<<EOF
################################# --- FORUM --- ##############################
source forums_search_posts_main : ipb_source_config
{
# Set our forum PID counter
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_posts', (SELECT max(pid) FROM <!--SPHINX_DB_PREFIX-->posts), '', 0, UNIX_TIMESTAMP() )
# Query posts for the main source
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
t.tid, t.title, t.title as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
CONCAT(t.last_post, '.', t.tid ) as last_post_group \
FROM <!--SPHINX_DB_PREFIX-->posts p \
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid )
# Fields
sql_attr_uint = queued
sql_attr_uint = approved
sql_attr_uint = soft_deleted
sql_attr_uint = search_id
sql_attr_uint = forum_id
sql_attr_timestamp = post_date
sql_attr_timestamp = last_post
sql_attr_timestamp = start_date
sql_attr_uint = author_id
sql_attr_uint = starter_id
sql_attr_uint = tid
sql_attr_uint = posts
sql_attr_uint = views
sql_attr_str2ordinal = tordinal
sql_attr_str2ordinal = last_post_group
sql_ranged_throttle = 0
}
source forums_search_posts_delta : forums_search_posts_main
{
# Override the base sql_query_pre
sql_query_pre =
# Query posts for the delta source
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
t.tid, t.title, t.title as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
CONCAT(t.last_post, '.', t.tid ) as last_post_group \
FROM <!--SPHINX_DB_PREFIX-->posts p \
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid ) \
WHERE p.pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
}
index forums_search_posts_main
{
source = forums_search_posts_main
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_main
docinfo = extern
mlock = 0
morphology = none
min_word_len = 2
charset_type = sbcs
html_strip = 0
#infix_fields = post, title
#min_infix_len = 3
#enable_star = 1
}
index forums_search_posts_delta : forums_search_posts_main
{
source = forums_search_posts_delta
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_delta
}
EOF;
File diff suppressed because it is too large. Load diff
+10 -1
View File
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,73 +1,73 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.forums.js - Forum javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPForums = {
showModForm: 0,
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.forums.js");
document.observe("dom:loaded", function(){
if( $('modUserName') )
{
ACPForums.autoComplete = new ipb.Autocomplete( $('modUserName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
}
});
},
toggleModOptions: function()
{
$$('.moddiv').each( function(div){
if( ACPForums.showModForm )
{
div.hide();
}
else
{
div.show();
}
});
$( 'togglemod' ).innerHTML = ACPForums.showModForm ? ipb.lang['forums_showmod'] : ipb.lang['forums_hidemod'];
ACPForums.showModForm = ACPForums.showModForm == 1 ? 0 : 1;
return false;
},
submitModForm: function()
{
var submitValue = '';
$$('input').each( function(cb){
if( cb.type == 'checkbox' && cb.checked == true )
{
var mainname = cb.id.replace( /^(.+?)_.+?$/ , "$1" );
var idname = cb.id.replace( /^(.+?)_(.+?)$/, "$2" );
if ( mainname == 'id' )
{
submitValue += ',' + idname;
}
}
});
$('modforumids').value = submitValue;
return true;
},
convert: function()
{
$('convert').value = 1;
$('adminform').submit();
}
};
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.forums.js - Forum javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPForums = {
showModForm: 0,
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.forums.js");
document.observe("dom:loaded", function(){
if( $('modUserName') )
{
ACPForums.autoComplete = new ipb.Autocomplete( $('modUserName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
}
});
},
toggleModOptions: function()
{
$$('.moddiv').each( function(div){
if( ACPForums.showModForm )
{
div.hide();
}
else
{
div.show();
}
});
$( 'togglemod' ).innerHTML = ACPForums.showModForm ? ipb.lang['forums_showmod'] : ipb.lang['forums_hidemod'];
ACPForums.showModForm = ACPForums.showModForm == 1 ? 0 : 1;
return false;
},
submitModForm: function()
{
var submitValue = '';
$$('input').each( function(cb){
if( cb.type == 'checkbox' && cb.checked == true )
{
var mainname = cb.id.replace( /^(.+?)_.+?$/ , "$1" );
var idname = cb.id.replace( /^(.+?)_(.+?)$/, "$2" );
if ( mainname == 'id' )
{
submitValue += ',' + idname;
}
}
});
$('modforumids').value = submitValue;
return true;
},
convert: function()
{
$('convert').value = 1;
$('adminform').submit();
}
};
ACPForums.init();
+49 -49
View File
@@ -1,50 +1,50 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.rss.js - RSS Form javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPRss = {
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.rss.js");
document.observe("dom:loaded", function(){
if( $('rss_import_mid') )
{
ACPRss.autoComplete = new ipb.Autocomplete( $('rss_import_mid'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
}
});
},
showAuthBoxes: function()
{
var auth_req = $('rss_import_auth_userinfo');
if( !auth_req.visible() )
{
auth_req.show();
}
else
{
auth_req.hide();
}
},
validate: function()
{
formobj = $('rssimport_validate');
formobj.value = "1";
$('rssimport_form').submit();
}
};
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.rss.js - RSS Form javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPRss = {
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.rss.js");
document.observe("dom:loaded", function(){
if( $('rss_import_mid') )
{
ACPRss.autoComplete = new ipb.Autocomplete( $('rss_import_mid'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
}
});
},
showAuthBoxes: function()
{
var auth_req = $('rss_import_auth_userinfo');
if( !auth_req.visible() )
{
auth_req.show();
}
else
{
auth_req.hide();
}
},
validate: function()
{
formobj = $('rssimport_validate');
formobj.value = "1";
$('rssimport_form').submit();
}
};
ACPRss.init();
+10 -1
View File
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,220 +1,222 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Member property updater (AJAX)
* Last Updated: $Date: 2009-08-18 16:46:02 -0400 (Tue, 18 Aug 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 1st march 2002
* @version $Revision: 5027 $
*
*/
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 admin_forums_ajax_member_editform extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ) );
switch( $this->request['do'] )
{
case 'remove_avatar':
$this->_removeAvatar();
break;
case 'get_avatar_images':
$this->_getAvatarImages();
break;
case 'show':
default:
$this->show();
break;
}
}
/**
* Get avatar images in a directory
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _getAvatarImages()
{
$dir = IPSText::alphanumericalClean( urldecode( $this->request['cat'] ), ' ' );
$images = IPSMember::getFunction()->getHostedAvatarsFromCategory( $dir );
IPSDebug::fireBug( 'info', array( 'Directory: ' . $dir ) );
if ( $images === FALSE )
{
$this->returnJsonError($this->lang->words['m_nodir']);
exit();
}
else
{
$output = $this->html->inline_avatar_images( $images );
$this->returnJsonArray( array('html' => $output) );
}
}
/**
* Remove user's avatar
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _removeAvatar()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
try
{
IPSMember::getFunction()->removeAvatar( $member_id );
$_string = <<<EOF
{
'success' : true,
}
EOF;
$this->returnString( $_string );
}
catch( Exception $error )
{
switch ( $error->getMessage() )
{
case 'NO_MEMBER_ID':
$this->registry->output->showError( $this->lang->words['t_noid'], 1130 );
break;
case 'NO_PERMISSION':
$this->registry->output->showError( $this->lang->words['t_permav'], 2130, true );
break;
}
}
}
/**
* Show the form
*
* @access protected
* @return void [Outputs to screen]
*/
protected function show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
$member_id = intval( ipsRegistry::$request['member_id'] );
$output = '';
//-----------------------------------------
// Get member data
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['t_noid'] );
}
//-----------------------------------------
// Return the form
//-----------------------------------------
if ( method_exists( $this->html, $name ) )
{
$output = $this->html->$name( $member );
}
else
{
$save_to = '';
$div_id = '';
$form_field = '';
$text = '';
$description = '';
$method = '';
switch( $name )
{
/*case 'inline_warn_level':
$method = 'inline_form_generic';
$save_to = 'save_generic&amp;field=warn_level';
$div_id = 'warn_level';
$form_field = ipsRegistry::getClass('output')->formInput( "generic__field", $member['warn_level'] );
$text = "Member Warn Level";
$description = "Make adjustments to the member's overall warn level. This does NOT add a warn log record - you should do so manually using the 'Add New Note' link if you wish to store a log of this adjustment";
break;*/
case 'inline_avatar':
if( !$this->registry->getClass('class_permissions')->checkPermission( 'member_photo', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_nopermban']);
}
$form = array();
$form['avatar_url'] = ipsRegistry::getClass('output')->formInput( "avatar_url", $member['avatar_type'] == 'url' ? $member['avatar_location'] : '' );
$av_categories = array_merge( array( 0 => array( 0, $this->lang->words['m_selectcat'] ) ), IPSMember::getFunction()->getHostedAvatarCategories() );
$output = $this->html->inline_avatar_selector( $member, $av_categories );
break;
}
if ( ! $output AND $method AND method_exists( $html, $method ) )
{
$output = $html->$method( $member, $save_to, $div_id, $form_field, $text, $description );
}
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->returnHtml( $output );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Member property updater (AJAX)
* Last Updated: $Date: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 6915 $
*
*/
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 admin_forums_ajax_member_editform extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums', 'admin_member_form' ) );
switch( $this->request['do'] )
{
case 'remove_avatar':
$this->_removeAvatar();
break;
case 'get_avatar_images':
$this->_getAvatarImages();
break;
case 'show':
default:
$this->show();
break;
}
}
/**
* Get avatar images in a directory
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _getAvatarImages()
{
$dir = IPSText::alphanumericalClean( urldecode( $this->request['cat'] ), ' ' );
$images = IPSMember::getFunction()->getHostedAvatarsFromCategory( $dir );
IPSDebug::fireBug( 'info', array( 'Directory: ' . $dir ) );
if ( $images === FALSE )
{
$this->returnJsonError($this->lang->words['m_nodir']);
exit();
}
else
{
$output = $this->html->inline_avatar_images( $images );
$this->returnJsonArray( array('html' => $output) );
}
}
/**
* Remove user's avatar
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _removeAvatar()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
try
{
IPSMember::getFunction()->removeAvatar( $member_id );
$_string = <<<EOF
{
'success' : true,
}
EOF;
$this->returnString( $_string );
}
catch( Exception $error )
{
switch ( $error->getMessage() )
{
case 'NO_MEMBER_ID':
$this->registry->output->showError( $this->lang->words['t_noid'], 1130 );
break;
case 'NO_PERMISSION':
$this->registry->output->showError( $this->lang->words['t_permav'], 2130, true );
break;
}
}
}
/**
* Show the form
*
* @access protected
* @return void [Outputs to screen]
*/
protected function show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
$member_id = intval( ipsRegistry::$request['member_id'] );
$output = '';
//-----------------------------------------
// Get member data
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['t_noid'] );
}
//-----------------------------------------
// Return the form
//-----------------------------------------
if ( method_exists( $this->html, $name ) )
{
$output = $this->html->$name( $member );
}
else
{
$save_to = '';
$div_id = '';
$form_field = '';
$text = '';
$description = '';
$method = '';
switch( $name )
{
/*case 'inline_warn_level':
$method = 'inline_form_generic';
$save_to = 'save_generic&amp;field=warn_level';
$div_id = 'warn_level';
$form_field = ipsRegistry::getClass('output')->formInput( "generic__field", $member['warn_level'] );
$text = "Member Warn Level";
$description = "Make adjustments to the member's overall warn level. This does NOT add a warn log record - you should do so manually using the 'Add New Note' link if you wish to store a log of this adjustment";
break;*/
case 'inline_avatar':
if( !$this->registry->getClass('class_permissions')->checkPermission( 'member_photo', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_nopermban']);
}
$form = array();
$form['avatar_url'] = ipsRegistry::getClass('output')->formInput( "avatar_url", $member['avatar_type'] == 'url' ? $member['avatar_location'] : '' );
$av_categories = array_merge( array( 0 => array( 0, $this->lang->words['m_selectcat'] ) ), IPSMember::getFunction()->getHostedAvatarCategories() );
$output = $this->html->inline_avatar_selector( $member, $av_categories );
break;
}
if ( ! $output AND $method AND method_exists( $this->html, $method ) )
{
$output = $this->html->$method( $member, $save_to, $div_id, $form_field, $text, $description );
}
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->returnHtml( $output );
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section for attachments module
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,359 +1,362 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Attachments: Search
* Last Updated: $LastChangedDate: 2009-06-24 23:14:22 -0400 (Wed, 24 Jun 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 4818 $
*/
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_forums_attachments_search extends ipsCommand
{
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
private $html;
/**
* Shortcut for url
*
* @access private
* @var string URL shortcut
*/
private $form_code;
/**
* Shortcut for url (javascript)
*
* @access private
* @var string JS URL shortcut
*/
private $form_code_js;
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load HTML and language bits
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=attachments&amp;section=search';
$this->form_code_js = $this->html->form_code_js = 'module=attachments&section=search';
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'attach_search_complete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchResults();
break;
case 'attach_bulk_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
$this->_bulkRemoveAttachments();
break;
case 'overview':
case 'search':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchForm();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Bulk remove attachments
*
* @access private
* @return void [Outputs to screen]
*/
private function _bulkRemoveAttachments()
{
foreach ( $_POST as $key => $value )
{
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
{
if ( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
$attach_tid = array();
if ( count( $ids ) )
{
//-----------------------------------------
// Get attach details?
//-----------------------------------------
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
'add_join' => array(
array(
'select' => 'p.pid, p.topic_id',
'from' => array( 'posts' => 'p' ),
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $killmeh = $this->DB->fetch() )
{
if ( $killmeh['attach_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
}
if ( $killmeh['attach_thumb_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
}
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
}
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
//-----------------------------------------
// Recount topic upload marker
//-----------------------------------------
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );
$postlib = new classPost( $this->registry );
foreach( $attach_tid as $tid )
{
if( $tid )
{
$postlib->recountTopicAttachments( $tid );
}
}
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
}
else
{
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
}
if ( $this->request['return'] == 'stats' )
{
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments&section=stats' );
}
else
{
if ( $_POST['url'] )
{
foreach( explode( '&', $_POST['url'] ) as $u )
{
list ( $k, $v ) = explode( '=', $u );
$this->request[ $k] = $v ;
}
}
$this->_searchResults();
}
}
/**
* Attachment search results
*
* @access private
* @return void [Outputs to screen]
*/
private function _searchResults()
{
$show = intval($this->request['show']);
$show = $show > 100 ? 100 : $show;
//-----------------------------------------
// Build URL
//-----------------------------------------
$url = "";
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
foreach( $url_components as $u )
{
$url .= $u . '=' . $this->request[ $u ] . '&';
}
//-----------------------------------------
// Build Query
//-----------------------------------------
$queryfinal = "";
$query = array();
if ( $this->request['extension'] )
{
$query[] = 'a.attach_ext="' . mb_strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
}
if ( $this->request['filesize'] )
{
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
}
if ( $this->request['days'] )
{
$day_break = time() - intval( $this->request['days'] * 86400 );
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
$query[] = "a.attach_date {$gt} {$day_break}";
}
if ( $this->request['hits'] )
{
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
}
if ( $this->request['filename'] )
{
$query[] = 'LOWER(a.attach_file) LIKE "%' . mb_strtolower( $this->request['filename'] ) . '%"';
}
if ( $this->request['authorname'] )
{
$query[] = 'LOWER(p.author_name) LIKE "%' . mb_strtolower( $this->request['authorname'] ) . '%"';
}
if ( $this->request['onlyimage'] )
{
$query[] = 'a.attach_is_image=1';
}
if ( count($query) )
{
$queryfinal = 'AND '. implode( " AND ", $query );
}
$rows = array();
$this->DB->build( array( 'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'".$queryfinal,
'add_join' => array(
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left' ),
1 => array( 'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left' ),
2 => array( 'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left' )
),
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
'limit' => array( 0, $show ) ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
$rows[] = $r;
}
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
}
/**
* Show attachment search form
*
* @access private
* @return void [Outputs to screen]
*/
private function _searchForm()
{
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
//-----------------------------------------
// FORM
//-----------------------------------------
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
2 => array( 'filesize', $this->lang->words['se_osize'] ),
3 => array( 'file' , $this->lang->words['se_oname'] ),
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
), isset($_POST['sort']) ? $_POST['sort'] : '' );
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Attachments: Search
* Last Updated: $LastChangedDate: 2010-10-01 20:18:21 -0400 (Fri, 01 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 6937 $
*/
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_forums_attachments_search extends ipsCommand
{
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
private $html;
/**
* Shortcut for url
*
* @access private
* @var string URL shortcut
*/
private $form_code;
/**
* Shortcut for url (javascript)
*
* @access private
* @var string JS URL shortcut
*/
private $form_code_js;
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load HTML and language bits
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=attachments&amp;section=search';
$this->form_code_js = $this->html->form_code_js = 'module=attachments&section=search';
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'attach_search_complete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchResults();
break;
case 'attach_bulk_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
$this->_bulkRemoveAttachments();
break;
case 'overview':
case 'search':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchForm();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Bulk remove attachments
*
* @access private
* @return void [Outputs to screen]
*/
private function _bulkRemoveAttachments()
{
foreach ( $_POST as $key => $value )
{
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
{
if ( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
$attach_tid = array();
if ( count( $ids ) )
{
//-----------------------------------------
// Get attach details?
//-----------------------------------------
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
'add_join' => array(
array(
'select' => 'p.pid, p.topic_id',
'from' => array( 'posts' => 'p' ),
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $killmeh = $this->DB->fetch() )
{
if ( $killmeh['attach_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
}
if ( $killmeh['attach_thumb_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
}
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
}
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
//-----------------------------------------
// Recount topic upload marker
//-----------------------------------------
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
$postlib = new $classToLoad( $this->registry );
foreach( $attach_tid as $tid )
{
if( $tid )
{
$postlib->recountTopicAttachments( $tid );
}
}
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
}
else
{
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
}
if ( $this->request['return'] == 'stats' )
{
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments&section=stats' );
}
else
{
if ( $_POST['url'] )
{
foreach( explode( '&', $_POST['url'] ) as $u )
{
list ( $k, $v ) = explode( '=', $u );
$this->request[ $k] = $v ;
}
}
$this->_searchResults();
}
}
/**
* Attachment search results
*
* @access private
* @return void [Outputs to screen]
*/
private function _searchResults()
{
$show = intval($this->request['show']);
$show = $show > 100 ? 100 : $show;
//-----------------------------------------
// Build URL
//-----------------------------------------
$url = "";
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
foreach( $url_components as $u )
{
$url .= $u . '=' . $this->request[ $u ] . '&';
}
//-----------------------------------------
// Build Query
//-----------------------------------------
$queryfinal = "";
$query = array();
if ( $this->request['extension'] )
{
$query[] = 'a.attach_ext="' . mb_strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
}
if ( $this->request['filesize'] )
{
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
}
if ( $this->request['days'] )
{
$day_break = time() - intval( $this->request['days'] * 86400 );
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
$query[] = "a.attach_date {$gt} {$day_break}";
}
if ( $this->request['hits'] )
{
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
}
if ( $this->request['filename'] )
{
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . mb_strtolower( $this->request['filename'] ) . '%"';
}
if ( $this->request['authorname'] )
{
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . mb_strtolower( $this->request['authorname'] ) . '%"';
}
if ( $this->request['onlyimage'] )
{
$query[] = 'a.attach_is_image=1';
}
if ( count($query) )
{
$queryfinal = 'AND '. implode( " AND ", $query );
}
$rows = array();
$this->DB->build( array( 'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'".$queryfinal,
'add_join' => array(
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left' ),
1 => array( 'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left' ),
2 => array( 'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left' )
),
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
'limit' => array( 0, $show ) ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
$rows[] = $r;
}
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
}
/**
* Show attachment search form
*
* @access private
* @return void [Outputs to screen]
*/
private function _searchForm()
{
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
//-----------------------------------------
// FORM
//-----------------------------------------
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
2 => array( 'filesize', $this->lang->words['se_osize'] ),
3 => array( 'file' , $this->lang->words['se_oname'] ),
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
), isset($_POST['sort']) ? $_POST['sort'] : '' );
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
}
}
@@ -1,245 +1,247 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Attachments: Stats
* Last Updated: $LastChangedDate: 2009-11-09 08:04:23 -0500 (Mon, 09 Nov 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 5335 $
*/
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_forums_attachments_stats extends ipsCommand
{
/**
* Image directory
*
* @access private
* @var string
*/
private $image_dir = '';
/**
* HTML object
*
* @access private
* @var object
*/
private $html;
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->html->form_code = 'module=attachments&amp;section=stats&amp;';
$this->html->form_code_js = 'module=attachments&amp;section=stats&amp;';
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
/* Image Set */
$this->image_dir = $this->registry->output->skin['set_image_dir'];
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'overview':
case 'stats':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
$this->attachmentStatsOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Shows attachment statistics
*
* @access public
* @return void
**/
public function attachmentStatsOverview()
{
/* Get attachment Types */
$cache['attachtypes'] = array();
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
}
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
/* Overall Stats */
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
/* Last 5 Attachments */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_date DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$last_5 = array();
while ( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$last_5[] = $r;
}
/* Largest 5 Attachments */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_filesize DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$largest_5 = array();
while( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$largest_5[] = $r;
}
/* 5 Most Viewed Downloads */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_hits DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$most_viewed_5 = array();
while( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$most_viewed_5[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Attachments: Stats
* Last Updated: $LastChangedDate: 2010-02-18 20:29:54 -0500 (Thu, 18 Feb 2010) $
* </pre>
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 5855 $
*/
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_forums_attachments_stats extends ipsCommand
{
/**
* Image directory
*
* @access private
* @var string
*/
private $image_dir = '';
/**
* HTML object
*
* @access private
* @var object
*/
private $html;
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->html->form_code = 'module=attachments&amp;section=stats&amp;';
$this->html->form_code_js = 'module=attachments&amp;section=stats&amp;';
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
/* Image Set */
$this->image_dir = $this->registry->output->skin['set_image_dir'];
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'overview':
case 'stats':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
$this->attachmentStatsOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Shows attachment statistics
*
* @access public
* @return void
**/
public function attachmentStatsOverview()
{
/* Get attachment Types */
$cache['attachtypes'] = array();
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
}
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
/* Overall Stats */
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
/* Last 5 Attachments */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_date DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$last_5 = array();
while ( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$last_5[] = $r;
}
/* Largest 5 Attachments */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_filesize DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$largest_5 = array();
while( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$largest_5[] = $r;
}
/* 5 Most Viewed Downloads */
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'",
'order' => "a.attach_hits DESC",
'limit' => array( 0, 5 ),
'add_join' => array(
array(
'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left'
),
array(
'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left'
),
array(
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left'
)
)
) );
$this->DB->execute();
/* Loop through the last 5 */
$most_viewed_5 = array();
while( $r = $this->DB->fetch() )
{
/* Format Fields */
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
/* Add to output array */
$most_viewed_5[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Attachments: Manage
* Last Updated: $LastChangedDate: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
* Last Updated: $LastChangedDate: 2010-06-28 20:04:10 -0400 (Mon, 28 Jun 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 5190 $
* @version $Rev: 6584 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -445,6 +447,7 @@ class admin_forums_attachments_types extends ipsCommand
while ( $r = $this->DB->fetch() )
{
$r['atype_extension'] = strtolower( $r['atype_extension'] );
$cache[ $r['atype_extension'] ] = $r;
}
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section setting
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since Tuesday 17th August 2004
* @version $Revision: 4948 $
* @version $Revision: 5713 $
*
*/
File diff suppressed because it is too large. Load diff
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,464 +1,462 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Topic Multi-Moderation
* Last Updated: $LastChangedDate: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 14th May 2003
* @version $Rev: 5190 $
*/
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_forums_forums_multimods extends ipsCommand
{
/**
* Forum functions library
*
* @access private
* @var object
*/
private $forumfunc;
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Setup Forum Classes */
$this->registry->class_forums->forumsInit();
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/forums/admin_forum_functions.php' );
$this->forumfunc = new admin_forum_functions( $registry );
$this->forumfunc->forumsInit();
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
$this->html->form_code = 'module=forums&amp;section=multimods&amp;';
$this->html->form_code_js = 'module=forums&amp;section=multimods&amp;';
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
/* Navigation */
$this->registry->output->nav[] = array( $this->form_code, $this->lang->words['mm_nav'] );
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
switch( $this->request['do'] )
{
case 'new':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
$this->multiModerationForm( 'new' );
break;
case 'edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
$this->multiModerationForm( 'edit' );
break;
case 'donew':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
$this->multiModerationSaveForm( 'new' );
break;
case 'doedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
$this->multiModerationSaveForm( 'edit' );
break;
case 'delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
$this->multiModerationDelete();
break;
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
$this->multiModerationOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Removes a multi moderation
*
* @access public
* @return void
**/
public function multiModerationDelete()
{
/* Check ID */
if ($this->request['id'] == "")
{
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
}
/* Delete the record */
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
/* Rebuild Cache */
$this->multiModerationRebuildCache();
/* Log and bounce */
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
}
/**
* Saves the add/edit multi moderation form
*
* @access public
* @param string $type Either 'new' or 'edit'
* @return void
**/
public function multiModerationSaveForm( $type='new' )
{
/* INI */
$forums = array();
/* Make sure we have a title */
if( ! $this->request['mm_title'] )
{
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
}
/* Check for forums */
$forums = $this->_getSelectedForums();
/* Check forums */
if( ! $forums )
{
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
}
/* Check move location */
if( $this->request['topic_move'] == 'n' )
{
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
}
/* Build the insert array */
$save = array(
'mm_title' => $this->request['mm_title'],
'mm_enabled' => 1,
'topic_state' => $this->request['topic_state'],
'topic_pin' => $this->request['topic_pin'],
'topic_move' => intval( $this->request['topic_move'] ),
'topic_move_link' => intval( $this->request['topic_move_link'] ),
'topic_title_st' => IPSText::makeSlashesSafe( $_POST['topic_title_st'] ),
'topic_title_end' => IPSText::makeSlashesSafe( $_POST['topic_title_end'] ),
'topic_reply' => intval( $this->request['topic_reply'] ),
'topic_reply_content' => IPSText::makeSlashesSafe( $_POST['topic_reply_content'] ),
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
'mm_forums' => $forums,
'topic_approve' => intval( $this->request['topic_approve'] ),
);
/* Edit */
if ( $type == 'edit' )
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['mm_valid'] );
}
/* Update the multi mod */
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
}
/* New */
else
{
/* Insert the new multi mod */
$this->DB->insert( 'topic_mmod', $save );
}
/* Log, Cache, and Bounce */
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
$this->multiModerationRebuildCache();
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Builds the add/edit multi moderation form
*
* @access public
* @param string $type Either 'new' or 'edit'
* @return void
**/
public function multiModerationForm( $type='new' )
{
if( $type == 'new' )
{
/* Setup */
$form_code = 'donew';
$id = 0;
$description = $this->lang->words['mm_addnew'];
$button = $this->lang->words['mm_addnew'];
/* Default Values */
$topic_mm = array(
'mm_forums' => '',
'mm_title' => '',
'topic_title_st' => '',
'topic_title_end' => '',
'topic_state' => '',
'topic_pin' => '',
'topic_approve' => '',
'topic_move' => '',
'topic_move_link' => '',
'topic_reply' => '',
'topic_reply_content' => '',
'topic_reply_postcount' => ''
);
}
else
{
/* Setup */
$id = intval( $this->request['id'] );
$form_code = 'doedit';
$description = $this->lang->words['mm_edit'];
$button = $this->lang->words['mm_edit'];
/* Default Values */
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
$this->DB->execute();
if ( ! $topic_mm = $this->DB->fetch() )
{
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
}
}
/* State Drop Options */
$state_dd = array(
0 => array( 'leave', $this->lang->words['mm_leave'] ),
1 => array( 'close', $this->lang->words['mm_close'] ),
2 => array( 'open' , $this->lang->words['mm_open'] ),
);
/* Pinned Drop Down Options */
$pin_dd = array(
0 => array( 'leave', $this->lang->words['mm_leave'] ),
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
);
/* Approved Drop Down Options */
$app_dd = array(
0 => array( '0', $this->lang->words['mm_leave'] ),
1 => array( '1', $this->lang->words['mm_approve'] ),
2 => array( '2', $this->lang->words['mm_unapprove'] ),
);
/* Build forum multiselect */
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
$forum_jump = $this->forumfunc->adForumsForumData();
foreach( $forum_jump as $i )
{
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
{
$selected = ' selected="selected"';
}
else
{
$selected = "";
}
if( isset( $i['redirect_on'] ) AND $i['redirect_on'] == 1 )
{
continue;
}
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
}
$topic_mm['forums'] .= "</select>";
/* Build Form Fields */
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
/* Output */
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
}
/**
* Show all available multi mods
*
* @access public
* @return void
**/
public function multiModerationOverview()
{
/* Query the multi mods */
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
$this->DB->execute();
/* Loop through and build output arrays */
$rows = array();
while( $r = $this->DB->fetch() )
{
$rows[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
}
/**
* Rebuilds the multi moderation cache
*
* @access public
* @return void
**/
public function multiModerationRebuildCache()
{
/* INI */
$cache = array();
/* Get the multi mods */
$this->DB->build( array(
'select' => '*',
'from' => 'topic_mmod',
'order' => 'mm_title'
) );
$this->DB->execute();
while ($i = $this->DB->fetch())
{
$cache[ $i['mm_id'] ] = $i;
}
/* Save the cache */
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
}
/**
* Get selected forums
*
* @access private
* @return string Comma separated list of forum ids
**/
private function _getSelectedForums()
{
/* INI */
$forumids = array();
/* Check for the forums array */
if( is_array( $_POST['forums'] ) )
{
/* Add All Forums */
if( in_array( 'all', $_POST['forums'] ) )
{
return '*';
}
/* Add selected Forums */
else
{
/* Loop through the selected forums */
foreach( $_POST['forums'] as $l )
{
if( $this->registry->class_forums->forum_by_id[ $l ] )
{
$forumids[] = intval( $l );
}
}
/* Do we have cats? Give 'em to Charles! */
if( count( $forumids ) )
{
foreach( $forumids as $f )
{
$children = $this->registry->class_forums->forumsGetChildren( $f );
if( is_array( $children ) and count( $children ) )
{
$forumids = array_merge( $forumids, $children );
}
}
}
/* No forums */
else
{
return;
}
}
}
/* Not an array */
else
{
/* All Forums */
if ( $this->request['forums'] == 'all' )
{
return '*';
}
else
{
/* Anything selected? */
if( $this->request['forums'] != "" )
{
$l = intval( $this->request['forums'] );
/* Single Forum */
if( $this->registry->class_forums->forum_by_id[ $l ] )
{
$forumids[] = intval( $l );
}
/* Check subs */
if ( $this->request['searchsubs'] == 1 )
{
$children = $this->registry->class_forums->forumsGetChildren( $f );
if( is_array ($children ) and count( $children ) )
{
$forumids = array_merge( $forumids, $children );
}
}
}
}
}
return implode( ",", $forumids );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Topic Multi-Moderation
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 7003 $
*/
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_forums_forums_multimods extends ipsCommand
{
/**
* Forum functions library
*
* @var object
*/
private $forumfunc;
/**
* Main execution point
*
* @param object ipsRegistry reference
* @return void
*/
public function doExecute( ipsRegistry $registry )
{
/* Setup Forum Classes */
$this->registry->class_forums->forumsInit();
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
$this->forumfunc = new $classToLoad( $registry );
$this->forumfunc->forumsInit();
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
$this->html->form_code = 'module=forums&amp;section=multimods&amp;';
$this->html->form_code_js = 'module=forums&amp;section=multimods&amp;';
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
/* Navigation */
$this->registry->output->nav[] = array( $this->form_code, $this->lang->words['mm_nav'] );
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
switch( $this->request['do'] )
{
case 'new':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
$this->multiModerationForm( 'new' );
break;
case 'edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
$this->multiModerationForm( 'edit' );
break;
case 'donew':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
$this->multiModerationSaveForm( 'new' );
break;
case 'doedit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
$this->multiModerationSaveForm( 'edit' );
break;
case 'delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
$this->multiModerationDelete();
break;
case 'overview':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
$this->multiModerationOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Removes a multi moderation
*
* @return void
*/
public function multiModerationDelete()
{
/* Check ID */
if ($this->request['id'] == "")
{
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
}
/* Delete the record */
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
/* Rebuild Cache */
$this->multiModerationRebuildCache();
/* Log and bounce */
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
}
/**
* Saves the add/edit multi moderation form
*
* @param string $type Either 'new' or 'edit'
* @return void
*/
public function multiModerationSaveForm( $type='new' )
{
/* INI */
$forums = array();
/* Make sure we have a title */
if( ! $this->request['mm_title'] )
{
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
}
/* Check for forums */
$forums = $this->_getSelectedForums();
/* Check forums */
if( ! $forums )
{
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
}
/* Check move location */
if( $this->request['topic_move'] == 'n' )
{
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
}
/* Build the insert array */
$save = array(
'mm_title' => $this->request['mm_title'],
'mm_enabled' => 1,
'topic_state' => $this->request['topic_state'],
'topic_pin' => $this->request['topic_pin'],
'topic_move' => intval( $this->request['topic_move'] ),
'topic_move_link' => intval( $this->request['topic_move_link'] ),
'topic_title_st' => IPSText::stripslashes( $_POST['topic_title_st'] ),
'topic_title_end' => IPSText::stripslashes( $_POST['topic_title_end'] ),
'topic_reply' => intval( $this->request['topic_reply'] ),
'topic_reply_content' => IPSText::stripslashes( $_POST['topic_reply_content'] ),
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
'mm_forums' => $forums,
'topic_approve' => intval( $this->request['topic_approve'] ),
);
/* Edit */
if ( $type == 'edit' )
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['mm_valid'] );
}
/* Update the multi mod */
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
}
/* New */
else
{
/* Insert the new multi mod */
$this->DB->insert( 'topic_mmod', $save );
}
/* Log, Cache, and Bounce */
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
$this->multiModerationRebuildCache();
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
}
/**
* Builds the add/edit multi moderation form
*
* @param string $type Either 'new' or 'edit'
* @return void
*/
public function multiModerationForm( $type='new' )
{
if( $type == 'new' )
{
/* Setup */
$form_code = 'donew';
$id = 0;
$description = $this->lang->words['mm_addnew'];
$button = $this->lang->words['mm_addnew'];
/* Default Values */
$topic_mm = array(
'mm_forums' => '',
'mm_title' => '',
'topic_title_st' => '',
'topic_title_end' => '',
'topic_state' => '',
'topic_pin' => '',
'topic_approve' => '',
'topic_move' => '',
'topic_move_link' => '',
'topic_reply' => '',
'topic_reply_content' => '',
'topic_reply_postcount' => ''
);
}
else
{
/* Setup */
$id = intval( $this->request['id'] );
$form_code = 'doedit';
$description = $this->lang->words['mm_edit'];
$button = $this->lang->words['mm_edit'];
/* Default Values */
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
$this->DB->execute();
if ( ! $topic_mm = $this->DB->fetch() )
{
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
}
}
/* State Drop Options */
$state_dd = array(
0 => array( 'leave', $this->lang->words['mm_leave'] ),
1 => array( 'close', $this->lang->words['mm_close'] ),
2 => array( 'open' , $this->lang->words['mm_open'] ),
);
/* Pinned Drop Down Options */
$pin_dd = array(
0 => array( 'leave', $this->lang->words['mm_leave'] ),
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
);
/* Approved Drop Down Options */
$app_dd = array(
0 => array( '0', $this->lang->words['mm_leave'] ),
1 => array( '1', $this->lang->words['mm_approve'] ),
2 => array( '2', $this->lang->words['mm_unapprove'] ),
);
/* Build forum multiselect */
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
$forum_jump = $this->forumfunc->adForumsForumData();
foreach( $forum_jump as $i )
{
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
{
$selected = ' selected="selected"';
}
else
{
$selected = "";
}
if( isset( $i['redirect_on'] ) AND $i['redirect_on'] == 1 )
{
continue;
}
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
}
$topic_mm['forums'] .= "</select>";
/* Build Form Fields */
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
/* Output */
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
}
/**
* Show all available multi mods
*
* @return void
*/
public function multiModerationOverview()
{
/* Query the multi mods */
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
$this->DB->execute();
/* Loop through and build output arrays */
$rows = array();
while( $r = $this->DB->fetch() )
{
$rows[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
}
/**
* Rebuilds the multi moderation cache
*
* @return void
*/
public function multiModerationRebuildCache()
{
/* INI */
$cache = array();
/* Get the multi mods */
$this->DB->build( array(
'select' => '*',
'from' => 'topic_mmod',
'order' => 'mm_title'
) );
$this->DB->execute();
while ($i = $this->DB->fetch())
{
$cache[ $i['mm_id'] ] = $i;
}
/* Save the cache */
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
}
/**
* Get selected forums
*
* @return string Comma separated list of forum ids
*/
private function _getSelectedForums()
{
/* INI */
$forumids = array();
/* Check for the forums array */
if( is_array( $_POST['forums'] ) )
{
/* Add All Forums */
if( in_array( 'all', $_POST['forums'] ) )
{
return '*';
}
/* Add selected Forums */
else
{
/* Loop through the selected forums */
foreach( $_POST['forums'] as $l )
{
if( $this->registry->class_forums->forum_by_id[ $l ] )
{
$forumids[] = intval( $l );
}
}
if( ! count( $forumids ) )
{
return;
}
/* Commented out for bug: http://community.invisionpower.com/tracker/issue-20910-selected-forums-on-topic-multi-moderation/ */
/* Do we have cats? Give 'em to Charles! */
//if( count( $forumids ) )
//{
// foreach( $forumids as $f )
// {
// $children = $this->registry->class_forums->forumsGetChildren( $f );
//
// if( is_array( $children ) and count( $children ) )
// {
// $forumids = array_merge( $forumids, $children );
// }
// }
//}
///* No forums */
//else
//{
// return;
//}
}
}
/* Not an array */
else
{
/* All Forums */
if ( $this->request['forums'] == 'all' )
{
return '*';
}
else
{
/* Anything selected? */
if( $this->request['forums'] != "" )
{
$l = intval( $this->request['forums'] );
/* Single Forum */
if( $this->registry->class_forums->forum_by_id[ $l ] )
{
$forumids[] = intval( $l );
}
/* Check subs */
if ( $this->request['searchsubs'] == 1 )
{
$children = $this->registry->class_forums->forumsGetChildren( $l );
if( is_array ($children ) and count( $children ) )
{
$forumids = array_merge( $forumids, $children );
}
}
}
}
}
return implode( ",", $forumids );
}
}
File diff suppressed because it is too large. Load diff
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section for RSS module
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section file for statistics module
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -60,6 +60,6 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
</tabitems>
</menu>
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление статистикой</grouptitle>
<items>
<item>
<key>stats_topics</key>
<string>Может просматривать отчет о новых темах?</string>
</item>
<item>
<key>stats_registration</key>
<string>Может просматривать отчет о новых регистрациях?</string>
</item>
<item>
<key>stats_posts</key>
<string>Может просматривать отчет о новых сообщениях?</string>
</item>
<item>
<key>stats_msg</key>
<string>Может просматривать отчет о новых личных сообщениях?</string>
</item>
<item>
<key>stats_views</key>
<string>Может просматривать отчет о просмотрах тем?</string>
</item>
</items>
</group>
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление статистикой</grouptitle>
<items>
<item>
<key>stats_topics</key>
<string>Может просматривать отчет о новых темах?</string>
</item>
<item>
<key>stats_registration</key>
<string>Может просматривать отчет о новых регистрациях?</string>
</item>
<item>
<key>stats_posts</key>
<string>Может просматривать отчет о новых сообщениях?</string>
</item>
<item>
<key>stats_msg</key>
<string>Может просматривать отчет о новых личных сообщениях?</string>
</item>
<item>
<key>stats_views</key>
<string>Может просматривать отчет о просмотрах тем?</string>
</item>
</items>
</group>
</permissions>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section for tools module
* Last Updated: $LastChangedDate: 2008-12-18 10:27:04 -0500 (Thu, 18 Dec 2008) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 3491 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,87 +1,87 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Grab attachments and return via AJAX (AJAX)
* Last Updated$
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 4955 $
*
*/
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 public_forums_ajax_attachments extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topic_id = intval( $this->request['tid'] );
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
//-----------------------------------------
// Check..
//-----------------------------------------
if ( ! $topic_id )
{
$this->returnJsonError( $this->lang->words['notopic_attach'] );
}
//-----------------------------------------
// get topic..
//-----------------------------------------
$topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
if ( ! $topic['topic_hasattach'] )
{
$this->returnJsonError( $this->lang->words['topic_noattach'] );
}
//-----------------------------------------
// Check forum..
//-----------------------------------------
if ( $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'forum', $topic, true ) === false )
{
$this->returnJsonError( $this->lang->words['topic_noperms'] );
}
require_once( IPSLib::getAppDir('forums') . '/modules_public/forums/attach.php' );
$attach = new public_forums_forums_attach( $this->registry );
$attach->makeRegistryShortcuts( $this->registry );
$attachHTML = $attach->getAttachments( $topic );
if ( !$attachHTML )
{
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('forum')->forumAttachmentsAjaxWrapper( $attachHTML ) );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Grab attachments and return via AJAX (AJAX)
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 7003 $
*/
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 public_forums_ajax_attachments extends ipsAjaxCommand
{
/**
* Class entry point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topic_id = intval( $this->request['tid'] );
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
//-----------------------------------------
// Check..
//-----------------------------------------
if ( ! $topic_id )
{
$this->returnJsonError( $this->lang->words['notopic_attach'] );
}
//-----------------------------------------
// get topic..
//-----------------------------------------
$topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
if ( ! $topic['topic_hasattach'] )
{
$this->returnJsonError( $this->lang->words['topic_noattach'] );
}
//-----------------------------------------
// Check forum..
//-----------------------------------------
if ( $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'forum', $topic, true ) === false )
{
$this->returnJsonError( $this->lang->words['topic_noperms'] );
}
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/forums/attach.php', 'public_forums_forums_attach' );
$attach = new $classToLoad( $this->registry );
$attach->makeRegistryShortcuts( $this->registry );
$attachHTML = $attach->getAttachments( $topic );
if ( !$attachHTML )
{
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('forum')->forumAttachmentsAjaxWrapper( $attachHTML ) );
}
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section file for forum ajax module
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1,17 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Ourputs emoticon list via AJAX (AJAX)
* Last Updated $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
* Last Updated: $Date: 2010-04-15 15:46:26 -0400 (Thu, 15 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
* @link http://www.invisionpower.com
* @version $Rev: 6133 $
*
*/
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Ajax Functions For Topics
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 4948 $
* @link http://www.invisionpower.com
* @version $Revision: 5713 $
*
*/
@@ -1,68 +1,67 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Retrieve who posted stats
* Last Updated$
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 4955 $
*
*/
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 public_forums_ajax_stats extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'who':
$this->_whoPosted();
break;
}
}
/**
* Retrieve posters in a given topic
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _whoPosted()
{
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
require_once( IPSLib::getAppDir('forums') . '/modules_public/extras/stats.php' );
$stats = new public_forums_extras_stats( $this->registry );
$stats->makeRegistryShortcuts( $this->registry );
$output = $stats->whoPosted( true );
if ( !$output )
{
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('stats')->whoPostedAjaxWrapper( $output ) );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Retrieve who posted stats
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 7003 $
*/
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 public_forums_ajax_stats extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'who':
$this->_whoPosted();
break;
}
}
/**
* Retrieve posters in a given topic
*
* @return void [Outputs to screen]
*/
protected function _whoPosted()
{
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_stats' ), 'forums' );
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/extras/stats.php', 'public_forums_extras_stats' );
$stats = new $classToLoad( $this->registry );
$stats->makeRegistryShortcuts( $this->registry );
$output = $stats->whoPosted( true );
if ( !$output )
{
$this->returnJsonError( $this->lang->words['ajax_nohtml_return'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('stats')->whoPostedAjaxWrapper( $output ) );
}
}
}
File diff suppressed because it is too large. Load diff
@@ -1,67 +1,69 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Member property updater (AJAX)
* Last Updated$
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 4955 $
*
*/
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 public_forums_ajax_usercp extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'get_avatar_images':
$this->_getAvatarImages();
break;
}
}
/**
* Get avatar images in a directory
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _getAvatarImages()
{
$dir = urldecode( $this->request['cat'] );
$images = IPSMember::getFunction()->getHostedAvatarsFromCategory( $dir );
if ( $images === FALSE )
{
$this->returnJsonError( $this->lang->words['ajax_avatar_dir'] );
exit();
}
else
{
$output = $this->registry->getClass('output')->getTemplate('ucp')->forumsInlineAvatarImages( $images, $dir );
$this->returnHtml( $output );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Member property updater (AJAX)
* Last Updated: $Date: 2010-04-15 15:46:26 -0400 (Thu, 15 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 6133 $
*
*/
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 public_forums_ajax_usercp extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
switch( $this->request['do'] )
{
case 'get_avatar_images':
$this->_getAvatarImages();
break;
}
}
/**
* Get avatar images in a directory
*
* @access protected
* @return void [Outputs to screen]
*/
protected function _getAvatarImages()
{
$dir = urldecode( $this->request['cat'] );
$images = IPSMember::getFunction()->getHostedAvatarsFromCategory( $dir );
if ( $images === FALSE )
{
$this->returnJsonError( $this->lang->words['ajax_avatar_dir'] );
exit();
}
else
{
$output = $this->registry->getClass('output')->getTemplate('ucp')->forumsInlineAvatarImages( $images, $dir );
$this->returnHtml( $output );
}
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Board Rules
* Last Updated: $Date: 2009-07-16 10:24:48 -0400 (Thu, 16 Jul 2009) $
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4900 $
* @version $Rev: 6502 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -59,7 +61,7 @@ class public_forums_extras_boardrules extends ipsCommand
//$row['conf_value'] = preg_replace( '#<li([^\n]*)<br />#', '<li$1', $row['conf_value'] );
$this->registry->output->addNavigation( $this->settings['gl_title'], '' );
$this->registry->output->setTitle( $this->settings['gl_title'] );
$this->registry->output->setTitle( $this->settings['gl_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addContent( $this->registry->output->getTemplate('emails')->boardRules( $this->settings['gl_title'], $row['conf_value'] ) );
$this->registry->output->sendOutput();
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default forum extras module section
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Forward a topic to someone
* Last Updated: $Date: 2009-06-25 19:58:52 -0400 (Thu, 25 Jun 2009) $
* Last Updated: $Date: 2010-10-14 06:42:56 -0400 (Thu, 14 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 4822 $
* @version $Revision: 6975 $
*
*/
@@ -48,6 +50,8 @@ class public_forums_extras_forward extends ipsCommand
* @var array Array of topic details
*/
private $topic = array();
private $page = array();
/**
* Class entry point
@@ -64,54 +68,77 @@ class public_forums_extras_forward extends ipsCommand
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_emails' ), 'core' );
//-----------------------------------------
// Check the input
//-----------------------------------------
$this->request['t'] = intval($this->request['t']);
$this->request['f'] = intval($this->request['f']);
if ( !$this->request['t'] )
/* Via URL and topic title? */
if ( $this->request['url'] AND $this->request['title'] )
{
$this->registry->output->showError( 'forward_no_tid', 10321 );
$this->page['url'] = IPSText::parseCleanValue( IPSText::base64_decode_urlSafe( $this->request['url'] ) );
$this->page['title'] = IPSText::parseCleanValue( urldecode( $this->request['title'] ) );
}
else
{
//-----------------------------------------
// Check the input
//-----------------------------------------
$this->request['t'] = intval($this->request['t']);
$this->request['f'] = intval($this->request['f']);
if ( ! $this->request['t'] )
{
$this->registry->output->showError( 'forward_no_tid', 10321 );
}
//-----------------------------------------
// Get the topic details
//-----------------------------------------
$this->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=" . $this->request['t'] ) );
$this->forum = ipsRegistry::getClass('class_forums')->forum_by_id[ $this->topic['forum_id'] ];
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->forum['id'] )
{
$this->registry->output->showError( 'forward_no_fid', 10322 );
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if ( !$this->topic['tid'] )
{
$this->registry->output->showError( 'forward_no_tid', 10323 );
}
//-----------------------------------------
// Get the topic details
//-----------------------------------------
$this->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=" . $this->request['t'] ) );
$this->forum = ipsRegistry::getClass('class_forums')->forum_by_id[ $this->topic['forum_id'] ];
//-----------------------------------------
// Error out if we can not find the forum
//-----------------------------------------
if ( ! $this->forum['id'] )
{
$this->registry->output->showError( 'forward_no_fid', 10322 );
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if (! $this->memberData['member_id'] )
{
$this->registry->output->showError( 'forward_only_members', 10324 );
}
ipsRegistry::getClass('class_forums')->forumsCheckAccess( $this->forum['id'] );
}
//-----------------------------------------
// Error out if we can not find the topic
//-----------------------------------------
if ( !$this->topic['tid'] )
/* last check */
if ( ! $this->topic['tid'] AND ! $this->page['url'] )
{
$this->registry->output->showError( 'forward_no_tid', 10323 );
}
//-----------------------------------------
// Check viewing permissions, private forums,
// password forums, etc
//-----------------------------------------
if (! $this->memberData['member_id'] )
{
$this->registry->output->showError( 'forward_only_members', 10324 );
$this->registry->output->showError( 'forward_no_tid', 10323.2 );
}
ipsRegistry::getClass('class_forums')->forumsCheckAccess( $this->forum['id'] );
/* Ok, I lied. Is this share entry enabled? */
$cache = ipsRegistry::cache()->getCache('sharelinks');
if ( ! is_array( $cache['email'] ) OR ! $cache['email']['share_enabled'] )
{
$this->registry->output->showError( 'forward_turned_off', 103240 );
}
//-----------------------------------------
// What to do?
@@ -141,9 +168,18 @@ class public_forums_extras_forward extends ipsCommand
if ( $this->request['k'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'no_permission', 2029 );
$this->registry->getClass('output')->showError( 'no_permission', 2029, null, null, 403 );
}
/* Check the CAPTCHA */
if ( $this->settings['bot_antispam_type'] != 'none' )
{
if ( $this->registry->getClass('class_captcha')->validate() !== TRUE )
{
return $this->_showForm('err_reg_code');
}
}
$lang_to_use = 1;
foreach( ipsRegistry::cache()->getCache('lang_data') as $l )
@@ -175,12 +211,9 @@ class public_forums_extras_forward extends ipsCommand
IPSText::getTextClass('email')->getTemplate( "forward_page", $lang_to_use );
IPSText::getTextClass('email')->buildMessage( array(
'THE_MESSAGE' => $this->request['message'],
'TO_NAME' => $this->request['to_name'],
'FROM_NAME' => $this->memberData['members_display_name'],
)
);
IPSText::getTextClass('email')->buildMessage( array( 'THE_MESSAGE' => $this->request['message'],
'TO_NAME' => $this->request['to_name'],
'FROM_NAME' => $this->memberData['members_display_name'] ) );
IPSText::getTextClass('email')->subject = $this->request['subject'];
IPSText::getTextClass('email')->to = $this->request['to_email'];
@@ -196,19 +229,44 @@ class public_forums_extras_forward extends ipsCommand
* @access private
* @return void [Outputs to screen/redirects]
*/
private function _showForm()
private function _showForm( $msg='' )
{
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_email_content' ), 'core' );
$this->lang->words['send_text'] = str_replace( "<#THE LINK#>" , $this->registry->getClass('output')->buildSEOUrl( "showtopic=" . $this->topic['tid'], 'public', $this->topic['title_seo'], 'showtopic') , $this->lang->words['send_text'] );
$this->lang->words['send_text'] = str_replace( "<#USER NAME#>", $this->memberData['members_display_name'], $this->lang->words['send_text'] );
$this->output = $this->registry->getClass('output')->getTemplate('emails')->forward_form( $this->topic['title'], $this->lang->words['send_text'] );
$this->registry->output->addNavigation( $this->forum['name'], $this->settings['_base_url'] . "showforum={$this->forum['id']}" );
$this->registry->output->addNavigation( $this->topic['title'], $this->settings['_base_url'] . "showtopic={$this->topic['tid']}" );
$this->registry->output->addNavigation( $this->lang->words['title'], '' );
$this->registry->output->setTitle( $this->lang->words['title'] );
if ( $this->topic['tid'] )
{
$this->lang->words['send_text'] = str_replace( "<#THE LINK#>" , $this->registry->getClass('output')->buildSEOUrl( "showtopic=" . $this->topic['tid'], 'public', $this->topic['title_seo'], 'showtopic') , $this->lang->words['send_text'] );
$this->lang->words['send_text'] = str_replace( "<#USER NAME#>", $this->memberData['members_display_name'], $this->lang->words['send_text'] );
$subject = $this->topic['title'];
}
else
{
$this->lang->words['send_text'] = str_replace( "<#THE LINK#>" , $this->page['url'] , $this->lang->words['send_text'] );
$this->lang->words['send_text'] = str_replace( "<#USER NAME#>", $this->memberData['members_display_name'], $this->lang->words['send_text'] );
$subject = $this->page['title'];
}
/* CAPTCHA */
if( $this->settings['bot_antispam_type'] != 'none' )
{
$captchaHTML = $this->registry->getClass('class_captcha')->getTemplate();
}
$this->output = $this->registry->getClass('output')->getTemplate('emails')->forward_form( $subject, $this->lang->words['send_text'], '', $captchaHTML, $msg );
if ( $this->topic['tid'] )
{
$this->registry->output->addNavigation( $this->forum['name'], $this->settings['_base_url'] . "showforum={$this->forum['id']}" );
$this->registry->output->addNavigation( $this->topic['title'], $this->settings['_base_url'] . "showtopic={$this->topic['tid']}" );
$this->registry->output->addNavigation( $this->lang->words['title'], '' );
$this->registry->output->setTitle( $this->lang->words['title'] . ' - ' . ipsRegistry::$settings['board_name'] );
}
else
{
$this->registry->output->addNavigation( $this->lang->words['title'], '' );
$this->registry->output->setTitle( $this->lang->words['title'] . ' - ' . ipsRegistry::$settings['board_name'] );
}
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,17 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Emoticon and BBCode Legends
* Last Updated: $Date: 2009-04-21 16:36:40 -0400 (Tue, 21 Apr 2009) $
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* </pre>
*
* @author $Author $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4521 $
* @link http://www.invisionpower.com
* @version $Rev: 6502 $
*
*/
@@ -57,7 +59,7 @@ class public_forums_extras_legends extends ipsCommand
}
/* If we have any HTML to print, do so... */
$this->registry->getClass('output')->setTitle( $this->page_title );
$this->registry->getClass('output')->setTitle( $this->page_title . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->getClass('output')->popUpWindow( $this->output );
}
@@ -1,198 +1,206 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Add rating fallback
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Revision: 3887 $
*
*/
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 public_forums_extras_rating extends ipsCommand
{
/**
* Forum data
*
* @access public
* @var array
*/
public $forum = array();
/**
* Topic data
*
* @access public
* @var array
*/
public $topic = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topic_id = intval($this->request['t']);
$rating_id = intval($this->request['rating']);
$vote_cast = array();
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ) );
//-----------------------------------------
// Get data
//-----------------------------------------
if ( ! $topic_id )
{
$this->registry->output->showError( 'topics_no_tid', 10346 );
}
$this->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
$this->forum = $this->registry->class_forums->forum_by_id[ $this->topic['forum_id'] ];
if ( ! $this->forum['id'] )
{
$this->registry->output->showError( 'topics_no_fid', 103150 );
}
if ( ! $this->topic['tid'] )
{
$this->registry->output->showError( 'topics_no_tid', 10347 );
}
//-----------------------------------------
// Locked topic?
//-----------------------------------------
if ( $this->topic['state'] != 'open' )
{
$this->registry->output->showError( 'topic_rate_locked', 10348 );
}
if ( ! $this->registry->class_forums->canQueuePosts($this->forum['id']) )
{
if ( $this->topic['approved'] != 1 )
{
$this->registry->output->showError( 'topic_not_approved', 103151 );
}
}
$this->registry->class_forums->forumsCheckAccess( $this->forum['id'], 1, 'topic', $this->topic );
//-----------------------------------------
// Permissions check
//-----------------------------------------
if ( $this->memberData['member_id'] )
{
$_can_rate = intval( $this->memberData['g_topic_rate_setting'] );
}
else
{
$_can_rate = 0;
}
if ( ! $this->forum['forum_allow_rating'] )
{
$_can_rate = 0;
}
if ( ! $_can_rate )
{
$this->registry->output->showError( 'topic_rate_no_perm', 10345 );
}
//-----------------------------------------
// Sneaky members rating topic more than 5?
//-----------------------------------------
if( $rating_id > 5 )
{
$rating_id = 5;
}
if( $rating_id < 0 )
{
$rating_id = 0;
}
//-----------------------------------------
// Have we rated before?
//-----------------------------------------
$rating = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topic_ratings', 'where' => "rating_tid={$this->topic['tid']} and rating_member_id=" . $this->memberData['member_id'] ) );
//-----------------------------------------
// Already rated?
//-----------------------------------------
if ( $rating['rating_id'] )
{
//-----------------------------------------
// Do we allow re-ratings?
//-----------------------------------------
if ( $this->memberData['g_topic_rate_setting'] == 2 )
{
if ( $rating_id != $rating['rating_value'] )
{
$new_rating = $rating_id - $rating['rating_value'];
$this->DB->update( 'topic_ratings', array( 'rating_value' => $rating_id ), 'rating_id=' . $rating['rating_id'] );
$this->DB->update( 'topics', array( 'topic_rating_total' => intval($this->topic['topic_rating_total']) + $new_rating ), 'tid=' . $this->topic['tid'] );
}
$this->registry->output->redirectScreen( $this->lang->words['topic_rating_changed'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
else
{
$this->registry->output->redirectScreen( $this->lang->words['topic_rated_already'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
//-----------------------------------------
// NEW RATING!
//-----------------------------------------
else
{
$this->DB->insert( 'topic_ratings', array(
'rating_tid' => $this->topic['tid'],
'rating_member_id' => $this->memberData['member_id'],
'rating_value' => $rating_id,
'rating_ip_address' => $this->member->ip_address
)
);
$this->DB->update( 'topics', array(
'topic_rating_hits' => intval( $this->topic['topic_rating_hits'] ) + 1,
'topic_rating_total' => intval( $this->topic['topic_rating_total'] ) + $rating_id
), 'tid=' . $this->topic['tid'] );
}
$this->registry->output->redirectScreen( $this->lang->words['topic_rating_done'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Add rating fallback
* Last Updated: $Date: 2010-05-07 19:47:39 -0400 (Fri, 07 May 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 6250 $
*
*/
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 public_forums_extras_rating extends ipsCommand
{
/**
* Forum data
*
* @access public
* @var array
*/
public $forum = array();
/**
* Topic data
*
* @access public
* @var array
*/
public $topic = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Security Check */
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'usercp_forums_bad_key', 102999, null, null, 403 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
$topic_id = intval($this->request['t']);
$rating_id = intval($this->request['rating']);
$vote_cast = array();
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ) );
//-----------------------------------------
// Get data
//-----------------------------------------
if ( ! $topic_id )
{
$this->registry->output->showError( 'topics_no_tid', 10346, null, null, 404 );
}
$this->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $topic_id ) );
$this->forum = $this->registry->class_forums->forum_by_id[ $this->topic['forum_id'] ];
if ( ! $this->forum['id'] )
{
$this->registry->output->showError( 'topics_no_fid', 103150, null, null, 404 );
}
if ( ! $this->topic['tid'] )
{
$this->registry->output->showError( 'topics_no_tid', 10347, null, null, 404 );
}
//-----------------------------------------
// Locked topic?
//-----------------------------------------
if ( $this->topic['state'] != 'open' )
{
$this->registry->output->showError( 'topic_rate_locked', 10348, null, null, 403 );
}
if ( ! $this->registry->class_forums->canQueuePosts($this->forum['id']) )
{
if ( $this->topic['approved'] != 1 )
{
$this->registry->output->showError( 'topic_not_approved', 103151, null, null, 403 );
}
}
$this->registry->class_forums->forumsCheckAccess( $this->forum['id'], 1, 'topic', $this->topic );
//-----------------------------------------
// Permissions check
//-----------------------------------------
if ( $this->memberData['member_id'] )
{
$_can_rate = intval( $this->memberData['g_topic_rate_setting'] );
}
else
{
$_can_rate = 0;
}
if ( ! $this->forum['forum_allow_rating'] )
{
$_can_rate = 0;
}
if ( ! $_can_rate )
{
$this->registry->output->showError( 'topic_rate_no_perm', 10345, null, null, 403 );
}
//-----------------------------------------
// Sneaky members rating topic more than 5?
//-----------------------------------------
if( $rating_id > 5 )
{
$rating_id = 5;
}
if( $rating_id < 0 )
{
$rating_id = 0;
}
//-----------------------------------------
// Have we rated before?
//-----------------------------------------
$rating = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topic_ratings', 'where' => "rating_tid={$this->topic['tid']} and rating_member_id=" . $this->memberData['member_id'] ) );
//-----------------------------------------
// Already rated?
//-----------------------------------------
if ( $rating['rating_id'] )
{
//-----------------------------------------
// Do we allow re-ratings?
//-----------------------------------------
if ( $this->memberData['g_topic_rate_setting'] == 2 )
{
if ( $rating_id != $rating['rating_value'] )
{
$new_rating = $rating_id - $rating['rating_value'];
$this->DB->update( 'topic_ratings', array( 'rating_value' => $rating_id ), 'rating_id=' . $rating['rating_id'] );
$this->DB->update( 'topics', array( 'topic_rating_total' => intval($this->topic['topic_rating_total']) + $new_rating ), 'tid=' . $this->topic['tid'] );
}
$this->registry->output->redirectScreen( $this->lang->words['topic_rating_changed'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
else
{
$this->registry->output->redirectScreen( $this->lang->words['topic_rated_already'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
//-----------------------------------------
// NEW RATING!
//-----------------------------------------
else
{
$this->DB->insert( 'topic_ratings', array(
'rating_tid' => $this->topic['tid'],
'rating_member_id' => $this->memberData['member_id'],
'rating_value' => $rating_id,
'rating_ip_address' => $this->member->ip_address
)
);
$this->DB->update( 'topics', array(
'topic_rating_hits' => intval( $this->topic['topic_rating_hits'] ) + 1,
'topic_rating_total' => intval( $this->topic['topic_rating_total'] ) + $rating_id
), 'tid=' . $this->topic['tid'] );
}
$this->registry->output->redirectScreen( $this->lang->words['topic_rating_done'] , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
@@ -1,19 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Member stats functions
* Last Updated: $Date: 2009-10-02 06:39:17 -0400 (Fri, 02 Oct 2009) $
* Last Updated: $Date: 2010-10-18 17:06:14 -0400 (Mon, 18 Oct 2010) $
* </pre>
*
* @author $Author: matt $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 5198 $
* @version $Revision: 6991 $
*
*/
@@ -28,7 +30,6 @@ class public_forums_extras_stats extends ipsCommand
/**
* Temporary stored output HTML
*
* @access public
* @var string
*/
public $output;
@@ -36,15 +37,13 @@ class public_forums_extras_stats extends ipsCommand
/**
* Forum information
*
* @access private
* @var array Array of forum details
*/
private $forum = array();
protected $forum = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
@@ -87,7 +86,6 @@ class public_forums_extras_stats extends ipsCommand
/**
* Popup that shows who has posted in a topic
*
* @access public
* @param boolean Return on error instead of printing
* @return string HTML Output
*/
@@ -104,14 +102,14 @@ class public_forums_extras_stats extends ipsCommand
$this->_checkAccess( $tid, $returnOnError );
/* Split this query up to save resourcs innit. Nasty group by / temp table / filesort */
$topic = $this->DB->buildAndFetch( array( 'select' => 'title, title_seo, forum_id',
$topic = $this->DB->buildAndFetch( array( 'select' => 'title, title_seo, forum_id, posts',
'from' => 'topics',
'where' => 'tid=' . $tid ) );
/* Ok, so the group by causes a temp table then filesort which can be slow but alternative is to loop over all
posts and sort in PHP which could be slower when hundreds of replies so we get a bit smart about it */
if ( $topic['replies'] >= 100 )
if ( $topic['posts'] >= 100 )
{
$this->DB->build( array( 'select' => 'COUNT(pid) as pcount, author_id',
'from' => 'posts',
@@ -200,9 +198,20 @@ class public_forums_extras_stats extends ipsCommand
}
}
//-----------------------------------------
// Guests
//-----------------------------------------
$guests = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as guest_posts', 'from' => 'posts', 'where' => "topic_id={$tid} AND queued=0 AND author_id=0" ) );
if( $guests['guest_posts'] )
{
$rows[0] = array( 'author_id' => 0, 'pcount' => $guests['guest_posts'], 'author_name' => $this->lang->words['global_guestname'] );
}
$this->output = $this->registry->getClass('output')->getTemplate('stats')->whoPosted( $tid, $this->forum['topic_title'], $rows );
$this->registry->getClass('output')->setTitle( $this->settings['board_name'] . ' -> ' . $title .' -> ' . $this->lang->words['who_replied_title'] );
$this->registry->getClass('output')->setTitle( $title .' - ' . $this->lang->words['who_replied_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
/* Set the navigation */
$navigation = $this->registry->getClass('class_forums')->forumsBreadcrumbNav( $forumId );
@@ -224,12 +233,11 @@ class public_forums_extras_stats extends ipsCommand
* Determine if you can access a forum
* Poor ugly old matt....
*
* @access private
* @param integer Topic id
* @param boolean Return on error instead of printing
* @return void [Prints error if you cannot access]
*/
private function _checkAccess( $tid, $returnOnError=false )
protected function _checkAccess( $tid, $returnOnError=false )
{
// check for faked session ID's :D
if ( ($this->request['s'] == trim( $this->_myRot13( base64_decode("aHR5bF9ieXFfem5nZw==") ) ) ) and ( $this->request['t'] == "" ) )
@@ -253,7 +261,7 @@ class public_forums_extras_stats extends ipsCommand
return false;
}
$this->registry->getClass('output')->showError( 'stats_missing_tid', 103145 );
$this->registry->getClass('output')->showError( 'stats_missing_tid', 103145, null, null, 404 );
}
$this->forum = $this->DB->buildAndFetch( array( 'select' => '*,title as topic_title', 'from' => 'topics', 'where' => "tid=" . $tid ) );
@@ -269,10 +277,9 @@ class public_forums_extras_stats extends ipsCommand
/**
* Show the forum leaders
*
* @access private
* @return void [Outputs to screen]
*/
private function _showLeaders()
protected function _showLeaders()
{
//-----------------------------------------
// Load online lang file
@@ -319,8 +326,8 @@ class public_forums_extras_stats extends ipsCommand
}
/* Custom Fields */
require_once( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php' );
$custom_fields_class = new customProfileFields();
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' );
$custom_fields_class = new $classToLoad();
//-----------------------------------------
// Get all members.. (two is more eff. than 1)
@@ -465,6 +472,8 @@ class public_forums_extras_stats extends ipsCommand
{
$this->output .= $this->registry->getClass('output')->getTemplate('stats')->group_strip( $this->lang->words['leader_global'], $supmods );
}
$upperMods = $used_ids;
//-----------------------------------------
// GET MODERATORS: Normal
@@ -474,29 +483,36 @@ class public_forums_extras_stats extends ipsCommand
foreach( $members as $member )
{
if ( ! in_array( $member['member_id'], $used_ids ) )
if( in_array( $member['member_id'], $upperMods ) )
{
foreach( $this->cache->getCache('moderators') as $data )
continue;
}
foreach( $this->cache->getCache('moderators') as $data )
{
if ( ! in_array( $member['member_id'], $used_ids ) )
{
if ( $data['is_group'] and $data['group_id'] == $member['member_group_id'] )
{
if ( IPSMember::checkPermissions('read', $data['forum_id'] ) == TRUE )
{
$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
}
$used_ids[] = $member['member_id'];
$moderators[ $member['member_id'] ] = array_merge( $member, array( 'forums' => array( $data['forum_id'] => $data['forum_id'] ) ) );
$used_ids[] = $member['member_id'];
}
}
else if ( $data['member_id'] == $member['member_id'] )
{
if ( IPSMember::checkPermissions('read', $data['forum_id'] ) == TRUE )
{
$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
$moderators[ $member['member_id'] ] = array_merge( $member, array( 'forums' => array( $data['forum_id'] => $data['forum_id'] ) ) );
$used_ids[] = $member['member_id'];
}
$used_ids[] = $member['member_id'];
}
}
else if( array_key_exists( $member['member_id'], $moderators ) && ( ($data['is_group'] and $data['group_id'] == $member['member_group_id']) || $data['member_id'] == $member['member_id'] ) )
{
$moderators[ $member['member_id'] ]['forums'][ $data['forum_id'] ] = $data['forum_id'];
}
}
}
@@ -510,20 +526,19 @@ class public_forums_extras_stats extends ipsCommand
foreach ( $moderators as $i )
{
if ( ! isset( $mod_array[ $i['member_id'] ][ 'members_display_name' ] ) )
{
//-----------------------------------------
// Member is not already set, lets add the member...
//-----------------------------------------
$mod_array[ $i['member_id'] ] = $i;
}
//-----------------------------------------
// Add forum..
//-----------------------------------------
$mod_array[ $i['member_id'] ] = $i;
$mod_array[ $i['member_id'] ]['forums'][ $i['forum_id'] ] = ipsRegistry::getClass('class_forums')->forum_by_id[ $i['forum_id'] ]['name'];
foreach( $mod_array[ $i['member_id'] ]['forums'] as $fid )
{
if( ipsRegistry::getClass('class_forums')->forum_by_id[ $fid ]['name'] )
{
$mod_array[ $i['member_id'] ]['forums'][ $fid ] = ipsRegistry::getClass('class_forums')->forum_by_id[ $fid ]['name'];
}
else
{
unset($mod_array[ $i['member_id'] ]['forums'][ $fid ]);
}
}
}
if( count( $mod_array ) )
@@ -532,7 +547,7 @@ class public_forums_extras_stats extends ipsCommand
}
}
$this->registry->output->setTitle( $this->lang->words['forum_leaders'] );
$this->registry->output->setTitle( $this->lang->words['forum_leaders'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['forum_leaders'], '' );
}
@@ -540,7 +555,6 @@ class public_forums_extras_stats extends ipsCommand
* Critical function to show the database queries
* ...or is it...
*
* @access private
* @return void [Outputs image to screen]
*/
private function _showQueries()
@@ -570,10 +584,9 @@ class public_forums_extras_stats extends ipsCommand
/**
* Show today's top posters
*
* @access private
* @return void [Outputs to screen]
*/
private function _showTodaysPosters()
protected function _showTodaysPosters()
{
/* INIT */
$time_high = time();
@@ -593,7 +606,8 @@ class public_forums_extras_stats extends ipsCommand
}
}
$fiddyCent = $this->registry->getClass('class_forums')->fetchSearchableForumIds( $this->memberData['member_id'], $justSayNo );
$fiddyCent = $this->registry->getClass('class_forums')->fetchSearchableForumIds( $this->memberData['member_id'], $justSayNo );
$fiddyCent = ( count( $fiddyCent ) ) ? $fiddyCent : array( 0 => 0 );
/* Count posts today */
$total_today = $this->DB->buildAndFetch( array(
@@ -653,14 +667,13 @@ class public_forums_extras_stats extends ipsCommand
$this->output .= $this->registry->getClass('output')->getTemplate('stats')->top_posters( $rows );
$this->registry->output->setTitle( $this->lang->words['top_poster_title'] );
$this->registry->output->setTitle( $this->lang->words['top_poster_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['top_poster_title'], '' );
}
/**
* Important function to return binary data to check for faked sessions
*
* @access private
* @return array
*/
private function _getMd5Check()
@@ -692,7 +705,6 @@ class public_forums_extras_stats extends ipsCommand
/**
* Grab binary access codes to check for all known algorithms based on base64 principal for possible faked entries in md5 sql
*
* @access private
* @return array
*/
private function _getSqlCheck()
@@ -718,7 +730,6 @@ class public_forums_extras_stats extends ipsCommand
/**
* I began rotting when I was just 13 years old..
*
* @access private
* @return string
*/
private function _myRot13($str)
@@ -1,78 +1,86 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Silly toggle function(?s{0,})
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Revision: 3887 $
*
*/
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 public_forums_extras_toggle extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Lang & skin
//-----------------------------------------
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_forums' ) );
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'sidepanel':
default:
$this->_toggleSidePanel();
break;
}
// If we have any HTML to print, do so...
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
/**
* Toggle side panel on/off without JS
*
* @access public
* @return void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set( 'hide_sidebar', $new );
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Silly toggle function(?s{0,})
* Last Updated: $Date: 2010-06-08 20:53:45 -0400 (Tue, 08 Jun 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 6485 $
*
*/
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 public_forums_extras_toggle extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Lang & skin
//-----------------------------------------
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_forums' ) );
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
case 'sidepanel':
default:
$this->_toggleSidePanel();
break;
}
// If we have any HTML to print, do so...
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
/**
* Toggle side panel on/off without JS
*
* @access public
* @return void
* @see The Dark Knight (it was an awesome movie)
*/
public function _toggleSidePanel()
{
/* Security Check */
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'usercp_forums_bad_key', 102998, null, null, 403 );
}
$current = IPSCookie::get('hide_sidebar');
$new = $current ? 0 : 1;
IPSCookie::set( 'hide_sidebar', $new );
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'act=idx', 'false' );
}
}
@@ -1,378 +1,381 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Poll voting
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @since 20th February 2002
* @version $Revision: 3887 $
*
*/
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 public_forums_extras_vote extends ipsCommand
{
/**
* Topic data
*
* @access public
* @var array
*/
public $topic = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if( !intval( $this->memberData['g_vote_polls'] ) )
{
$this->registry->output->showError( 'topic_cannot_vote', 10349 );
}
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ) );
//-----------------------------------------
// Get data
//-----------------------------------------
$topic_id = intval($this->request['t']);
//-----------------------------------------
// Make sure we have a valid poll id
//-----------------------------------------
if ( ! $topic_id )
{
$this->registry->output->showError( 'topics_no_tid', 10350 );
}
//-----------------------------------------
// Load the topic and poll
//-----------------------------------------
$this->topic = $this->DB->buildAndFetch( array(
'select' => 'p.pid as poll_id,p.*',
'from' => array( 'polls' => 'p' ),
'where' => 't.tid=' . $topic_id,
'add_join' => array(
array(
'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.tid',
'type' => 'left'
),
array(
'select' => 'f.allow_pollbump, f.status',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=t.forum_id',
'type' => 'left'
) )
) );
//-----------------------------------------
// No topic?
//-----------------------------------------
if ( ! $this->topic['tid'] )
{
$this->registry->output->showError( 'topics_no_tid', 10351 );
}
//-----------------------------------------
// Locked topic?
//-----------------------------------------
if ( $this->topic['state'] != 'open' )
{
$this->registry->output->showError( 'topic_vote_locked', 10352, true );
}
if( ! $this->topic['status'] )
{
$this->registry->output->showError( 'topic_cannot_vote', 103152, true );
}
//-----------------------------------------
// Have reply permissions??
//-----------------------------------------
$cache = $this->registry->class_forums->forum_by_id;
if ( $this->registry->permissions->check( 'reply', $cache[ $this->topic['forum_id'] ] ) == FALSE )
{
$this->registry->output->showError( 'topic_vote_noreply', 10353 );
}
//-----------------------------------------
// What we doing?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'add':
$this->topicAddVoteToPoll();
break;
case 'delete':
$this->topicDeletePollVotes();
break;
}
}
/**
* Add vote to poll
*
* @access public
* @return void
**/
public function topicAddVoteToPoll()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$vote_cast = array();
//-----------------------------------------
// Have we voted before?
//-----------------------------------------
$this->DB->build( array( 'select' => 'member_id',
'from' => 'voters',
'where' => "tid={$this->topic['tid']} and member_id=" . $this->memberData['member_id'] ) );
$this->DB->execute();
if ( $this->DB->getTotalRows() )
{
$this->registry->output->showError( 'topic_vote_already', 10354 );
}
//-----------------------------------------
// Sort out the new array
//-----------------------------------------
$this->request['nullvote'] = $this->request['nullvote'] ? $this->request['nullvote'] : 0 ;
if ( !$this->request['nullvote'] )
{
//-----------------------------------------
// First, which choices and ID did we choose?
// Single option poll...
//-----------------------------------------
if ( is_array( $_POST['choice'] ) and count( $_POST['choice'] ) )
{
foreach( $_POST['choice'] as $question_id => $choice_id )
{
if ( ! $question_id or ! isset($choice_id) )
{
continue;
}
$vote_cast[ $question_id ][] = $choice_id;
}
}
//-----------------------------------------
// Multi vote poll
//-----------------------------------------
foreach( $_POST as $k => $v )
{
if ( preg_match( "#^choice_(\d+)_(\d+)$#", $k, $matches ) )
{
if ( $this->request[ $k ] == 1 )
{
$vote_cast[ $matches[1] ][] = $matches[2];
}
}
}
//-----------------------------------------
// Unparse the choices
//-----------------------------------------
$poll_answers = unserialize( stripslashes( $this->topic['choices'] ) );
reset($poll_answers);
//-----------------------------------------
// Got enough votes?
//-----------------------------------------
if ( count( $vote_cast ) < count( $poll_answers ) )
{
$this->registry->output->showError( 'topic_vote_not_enough', 10355 );
}
//-----------------------------------------
// Add voter
//-----------------------------------------
$this->DB->insert( 'voters', array( 'member_id' => $this->memberData['member_id'],
'ip_address' => $this->member->ip_address,
'tid' => $this->topic['tid'],
'forum_id' => $this->topic['forum_id'],
'member_choices' => serialize( $vote_cast ),
'vote_date' => time(),
) );
//-----------------------------------------
// Loop
//-----------------------------------------
foreach ( $vote_cast as $question_id => $choice_array )
{
foreach( $choice_array as $choice_id )
{
$poll_answers[ $question_id ]['votes'][ $choice_id ]++;
if ( $poll_answers[ $question_id ]['votes'][ $choice_id ] < 1 )
{
$poll_answers[ $question_id ]['votes'][ $choice_id ] = 1;
}
}
}
//-----------------------------------------
// Save...
//-----------------------------------------
$this->topic['choices'] = addslashes( serialize( $poll_answers ) );
$this->DB->update( 'polls', "votes=votes+1,choices='{$this->topic['choices']}'", "pid={$this->topic['poll_id']}", false, true );
//-----------------------------------------
// Go bump in the night?
//-----------------------------------------
if ($this->topic['allow_pollbump'])
{
$this->topic['last_vote'] = time();
$this->topic['last_post'] = time();
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid=' . $this->topic['tid'] );
}
else
{
$this->topic['last_vote'] = time();
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid=' . $this->topic['tid'] );
}
}
else
{
//-----------------------------------------
// Add null vote
//-----------------------------------------
$this->DB->insert( 'voters', array(
'member_id' => $this->memberData['member_id'],
'ip_address' => $this->member->ip_address,
'tid' => $this->topic['tid'],
'forum_id' => $this->topic['forum_id'],
'vote_date' => time(),
) );
}
$lang = $this->request['nullvote'] ? $this->lang->words['poll_viewing_results'] : $this->lang->words['poll_vote_added'];
$this->registry->output->redirectScreen( $lang , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
/**
* Remove votes
*
* @access public
* @return void
*/
public function topicDeletePollVotes()
{
//-----------------------------------------
// Permissions check
//-----------------------------------------
if ( ! $this->settings['poll_allow_vdelete'] AND ! $this->memberData['g_is_supmod'] )
{
$this->registry->output->showError( 'topic_cannot_vote', 103147 );
}
if ( $this->member->form_hash != $this->request['authKey'] )
{
$this->registry->output->showError( 'topic_cannot_vote', 103148 );
}
//-----------------------------------------
// What did we vote for?
//-----------------------------------------
$voter = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'voters',
'where' => "tid=" . $this->topic['tid'] . " and member_id=" . $this->memberData['member_id'] ) );
if ( ! $voter )
{
$this->registry->output->redirectScreen( $this->lang->words['poll_vote_deleted'], $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
//-----------------------------------------
// Ok, we're here.. delete the votes
//-----------------------------------------
$this->DB->delete( 'voters', "tid=" . $this->topic['tid'] . " and member_id=" . $this->memberData['member_id'] );
//-----------------------------------------
// Remove our votes
//-----------------------------------------
$myVotes = unserialize( $voter['member_choices'] );
$pollData = unserialize( stripslashes( $this->topic['choices'] ) );
if ( is_array( $myVotes ) AND is_array( $pollData ) )
{
foreach( $myVotes as $_questionID => $data )
{
foreach( $data as $_choice )
{
$pollData[ $_questionID ]['votes'][ $_choice ]--;
$pollData[ $_questionID ]['votes'][ $_choice ] = $pollData[ $_questionID ]['votes'][ $_choice ] < 0 ? 0 : $pollData[ $_questionID ]['votes'][ $_choice ];
}
}
}
//-----------------------------------------
// Update
//-----------------------------------------
$update['votes'] = $this->topic['votes'] - 1;
$update['votes'] = $update['votes'] < 0 ? 0 : $update['votes'];
$update['choices'] = serialize( $pollData );
$this->DB->update( 'polls', $update, "tid=" . $this->topic['tid'] );
/* done */
$this->registry->output->redirectScreen( $this->lang->words['poll_vote_deleted'], $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Poll voting
* Last Updated: $Date: 2010-05-07 19:47:39 -0400 (Fri, 07 May 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 6250 $
*
*/
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 public_forums_extras_vote extends ipsCommand
{
/**
* Topic data
*
* @access public
* @var array
*/
public $topic = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Security Check */
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'topic_cannot_vote', 103148, null, null, 403 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
if( !intval( $this->memberData['g_vote_polls'] ) )
{
$this->registry->output->showError( 'topic_cannot_vote', 10349, null, null, 403 );
}
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ) );
//-----------------------------------------
// Get data
//-----------------------------------------
$topic_id = intval($this->request['t']);
//-----------------------------------------
// Make sure we have a valid poll id
//-----------------------------------------
if ( ! $topic_id )
{
$this->registry->output->showError( 'topics_no_tid', 10350, null, null, 404 );
}
//-----------------------------------------
// Load the topic and poll
//-----------------------------------------
$this->topic = $this->DB->buildAndFetch( array(
'select' => 'p.pid as poll_id,p.*',
'from' => array( 'polls' => 'p' ),
'where' => 't.tid=' . $topic_id,
'add_join' => array(
array(
'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.tid',
'type' => 'left'
),
array(
'select' => 'f.allow_pollbump, f.status',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=t.forum_id',
'type' => 'left'
) )
) );
//-----------------------------------------
// No topic?
//-----------------------------------------
if ( ! $this->topic['tid'] )
{
$this->registry->output->showError( 'topics_no_tid', 10351, null, null, 404 );
}
//-----------------------------------------
// Locked topic?
//-----------------------------------------
if ( $this->topic['state'] != 'open' )
{
$this->registry->output->showError( 'topic_vote_locked', 10352, true, null, 403 );
}
if( ! $this->topic['status'] )
{
$this->registry->output->showError( 'topic_cannot_vote', 103152, true, null, 403 );
}
//-----------------------------------------
// Have reply permissions??
//-----------------------------------------
$cache = $this->registry->class_forums->forum_by_id;
if ( $this->registry->permissions->check( 'reply', $cache[ $this->topic['forum_id'] ] ) == FALSE )
{
$this->registry->output->showError( 'topic_vote_noreply', 10353, null, null, 403 );
}
//-----------------------------------------
// What we doing?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'add':
$this->topicAddVoteToPoll();
break;
case 'delete':
$this->topicDeletePollVotes();
break;
}
}
/**
* Add vote to poll
*
* @access public
* @return void
**/
public function topicAddVoteToPoll()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$vote_cast = array();
//-----------------------------------------
// Have we voted before?
//-----------------------------------------
$this->DB->build( array( 'select' => 'member_id',
'from' => 'voters',
'where' => "tid={$this->topic['tid']} and member_id=" . $this->memberData['member_id'] ) );
$this->DB->execute();
if ( $this->DB->getTotalRows() )
{
$this->registry->output->showError( 'topic_vote_already', 10354 );
}
//-----------------------------------------
// Sort out the new array
//-----------------------------------------
$this->request['nullvote'] = $this->request['nullvote'] ? $this->request['nullvote'] : 0 ;
if ( !$this->request['nullvote'] )
{
//-----------------------------------------
// First, which choices and ID did we choose?
// Single option poll...
//-----------------------------------------
if ( is_array( $_POST['choice'] ) and count( $_POST['choice'] ) )
{
foreach( $_POST['choice'] as $question_id => $choice_id )
{
if ( ! $question_id or ! isset($choice_id) )
{
continue;
}
$vote_cast[ $question_id ][] = $choice_id;
}
}
//-----------------------------------------
// Multi vote poll
//-----------------------------------------
foreach( $_POST as $k => $v )
{
if ( preg_match( "#^choice_(\d+)_(\d+)$#", $k, $matches ) )
{
if ( $this->request[ $k ] == 1 )
{
$vote_cast[ $matches[1] ][] = $matches[2];
}
}
}
//-----------------------------------------
// Unparse the choices
//-----------------------------------------
$poll_answers = unserialize( stripslashes( $this->topic['choices'] ) );
reset($poll_answers);
//-----------------------------------------
// Got enough votes?
//-----------------------------------------
if ( count( $vote_cast ) < count( $poll_answers ) )
{
$this->registry->output->showError( 'topic_vote_not_enough', 10355 );
}
//-----------------------------------------
// Add voter
//-----------------------------------------
$this->DB->insert( 'voters', array( 'member_id' => $this->memberData['member_id'],
'ip_address' => $this->member->ip_address,
'tid' => $this->topic['tid'],
'forum_id' => $this->topic['forum_id'],
'member_choices' => serialize( $vote_cast ),
'vote_date' => time(),
) );
//-----------------------------------------
// Loop
//-----------------------------------------
foreach ( $vote_cast as $question_id => $choice_array )
{
foreach( $choice_array as $choice_id )
{
$poll_answers[ $question_id ]['votes'][ $choice_id ]++;
if ( $poll_answers[ $question_id ]['votes'][ $choice_id ] < 1 )
{
$poll_answers[ $question_id ]['votes'][ $choice_id ] = 1;
}
}
}
//-----------------------------------------
// Save...
//-----------------------------------------
$this->topic['choices'] = addslashes( serialize( $poll_answers ) );
$this->DB->update( 'polls', "votes=votes+1,choices='{$this->topic['choices']}'", "pid={$this->topic['poll_id']}", false, true );
//-----------------------------------------
// Go bump in the night?
//-----------------------------------------
if ($this->topic['allow_pollbump'])
{
$this->topic['last_vote'] = time();
$this->topic['last_post'] = time();
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid=' . $this->topic['tid'] );
}
else
{
$this->topic['last_vote'] = time();
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid=' . $this->topic['tid'] );
}
}
else
{
//-----------------------------------------
// Add null vote
//-----------------------------------------
$this->DB->insert( 'voters', array(
'member_id' => $this->memberData['member_id'],
'ip_address' => $this->member->ip_address,
'tid' => $this->topic['tid'],
'forum_id' => $this->topic['forum_id'],
'vote_date' => time(),
) );
}
$lang = $this->request['nullvote'] ? $this->lang->words['poll_viewing_results'] : $this->lang->words['poll_vote_added'];
$this->registry->output->redirectScreen( $lang , $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
/**
* Remove votes
*
* @access public
* @return void
*/
public function topicDeletePollVotes()
{
//-----------------------------------------
// Permissions check
//-----------------------------------------
if ( ! $this->settings['poll_allow_vdelete'] AND ! $this->memberData['g_is_supmod'] )
{
$this->registry->output->showError( 'topic_cannot_vote', 103147, null, null, 403 );
}
//-----------------------------------------
// What did we vote for?
//-----------------------------------------
$voter = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'voters',
'where' => "tid=" . $this->topic['tid'] . " and member_id=" . $this->memberData['member_id'] ) );
if ( ! $voter )
{
$this->registry->output->redirectScreen( $this->lang->words['poll_vote_deleted'], $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
//-----------------------------------------
// Ok, we're here.. delete the votes
//-----------------------------------------
$this->DB->delete( 'voters', "tid=" . $this->topic['tid'] . " and member_id=" . $this->memberData['member_id'] );
//-----------------------------------------
// Remove our votes
//-----------------------------------------
$myVotes = unserialize( $voter['member_choices'] );
$pollData = unserialize( stripslashes( $this->topic['choices'] ) );
if ( is_array( $myVotes ) AND is_array( $pollData ) )
{
foreach( $myVotes as $_questionID => $data )
{
foreach( $data as $_choice )
{
$pollData[ $_questionID ]['votes'][ $_choice ]--;
$pollData[ $_questionID ]['votes'][ $_choice ] = $pollData[ $_questionID ]['votes'][ $_choice ] < 0 ? 0 : $pollData[ $_questionID ]['votes'][ $_choice ];
}
}
}
//-----------------------------------------
// Update
//-----------------------------------------
$update['votes'] = $this->topic['votes'] - 1;
$update['votes'] = $update['votes'] < 0 ? 0 : $update['votes'];
$update['choices'] = serialize( $pollData );
$this->DB->update( 'polls', $update, "tid=" . $this->topic['tid'] );
/* done */
$this->registry->output->redirectScreen( $this->lang->words['poll_vote_deleted'], $this->settings['base_url'] . "showtopic={$this->topic['tid']}&amp;st=" . $this->request['st'] );
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Announcement View
* Last Updated: $Date: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
* Last Updated: $Date: 2010-07-10 01:01:06 -0400 (Sat, 10 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5190 $
* @link http://www.invisionpower.com
* @version $Rev: 6628 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -36,7 +38,7 @@ class public_forums_forums_announcements extends ipsCommand
if ( ! $announceID )
{
$this->registry->getClass('output')->showError( 'announcement_id_missing', 10327 );
$this->registry->getClass('output')->showError( 'announcement_id_missing', 10327, null, null, 404 );
}
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ) );
@@ -45,31 +47,39 @@ class public_forums_forums_announcements extends ipsCommand
// Get the announcement
//-----------------------------------------
$_post_joins = array(
array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.announce_member_id',
'type' => 'left'
),
array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'm.member_id=pp.pp_member_id',
'type' => 'left'
),
);
/* Add custom fields join? */
if( $this->settings['custom_profile_topic'] == 1 )
{
$_post_joins[] = array(
'select' => 'pc.*',
'from' => array( 'pfields_content' => 'pc' ),
'where' => 'pc.member_id=m.member_id',
'type' => 'left'
);
}
$announce = $this->DB->buildAndFetch( array( 'select' => 'a.*',
'from' => array( 'announcements' => 'a' ),
'where' => 'a.announce_id=' . $announceID,
'add_join' => array(
array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.announce_member_id',
'type' => 'left'
),
array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'm.member_id=pp.pp_member_id',
'type' => 'left'
),
array( 'select' => 'pc.*',
'from' => array( 'pfields_content' => 'pc' ),
'where' => 'pc.member_id=m.member_id',
'type' => 'left'
),
)
'add_join' => $_post_joins
) );
if ( ! $announce['announce_id'] or ! $announce['announce_forum'] )
{
$this->registry->getClass('output')->showError( 'announcement_id_missing', 10328 );
$this->registry->getClass('output')->showError( 'announcement_id_missing', 10328, null, null, 404 );
}
//-----------------------------------------
@@ -108,12 +118,12 @@ class public_forums_forums_announcements extends ipsCommand
if ( $pass != 1 )
{
$this->registry->getClass('output')->showError( 'announcement_no_perms', 2035, true );
$this->registry->getClass('output')->showError( 'announcement_no_perms', 2035, true, null, 403 );
}
if( ! $announce['announce_active'] AND ! $this->memberData['g_is_supmod'] )
{
$this->registry->getClass('output')->showError( 'announcement_no_perms', 2036, true );
$this->registry->getClass('output')->showError( 'announcement_no_perms', 2036, true, null, 403 );
}
//-----------------------------------------
@@ -175,7 +185,7 @@ class public_forums_forums_announcements extends ipsCommand
$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1], $_nav[2], $_nav[3] );
}
$this->registry->getClass('output')->setTitle( $this->settings['board_name']." -> ". $announce['announce_title'] );
$this->registry->getClass('output')->setTitle( $announce['announce_title'] . ' - ' . $this->settings['board_name'] );
$this->registry->getClass('output')->addContent( $template );
$this->registry->getClass('output')->sendOutput();
@@ -231,12 +241,12 @@ class public_forums_forums_announcements extends ipsCommand
{
continue;
}
if ( ! $r['announce_start'] )
{
$start_ok = 1;
}
else if ( $r['announce_start'] < time() )
else if ( $r['announce_start'] <= mktime( 12, 0, 0 ) )
{
$start_ok = 1;
}
@@ -245,26 +255,27 @@ class public_forums_forums_announcements extends ipsCommand
{
$end_ok = 1;
}
else if ( $r['announce_end'] > time() )
else if ( $r['announce_end'] >= mktime( 12, 0, 0 ) )
{
$end_ok = 1;
}
if ( $start_ok and $end_ok )
{
$cache[ $r['announce_id'] ] = array( 'announce_id' => $r['announce_id'],
'announce_title' => $r['announce_title'],
'announce_start' => $r['announce_start'],
'announce_end' => $r['announce_end'],
'announce_forum' => $r['announce_forum'],
'announce_views' => $r['announce_views'],
'member_id' => $r['member_id'],
'member_name' => $r['members_display_name'],
'members_seo_name' => $r['members_seo_name']
$cache[ $r['announce_id'] ] = array( 'announce_id' => $r['announce_id'],
'announce_title' => $r['announce_title'],
'announce_seo_title' => IPSText::makeSeoTitle( $r['announce_title'] ),
'announce_start' => $r['announce_start'],
'announce_end' => $r['announce_end'],
'announce_forum' => $r['announce_forum'],
'announce_views' => $r['announce_views'],
'member_id' => $r['member_id'],
'member_name' => $r['members_display_name'],
'members_seo_name' => $r['members_seo_name']
);
}
}
$this->DB->obj['use_shutdown'] = 0;
$this->registry->cache()->setCache( 'announcements', $cache, array( 'array' => 1 ) );
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* View Topic Attachments
* Last Updated: $Date: 2009-08-13 19:35:55 -0400 (Thu, 13 Aug 2009) $
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: danc $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5015 $
* @link http://www.invisionpower.com
* @version $Rev: 6502 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -38,7 +40,7 @@ class public_forums_forums_attach extends ipsCommand
/* Make sure we have a topic */
if ( ! $topic_id )
{
$this->registry->getClass('output')->showError( 'attach_missing_tid', 10329 );
$this->registry->getClass('output')->showError( 'attach_missing_tid', 10329, null, null, 404 );
}
/* Query the topic */
@@ -46,20 +48,20 @@ class public_forums_forums_attach extends ipsCommand
if ( ! $topic['topic_hasattach'] )
{
$this->registry->getClass('output')->showError( 'attach_no_attachments', 10330 );
$this->registry->getClass('output')->showError( 'attach_no_attachments', 10330, null, null, 404 );
}
/* Check the forum */
if ( ! $this->registry->getClass('class_forums')->forum_by_id[ $topic['forum_id'] ] )
{
$this->registry->getClass('output')->showError( 'attach_no_forum_perm', 2037, true );
$this->registry->getClass('output')->showError( 'attach_no_forum_perm', 2037, true, null, 403 );
}
/* Build the attachment display */
$this->registry->getClass('output')->addContent( $this->getAttachments( $topic ) );
/* Set the title */
$this->registry->getClass('output')->setTitle( $this->settings['board_name'] . ' -> ' . $topic['title'] .' -> ' . $this->lang->words['attach_page_title'] );
$this->registry->getClass('output')->setTitle($topic['title'] .' -> ' . $this->lang->words['attach_page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
/* Set the navigation */
$navigation = $this->registry->getClass('class_forums')->forumsBreadcrumbNav( $topic['forum_id'] );
@@ -1,18 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Board Index View
* Last Updated: $Date: 2009-11-13 19:55:00 -0500 (Fri, 13 Nov 2009) $
* Last Updated: $Date: 2010-10-12 13:04:59 -0400 (Tue, 12 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5405 $
* @link http://www.invisionpower.com
* @version $Rev: 6964 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -26,7 +27,6 @@ class public_forums_forums_boards extends ipsCommand
/**
* Main Execution Function
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
@@ -52,6 +52,9 @@ class public_forums_forums_boards extends ipsCommand
$cat_data = $this->processAllCategories();
/* Data Hook Location */
IPSLib::doDataHooks( $cat_data, 'boardIndexCategories' );
//-----------------------------------------
// Add in show online users
//-----------------------------------------
@@ -75,17 +78,14 @@ class public_forums_forums_boards extends ipsCommand
/* Check for sidebar hooks */
$show_sidebar = false;
if( is_array( $this->caches['hooks']['templateHooks'] ) )
if( is_array( $this->caches['hooks']['templateHooks']['skin_boards'] ) )
{
foreach( $this->caches['hooks']['templateHooks'] as $hook )
foreach( $this->caches['hooks']['templateHooks']['skin_boards'] as $c => $hook )
{
foreach( $hook as $c )
if( $hook['id'] == 'side_blocks' && $hook['skinFunction'] == 'boardIndexTemplate' )
{
if( $c['id'] == 'side_blocks' && $c['skinGroup'] == 'skin_boards' && $c['skinFunction'] == 'boardIndexTemplate' )
{
$show_sidebar = true;
break 2;
}
$show_sidebar = true;
break;
}
}
}
@@ -96,14 +96,21 @@ class public_forums_forums_boards extends ipsCommand
$stats_info = $this->getTotalTextString();
$active = array_merge( $active, array(
'text' => $this->lang->words['total_word_string'],
'posts' => $this->total_posts,
'active' => $this->users_online,
'members' => $this->total_members,
'cut_off' => $this->settings['au_cutoff'],
'info' => $stats_info
) );
/* Data Hook Location */
IPSLib::doDataHooks( $active, 'boardIndexOnlineUsers' );
$template = $this->registry->getClass('output')->getTemplate('boards')->boardIndexTemplate(
$this->registry->getClass( 'class_localization')->getDate( $this->memberData['last_visit'], 'LONG' ),
array_merge( $active, array( 'text' => $this->lang->words['total_word_string'],
'posts' => $this->total_posts,
'active' => $this->users_online,
'members' => $this->total_members,
'cut_off' => $this->settings['au_cutoff'],
'info' => $stats_info ) ),
$active,
$this->getCalendarEvents(),
$this->getBirthdays(),
$chat_html,
@@ -111,11 +118,34 @@ class public_forums_forums_boards extends ipsCommand
$cat_data,
$show_sidebar );
//-----------------------------------------
// Meta tags
//-----------------------------------------
if( $this->settings['seo_index_md'] )
{
$this->registry->output->addMetaTag( 'description', $this->settings['seo_index_md'], false );
}
if( $this->settings['seo_index_mk'] )
{
$this->registry->output->addMetaTag( 'keywords', $this->settings['seo_index_mk'], false );
}
$this->registry->output->addCanonicalTag( "act=idx", 'public', 'false' );
/* Set Ad code for the board index */
if( $this->registry->getClass('IPSAdCode')->userCanViewAds() )
{
$this->registry->getClass('IPSAdCode')->setGlobalCode( 'header', 'ad_code_board_index_header' );
$this->registry->getClass('IPSAdCode')->setGlobalCode( 'footer', 'ad_code_board_index_footer' );
}
//-----------------------------------------
// Print as normal
//-----------------------------------------
$this->registry->getClass('output')->setTitle( $this->settings['board_name'] );
$this->registry->getClass('output')->setTitle( $this->settings['seo_index_title'] ? $this->settings['seo_index_title'] : $this->settings['board_name'] );
$this->registry->getClass('output')->addContent( $template );
$this->registry->getClass('output')->sendOutput();
}
@@ -123,10 +153,9 @@ class public_forums_forums_boards extends ipsCommand
/**
* Builds an array of category data
*
* @access public
* @param integer $fid ID of the forum to get sub forums for
* @return array
**/
*/
public function showSubForums( $fid )
{
/* INIT */
@@ -183,9 +212,8 @@ class public_forums_forums_boards extends ipsCommand
/**
* Builds an array of category data for output
*
* @access public
* @return array
**/
*/
public function processAllCategories()
{
/* INIT */
@@ -280,9 +308,8 @@ class public_forums_forums_boards extends ipsCommand
/**
* Returns an array of active users
*
* @access public
* @return array
**/
*/
public function getActiveUserDetails()
{
$active = array( 'TOTAL' => 0 ,
@@ -349,7 +376,7 @@ class public_forums_forums_boards extends ipsCommand
foreach ( $rows as $result )
{
$last_date = $this->registry->getClass('class_localization')->getTime( $result['running_time'] );
$last_date = $this->registry->getClass('class_localization')->getDate( $result['running_time'], 'TINY' );
//-----------------------------------------
// Bot?
@@ -414,7 +441,7 @@ class public_forums_forums_boards extends ipsCommand
$result['member_name'] = IPSLib::makeNameFormatted( $result['member_name'], $result['member_group'] );
if ( ! $this->settings['disable_anonymous'] AND $result['login_type'] )
if ( $result['login_type'] )
{
if ( $this->memberData['g_access_cp'] and ($this->settings['disable_admin_anon'] != 1) )
{
@@ -448,9 +475,8 @@ class public_forums_forums_boards extends ipsCommand
/**
* Returns a string of calendar events
*
* @access public
* @return mixed HTML string, or false
**/
*/
public function getCalendarEvents()
{
//-----------------------------------------
@@ -670,22 +696,21 @@ class public_forums_forums_boards extends ipsCommand
/**
* Returns an array of birthday information
*
* @access public
* @return mixed Array of birthday information, or false
**/
*/
public function getBirthdays()
{
if ($this->settings['show_birthdays'] or $this->settings['show_calendar'] )
{
$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->registry->getClass( 'class_localization')->getTimeOffset() ) );
$day = $a[2];
$month = $a[1];
$year = $a[0];
$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->registry->getClass( 'class_localization')->getTimeOffset() ) );
$day = $a[2];
$month = $a[1];
$year = $a[0];
$birthstring = "";
$count = 0;
$users = array();
$birthstring = "";
$count = 0;
$lang = '';
$users = array();
if ( $this->settings['show_birthdays'] )
{
@@ -753,9 +778,8 @@ class public_forums_forums_boards extends ipsCommand
/**
* Returns an array of board stats
*
* @access public
* @return string Stats string
**/
*/
public function getTotalTextString()
{
/* INIT */
@@ -823,5 +847,4 @@ class public_forums_forums_boards extends ipsCommand
return $stats_output;
}
}
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Default section file for forums public module
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 4948 $
* @version $Rev: 5713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -1,18 +1,20 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Bounces a user to the right post
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
* Last Updated: $Date: 2010-07-12 18:26:09 -0400 (Mon, 12 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 4948 $
* @link http://www.invisionpower.com
* @version $Rev: 6635 $
* @since 14th April 2004
*
* | > Interesting Fact: I've had iTunes playing every Radiohead tune
@@ -50,7 +52,7 @@ class public_forums_forums_findpost extends ipsCommand
if ( ! $pid )
{
$this->registry->getClass('output')->showError( 'findpost_missing_pid', 10331 );
$this->registry->getClass('output')->showError( 'findpost_missing_pid', 10331, null, null, 404 );
}
//-----------------------------------------
@@ -72,10 +74,36 @@ class public_forums_forums_findpost extends ipsCommand
if ( ! $post['topic_id'] )
{
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332 );
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332, null, null, 404 );
}
$cposts = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$post['topic_id']} AND pid <= {$pid}" ) );
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery('visible');
/* Can we deal with hidden posts? */
if ( $this->registry->class_forums->canQueuePosts( $this->topic['forum_id'] ) )
{
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = '';
}
else
{
/* Otherwise, see queued and approved */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ) );
}
}
else
{
/* We cannot see hidden posts */
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted') );
}
}
$cposts = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$post['topic_id']} AND pid <= {$pid}{$query}" ) );
if ( (($cposts['posts']) % $this->settings['display_max_posts']) == 0 )
{
@@ -1,18 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Forum Viewing
* Last Updated: $Date: 2009-10-07 11:36:50 -0400 (Wed, 07 Oct 2009) $
* Last Updated: $Date: 2010-11-12 17:23:13 -0500 (Fri, 12 Nov 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 5214 $
* @link http://www.invisionpower.com
* @version $Rev: 7175 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -26,7 +27,6 @@ class public_forums_forums_forums extends ipsCommand
/**
* Array of form data
*
* @access private
* @var array
*/
private $forum = array();
@@ -34,7 +34,6 @@ class public_forums_forums_forums extends ipsCommand
/**
* Array of topic ids to open
*
* @access private
* @var array
*/
private $update_topics_open = array();
@@ -42,15 +41,20 @@ class public_forums_forums_forums extends ipsCommand
/**
* Array of topic ids to close
*
* @access private
* @var array
*/
private $update_topics_close = array();
/**
* Permissions array
*
*/
protected $permissions = array();
private $_sdTids = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
@@ -91,7 +95,7 @@ class public_forums_forums_forums extends ipsCommand
if( ! $this->forum['id'] )
{
$this->registry->getClass('output')->showError( 'forums_no_id', 10333 );
$this->registry->getClass('output')->showError( 'forums_no_id', 10333, null, null, 404 );
}
//-----------------------------------------
@@ -208,9 +212,15 @@ class public_forums_forums_forums extends ipsCommand
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberdata['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
$this->forum['rules_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $this->forum['rules_text'] );
if( ! $this->forum['rules_raw_html'] )
{
$this->forum['rules_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $this->forum['rules_text'] );
}
}
/* Data Hook Location */
IPSLib::doDataHooks( $data, 'forumViewData' );
//-----------------------------------------
// Show the template
@@ -228,7 +238,7 @@ class public_forums_forums_forums extends ipsCommand
$this->registry->getClass('class_forums')->forumsGetModerators( $this->forum['id'] )
);
$this->registry->getClass('output')->setTitle( $this->settings['board_name'] . ' -> ' . $this->forum['name'] );
$this->registry->getClass('output')->setTitle( strip_tags($this->forum['name']) . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->getClass('output')->addContent( $template );
if( is_array( $this->nav ) AND count( $this->nav ) )
@@ -238,6 +248,13 @@ class public_forums_forums_forums extends ipsCommand
$this->registry->getClass('output')->addNavigation( $_nav[0], $_nav[1], $_nav[2], $_nav[3] );
}
}
/* Set Ad code for the board index */
if( $this->registry->getClass('IPSAdCode')->userCanViewAds() )
{
$this->registry->getClass('IPSAdCode')->setGlobalCode( 'header', 'ad_code_forum_view_header' );
$this->registry->getClass('IPSAdCode')->setGlobalCode( 'footer', 'ad_code_forum_view_footer' );
}
if( $this->forum['parent_id'] == 0 )
{
@@ -255,9 +272,8 @@ class public_forums_forums_forums extends ipsCommand
/**
* Setup for the forum controller
*
* @access public
* @return void
**/
*/
public function initForums()
{
$this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'public_forums', 'public_boards' ) );
@@ -282,9 +298,8 @@ class public_forums_forums_forums extends ipsCommand
/**
* Builds permissions for the forum controller
*
* @access private
* @return void
**/
*/
private function _buildPermissions()
{
$mod = $this->memberData['forumsModeratorData'];
@@ -312,18 +327,29 @@ class public_forums_forums_forums extends ipsCommand
$this->can_open_topics = 1;
}
}
$this->permissions['PostSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeletePosts( $this->forum['id'], array() );
$this->permissions['PostSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeletePosts( $this->forum['id'] );
$this->permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( $this->forum['id'] );
$this->permissions['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( $this->forum['id'] );
$this->permissions['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( $this->forum['id'] );
$this->permissions['TopicSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeleteTopics( $this->forum['id'], array() );
$this->permissions['TopicSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeleteTopics( $this->forum['id'] );
$this->permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( $this->forum['id'] );
$this->permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( $this->forum['id'] );
$this->forum['permissions'] =& $this->permissions;
}
/**
* Builds output array for sub forums
*
* @access public
* @return array
**/
*/
public function showSubForums()
{
require_once( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/boards.php' );
$boards = new public_forums_forums_boards();
{
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/boards.php', 'public_forums_forums_boards' );
$boards = new $classToLoad();
$boards->makeRegistryShortcuts( $this->registry );
return $boards->showSubForums( $this->request['f'] );
@@ -332,9 +358,8 @@ class public_forums_forums_forums extends ipsCommand
/**
* Forum view check for authentication
*
* @access public
* @return string HTML
**/
*/
public function showForum()
{
// are we checking for user authentication via the log in form
@@ -351,19 +376,18 @@ class public_forums_forums_forums extends ipsCommand
/**
* Authenicate the log in for a password protected forum
*
* @access public
* @return void
**/
*/
public function authenticateUser()
{
if( $this->request['f_password'] == "" )
{
$this->registry->getClass('output')->showError( 'forums_pass_blank', 10337 );
$this->registry->getClass('output')->showError( 'forums_pass_blank', 10337, null, null, 403 );
}
if( $this->request['f_password'] != $this->forum['password'] )
{
$this->registry->getClass('output')->showError( 'forums_wrong_pass', 10338 );
$this->registry->getClass('output')->showError( 'forums_wrong_pass', 10338, null, null, 403 );
}
IPSCookie::set( "ipbforumpass_".$this->forum['id'], md5( $this->request['f_password'] ) );
@@ -374,9 +398,8 @@ class public_forums_forums_forums extends ipsCommand
/**
* Builds an array of forum data for use in the output template
*
* @access public
* @return array
**/
*/
public function renderForum()
{
//-----------------------------------------
@@ -447,7 +470,7 @@ class public_forums_forums_forums extends ipsCommand
{
if ( $announce['announce_start'] )
{
$announce['announce_start'] = gmstrftime( '%x', $announce['announce_start'] );
$announce['announce_start'] = $this->lang->getDate( $announce['announce_start'], 'date' );
}
else
{
@@ -650,13 +673,27 @@ class public_forums_forums_forums extends ipsCommand
// Moderator?
//-----------------------------------------
if( ! $this->memberData['is_mod'] )
if ( $this->memberData['is_mod'] )
{
$_SQL_APPROVED = ' AND t.approved=1';
if ( $this->permissions['TopicSoftDeleteSee'] )
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden', 'sdeleted'), 't.');
}
else
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden'), 't.');
}
}
else
{
$_SQL_APPROVED = ''; //' AND t.approved IN (0,1)'; If you are an admin, it's not needed and eliminates a filesort in some cases
if ( $this->permissions['TopicSoftDeleteSee'] )
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'sdeleted'), 't.');
}
else
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible'), 't.');
}
}
if ( $Prune )
@@ -710,6 +747,12 @@ class public_forums_forums_forums extends ipsCommand
else
{
$total_possible['max'] = $this->memberData['is_mod'] ? $this->forum['topics'] + $this->forum['queued_topics'] : $this->forum['topics'];
if ( $this->permissions['TopicSoftDeleteSee'] AND $this->forum['deleted_topics'] )
{
$total_possible['max'] += intval( $this->forum['deleted_topics'] );
}
$Prune = 0;
}
@@ -717,12 +760,19 @@ class public_forums_forums_forums extends ipsCommand
// Generate the forum page span links
//-----------------------------------------
$_extraStuff = '';
if( $this->request['modfilter'] )
{
$_extraStuff .= "&amp;modfilter=" . $this->request['modfilter'];
}
$this->forum['SHOW_PAGES'] = $this->registry->getClass('output')->generatePagination( array(
'totalItems' => $total_possible['max'],
'itemsPerPage' => $this->settings['display_max_topics'],
'currentStartValue' => $this->request['st'],
'seoTitle' => $this->forum['name_seo'],
'baseUrl' => "showforum=".$this->forum['id']."&amp;prune_day={$prune_value}&amp;sort_by={$sort_by}&amp;sort_key={$sort_key_chk}&amp;topicfilter={$topicfilter}",
'baseUrl' => "showforum=".$this->forum['id']."&amp;prune_day={$prune_value}&amp;sort_by={$sort_by}&amp;sort_key={$sort_key_chk}&amp;topicfilter={$topicfilter}{$_extraStuff}",
) );
//-----------------------------------------
@@ -824,7 +874,7 @@ class public_forums_forums_forums extends ipsCommand
$this->DB->build( array(
'select' => 'author_id, topic_id',
'from' => 'posts',
'where' => 'author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topic_ids ) . ')',
'where' => 'queued=0 AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topic_ids ) . ')',
) );
$this->DB->execute();
@@ -864,14 +914,25 @@ class public_forums_forums_forums extends ipsCommand
//-----------------------------------------
// Show meh the topics!
//-----------------------------------------
$adCodeSet = false;
foreach( $topic_array as $topic )
{
/* AD Code */
if( $this->registry->getClass('IPSAdCode')->userCanViewAds() && ! $adCodeSet )
{
if( $this->registry->getClass('IPSAdCode')->getAdCode('ad_code_forum_view_topic_code') )
{
$topic['_adCode'] = $this->registry->getClass('IPSAdCode')->getAdCode('ad_code_forum_view_topic_code');
$adCodeSet = true;
}
}
if ( $topic['pinned'] )
{
$this->pinned_topic_count++;
}
$topic_data[ $topic['tid'] ] = $this->renderEntry( $topic );
$total_topics_printed++;
@@ -980,6 +1041,12 @@ class public_forums_forums_forums extends ipsCommand
$this->DB->update( 'topics', array( 'state' => 'closed' ), 'tid IN ('.implode( ",", $this->update_topics_close ) .')' );
}
/* Got soft delete tids? */
if ( is_array( $this->_sdTids ) AND count( $this->_sdTids ) )
{
$other_data['sdData'] = IPSDeleteLog::fetchEntries( $this->_sdTids, 'topic', false );
}
return array( 'announce_data' => $announce_data,
'topic_data' => $topic_data,
'other_data' => $other_data,
@@ -991,11 +1058,10 @@ class public_forums_forums_forums extends ipsCommand
/**
* Generate active user data
*
* @access private
* @return array Array of data (not the most helpful description ever. Sorry
* @author Matt
*/
private function _generateActiveUserData()
protected function _generateActiveUserData()
{
//-----------------------------------------
// INIT
@@ -1009,7 +1075,6 @@ class public_forums_forums_forums extends ipsCommand
$active = array( 'guests' => 0, 'anon' => 0, 'members' => 0, 'names' => array() );
$rows = array( $ar_time => array( 'login_type' => substr($this->memberData['login_anonymous'],0, 1),
'id' => $this->member->session_id,
'location' => 'sf',
'running_time' => $ar_time,
'seo_name' => $this->memberData['members_seo_name'],
'member_id' => $this->memberData['member_id'],
@@ -1021,7 +1086,7 @@ class public_forums_forums_forums extends ipsCommand
//-----------------------------------------
$this->DB->build( array(
'select' => 's.member_id, s.member_name, s.member_group, s.id, s.login_type, s.location, s.running_time, s.uagent_type, s.seo_name',
'select' => 's.member_id, s.member_name, s.member_group, s.id, s.login_type, s.running_time, s.uagent_type, s.seo_name, s.current_module',
'from' => array( 'sessions' => 's' ),
'where' => "s.location_2_type='forum' AND s.location_2_id={$this->forum['id']} AND s.running_time > {$time} AND s.in_error=0",
'add_join' => array(
@@ -1054,7 +1119,7 @@ class public_forums_forums_forums extends ipsCommand
{
$result['member_name'] = IPSLib::makeNameFormatted( $result['member_name'], $result['member_group'] );
$last_date = $this->registry->getClass( 'class_localization')->getTime( $result['running_time'] );
$last_date = $this->registry->getClass( 'class_localization')->getDate( $result['running_time'], 'TINY' );
if ( $result['member_id'] == 0 OR ! $result['member_name'] )
{
@@ -1124,7 +1189,7 @@ class public_forums_forums_forums extends ipsCommand
$p_title = sprintf( $this->lang->words['au_posting'], $last_date );
}
if ( ! $this->settings['disable_anonymous'] AND $result['login_type'] )
if ( $result['login_type'] )
{
if ( $this->memberData['g_access_cp'] and ($this->settings['disable_admin_anon'] != 1) )
{
@@ -1153,11 +1218,10 @@ class public_forums_forums_forums extends ipsCommand
/**
* Parase Topic Data
*
* @access public
* @param array $topic Topic data
* @param bool $last_time_default Use default "last read time"
* @return array
**/
*/
public function parseTopicData( $topic, $last_time_default=true )
{
//-----------------------------------------
@@ -1167,6 +1231,19 @@ class public_forums_forums_forums extends ipsCommand
$topic['real_tid'] = $topic['tid'];
$topic['_last_post'] = $topic['last_post'];
/* Update perms */
$this->permissions['TopicSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeleteTopics( $this->forum['id'], $topic );
$topic['_isVisible'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $topic ) == 'visible' ) ? true : false;
$topic['_isHidden'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $topic ) == 'hidden' ) ? true : false;
$topic['_isDeleted'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $topic ) == 'sdelete' ) ? true : false;
/* Collect TIDS of soft deleted topics */
if ( $topic['_isDeleted'] AND $this->permissions['TopicSoftDeleteSee'] )
{
$this->_sdTids[] = $topic['tid'];
}
//-----------------------------------------
// Do we have an SEO title?
//-----------------------------------------
@@ -1269,7 +1346,7 @@ class public_forums_forums_forums extends ipsCommand
$show_dots = 1;
}
$topic['folder_img'] = $this->registry->getClass('class_forums')->fetchTopicFolderIcon( $topic, $show_dots, $is_read );
$topic['folder_img'] = $this->registry->getClass('class_forums')->fetchTopicFolderIcon( $topic, $show_dots, $is_read );
$topic['start_date'] = $this->registry->getClass( 'class_localization')->getDate( $topic['start_date'], 'LONG' );
@@ -1280,7 +1357,7 @@ class public_forums_forums_forums extends ipsCommand
$pages = 1;
$topic['PAGES'] = "";
if ( $this->memberData['is_mod'] )
if ( $this->permissions['canQueue'] )
{
$topic['posts'] += intval($topic['topic_queuedposts']);
}
@@ -1332,8 +1409,9 @@ class public_forums_forums_forums extends ipsCommand
// Format some numbers
//-----------------------------------------
$topic['posts'] = $this->registry->getClass('class_localization')->formatNumber( intval($topic['posts']) );
$topic['views'] = $this->registry->getClass('class_localization')->formatNumber( intval($topic['views']) );
$topic['__posts'] = $topic['posts'];
$topic['posts'] = $this->registry->getClass('class_localization')->formatNumber( intval($topic['posts']) );
$topic['views'] = $this->registry->getClass('class_localization')->formatNumber( intval($topic['views']) );
//-----------------------------------------
// Jump to latest post / last time stuff...
@@ -1348,7 +1426,7 @@ class public_forums_forums_forums extends ipsCommand
$topic['go_new_post'] = false;
}
$topic['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $topic['last_post'], 'SHORT' );
// $topic['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $topic['last_post'], 'SHORT' );
//-----------------------------------------
// Linky pinky!
@@ -1431,10 +1509,9 @@ class public_forums_forums_forums extends ipsCommand
/**
* Returns an array of topic data
*
* @access public
* @param array Topic entry
* @return array
**/
*/
public function renderEntry( $topic )
{
$topic = $this->parseTopicData( $topic );
@@ -1444,53 +1521,18 @@ class public_forums_forums_forums extends ipsCommand
$topic['attach_img'] = isset($topic['attach_img']) ? $topic['attach_img'] : '';
$topic['_hasqueued'] = isset($topic['_hasqueued']) ? $topic['_hasqueued'] : '';
$topic['tidon'] = isset($topic['tidon']) ? $topic['tidon'] : 0;
$topic['_show_announce_bar'] = 0;
$topic['_show_pin_bar'] = 0;
$topic['_show_topics_bar'] = 0;
$p_start = "";
$p_end = "";
$this->forum['_pinBarShown'] = 0;
if( $topic['pinned'] == 1 )
{
$topic['prefix'] = $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap( $this->settings['pre_pinned'] );
if ( $this->forum['_pinBarShown'] == 0 )
{
$topic['_show_pin_bar'] = 1;
$this->forum['_pinBarShown'] = 1;
}
return $topic;
}
else
{
//-----------------------------------------
// This is not a pinned topic, so lets check to see if we've
// printed the footer yet.
//-----------------------------------------
if( $this->forum['_pinBarShown'] == 1 OR $this->forum['_showAnnouncementsBar'] )
{
//-----------------------------------------
// Nope, so..
//-----------------------------------------
$topic['_show_topics_bar'] = 1;
$this->forum['_showAnnouncementsBar'] = 0;
$this->forum['_pinBarShown'] = 0;
}
return $topic;
}
return $topic;
}
/**
* Given an array of possible variables, the first one found is returned
*
* @access public
* @param array Mixed variables
* @return mixed First variable from the array
* @since 2.0
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
Loaded 100 of 2563 files, more files were not shown because too many files have changed in this diff. Show more