Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Subscriptions Hooks Gateway "Handler"
|
||||
* Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
|
||||
* Last Updated: $Date: 2011-06-10 13:49:21 -0400 (Fri, 10 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://hatynka.in
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 9029 $
|
||||
*/
|
||||
|
||||
class core_hookGateway
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Method constructor
|
||||
*
|
||||
* @param object Registry Object
|
||||
* @return @e void
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Subscriptions Hooks Gateway "Handler"
|
||||
* Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
class core_hookGateway
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Method constructor
|
||||
*
|
||||
* @param object Registry Object
|
||||
* @return @e void
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,360 +1,382 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Library of shared methods for hooks installation/configuration
|
||||
* Last Updated: $LastChangedDate: 2011-07-22 06:21:22 -0400 (Fri, 22 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9303 $
|
||||
*/
|
||||
|
||||
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 hooksFunctions
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e 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;
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_applications' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available hook ids in a function for a given type
|
||||
*
|
||||
* @param string Skin Function
|
||||
* @param string Hook type [foreach|if]
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getHookIds( $template='', $type='' )
|
||||
{
|
||||
if( !$template )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$type = $type ? $type : 'foreach';
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'template_content', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_name='{$template}'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Use regex to try to find the ids */
|
||||
|
||||
$matches = array();
|
||||
|
||||
if( $type == 'foreach' )
|
||||
{
|
||||
preg_match_all( "#\<foreach\s+loop=\"(.+?)\:(.+?)\"\>#i", $r['template_content'], $matches );
|
||||
}
|
||||
else
|
||||
{
|
||||
preg_match_all( "#\<if\s+test=\"([^\>]+?)\:\|\:(.+?)\"\>#i", $r['template_content'], $matches );
|
||||
}
|
||||
|
||||
if( is_array($matches[1]) AND count($matches[1]) )
|
||||
{
|
||||
foreach( $matches[1] as $match )
|
||||
{
|
||||
$return[ $match ] = array( $match, $match );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Put the ids in alphabetical order, kinda hacky, oh well ;) */
|
||||
ksort( $return );
|
||||
|
||||
array_unshift( $return, array( 0, $this->lang->words['h_selectid'] ) );
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available skin files
|
||||
*
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getSkinGroups()
|
||||
{
|
||||
$return = array( array( 0, $this->lang->words['h_selectfile'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ), 'from' => 'skin_templates', 'order' => 'template_group ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['template_group'], $r['template_group'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available skin templates in a skin group
|
||||
*
|
||||
* @param string Skin Group
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getSkinMethods( $file='' )
|
||||
{
|
||||
if( !$file )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$return = array( array( 0, $this->lang->words['h_selecttemp'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_name' ), 'from' => 'skin_templates', 'where' => "template_group='{$file}'", 'order' => 'template_name ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['template_name'], $r['template_name'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve css files for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getCSSFiles()
|
||||
{
|
||||
/* Query CSS Files */
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct('css_group'), 'from' => 'skin_css', 'order' => 'css_group ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through CSS Files and add to array */
|
||||
$cssFiles = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cssFiles[] = array( $r['css_group'], $r['css_group'] );
|
||||
}
|
||||
|
||||
return $cssFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve setting groups for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getSettingGroups()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'conf_title_keyword, conf_title_title', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['conf_title_keyword'], $r['conf_title_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve settings for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getSettings()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'conf_key, conf_title', 'from' => 'core_sys_conf_settings', 'order' => 'conf_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['conf_key'], $r['conf_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available modules for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getModules()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build(
|
||||
array(
|
||||
'select' => 'm.sys_module_application, m.sys_module_key, m.sys_module_title, m.sys_module_admin',
|
||||
'from' => array( 'core_sys_module' => 'm' ),
|
||||
'order' => 'a.app_title ASC, m.sys_module_title ASC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'a.app_title',
|
||||
'from' => array( 'core_applications' => 'a' ),
|
||||
'where' => 'a.app_directory=m.sys_module_application',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$admin = $r['sys_module_admin'] ? $this->lang->words['hook_admin_module'] : $this->lang->words['hook_public_module'];
|
||||
$prefix = $r['sys_module_admin'] ? 'admin' : 'public';
|
||||
|
||||
$return[] = array( $prefix.'-'.$r['sys_module_application'].'-'.$r['sys_module_key'], $r['app_title'] . ':: ' . $r['sys_module_title'] . $admin );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available Help Files for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getHelpFiles()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, title', 'from' => 'faq', 'order' => 'title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['title'], $r['title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available tasks for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getTasks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'task_key, task_title', 'from' => 'task_manager', 'order' => 'task_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['task_key'], $r['task_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available language files
|
||||
*
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getLanguageFiles()
|
||||
{
|
||||
$return = array( array( 0, $this->lang->words['selectafile'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => 'word_app, word_pack', 'from' => 'core_sys_lang_words', 'group' => 'word_app, word_pack', 'order' => 'word_app, word_pack' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['word_app'] . '_' . $r['word_pack'], $r['word_app'] . '_' . $r['word_pack'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available language strings in a given file
|
||||
*
|
||||
* @param string Language file
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getStrings( $file='' )
|
||||
{
|
||||
if( !$file )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$bits = explode( '_', $file );
|
||||
$app = $bits[0];
|
||||
$pack = str_replace( $app . '_', '', $file );
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'word_key' ), 'from' => 'core_sys_lang_words', 'where' => "word_app='{$app}' AND word_pack='{$pack}'", 'order' => 'word_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['word_key'], $r['word_key'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Library of shared methods for hooks installation/configuration
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
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 hooksFunctions
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e 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;
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_applications' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available hook ids in a function for a given type
|
||||
*
|
||||
* @param string Skin Function
|
||||
* @param string Hook type [foreach|if]
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getHookIds( $template='', $type='', $group='' )
|
||||
{
|
||||
if( !$template )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$type = $type ? $type : 'foreach';
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'template_content', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_name='{$template}'" . ( $group ? " AND template_group='{$group}'" : '' ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Use regex to try to find the ids */
|
||||
|
||||
$matches = array();
|
||||
|
||||
if( $type == 'foreach' )
|
||||
{
|
||||
preg_match_all( "#\<foreach\s+loop=\"(.+?)\:(.+?)\"\>#i", $r['template_content'], $matches );
|
||||
}
|
||||
else
|
||||
{
|
||||
preg_match_all( "#\<if\s+test=\"([^\>]+?)\:\|\:(.+?)\"\>#i", $r['template_content'], $matches );
|
||||
}
|
||||
|
||||
if( is_array($matches[1]) AND count($matches[1]) )
|
||||
{
|
||||
foreach( $matches[1] as $match )
|
||||
{
|
||||
$return[ $match ] = array( $match, $match );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Put the ids in alphabetical order, kinda hacky, oh well ;) */
|
||||
ksort( $return );
|
||||
|
||||
array_unshift( $return, array( 0, $this->lang->words['h_selectid'] ) );
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available skin files
|
||||
*
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getSkinGroups()
|
||||
{
|
||||
$return = array( array( 0, $this->lang->words['h_selectfile'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ), 'from' => 'skin_templates', 'order' => 'template_group ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['template_group'], $r['template_group'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available skin templates in a skin group
|
||||
*
|
||||
* @param string Skin Group
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getSkinMethods( $file='' )
|
||||
{
|
||||
if( !$file )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$return = array( array( 0, $this->lang->words['h_selecttemp'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_name' ), 'from' => 'skin_templates', 'where' => "template_group='{$file}'", 'order' => 'template_name ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['template_name'], $r['template_name'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve css files for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getCSSFiles()
|
||||
{
|
||||
/* Query CSS Files */
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct('css_group'), 'from' => 'skin_css', 'order' => 'css_group ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through CSS Files and add to array */
|
||||
$cssFiles = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cssFiles[] = array( $r['css_group'], $r['css_group'] );
|
||||
}
|
||||
|
||||
return $cssFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve skin replacements for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getSkinReplacements()
|
||||
{
|
||||
/* Query CSS Files */
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct('replacement_key'), 'from' => 'skin_replacements', 'order' => 'replacement_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through CSS Files and add to array */
|
||||
$replacements = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$replacements[] = array( $r['replacement_key'], $r['replacement_key'] );
|
||||
}
|
||||
|
||||
return $replacements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve setting groups for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getSettingGroups()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'conf_title_keyword, conf_title_title', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['conf_title_keyword'], $r['conf_title_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve settings for multiselect
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getSettings()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'conf_key, conf_title', 'from' => 'core_sys_conf_settings', 'order' => 'conf_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['conf_key'], $r['conf_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available modules for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getModules()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build(
|
||||
array(
|
||||
'select' => 'm.sys_module_application, m.sys_module_key, m.sys_module_title, m.sys_module_admin',
|
||||
'from' => array( 'core_sys_module' => 'm' ),
|
||||
'order' => 'a.app_title ASC, m.sys_module_title ASC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'a.app_title',
|
||||
'from' => array( 'core_applications' => 'a' ),
|
||||
'where' => 'a.app_directory=m.sys_module_application',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$admin = $r['sys_module_admin'] ? $this->lang->words['hook_admin_module'] : $this->lang->words['hook_public_module'];
|
||||
$prefix = $r['sys_module_admin'] ? 'admin' : 'public';
|
||||
|
||||
$return[] = array( $prefix . '-' . $r['sys_module_application'] . '-' . $r['sys_module_key'], $r['app_title'] . ':: ' . $r['sys_module_title'] . ' ' . $admin );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available Help Files for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getHelpFiles()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, title', 'from' => 'faq', 'order' => 'title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['title'], $r['title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available tasks for export
|
||||
*
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getTasks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'task_key, task_title', 'from' => 'task_manager', 'order' => 'task_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['task_key'], $r['task_title'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available language files
|
||||
*
|
||||
* @return array Settings for dropdown
|
||||
*/
|
||||
public function getLanguageFiles()
|
||||
{
|
||||
$return = array( array( 0, $this->lang->words['selectafile'] ) );
|
||||
|
||||
$this->DB->build( array( 'select' => 'word_app, word_pack', 'from' => 'core_sys_lang_words', 'group' => 'word_app, word_pack', 'order' => 'word_app, word_pack' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['word_app'] . '_' . $r['word_pack'], $r['word_app'] . '_' . $r['word_pack'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the available language strings in a given file
|
||||
*
|
||||
* @param string Language file
|
||||
* @return array Settings for multiselect
|
||||
*/
|
||||
public function getStrings( $file='' )
|
||||
{
|
||||
if( !$file )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$bits = explode( '_', $file );
|
||||
$app = $bits[0];
|
||||
$pack = str_replace( $app . '_', '', $file );
|
||||
$return = array();
|
||||
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'word_key' ), 'from' => 'core_sys_lang_words', 'where' => "word_app='{$app}' AND word_pack='{$pack}'", 'order' => 'word_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$return[] = array( $r['word_key'], $r['word_key'] );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,439 +1,437 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Notifications class for reported content
|
||||
* Last Updated: $LastChangedDate: 2011-09-30 05:21:05 -0400 (Fri, 30 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9571 $
|
||||
*/
|
||||
|
||||
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 reportNotifications
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Messenger object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $messenger;
|
||||
|
||||
/**
|
||||
* Data for the members
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $my_data;
|
||||
|
||||
/**
|
||||
* Data for the reported content
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $my_report_data;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e 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->getClass('class_localization');
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messenger = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize library
|
||||
*
|
||||
* @param array Member data
|
||||
* @param array Reported content
|
||||
* @return @e void
|
||||
*/
|
||||
public function initNotify( $data, $report_data )
|
||||
{
|
||||
$this->my_data = $data;
|
||||
$this->my_report_data = $report_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the notifications for comments/replies to a report
|
||||
*
|
||||
* @param string $comment Comment string
|
||||
* @return @e void
|
||||
*/
|
||||
public function sendReplyNotifications( $postContent )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$_memberIds = array();
|
||||
|
||||
foreach( $this->my_data as $_data )
|
||||
{
|
||||
$_memberIds[] = $_data['member_id'];
|
||||
}
|
||||
|
||||
$_memberData = IPSMember::load( $_memberIds );
|
||||
|
||||
foreach( $this->my_data as $user )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Don't send notification to self
|
||||
//-----------------------------------------
|
||||
|
||||
if( $user['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = array_merge( $user, $_memberData[ $user['member_id'] ] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->getTemplate( "report_reply", $user['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MOD_NAME' => $user['members_display_name'],
|
||||
'COMMENTER' => $this->memberData['members_display_name'],
|
||||
'LINK' => $this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] ),
|
||||
'REPORTLINK'=> $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
'COMMENT' => $postContent,
|
||||
)
|
||||
);
|
||||
|
||||
$_subject = sprintf(
|
||||
$this->lang->words['subject_reportreply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ),
|
||||
$this->memberData['members_display_name'],
|
||||
$this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
$this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] )
|
||||
);
|
||||
$notifyLibrary->setMember( $user );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'report_center' );
|
||||
$notifyLibrary->setNotificationUrl( $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'] );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( $_subject );
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
}
|
||||
|
||||
$this->_buildRSSFeed( $this->my_data, $this->my_report_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the notifications
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function sendNotifications()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$_memberIds = array();
|
||||
|
||||
foreach( $this->my_data as $_data )
|
||||
{
|
||||
$_memberIds[] = $_data['member_id'];
|
||||
}
|
||||
|
||||
$_memberData = IPSMember::load( $_memberIds );
|
||||
|
||||
foreach( $this->my_data as $user )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Don't send notification to self
|
||||
//-----------------------------------------
|
||||
|
||||
if( $user['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = array_merge( $user, $_memberData[ $user['member_id'] ] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->getTemplate( "report_emailpm", $user['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MOD_NAME' => $user['members_display_name'],
|
||||
'USERNAME' => $this->memberData['members_display_name'],
|
||||
'LINK' => $this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] ),
|
||||
'REPORTLINK'=> $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
'REPORT' => $this->my_report_data['REPORT'],
|
||||
)
|
||||
);
|
||||
|
||||
$_subject = sprintf(
|
||||
$this->lang->words['subject_report'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ),
|
||||
$this->memberData['members_display_name'],
|
||||
$this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
$this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] )
|
||||
);
|
||||
$notifyLibrary->setMember( $user );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'report_center' );
|
||||
$notifyLibrary->setNotificationUrl( $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'] );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( $_subject );
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
}
|
||||
|
||||
$this->_buildRSSFeed( $this->my_data, $this->my_report_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a private RSS feed for the member to monitor reports
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _buildRSSFeed( $data=array(), $report_data )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check member ids
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = array();
|
||||
|
||||
if( is_array($data) AND count($data) )
|
||||
{
|
||||
foreach( $data as $user )
|
||||
{
|
||||
$ids[] = intval($user['member_id']);
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $ids ) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$rssClassToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get status data
|
||||
//-----------------------------------------
|
||||
|
||||
$status = array();
|
||||
$active = array( 0 );
|
||||
|
||||
$this->DB->build( array( 'select' => 'status, is_new, is_complete',
|
||||
'from' => 'rc_status',
|
||||
'where' => "is_new=1 OR is_complete=1 OR is_active=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'];
|
||||
}
|
||||
|
||||
if( $row['is_active'] )
|
||||
{
|
||||
$active[] = $row['status'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now we need to find all open reports
|
||||
//-----------------------------------------
|
||||
|
||||
$_reports = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'rc_reports_index' => 'i' ),
|
||||
'where' => 'i.status IN(' . implode( ',', $active ) . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_status' => 's' ),
|
||||
'where' => 's.status=i.status',
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'c.my_class, c.mod_group_perm, c.app',
|
||||
'from' => array( 'rc_classes' => 'c' ),
|
||||
'where' => 'c.com_id=i.rc_class',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Skip deleted plugins
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['my_class'] == '' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix stuff....this is hackish :(
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['my_class'] == 'post' )
|
||||
{
|
||||
$r['FORUM_ID'] = $r['exdat1'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get notify list
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $r['app'] ) . '/extensions/reportPlugins/' . $r['my_class'] . '.php', $r['my_class'] . '_plugin', $r['app'] );
|
||||
$object = new $classToLoad( $this->registry );
|
||||
|
||||
$notify = $object->getNotificationList( IPSText::cleanPermString( $r['mod_group_perm'] ), $r );
|
||||
|
||||
$_reports[] = array( 'data' => $r, 'notify' => $notify );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now, we loop over each of the member ids
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $ids as $id )
|
||||
{
|
||||
if( !$id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clear out for new RSS doc and add channel
|
||||
//-----------------------------------------
|
||||
|
||||
$rss = new $rssClassToLoad();
|
||||
$channel_id = $rss->createNewChannel( array( 'title' => $this->lang->words['rss_feed_title'],
|
||||
'link' => $this->settings['board_url'],
|
||||
'description' => $this->lang->words['reports_rss_desc'],
|
||||
'pubDate' => $rss->formatDate( time() )
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What reports can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($_reports) )
|
||||
{
|
||||
foreach( $_reports as $_report )
|
||||
{
|
||||
$pass = false;
|
||||
|
||||
if( is_array($_report['notify']) AND count($_report['notify']) )
|
||||
{
|
||||
foreach( $_report['notify'] as $memberAccount )
|
||||
{
|
||||
if( $memberAccount['mem_id'] == $id )
|
||||
{
|
||||
$pass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $pass )
|
||||
{
|
||||
$url = $this->registry->getClass('reportLibrary')->processUrl( str_replace( '&', '&', $_report['data']['url'] ) );
|
||||
|
||||
$rss->addItemToChannel( $channel_id, array( 'title' => $url,
|
||||
'link' => $url,
|
||||
'description' => $_report['data']['title'],
|
||||
'content' => $_report['data']['title'],
|
||||
'pubDate' => $rss->formatDate( $_report['data']['date_updated'] )
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rss->createRssDocument();
|
||||
|
||||
$this->DB->replace( 'rc_modpref', array( 'rss_cache' => $rss->rss_document ), "mem_id=" . $id, array( 'mem_id' ) );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Notifications class for reported content
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </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/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
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 reportNotifications
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Messenger object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $messenger;
|
||||
|
||||
/**
|
||||
* Data for the members
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $my_data;
|
||||
|
||||
/**
|
||||
* Data for the reported content
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $my_report_data;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e 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->getClass('class_localization');
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messenger = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize library
|
||||
*
|
||||
* @param array Member data
|
||||
* @param array Reported content
|
||||
* @return @e void
|
||||
*/
|
||||
public function initNotify( $data, $report_data )
|
||||
{
|
||||
$this->my_data = $data;
|
||||
$this->my_report_data = $report_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the notifications for comments/replies to a report
|
||||
*
|
||||
* @param string $comment Comment string
|
||||
* @return @e void
|
||||
*/
|
||||
public function sendReplyNotifications( $postContent )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Notifications library
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$_memberIds = array();
|
||||
|
||||
foreach( $this->my_data as $_data )
|
||||
{
|
||||
$_memberIds[] = $_data['member_id'];
|
||||
}
|
||||
|
||||
$_memberData = IPSMember::load( $_memberIds );
|
||||
|
||||
foreach( $this->my_data as $user )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Don't send notification to self
|
||||
//-----------------------------------------
|
||||
|
||||
if( $user['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = array_merge( $user, $_memberData[ $user['member_id'] ] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->getTemplate( "report_reply", $user['language'] );
|
||||
|
||||
IPSText::getTextClass( 'email' )->buildMessage( array(
|
||||
'MOD_NAME' => $user['members_display_name'],
|
||||
'COMMENTER' => $this->memberData['members_display_name'],
|
||||
'LINK' => $this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] ),
|
||||
'REPORTLINK'=> $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
'COMMENT' => $postContent,
|
||||
)
|
||||
);
|
||||
|
||||
$_subject = sprintf(
|
||||
$this->lang->words['subject_reportreply'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ),
|
||||
$this->memberData['members_display_name'],
|
||||
$this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
$this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] )
|
||||
);
|
||||
$notifyLibrary->setMember( $user );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'report_center' );
|
||||
$notifyLibrary->setNotificationUrl( $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'] );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( $_subject );
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
}
|
||||
|
||||
$this->_buildRSSFeed( $this->my_data, $this->my_report_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the notifications
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function sendNotifications()
|
||||
{
|
||||
/* Notifications library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$_memberIds = array();
|
||||
|
||||
foreach( $this->my_data as $_data )
|
||||
{
|
||||
$_memberIds[] = $_data['member_id'];
|
||||
}
|
||||
|
||||
$_memberData = IPSMember::load( $_memberIds );
|
||||
|
||||
foreach( $this->my_data as $user )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Don't send notification to self
|
||||
//-----------------------------------------
|
||||
|
||||
if( $user['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = array_merge( $user, $_memberData[ $user['member_id'] ] );
|
||||
|
||||
IPSText::getTextClass('email')->getTemplate( "report_emailpm", $user['language'], 'public_reports', 'core' );
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'MOD_NAME' => $user['members_display_name'],
|
||||
'USERNAME' => $this->memberData['members_display_name'],
|
||||
'LINK' => $this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] ),
|
||||
'REPORTLINK'=> $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
'REPORT' => $this->my_report_data['REPORT'],
|
||||
)
|
||||
);
|
||||
|
||||
$_subject = sprintf(
|
||||
$this->lang->words['subject_report'],
|
||||
$this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ),
|
||||
$this->memberData['members_display_name'],
|
||||
$this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'],
|
||||
$this->registry->getClass('reportLibrary')->processUrl( $this->my_report_data['SAVED_URL'], $this->my_report_data['SEOTITLE'], $this->my_report_data['TEMPLATE'] )
|
||||
);
|
||||
|
||||
$notifyLibrary->setMember( $user );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'report_center' );
|
||||
$notifyLibrary->setNotificationUrl( $this->settings['base_url'] . 'app=core&module=reports&do=show_report&rid=' . $this->my_report_data['REPORT_INDEX'] );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
|
||||
$notifyLibrary->setNotificationTitle( $_subject );
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
}
|
||||
|
||||
$this->_buildRSSFeed( $this->my_data, $this->my_report_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a private RSS feed for the member to monitor reports
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _buildRSSFeed( $data=array(), $report_data )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check member ids
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = array();
|
||||
|
||||
if( is_array($data) AND count($data) )
|
||||
{
|
||||
foreach( $data as $user )
|
||||
{
|
||||
$ids[] = intval($user['member_id']);
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $ids ) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$rssClassToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get status data
|
||||
//-----------------------------------------
|
||||
|
||||
$status = array();
|
||||
$active = array( 0 );
|
||||
|
||||
$this->DB->build( array( 'select' => 'status, is_new, is_complete',
|
||||
'from' => 'rc_status',
|
||||
'where' => "is_new=1 OR is_complete=1 OR is_active=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'];
|
||||
}
|
||||
|
||||
if( $row['is_active'] )
|
||||
{
|
||||
$active[] = $row['status'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now we need to find all open reports
|
||||
//-----------------------------------------
|
||||
|
||||
$_reports = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'rc_reports_index' => 'i' ),
|
||||
'where' => 'i.status IN(' . implode( ',', $active ) . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_status' => 's' ),
|
||||
'where' => 's.status=i.status',
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'c.my_class, c.mod_group_perm, c.app',
|
||||
'from' => array( 'rc_classes' => 'c' ),
|
||||
'where' => 'c.com_id=i.rc_class',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Skip deleted plugins
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['my_class'] == '' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix stuff....this is hackish :(
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['my_class'] == 'post' )
|
||||
{
|
||||
$r['FORUM_ID'] = $r['exdat1'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get notify list
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $r['app'] ) . '/extensions/reportPlugins/' . $r['my_class'] . '.php', $r['my_class'] . '_plugin', $r['app'] );
|
||||
$object = new $classToLoad( $this->registry );
|
||||
|
||||
$notify = $object->getNotificationList( IPSText::cleanPermString( $r['mod_group_perm'] ), $r );
|
||||
|
||||
$_reports[] = array( 'data' => $r, 'notify' => $notify );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now, we loop over each of the member ids
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $ids as $id )
|
||||
{
|
||||
if( !$id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clear out for new RSS doc and add channel
|
||||
//-----------------------------------------
|
||||
|
||||
$rss = new $rssClassToLoad();
|
||||
$channel_id = $rss->createNewChannel( array( 'title' => $this->lang->words['rss_feed_title'],
|
||||
'link' => $this->settings['board_url'],
|
||||
'description' => $this->lang->words['reports_rss_desc'],
|
||||
'pubDate' => $rss->formatDate( time() )
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What reports can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($_reports) )
|
||||
{
|
||||
foreach( $_reports as $_report )
|
||||
{
|
||||
$pass = false;
|
||||
|
||||
if( is_array($_report['notify']) AND count($_report['notify']) )
|
||||
{
|
||||
foreach( $_report['notify'] as $memberAccount )
|
||||
{
|
||||
if( $memberAccount['mem_id'] == $id )
|
||||
{
|
||||
$pass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $pass )
|
||||
{
|
||||
$url = $this->registry->getClass('reportLibrary')->processUrl( str_replace( '&', '&', $_report['data']['url'] ) );
|
||||
|
||||
$rss->addItemToChannel( $channel_id, array( 'title' => $url,
|
||||
'link' => $url,
|
||||
'description' => $_report['data']['title'],
|
||||
'content' => $_report['data']['title'],
|
||||
'pubDate' => $rss->formatDate( $_report['data']['date_updated'] )
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rss->createRssDocument();
|
||||
|
||||
$this->DB->replace( 'rc_modpref', array( 'rss_cache' => $rss->rss_document ), "mem_id=" . $id, array( 'mem_id' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user