Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,83 +1,98 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* API: Core
|
||||
* 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
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @file api_core.php Core functions for the API classes
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8129 $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @class apiCore
|
||||
* @brief Core functions for the API classes
|
||||
*/
|
||||
class apiCore
|
||||
{
|
||||
/**
|
||||
* 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 $cache;
|
||||
protected $registry;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* API Error string
|
||||
* Array of the API errors
|
||||
*
|
||||
* @var array Errors
|
||||
* @var $api_error
|
||||
*/
|
||||
public $api_error = array();
|
||||
|
||||
/**
|
||||
* API Path to IPB root (where init.php/index.php is)
|
||||
* API Path to IPB root (where initdata.php/index.php is)
|
||||
*
|
||||
* @var string Path to IPB root folder
|
||||
* @var $path_to_ipb
|
||||
*/
|
||||
public $path_to_ipb = '';
|
||||
|
||||
/**
|
||||
* Loads the API Classes
|
||||
* Loads the registry class
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
/* Path not set? */
|
||||
if( !$this->path_to_ipb )
|
||||
{
|
||||
/* Constant available? */
|
||||
if( defined('DOC_IPS_ROOT_PATH') )
|
||||
{
|
||||
$this->path_to_ipb = DOC_IPS_ROOT_PATH;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fallback.. */
|
||||
$this->path_to_ipb = dirname(__FILE__) . '/../../';
|
||||
}
|
||||
}
|
||||
|
||||
/* Load the registry */
|
||||
require_once( $this->path_to_ipb . 'initdata.php' );
|
||||
require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' );
|
||||
require_once( $this->path_to_ipb . 'initdata.php' );/*noLibHook*/
|
||||
require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->registry->init();
|
||||
|
||||
/* Make Shortcuts */
|
||||
$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();
|
||||
/* Make registry shortcuts */
|
||||
$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();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
/* INIT Child? */
|
||||
if( method_exists( $this, 'childInit' ) )
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Blog API file
|
||||
* Last Updated: $Date: 2010-10-22 14:06:33 -0400 (Fri, 22 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.Blog
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7018 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'apiCore' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiBlog class
|
||||
* @package IP.Blog
|
||||
*/
|
||||
class apiBlog extends apiCore
|
||||
{
|
||||
/**
|
||||
* Constructor. Calls parent init() method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
if( ! ipsRegistry::isClassLoaded( 'blogFunctions' ) )
|
||||
{
|
||||
/* Load the Blog functions library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php', 'blogFunctions', 'blog' );
|
||||
$this->registry->setClass( 'blogFunctions', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the Blog ID of a member
|
||||
* THIS IS DEPRECATED - use fetchBlogIds
|
||||
*
|
||||
* @param int Member ID
|
||||
* @return int Blog ID ( 0 if no Blog found )
|
||||
*/
|
||||
public function getBlogID( $member_id=0 )
|
||||
{
|
||||
$member_id = intval( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// We entered here on member id, find blog_id and redirect them to here
|
||||
//-----------------------------------------
|
||||
$blog = $this->DB->buildAndFetch( array(
|
||||
'select' => 'blog_id, blog_name',
|
||||
'from' => 'blog_blogs',
|
||||
'where' => "member_id={$member_id}"
|
||||
) );
|
||||
if( ! $blog['blog_id'] or ! $blog['blog_name'] )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $blog['blog_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve blog IDs this member can author in
|
||||
*
|
||||
* @access public
|
||||
* @param int Member ID
|
||||
* @return array array of ids with basic information, like: array( blog_id => array( 'blog_name', 'blog_seo_name' )
|
||||
*/
|
||||
public function fetchBlogIds( $member_id=0 )
|
||||
{
|
||||
$return = array();
|
||||
$member_id = intval( $member_id );
|
||||
$data = $this->registry->getClass('blogFunctions')->fetchMyBlogs( IPSMember::load( $member_id ) );
|
||||
|
||||
if ( is_array( $data ) AND count( $data ) )
|
||||
{
|
||||
foreach( $data as $id => $blog )
|
||||
{
|
||||
if ( $blog['_canPostIn'] )
|
||||
{
|
||||
$return[ $id ] = $blog;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the Blog ID of a member
|
||||
*
|
||||
* @param int Blog ID
|
||||
* @return string Blog URL
|
||||
*/
|
||||
public function getBlogUrl( $blog_id=0 )
|
||||
{
|
||||
$blog_id = intval( $blog_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// We entered here on member id, find blog_id and redirect them to here
|
||||
//-----------------------------------------
|
||||
$blog = $this->DB->buildAndFetch( array (
|
||||
'select' => 'blog_id, blog_name, blog_seo_name',
|
||||
'from' => 'blog_blogs',
|
||||
'where' => "blog_id={$blog_id}"
|
||||
) );
|
||||
if( ! $blog['blog_id'] or ! $blog['blog_name'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->registry->output->buildSEOUrl( 'app=blog&blogid=' . $blog_id, 'public', $blog['blog_seo_name'], 'showblog' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the last x entries of a Blog
|
||||
* Only public publishes entries are returned
|
||||
*
|
||||
* @param string Either 'member' or 'blog'
|
||||
* @param int Blog ID or Member ID
|
||||
* @param int Number of entries (to return)
|
||||
* @return array Array of last X entries
|
||||
*/
|
||||
public function lastXEntries( $type, $id, $number_of_entries=10 )
|
||||
{
|
||||
/* INIT */
|
||||
$id = intval( $id );
|
||||
$return_array = array();
|
||||
$where = array();
|
||||
|
||||
/* Build permissions */
|
||||
$modData = $this->registry->blogFunctions->buildPerms();
|
||||
|
||||
/* Got permission to view blog entries? */
|
||||
if ( $this->memberData['g_blog_settings']['g_blog_allowview'] )
|
||||
{
|
||||
$this->DB->build( array( 'select' => "e.*, b.*",
|
||||
'from' => array('blog_entries' => 'e'),
|
||||
'where' => ( $type == 'member' ? "b.member_id={$id}" : "b.blog_id={$id}" ) . " AND b.blog_type='local' AND e.entry_status='published'",
|
||||
'order' => 'e.entry_date DESC',
|
||||
'limit' => array( 0, intval( $number_of_entries ) ),
|
||||
'add_join' => array( array( 'select' => 'b.blog_name, b.blog_seo_name',
|
||||
'from' => array( 'blog_blogs' => 'b' ),
|
||||
'where' => "e.blog_id=b.blog_id",
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $entry = $this->DB->fetch($outer) )
|
||||
{
|
||||
if ( !$this->memberData['member_id'] or !$modData['_blogmod']['moderate_can_view_private'] )
|
||||
{
|
||||
switch ( $entry['blog_view_level'] )
|
||||
{
|
||||
case 'public':
|
||||
if ( !$this->memberData['member_id'] and !$entry['blog_allowguests'] )
|
||||
{
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'private':
|
||||
if ( !$this->memberData['member_id'] or $this->memberData['member_id'] != $entry['member_id'] )
|
||||
{
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'privateclub':
|
||||
if ( !$this->memberData['member_id'] or !in_array( $this->memberData['member_id'], explode( ',', $entry['blog_authorized_users'] ) ) )
|
||||
{
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$entry['blog_url'] = $this->registry->blogFunctions->getBlogUrl( $entry['blog_id'] );
|
||||
$entry['entry_url'] = $entry['blog_url'] . 'showentry='.$entry['entry_id'];
|
||||
|
||||
$return_array[] = $entry;
|
||||
}
|
||||
return $return_array;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,82 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Forums topic view API file
|
||||
* Last Updated: $Date: 2010-10-25 11:20:47 -0400 (Mon, 25 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 $Rev: 7036 $
|
||||
* @file api_topic_view.php Forums topic view API
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2.2.0
|
||||
*
|
||||
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8129 $
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'apiCore' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
/**
|
||||
* apiTopicView class
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
*
|
||||
* @class apiTopicView
|
||||
* @brief Forums topic view API
|
||||
*/
|
||||
class apiTopicView extends apiCore
|
||||
{
|
||||
/**
|
||||
* Topic list config
|
||||
* Configuration array for the topic list
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
* @var $topic_list_config
|
||||
*/
|
||||
public $topic_list_config = array( 'offset' => 0,
|
||||
public $topic_list_config = array( 'offset' => 0,
|
||||
'limit' => 5,
|
||||
'forums' => '*',
|
||||
'order_field' => 'last_post',
|
||||
'order_by' => 'DESC' );
|
||||
|
||||
'order_by' => 'DESC'
|
||||
);
|
||||
|
||||
/**
|
||||
* Attachment pids
|
||||
* Array of post IDs with attachments
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
* @var $attach_pids
|
||||
*/
|
||||
protected $attach_pids = array();
|
||||
|
||||
/**
|
||||
* Constructor. Calls parent init() method
|
||||
* Constructor: calls parent init() method and runs other additional calls
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$appClass = new $classToLoad( $this->registry );
|
||||
/* Load forums app main class */
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of gallery data
|
||||
* Returns an array of topics
|
||||
*
|
||||
* @access public
|
||||
* @param bool View as guest?
|
||||
* @return mixed Array of data, or void
|
||||
* @param boolean Load only topics viewable by guests?
|
||||
* @return @e array Array of topics data
|
||||
*/
|
||||
public function return_topic_list_data( $view_as_guest=0 )
|
||||
public function return_topic_list_data( $view_as_guest=false )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -84,14 +69,14 @@ class apiTopicView extends apiCore
|
||||
|
||||
$topics = array();
|
||||
|
||||
if( !$view_as_guest )
|
||||
if( $view_as_guest )
|
||||
{
|
||||
$this->registry->class_forums->strip_invisible = false;
|
||||
$this->registry->class_forums->strip_invisible = true;
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->class_forums->strip_invisible = true;
|
||||
$this->registry->class_forums->strip_invisible = false;
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
|
||||
@@ -139,9 +124,11 @@ class apiTopicView extends apiCore
|
||||
// Get from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',
|
||||
'where' => $_approved . ' AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',
|
||||
'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'],
|
||||
'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ),
|
||||
'add_join' => array(
|
||||
@@ -292,5 +279,4 @@ class apiTopicView extends apiCore
|
||||
return $topics;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,195 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Gallery API file
|
||||
* 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.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'apiCore' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiGallery class
|
||||
* @package IP.Gallery
|
||||
*/
|
||||
class apiGallery extends apiCore
|
||||
{
|
||||
/**
|
||||
* Gallery library object
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $glib;
|
||||
|
||||
/**
|
||||
* Gallery category object
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $category;
|
||||
|
||||
/**
|
||||
* Total images found for result
|
||||
*
|
||||
* @access public
|
||||
* @var integer
|
||||
*/
|
||||
public $total = 0;
|
||||
|
||||
/**
|
||||
* Database result resource
|
||||
*
|
||||
* @access public
|
||||
* @var resource
|
||||
*/
|
||||
public $res;
|
||||
|
||||
/**
|
||||
* Constructor. Calls parent init() method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of gallery data
|
||||
*
|
||||
* @access public
|
||||
* @param integer Member id
|
||||
* @param integer Limit
|
||||
* @param integer true pulls the image results and returns them, false leaves the result set as $this->res
|
||||
* @return mixed Array of gallery data, or void
|
||||
*/
|
||||
function return_gallery_data( $member_id=0, $limit=5, $do_pull=true )
|
||||
{
|
||||
if( !$member_id )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$images = array();
|
||||
|
||||
$member_id = intval($member_id);
|
||||
|
||||
$categories = $this->category->getAllowedCats( 0 );
|
||||
$albums = $this->glib->getAllowedAlbums();
|
||||
|
||||
if( !count($categories) AND !count($albums) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$where = array();
|
||||
$where_statement = "";
|
||||
|
||||
if( count($categories) )
|
||||
{
|
||||
$where[] = "i.category_id IN (".implode( ',', $categories ).")";
|
||||
}
|
||||
|
||||
if( is_array($albums) AND count($albums) )
|
||||
{
|
||||
$where[] = "i.album_id IN (".implode( ",", $albums ).")";
|
||||
}
|
||||
else if( $albums == true AND count($categories) )
|
||||
{
|
||||
$dewhere .= " ( i.album_id > 0 AND a.category_id IN ( ".implode( ",", $categories )." ) ";
|
||||
|
||||
if( !$this->memberData['g_mod_albums'] )
|
||||
{
|
||||
$dewhere .= " AND ( a.public_album=1 OR a.member_id={$this->memberData['member_id']} ) ";
|
||||
}
|
||||
|
||||
$dewhere .= ")";
|
||||
|
||||
$where[] = $dewhere;
|
||||
}
|
||||
|
||||
if( !count($where) )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$where_statement = implode( " OR ", $where );
|
||||
}
|
||||
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'gallery_images' => 'i' ),
|
||||
'where' => "i.approved=1 AND i.member_id={$member_id} AND ({$where_statement})",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'type' => 'left',
|
||||
'select' => 'a.name as album_name, a.public_album',
|
||||
'from' => array( 'gallery_albums' => 'a' ),
|
||||
'where' => 'a.id=i.album_id',
|
||||
),
|
||||
array(
|
||||
'type' => 'left',
|
||||
'select' => 'c.name as category_name',
|
||||
'from' => array( 'gallery_categories' => 'c' ),
|
||||
'where' => "c.id=i.category_id",
|
||||
),
|
||||
array(
|
||||
'type' => 'left',
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=i.member_id",
|
||||
),
|
||||
array(
|
||||
'type' => 'left',
|
||||
'select' => 'r.id as rated, r.rate as my_rate',
|
||||
'from' => array( 'gallery_ratings' => 'r' ),
|
||||
'where' => "r.img_id=i.id AND r.member_id={$this->memberData['member_id']}",
|
||||
)
|
||||
),
|
||||
'order' => 'i.idate DESC',
|
||||
'limit' => array( 0, $limit )
|
||||
) );
|
||||
|
||||
$this->res = $this->DB->execute();
|
||||
|
||||
$this->total = $this->DB->getTotalRows( $this->res );
|
||||
|
||||
if( $do_pull )
|
||||
{
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_my_rate'] = $r['my_rate'];
|
||||
|
||||
$images[] = $r;
|
||||
}
|
||||
|
||||
return $images;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
/**
|
||||
* @file group_form.php Core group editing form
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-07-20 20:19:22 -0400 (Wed, 20 Jul 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9296 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @interface admin_group_form__core
|
||||
* @brief Core group editing form
|
||||
*
|
||||
*/
|
||||
class admin_group_form__core implements admin_group_form
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Tab name (leave it blank to use the default application title)
|
||||
*
|
||||
* @var $tab_name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$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->tab_name = ipsRegistry::getClass('class_localization')->words['tab_groupform_rc'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML tabs content for the page
|
||||
*
|
||||
* @param array $group Group data
|
||||
* @param integer $tabsUsed Number of tabs used so far (your ids should be this +1)
|
||||
* @return @e array Array of 'tabs' (HTML for the tabs), 'content' (HTML for the content), 'tabsUsed' (number of tabs you have used)
|
||||
*/
|
||||
public function getDisplayContent( $group=array(), $tabsUsed = 2 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate( 'cp_skin_group_core', 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get report center plugins and sort perms
|
||||
//-----------------------------------------
|
||||
|
||||
$_canView = array();
|
||||
$_canSend = array();
|
||||
$_plugins = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'rc_classes', 'order' => 'class_title' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$senders = explode( ',', IPSText::cleanPermString( $r['group_can_report'] ) );
|
||||
$viewers = explode( ',', IPSText::cleanPermString( $r['mod_group_perm'] ) );
|
||||
|
||||
if( in_array( $group['g_id'], $senders ) )
|
||||
{
|
||||
$_canSend[] = $r['com_id'];
|
||||
}
|
||||
|
||||
if( in_array( $group['g_id'], $viewers ) )
|
||||
{
|
||||
$_canView[] = $r['com_id'];
|
||||
}
|
||||
|
||||
$_plugins[ $r['com_id'] ] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
return array( 'tabs' => $this->html->acp_group_form_tabs( $group, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_group_form_main( $group, ( $tabsUsed + 1 ), $_plugins, $_canView, $_canSend ), 'tabsUsed' => 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @return @e array Array of keys => values for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Post-process the entries for saving
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @param int $groupId Group id
|
||||
* @return @e void
|
||||
*/
|
||||
public function postSave( $groupId )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'com_id, group_can_report, mod_group_perm', 'from' => 'rc_classes' ) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$senders = explode( ',', IPSText::cleanPermString( $r['group_can_report'] ) );
|
||||
$viewers = explode( ',', IPSText::cleanPermString( $r['mod_group_perm'] ) );
|
||||
$canView = 0;
|
||||
$canSend = 0;
|
||||
|
||||
if( $this->request['rc_send_' . $r['com_id'] ] )
|
||||
{
|
||||
$canSend = 1;
|
||||
}
|
||||
|
||||
if( $this->request['rc_view_' . $r['com_id'] ] )
|
||||
{
|
||||
$canView = 1;
|
||||
}
|
||||
|
||||
$_newSenders = array();
|
||||
$_newViewers = array();
|
||||
|
||||
foreach( $senders as $sender )
|
||||
{
|
||||
if( $sender == $groupId )
|
||||
{
|
||||
if( $canSend )
|
||||
{
|
||||
$_newSenders[ $sender ] = $sender;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_newSenders[ $sender ] = $sender;
|
||||
}
|
||||
}
|
||||
|
||||
if( $canSend )
|
||||
{
|
||||
$_newSenders[ $groupId ] = $groupId;
|
||||
}
|
||||
|
||||
foreach( $viewers as $viewer )
|
||||
{
|
||||
if( $viewer == $groupId )
|
||||
{
|
||||
if( $canView )
|
||||
{
|
||||
$_newViewers[ $viewer ] = $viewer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_newViewers[ $viewer ] = $viewer;
|
||||
}
|
||||
}
|
||||
|
||||
if( $canView )
|
||||
{
|
||||
$_newViewers[ $groupId ] = $groupId;
|
||||
}
|
||||
|
||||
$this->DB->update( 'rc_classes', array( 'group_can_report' => ',' . implode( ',', $_newSenders ) . ',', 'mod_group_perm' => ',' . implode( ',', $_newViewers ) . ',' ), 'com_id=' . $r['com_id'] );
|
||||
}
|
||||
|
||||
$this->cache->rebuildCache( 'report_plugins', 'global' );
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2010-01-15 14:28:09 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5715 $
|
||||
* @version $Revision: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,6 @@ class admin_member_form__core implements admin_member_form
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $tab_name = "";
|
||||
@@ -51,7 +50,6 @@ class admin_member_form__core implements admin_member_form
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
@@ -64,7 +62,7 @@ class admin_member_form__core implements admin_member_form
|
||||
{
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => "app=members&module=members&section=tools&do=do_locked&auth_key=".ipsRegistry::member()->form_hash."&mid_{$member['member_id']}=1&type=unlock",
|
||||
'title' => $this->lang->words['reset_failed_logins'] );
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['reset_failed_logins'] );
|
||||
}
|
||||
|
||||
return $array;
|
||||
@@ -73,7 +71,6 @@ class admin_member_form__core implements admin_member_form
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
@@ -86,7 +83,6 @@ class admin_member_form__core implements admin_member_form
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,340 @@
|
||||
<?php
|
||||
/**
|
||||
* Report center comments class
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Downloads
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9229 $
|
||||
*/
|
||||
|
||||
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 comments_core_reports extends classes_comments_renderer
|
||||
{
|
||||
/**
|
||||
* Internal remap array
|
||||
*
|
||||
* @param array
|
||||
*/
|
||||
protected $_remap = array( 'comment_id' => 'id',
|
||||
'comment_author_id' => 'comment_by',
|
||||
'comment_author_name' => 'author_name',
|
||||
'comment_text' => 'comment',
|
||||
'comment_ip_address' => 'ip_address',
|
||||
'comment_edit_date' => 'edit_date',
|
||||
'comment_date' => 'comment_date',
|
||||
'comment_approved' => 'approved',
|
||||
'comment_parent_id' => 'rid' );
|
||||
|
||||
/**
|
||||
* Internal parent remap array
|
||||
*
|
||||
* @param array
|
||||
*/
|
||||
protected $_parentRemap = array( 'parent_id' => 'id',
|
||||
'parent_owner_id' => 'updated_by',
|
||||
'parent_parent_id' => 'uid',
|
||||
'parent_title' => 'title',
|
||||
'parent_seo_title' => 'seoname',
|
||||
'parent_date' => 'date_created' );
|
||||
|
||||
/**
|
||||
* Parent SEO template
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function seoTemplate()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Who am I?
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function whoAmI()
|
||||
{
|
||||
return 'core-reports';
|
||||
}
|
||||
|
||||
/**
|
||||
* Comment table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function table()
|
||||
{
|
||||
return 'rc_comments';
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable reputation?
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function reputationEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch parent
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchParent( $id )
|
||||
{
|
||||
static $cachedReports = array();
|
||||
|
||||
if( !isset($cachedReports[ $id ]) )
|
||||
{
|
||||
$cachedReports[ $id ] = $this->DB->buildAndFetch( array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'rc_reports_index' => 'i' ),
|
||||
'where' => "i.id=" . intval($id),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'c.*',
|
||||
'from' => array( 'rc_classes' => 'c' ),
|
||||
'where' => 'c.com_id=i.rc_class',
|
||||
'type' => 'left',
|
||||
)
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
return $cachedReports[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function settings()
|
||||
{
|
||||
return array( 'urls-showParent' => "app=core&module=reports&do=show_report&rid=%s",
|
||||
'urls-report' => '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items per page
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function perPage()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre save
|
||||
* Accepts an array of GENERIC data and allows manipulation before it's added to DB
|
||||
*
|
||||
* @param string Type of save (edit/add)
|
||||
* @param array Array of GENERIC data (comment_xxxx)
|
||||
* @param int Comment id (if available)
|
||||
* @param int Parent id
|
||||
* @return array Array of GENERIC data
|
||||
*/
|
||||
public function preSave( $type, array $array, $commentId=0, $parentId=0 )
|
||||
{
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post save
|
||||
* Accepts an array of GENERIC data and allows manipulation after it's added to DB
|
||||
*
|
||||
* @param string Type of action (edit/add)
|
||||
* @param array Array of GENERIC data (comment_xxxx)
|
||||
* @param int Comment id (if available)
|
||||
* @param int Parent id
|
||||
* @return array Array of GENERIC data
|
||||
*/
|
||||
public function postSave( $type, array $array, $commentId=0, $parentId=0 )
|
||||
{
|
||||
$_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) );
|
||||
$this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId );
|
||||
|
||||
//$this->DB->setDataType( 'num_comments', 'int' );
|
||||
//$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'plus:1', 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId );
|
||||
|
||||
//-----------------------------------------
|
||||
// Notify other moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$report = $this->fetchParent( $parentId );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_reports' ) );
|
||||
|
||||
$this->DB->loadCacheFile( IPSLib::getAppDir('core') . '/sql/' . ips_DBRegistry::getDriverType() . '_report_queries.php', 'report_sql_queries' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php', 'reportLibrary' );
|
||||
$this->registry->setClass( 'reportLibrary', new $classToLoad( $this->registry ) );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportNotifications.php', 'reportNotifications' );
|
||||
$notify = new $classToLoad( $this->registry );
|
||||
|
||||
$this->registry->getClass('reportLibrary')->loadPlugin( $report['my_class'], $report['app'] );
|
||||
|
||||
if( is_object($this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]) )
|
||||
{
|
||||
if( $report['extra_data'] && $report['extra_data'] != 'N;' )
|
||||
{
|
||||
$this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = unserialize( $report['extra_data'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = array();
|
||||
}
|
||||
|
||||
$report_data = $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->formatReportData( $report );
|
||||
|
||||
$notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->getNotificationList( IPSText::cleanPermString( $report['mod_group_perm'] ), $report_data ), $report_data );
|
||||
$notify->sendReplyNotifications( $array['comment_text'] );
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post delete. Can do stuff and that
|
||||
*
|
||||
* @param array Array of comment IDs to be deleted
|
||||
* @param int Parent ID
|
||||
* @return void
|
||||
*/
|
||||
public function postDelete( $commentIds, $parentId )
|
||||
{
|
||||
/* Determine most recent comment or report... */
|
||||
$_comment = $this->DB->buildAndFetch( array( 'select' => 'comment_by, comment_date', 'from' => 'rc_comments', 'where' => 'approved=1 AND rid=' . $parentId, 'order' => 'comment_date DESC', 'limit' => array( 1 ) ) );
|
||||
$_report = $this->DB->buildAndFetch( array( 'select' => 'report_by, date_reported', 'from' => 'rc_reports', 'where' => 'rid=' . $parentId, 'order' => 'date_reported DESC', 'limit' => array( 1 ) ) );
|
||||
|
||||
$_date_updated = 0;
|
||||
$_updated_by = 0;
|
||||
|
||||
if( $_comment['comment_date'] )
|
||||
{
|
||||
$_date_updated = $_comment['comment_date'];
|
||||
$_updated_by = $_comment['comment_by'];
|
||||
}
|
||||
|
||||
if( $_report['date_reported'] > $_date_updated )
|
||||
{
|
||||
$_date_updated = $_report['date_reported'];
|
||||
$_updated_by = $_report['report_by'];
|
||||
}
|
||||
|
||||
$_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) );
|
||||
$this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => $_date_updated, 'updated_by' => $_updated_by ), "id=" . $parentId );
|
||||
|
||||
//$this->DB->setDataType( 'num_comments', 'int' );
|
||||
//$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'minus:' . count($commentIds) ), "id=" . $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles visibility
|
||||
*
|
||||
* @param string on/off
|
||||
* @param array Array of comment IDs to be deleted
|
||||
* @param int Parent ID
|
||||
* @return void
|
||||
*/
|
||||
public function postVisibility( $toggle, $commentIds, $parentId )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a total count of comments we can see
|
||||
*
|
||||
* @param mixed parent Id or parent array
|
||||
* @return int
|
||||
*/
|
||||
public function count( $parent )
|
||||
{
|
||||
/* Get parent */
|
||||
if ( is_numeric( $parent ) )
|
||||
{
|
||||
$parent = $this->fetchParent( $parent );
|
||||
}
|
||||
|
||||
return intval($parent['num_comments']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a permission check
|
||||
*
|
||||
* @param string Type of check (add/edit/delete/editall/deleteall/approve all)
|
||||
* @param array Array of GENERIC data
|
||||
* @return true or string to be used in exception
|
||||
*/
|
||||
public function can( $type, array $array )
|
||||
{
|
||||
/* Init */
|
||||
$comment = array();
|
||||
|
||||
/* Got data? */
|
||||
if ( empty( $array['comment_parent_id'] ) )
|
||||
{
|
||||
trigger_error( "No parent ID passed to " . __FILE__, E_USER_WARNING );
|
||||
}
|
||||
|
||||
/* Get the file */
|
||||
$event = $this->fetchParent( $array['comment_parent_id'] );
|
||||
|
||||
/* Fetch comment */
|
||||
if ( $array['comment_id'] )
|
||||
{
|
||||
$comment = $this->fetchById( $array['comment_id'] );
|
||||
}
|
||||
|
||||
/* Check permissions */
|
||||
switch( $type )
|
||||
{
|
||||
case 'view':
|
||||
return true;
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['member_id'] != $comment['comment_mid'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return 'NO_PERMISSION';
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
return true;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
return $this->memberData['g_is_supmod'] ? true : 'NO_PERMISSION';
|
||||
break;
|
||||
|
||||
case 'visibility':
|
||||
case 'moderate':
|
||||
return 'NO_PERMISSION';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns remap keys (generic => local)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function remapKeys( $type='comment' )
|
||||
{
|
||||
return ( $type == 'comment' ) ? $this->_remap : $this->_parentRemap;
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Core Sessions
|
||||
* Last Updated: $Date: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5732 $
|
||||
* @version $Rev: 9495 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,101 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Item Marking
|
||||
* Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Downloads
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9495 $
|
||||
*
|
||||
*/
|
||||
|
||||
class itemMarking__core
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* I'm a constructor, twisted constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert Data
|
||||
* Takes an array of app specific data and remaps it to the DB table fields
|
||||
*
|
||||
* @param array
|
||||
* @return array
|
||||
*/
|
||||
public function convertData( $data )
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch unread count
|
||||
*
|
||||
* Grab the number of items truly unread
|
||||
* This is called upon by 'markRead' when the number of items
|
||||
* left hits zero (or less).
|
||||
*
|
||||
*
|
||||
* @param array Array of data
|
||||
* @param array Array of read itemIDs
|
||||
* @param int Last global reset
|
||||
* @return integer Last unread count
|
||||
*/
|
||||
public function fetchUnreadCount( $data, $readItems, $lastReset )
|
||||
{
|
||||
$readItems = is_array( $readItems ) ? $readItems : array( 0 );
|
||||
|
||||
$_count = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as cnt, MIN(date_updated) AS lastItem',
|
||||
'from' => 'rc_reports_index',
|
||||
'where' => "id NOT IN(" . implode( ",", array_keys( $readItems ) ) . ") AND date_updated > " . intval($lastReset)
|
||||
) );
|
||||
|
||||
return array( 'count' => intval( $_count['cnt'] ),
|
||||
'lastItem' => intval( $_count['lastItem'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main loader class
|
||||
*/
|
||||
@@ -36,7 +131,6 @@ class publicSessions__core
|
||||
* current_appcomponent, current_module and current_section are automatically
|
||||
* stored. This function allows you to add specific variables in.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @return array
|
||||
*/
|
||||
@@ -50,6 +144,12 @@ class publicSessions__core
|
||||
'location_1_id' => 0,
|
||||
'location_2_type' => '',
|
||||
'location_2_id' => 0 );
|
||||
|
||||
/* @link http://community.invisionpower.com/tracker/issue-33345-start-new-topic-reply-to-this-topic-online-list-location */
|
||||
if( ipsRegistry::$request['module'] == 'attach' )
|
||||
{
|
||||
define( 'NO_SESSION_UPDATE', true );
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
@@ -57,7 +157,6 @@ class publicSessions__core
|
||||
/**
|
||||
* Parse/format the online list data for the records
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @param array Online list rows to check against
|
||||
* @return array Online list rows parsed
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Core registered caches, redirect resets and bitwise settings
|
||||
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-03-15 18:03:09 -0400 (Tue, 15 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6882 $
|
||||
* @version $Rev: 8085 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,11 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*/
|
||||
$_LOAD = array();
|
||||
|
||||
if( IN_ACP AND ( !isset($_GET['module']) OR $_GET['module'] == 'mycp' ) )
|
||||
{
|
||||
$_LOAD['stats'] = 1;
|
||||
}
|
||||
|
||||
if( isset($_GET['module']) )
|
||||
{
|
||||
if ( $_GET['module'] == 'search' )
|
||||
@@ -45,6 +50,8 @@ if( isset($_GET['module']) )
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['moderators'] = 1;
|
||||
}
|
||||
|
||||
if( $_GET['module'] == 'usercp' )
|
||||
@@ -53,6 +60,31 @@ if( isset($_GET['module']) )
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
}
|
||||
|
||||
if ( $_GET['module'] == 'modcp' )
|
||||
{
|
||||
$_LOAD['moderators'] = 1;
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['attachtypes'] = 1;
|
||||
}
|
||||
|
||||
if( IN_ACP AND $_GET['module'] == 'applications' AND $_GET['section'] == 'hooks' )
|
||||
{
|
||||
$_LOAD['disabledHooksCache'] = 1;
|
||||
}
|
||||
}
|
||||
else if( IN_ACP )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
$_LOAD['moderators'] = 1;
|
||||
$_LOAD['adminnotes'] = 1;
|
||||
$_LOAD['performanceCache'] = 1;
|
||||
$_LOAD['sphinx_config'] = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Dashboard Notifications
|
||||
* Last Updated: $Date
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6980 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9551 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -35,6 +35,7 @@ class dashboardNotifications__core
|
||||
public $lang;
|
||||
public $cache;
|
||||
public $caches;
|
||||
public $DB;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -42,6 +43,7 @@ class dashboardNotifications__core
|
||||
$this->lang = ipsRegistry::getClass('class_localization');
|
||||
$this->caches =& ipsRegistry::cache()->fetchCaches();
|
||||
$this->cache = ipsRegistry::cache();
|
||||
$this->DB = ipsRegistry::DB();
|
||||
}
|
||||
|
||||
public function get()
|
||||
@@ -49,15 +51,117 @@ class dashboardNotifications__core
|
||||
/* INIT */
|
||||
$entries = array();
|
||||
|
||||
if( ! $this->settings['ipb_reg_number'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We need a classFileManagement object */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Try to automatically update if expired */
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) )
|
||||
{
|
||||
/* Query the api */
|
||||
$response = $classFileManagement->getFileContents( "http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" );
|
||||
|
||||
/* Get License Data */
|
||||
$licenseData = json_decode( $response, true );
|
||||
|
||||
/* Copyright Removal? */
|
||||
if ( $licenseData['cr'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
|
||||
}
|
||||
elseif ( $this->settings['ips_cp_purchase'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
|
||||
}
|
||||
|
||||
/* Save to cache */
|
||||
$licenseData['_cached_date'] = time();
|
||||
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
|
||||
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
|
||||
|
||||
$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
|
||||
|
||||
}
|
||||
|
||||
/* Query the api */
|
||||
$response = $classFileManagement->getFileContents("http://myipb.in/license.php?api=checkService&service=ipb&lk={$this->settings['ipb_reg_number']}&domain={$this->settings['board_url']}" );
|
||||
|
||||
/* Get License Data */
|
||||
$response = json_decode( $response, true );
|
||||
|
||||
/* Is the Spam Service Working? */
|
||||
if ( $this->settings['spam_service_enabled'] )
|
||||
{
|
||||
//$lastLog = $this->DB->buildAndFetch( array( 'select' => 'log_code', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 1 ) ); // Order on ID since log_date has no index
|
||||
|
||||
//if ( $lastLog['log_code'] === '0' )
|
||||
|
||||
/* Get last 5 logs, and if all 5 are errors, show message */
|
||||
$_errors = 0;
|
||||
$_entries = 0;
|
||||
$_lastError = '';
|
||||
|
||||
$this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $_r = $this->DB->fetch() )
|
||||
{
|
||||
$_entries++;
|
||||
|
||||
if( $_r['log_code'] === '0' )
|
||||
{
|
||||
$_errors++;
|
||||
|
||||
if( !$_lastError )
|
||||
{
|
||||
$_lastError = $_r['log_msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $_entries > 0 && $_errors == $_entries )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
|
||||
}
|
||||
}
|
||||
/* If it's disabled, are we entitiled to it? */
|
||||
else
|
||||
{
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
|
||||
{
|
||||
foreach ( $licenseData['ipbMain'] as $data )
|
||||
{
|
||||
if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* FURL cache OOD? */
|
||||
if ( file_exists( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
|
||||
if ( is_file( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
|
||||
{
|
||||
$mtime = intval( @filemtime( IPS_CACHE_PATH . 'cache/furlCache.php' ) );
|
||||
|
||||
/* Check mtimes on extensions.. */
|
||||
foreach( ipsRegistry::$applications as $app_dir => $application )
|
||||
{
|
||||
if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
|
||||
|
||||
@@ -69,30 +173,46 @@ class dashboardNotifications__core
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Sphinx cache OOD? */
|
||||
if ( $this->settings['search_method'] == 'sphinx' )
|
||||
{
|
||||
$mtime = intval( $this->cache->getCache('sphinx_config') );
|
||||
|
||||
/* Check mtimes on extensions.. */
|
||||
foreach( ipsRegistry::$applications as $app_dir => $application )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) );
|
||||
|
||||
if ( !$mtime OR $_mtime > $mtime )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&module=applications&section=applications&do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Minify on but /cache/tmp not writeable? */
|
||||
if ( isset( $this->settings['_use_minify'] ) AND $this->settings['_use_minify'] )
|
||||
if ( !empty( $this->settings['_use_minify'] ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] );
|
||||
}
|
||||
|
||||
/* Installer Check */
|
||||
if( @file_exists( IPS_ROOT_PATH . 'install/index.php' ) )
|
||||
if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) )
|
||||
{
|
||||
if ( ! @file_exists( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
|
||||
if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
|
||||
{
|
||||
$this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY );
|
||||
$entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] );
|
||||
}
|
||||
}
|
||||
else if( @is_dir( IPS_ROOT_PATH . 'applications_addon/ips/convert/' ) and !@file_exists( DOC_IPS_ROOT_PATH . 'cache/converter_lock.php' ) and $this->caches['app_cache']['convert'] )
|
||||
{
|
||||
$this->lang->words['cp_warning_converter'] = sprintf( $this->lang->words['cp_warning_converter'], $this->settings['_base_url'] );
|
||||
$entries[] = array( $this->lang->words['cp_unlocked_converter'], $this->lang->words['cp_warning_converter'] );
|
||||
}
|
||||
|
||||
/* Unfinished Upgrade */
|
||||
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );
|
||||
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/
|
||||
$versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
|
||||
|
||||
if( $versions['current'][0] != $versions['latest'][0] )
|
||||
@@ -108,16 +228,22 @@ class dashboardNotifications__core
|
||||
$entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] );
|
||||
}
|
||||
|
||||
/* Outgoing email address specified */
|
||||
if ( !$this->settings['email_out'] OR !$this->settings['email_in'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=email'>{$this->lang->words['cp_missingemail2']}</a>" );
|
||||
}
|
||||
|
||||
/* Board Offline Check */
|
||||
if ( $this->settings['board_offline'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
|
||||
$entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
|
||||
}
|
||||
|
||||
/* Fulltext Check */
|
||||
if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
|
||||
$entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
|
||||
}
|
||||
|
||||
/* Make sure the profile directory is writable */
|
||||
@@ -176,7 +302,7 @@ class dashboardNotifications__core
|
||||
}
|
||||
|
||||
/* SQL error check */
|
||||
if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
/*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
{
|
||||
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
|
||||
|
||||
@@ -187,10 +313,10 @@ class dashboardNotifications__core
|
||||
|
||||
if ( $mtime == $now )
|
||||
{
|
||||
/* Display a message */
|
||||
// Display a message
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Define data hook locations (core)
|
||||
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8812 $
|
||||
*/
|
||||
|
||||
$dataHookLocations = array(
|
||||
|
||||
/* POSTING LIBRARY DATA LOCATIONS */
|
||||
array( 'warnLogs', 'Insert Warn Log' ),
|
||||
|
||||
|
||||
);
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-04-20 18:01:37 -0400 (Wed, 20 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5732 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8419 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -31,5 +31,6 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'],
|
||||
'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'],
|
||||
'global_comments' => ipsRegistry::getClass('class_localization')->words['ctype__comments'],
|
||||
);
|
||||
@@ -9,10 +9,10 @@
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6596 $
|
||||
*
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-09-16 07:16:26 -0400 (Fri, 16 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6596 $
|
||||
* @version $Rev: 9496 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -50,8 +50,12 @@ $_SEOTEMPLATES = array(
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=register(&|&|$)#i', 'register/$3' ),
|
||||
'in' => array( 'regex' => "#/register(/|$|\?)#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ),
|
||||
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ),
|
||||
'likeunsubscribe' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=like(&|&)do=unsubscribe(&|&)key=(\S+?)(&|&|$)#i', 'unsubscribe/$5/' ),
|
||||
'in' => array( 'regex' => "#/unsubscribe/(\S+?)/$#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'like' ), array( 'do', 'unsubscribe' ), array( 'key', '$1' ) ) ) ),
|
||||
'section=rss' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)$#i', 'rss/$4/' ),
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* @file generate.php Navigation plugin: attachments
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 3/8/2011
|
||||
* $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8754 $
|
||||
*/
|
||||
|
||||
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 navigation_core
|
||||
* @brief Provide ability to share attachments via editor
|
||||
*/
|
||||
class navigation_core
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tab title
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getTabName()
|
||||
{
|
||||
return $this->lang->words['quicknav_comm_link'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns navigation data
|
||||
*
|
||||
* @return @e array array( array( 0 => array( 'title' => 'x', 'url' => 'x' ) ) );
|
||||
*/
|
||||
public function getNavigationData()
|
||||
{
|
||||
$blocks = array();
|
||||
$links = array();
|
||||
|
||||
$links[] = array( 'title' => $this->lang->words['view_new_posts'] , 'url' => $this->registry->output->buildUrl( 'app=core&module=search&do=viewNewContent&search_app=forums', 'public') );
|
||||
$links[] = array( 'title' => $this->lang->words['online_user_link'] , 'url' => $this->registry->output->buildUrl( 'app=members&module=online&sort_order=desc', 'public') );
|
||||
$links[] = array( 'title' => $this->lang->words['registered_users_link'], 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=list', 'public', 'false', 'members_list' ) );
|
||||
$links[] = array( 'title' => $this->lang->words['status_updates_link'] , 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=profile&section=status', 'public', 'false', 'members_status_all' ) );
|
||||
|
||||
/* Add to blocks */
|
||||
$blocks[] = array( 'title' => '', 'links' => $links );
|
||||
|
||||
return $blocks;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2010-10-25 10:10:56 -0400 (Mon, 25 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-03-11 06:59:39 -0500 (Fri, 11 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 7030 $
|
||||
* @version $Rev: 8031 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -37,9 +37,9 @@ class core_notifications
|
||||
$_NOTIFY = array(
|
||||
// Future...
|
||||
// array( 'key' => 'reputation_received', 'default' => array( 'inline' ), 'disabled' => array() ),
|
||||
array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE , 'icon' => 'notify_reportcenter' ),
|
||||
array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE, 'icon' => 'notify_reportcenter' ),
|
||||
array( 'key' => 'new_comment' , 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => false, 'icon' => 'notify_profilecomment' ),
|
||||
);
|
||||
);/*noLibHook*/
|
||||
return $_NOTIFY;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Report Center :: Default plugin
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @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
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -25,25 +25,32 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class default_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
*
|
||||
* @access private
|
||||
* @var array Data specific to the plugin
|
||||
*/
|
||||
public $_extra;
|
||||
@@ -51,9 +58,8 @@ class default_plugin
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -74,7 +80,6 @@ class default_plugin
|
||||
/**
|
||||
* Display the form for extra data in the ACP
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data
|
||||
* @param object HTML object
|
||||
* @return string HTML to add to the form
|
||||
@@ -122,12 +127,12 @@ EOF;
|
||||
$return .= $html->addRow( "URL String",
|
||||
"The formatted URL that is used to point to the reported content. If the URL does not contain 'http://' the board's base url will be inserted. You may also include input data: {input_id}",
|
||||
$this->registry->output->formInput('string_url', $plugin_data['string_url'])
|
||||
);
|
||||
);/*noLibHook*/
|
||||
|
||||
$return .= $html->addRow( "Title String",
|
||||
"The formatted title that is shown on the reporting page and when reports are listed. You may include input data: {input_id}. If you would like the report center to pull the page title, use #PAGE_TITLE#",
|
||||
$this->registry->output->formInput('string_title', $plugin_data['string_title'])
|
||||
);
|
||||
);/*noLibHook*/
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -135,7 +140,6 @@ EOF;
|
||||
/**
|
||||
* Process the plugin's form fields for saving
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data for save
|
||||
* @return string Error message
|
||||
*/
|
||||
@@ -176,7 +180,6 @@ EOF;
|
||||
/**
|
||||
* Update timestamp for report
|
||||
*
|
||||
* @access public
|
||||
* @param array New reports
|
||||
* @param array New members cache
|
||||
* @return boolean
|
||||
@@ -189,7 +192,6 @@ EOF;
|
||||
/**
|
||||
* Get report permissions
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of perms to check
|
||||
* @param array Permissions data
|
||||
* @param array group ids
|
||||
@@ -211,7 +213,6 @@ EOF;
|
||||
/**
|
||||
* Show the report form for this module
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @return string HTML form information
|
||||
*/
|
||||
@@ -236,7 +237,6 @@ EOF;
|
||||
/**
|
||||
* Process the basic forum data
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @param string URL
|
||||
* @param string Title
|
||||
@@ -317,7 +317,6 @@ EOF;
|
||||
/**
|
||||
* Get section and link
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Section/link
|
||||
*/
|
||||
@@ -332,7 +331,6 @@ EOF;
|
||||
/**
|
||||
* Process a report and save the data appropriate
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Data from saving the report
|
||||
*/
|
||||
@@ -417,13 +415,28 @@ EOF;
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an array of data from rc_reports_index and returns an array formatted nearly identical to processReport()
|
||||
*
|
||||
* @param array Report data
|
||||
* @return array Formatted report data
|
||||
*/
|
||||
public function formatReportData( $report_data )
|
||||
{
|
||||
return array(
|
||||
'REDIRECT_URL' => $report_data['url'],
|
||||
'REPORT_INDEX' => $report_data['id'],
|
||||
'SAVED_URL' => $report_data['url'],
|
||||
'REPORT' => '',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
@@ -433,11 +446,10 @@ EOF;
|
||||
/**
|
||||
* Loads an HTML page and grabs its title
|
||||
*
|
||||
* @access private
|
||||
* @param string Web URL
|
||||
* @return string
|
||||
*/
|
||||
private function _getPageTitle( $URL )
|
||||
protected function _getPageTitle( $URL )
|
||||
{
|
||||
$html_code = file_get_contents( $URL );
|
||||
|
||||
@@ -455,7 +467,6 @@ EOF;
|
||||
/**
|
||||
* Retrieve list of users to send notifications to
|
||||
*
|
||||
* @access public
|
||||
* @param string Group ids
|
||||
* @param array Report data
|
||||
* @return array Array of users to PM/Email
|
||||
@@ -465,16 +476,16 @@ EOF;
|
||||
$notify = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: report center
|
||||
* Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 6980 $
|
||||
* @version $Revision: 8021 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -30,7 +30,7 @@ class rss_output_core
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
private $expires = 0;
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config file
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-04-13 23:15:13 -0400 (Wed, 13 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8333 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -23,13 +24,10 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 0;
|
||||
|
||||
/* Can fetch active content with this app */
|
||||
$CONFIG['can_activeContent'] = 0;
|
||||
$CONFIG['can_viewNewContent'] = 0;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 0;
|
||||
$CONFIG['can_userContent'] = 0;
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Basic Forum Search
|
||||
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5861 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -26,6 +26,9 @@ class search_engine_core extends search_engine
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -39,78 +42,50 @@ class search_engine_core extends search_engine
|
||||
*
|
||||
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
/* INIT */
|
||||
$count = 0;
|
||||
$results = array();
|
||||
$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');
|
||||
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
|
||||
$sortKey = '';
|
||||
$sortType = '';
|
||||
$rows = array();
|
||||
$got = 0;
|
||||
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') )
|
||||
{
|
||||
$group_by = 'h.id';
|
||||
}
|
||||
|
||||
/* 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');
|
||||
$sortKey = '';
|
||||
$rows = array();
|
||||
|
||||
/* Sorting */
|
||||
switch( $sort_by )
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = ( $content_title_only ) ? 'id' : 'id';
|
||||
$sortType = 'numerical';
|
||||
$sortKey = 'id';
|
||||
break;
|
||||
case 'title':
|
||||
$sortKey = 'title';
|
||||
$sortType = 'string';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Query the count */
|
||||
$count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results',
|
||||
'from' => array( 'faq' => 'h' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'group' => $group_by,
|
||||
'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ),
|
||||
'where' => "i.perm_type='help' AND i.perm_type_id=1",
|
||||
'type' => 'left' ) ) ) );
|
||||
'from' => 'faq',
|
||||
'where' => $this->_buildWhereStatement( $search_term ),
|
||||
) );
|
||||
|
||||
|
||||
|
||||
/* Fetch data */
|
||||
$this->DB->build( array( 'select' => 'h.*',
|
||||
'from' => array( 'faq' => 'h' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'group' => $group_by,
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'faq',
|
||||
'where' => $this->_buildWhereStatement( $search_term ),
|
||||
'order' => $sortKey . ' ' . $sort_order,
|
||||
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
|
||||
'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ),
|
||||
'where' => "i.perm_type='help' AND i.perm_type_id=1",
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Sort */
|
||||
/* Get results */
|
||||
while ( $_row = $this->DB->fetch() )
|
||||
{
|
||||
$rows[ $got ] = $_row;
|
||||
|
||||
$got++;
|
||||
$rows[] = $_row;
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
@@ -120,25 +95,30 @@ class search_engine_core extends search_engine
|
||||
/**
|
||||
* Builds the where portion of a search string
|
||||
*
|
||||
* @access private
|
||||
* @param string $search_term The string to use in the search
|
||||
* @param bool $content_title_only Search only title records
|
||||
* @return string
|
||||
**/
|
||||
private function _buildWhereStatement( $search_term, $content_title_only=false )
|
||||
*/
|
||||
protected function _buildWhereStatement( $search_term )
|
||||
{
|
||||
/* INI */
|
||||
$where_clause = array();
|
||||
|
||||
if( $search_term )
|
||||
{
|
||||
if( $content_title_only )
|
||||
switch( IPSSearchRegistry::get('opt.searchType') )
|
||||
{
|
||||
$where_clause[] = "h.title LIKE '%{$search_term}%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where_clause[] = "(h.title LIKE '%{$search_term}%' OR h.text LIKE '%{$search_term}%' OR h.description LIKE '%{$search_term}%')";
|
||||
case 'both':
|
||||
default:
|
||||
$where_clause[] = "(title LIKE '%{$search_term}%' OR text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
|
||||
break;
|
||||
|
||||
case 'titles':
|
||||
$where_clause[] = "title LIKE '%{$search_term}%'";
|
||||
break;
|
||||
|
||||
case 'content':
|
||||
$where_clause[] = "(text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,9 +134,6 @@ class search_engine_core extends search_engine
|
||||
$where_clause[] = '( ' . implode( ' OR ', $this->whereConditions['OR'] ) . ' )';
|
||||
}
|
||||
|
||||
/* Permissions */
|
||||
$where_clause[] = $this->DB->buildRegexp( "i.perm_view", $this->member->perm_id_array );
|
||||
|
||||
/* Build and return the string */
|
||||
return implode( " AND ", $where_clause );
|
||||
}
|
||||
@@ -164,10 +141,9 @@ class search_engine_core extends search_engine
|
||||
/**
|
||||
* Remap standard columns (Apps can override )
|
||||
*
|
||||
* @access public
|
||||
* @param string $column sql table column for this condition
|
||||
* @return string column
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function remapColumn( $column )
|
||||
{
|
||||
@@ -182,26 +158,17 @@ class search_engine_core extends search_engine
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
/* INIT */
|
||||
$return = array();
|
||||
|
||||
/* Set up some defaults */
|
||||
IPSSearchRegistry::set( 'opt.noPostPreview' , false );
|
||||
IPSSearchRegistry::set( 'opt.onlySearchPosts', false );
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Can handle boolean searching
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function isBoolean()
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -27,6 +28,7 @@ class search_form_core
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -45,8 +47,6 @@ class search_form_core
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Formats forum search results
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -26,6 +27,9 @@ class search_format_core extends search_format
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -35,7 +39,6 @@ class search_format_core extends search_format
|
||||
/**
|
||||
* Parse search results
|
||||
*
|
||||
* @access private
|
||||
* @param array $r Search result
|
||||
* @return array $html Blocks of HTML
|
||||
*/
|
||||
@@ -47,20 +50,18 @@ class search_format_core extends search_format
|
||||
/**
|
||||
* Formats the forum search result for display
|
||||
*
|
||||
* @access public
|
||||
* @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 )
|
||||
{
|
||||
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('display.onlyTitles') ), 0 );
|
||||
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats / grabs extra data for results
|
||||
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processResults( $ids )
|
||||
@@ -80,7 +81,7 @@ class search_format_core extends search_format
|
||||
*
|
||||
* @param array $r
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
public function genericizeResults( $r )
|
||||
{
|
||||
$r['app'] = 'core';
|
||||
@@ -92,5 +93,4 @@ class search_format_core extends search_format
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_attachments.php Shared media plugin: attachments
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: rtissier $
|
||||
* @since 3/8/2011
|
||||
* $LastChangedDate: 2011-03-16 19:10:59 -0400 (Wed, 16 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8108 $
|
||||
*/
|
||||
|
||||
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 plugin_core_attachments
|
||||
* @brief Provide ability to share attachments via editor
|
||||
*/
|
||||
class plugin_core_attachments
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Attachments class
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $attach;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tab title
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getTab()
|
||||
{
|
||||
if( $this->memberData['member_id'] )
|
||||
{
|
||||
return $this->lang->words['sharedmedia_attachments'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTML to display the tab
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function showTab( $string )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Are we a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// How many attachments do we have?
|
||||
//-----------------------------------------
|
||||
|
||||
$mimes = $this->cache->getCache('attachtypes');
|
||||
$st = intval($this->request['st']);
|
||||
$each = 30;
|
||||
$where = '';
|
||||
|
||||
if( $string )
|
||||
{
|
||||
$where = " AND attach_file LIKE '%{$string}%'";
|
||||
}
|
||||
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'attachments', 'where' => "attach_member_id={$this->memberData['member_id']}" . $where ) );
|
||||
$rows = array();
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $count['total'],
|
||||
'itemsPerPage' => $each,
|
||||
'currentStartValue' => $st,
|
||||
'seoTitle' => '',
|
||||
'method' => 'nextPrevious',
|
||||
'noDropdown' => true,
|
||||
'ajaxLoad' => 'mymedia_content',
|
||||
'baseUrl' => "app=core&module=ajax&section=media&do=loadtab&tabapp=core&tabplugin=attachments&search=" . urlencode($string) ) );
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_member_id={$this->memberData['member_id']}" . $where, 'order' => 'attach_date DESC', 'limit' => array( $st, $each ) ) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
if( $r['attach_thumb_location'] )
|
||||
{
|
||||
$image = $this->settings['upload_url'] . '/' . $r['attach_thumb_location'];
|
||||
|
||||
$dims = IPSLib::scaleImage( array(
|
||||
'cur_width' => $r['attach_thumb_width'],
|
||||
'cur_height' => $r['attach_thumb_height'],
|
||||
'max_width' => 80,
|
||||
'max_height' => 80,
|
||||
) );
|
||||
$width = $dims['img_width'];
|
||||
$height = $dims['img_height'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = $this->settings['public_dir'] . $mimes[ $r['attach_ext'] ]['atype_img'];
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
'image' => $image,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'title' => IPSText::truncate( $r['attach_file'], 25 ),
|
||||
'desc' => '',
|
||||
'insert' => "core:attachments:" . $r['attach_id'],
|
||||
);
|
||||
}
|
||||
|
||||
return $this->registry->output->getTemplate('editors')->mediaGenericWrapper( $rows, $pages, 'core', 'attachments' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTML output to display
|
||||
*
|
||||
* @param int $attachId Attachment ID to show
|
||||
* @return @e string
|
||||
*/
|
||||
public function getOutput( $attachId=0 )
|
||||
{
|
||||
$attachId = intval($attachId);
|
||||
|
||||
if( !$attachId )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if( !is_object($this->attach) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->attach = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
$attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . $attachId ) );
|
||||
|
||||
$this->attach->type = $attachment['attach_rel_module'];
|
||||
$this->attach->init();
|
||||
|
||||
$output = $this->attach->renderSingleAttachment( $attachment );
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify current user has permission to post this
|
||||
*
|
||||
* @param int $attachId Attachment ID to show
|
||||
* @return @e bool
|
||||
*/
|
||||
public function checkPostPermission( $attachId )
|
||||
{
|
||||
$attachId = intval($attachId);
|
||||
|
||||
if( !$attachId )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . $attachId ) );
|
||||
|
||||
if( $this->memberData['member_id'] AND $attachment['attach_member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return 'no_permission_shared';
|
||||
}
|
||||
}
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-08-31 20:57:38 -0400 (Wed, 31 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9438 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
@@ -27,62 +27,64 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
$appSphinxTemplate = <<<EOF
|
||||
|
||||
############################### --- CORE --- ################################
|
||||
############################### --- TAGS --- ################################
|
||||
|
||||
source core_search_main : ipb_source_config
|
||||
source <!--SPHINX_CONF_PREFIX-->core_tags_search_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_core_counter', (SELECT max(id) FROM <!--SPHINX_DB_PREFIX-->faq), '', 0, UNIX_TIMESTAMP() )
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_core_tags_counter', (SELECT max(tag_id) FROM <!--SPHINX_DB_PREFIX-->core_tags), 0, UNIX_TIMESTAMP(), 0 )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT f.*, f.id as search_id, \
|
||||
REPLACE( pi.perm_view, '*', 0 ) as perm_view \
|
||||
FROM <!--SPHINX_DB_PREFIX-->faq f \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='help' ) \
|
||||
WHERE f.id <= ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_counter' )
|
||||
sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \
|
||||
p.tag_perm_text, p.tag_perm_visible \
|
||||
FROM <!--SPHINX_DB_PREFIX-->core_tags t \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \
|
||||
WHERE t.tag_id <= ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_tags_counter' )
|
||||
|
||||
# Fields
|
||||
sql_attr_uint = search_id
|
||||
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_timestamp = tag_added
|
||||
sql_attr_uint = tag_member_id
|
||||
sql_attr_uint = tag_meta_id
|
||||
sql_attr_uint = tag_meta_parent_id
|
||||
sql_attr_uint = tag_perm_visible
|
||||
sql_ranged_throttle = 0
|
||||
}
|
||||
|
||||
source core_search_delta : core_search_main
|
||||
source <!--SPHINX_CONF_PREFIX-->core_tags_search_delta : <!--SPHINX_CONF_PREFIX-->core_tags_search_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT f.*, f.id as search_id, \
|
||||
REPLACE( pi.perm_view, '*', 0 ) as perm_view \
|
||||
FROM <!--SPHINX_DB_PREFIX-->faq f \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='help' ) \
|
||||
WHERE f.id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_counter' )
|
||||
|
||||
# Fields
|
||||
sql_attr_uint = search_id
|
||||
|
||||
sql_ranged_throttle = 0
|
||||
sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \
|
||||
p.tag_perm_text, p.tag_perm_visible \
|
||||
FROM <!--SPHINX_DB_PREFIX-->core_tags t \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \
|
||||
WHERE t.tag_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_core_tags_counter' )
|
||||
}
|
||||
|
||||
index core_search_main
|
||||
index <!--SPHINX_CONF_PREFIX-->core_tags_search_main
|
||||
{
|
||||
source = core_search_main
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_main
|
||||
source = <!--SPHINX_CONF_PREFIX-->core_tags_search_main
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->core_tags_search_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
charset_type = utf-8
|
||||
html_strip = 0
|
||||
#infix_fields = tag_text
|
||||
#min_infix_len = 3
|
||||
#enable_star = 1
|
||||
}
|
||||
|
||||
index core_search_delta : core_search_main
|
||||
index <!--SPHINX_CONF_PREFIX-->core_tags_search_delta : <!--SPHINX_CONF_PREFIX-->core_tags_search_main
|
||||
{
|
||||
source = core_search_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_delta
|
||||
source = <!--SPHINX_CONF_PREFIX-->core_tags_search_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->core_tags_search_delta
|
||||
}
|
||||
|
||||
|
||||
EOF;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -238,13 +238,13 @@ function IPB3TemplateDiffResults()
|
||||
{
|
||||
default:
|
||||
case 'orig':
|
||||
_text = 'Старый';
|
||||
_text = ipb.lang['comparediff_oldd'];
|
||||
break;
|
||||
case 'new':
|
||||
_text = 'Новый';
|
||||
_text = ipb.lang['comparediff_newd'];
|
||||
break;
|
||||
case 'custom':
|
||||
_text = 'Пользовательский';
|
||||
_text = ipb.lang['comparediff_cust'];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -253,11 +253,11 @@ function IPB3TemplateDiffResults()
|
||||
{
|
||||
if ( json['data_type'] == 'css' )
|
||||
{
|
||||
content = '<h3>' + _text + ': ' + json['data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div>';
|
||||
content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
content = '<h3>' + _text + ': ' + json['data_group'] + ' > ' + json['data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div>';
|
||||
content = '<div class="acp-box"><h3>' + _text + ': ' + json['data_group'] + ' > ' + json['data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div></div>';
|
||||
}
|
||||
|
||||
max = document.viewport.getHeight();
|
||||
@@ -313,10 +313,10 @@ function IPB3TemplateDiffResults()
|
||||
{
|
||||
default:
|
||||
case 'diff':
|
||||
_text = 'Различия';
|
||||
_text = ipb.lang['comparediff_diff'];
|
||||
break;
|
||||
case 'merge':
|
||||
_text = 'Препросмотр объединения';
|
||||
_text = ipb.lang['comparediff_merg'];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ function IPB3TemplateDiffResults()
|
||||
/* Extra work for merge */
|
||||
if ( type == 'merge' )
|
||||
{
|
||||
_qb = "<div class='acp-actionbar' style='text-align:left;'><div style='float:right'><input type='button' id='mergeEditCustom' class='button __re" + changeId + "' value='Изменить' /></div><input type='button' id='mergeResolveCustom' class='button __rc" + changeId + "' value='Решить все: в пользу пользовательских изменений' /> <input type='button' id='mergeResolveNew' class='button __rn" + changeId + "' value='Решить все: в пользу новых изменений' /></div>";
|
||||
_qb = "<div class='acp-actionbar' style='text-align:left;'><div style='float:right'><input type='button' id='mergeEditCustom' class='button __re" + changeId + "' value='" + ipb.lang['merge_edititem'] + "' /></div><input type='button' id='mergeResolveCustom' class='button __rc" + changeId + "' value='" + ipb.lang['resolveall_button'] + "' /> <input type='button' id='mergeResolveNew' class='button __rn" + changeId + "' value='" + ipb.lang['resolveall_newwin'] + "' /></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -335,11 +335,11 @@ function IPB3TemplateDiffResults()
|
||||
|
||||
if ( json['change_data_type'] == 'css' )
|
||||
{
|
||||
content = '<h3>'+ _text + ': ' + json['change_data_title'] + '.css</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb;
|
||||
content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_title'] + '.css</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
content = '<h3>'+ _text + ': ' + json['change_data_group'] + ' > ' + json['change_data_title'] + '</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb;
|
||||
content = '<div class="acp-box"><h3>'+ _text + ': ' + json['change_data_group'] + ' > ' + json['change_data_title'] + '</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb + "</div>";
|
||||
}
|
||||
|
||||
max = document.viewport.getHeight();
|
||||
@@ -410,16 +410,16 @@ function IPB3TemplateDiffResults()
|
||||
<3 javascript */
|
||||
var _tmp = Math.floor( Math.random() * 1001 );
|
||||
|
||||
_qb = "<div style='float:left; margin-top:6px'><input type='button' id='mergeResolveCustom_" + _tmp + "' class='button __rc" + changeId + "' value='Решить все: в пользу пользовательских изменений' /> <input type='button' id='mergeResolveNew_" + _tmp + "' class='button __rn" + changeId + "' value='Решить все: в пользу новых изменений' /></div>";
|
||||
_tb = '<textarea name="content" id="mergeContent" style="width:100%; height:700px; line-height:150%">' + json['change_merge_content'] + '</textarea>' + _qb + '<div style="text-align:right" class="acp-actionbar"><input type="button" id="mergeSubmit" value="Сохранить" class="button primary __i' + changeId + '" /></div>';
|
||||
_qb = "<div style='float:left; margin-top:6px'><input type='button' id='mergeResolveCustom_" + _tmp + "' class='button __rc" + changeId + "' value='" + ipb.lang['resolveall_button'] + "' /> <input type='button' id='mergeResolveNew_" + _tmp + "' class='button __rn" + changeId + "' value='" + ipb.lang['resolveall_newwin'] + "' /></div>";
|
||||
_tb = '<textarea name="content" id="mergeContent" style="width:100%; height:700px; line-height:150%">' + json['change_merge_content'] + '</textarea>' + _qb + '<div style="text-align:right" class="acp-actionbar"><input type="button" id="mergeSubmit" value="' + ipb.lang['save_button'] + '" class="button primary __i' + changeId + '" /></div>';
|
||||
|
||||
if ( json['change_data_type'] == 'css' )
|
||||
{
|
||||
content = '<h3>' + json['change_data_title'] + '.css' + '</h3><div style="padding:4px;">' + _tb + '</div>';
|
||||
content = '<div class="acp-box"><h3>' + json['change_data_title'] + '.css' + '</h3><div style="padding:4px;">' + _tb + '</div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
content = '<h3>' + json['change_data_group'] + ' > ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</div>';
|
||||
content = '<div class="acp-box"><h3>' + json['change_data_group'] + ' > ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</div></div>';
|
||||
}
|
||||
|
||||
IPB3TemplateDiffResults.popUps['edit-' + changeId ] = new ipb.Popup('diffEditPopUp_' + _tmp, { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: '600px', initial: '<div style="height:750px"> </div>' } );
|
||||
@@ -535,7 +535,7 @@ function IPB3TemplateDiffResults()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
alert( ipb.lang['oops'] + t.responseText );
|
||||
}
|
||||
},
|
||||
onFailure: function()
|
||||
@@ -567,7 +567,7 @@ function IPB3TemplateDiffResults()
|
||||
/* Test to see if we've left in merge stuff */
|
||||
if ( content.match( '<<<<<<<<<<' ) || content.match( '>>>>>>>>>' ) )
|
||||
{
|
||||
alert( 'Нельзя сохранить пока не будут устранены все конфликты' );
|
||||
alert( ipb.lang['mustfixfirst'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -608,7 +608,7 @@ function IPB3TemplateDiffResults()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
alert( ipb.lang['oops'] + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -40,7 +40,7 @@ function IPBCSS()
|
||||
* @var hash
|
||||
*/
|
||||
this.cssNames = {
|
||||
'cssRow' : 'tablerow2',
|
||||
'cssRow' : 'row2',
|
||||
'cssHover' : 'cssHover' };
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ function IPBCSS()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Похоже у нас проблемы: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
@@ -143,7 +143,7 @@ function IPBCSS()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
alert( "Похоже у нас проблемы: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
@@ -196,13 +196,13 @@ function IPBCSS()
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
alert("Я СКАЗАЛ: " + json['errors'] );
|
||||
alert("Ошибка: " + json['errors'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
alert( "Похоже у нас проблемы: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
@@ -239,7 +239,7 @@ function IPBCSS()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
alert( "Похоже у нас проблемы: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
|
||||
@@ -1,27 +1,74 @@
|
||||
|
||||
function addAnotherRequirement()
|
||||
{
|
||||
requireIndex = parseInt(requireIndex) + 1;
|
||||
|
||||
// Show the data location dropdown now
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getApplications&secure_key=" + ipb.vars['md5_hash'] + "&i=" + requireIndex + "&name=requireApp";
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'GET',
|
||||
onSuccess: function ( t )
|
||||
{
|
||||
var newApp = ipb.templates['new_app_require'].evaluate({ index: requireIndex, dropdown: t.responseText });
|
||||
|
||||
if ( $('RequirementsContainer').down('tbody') )
|
||||
{
|
||||
$('RequirementsContainer').down('tbody').insert( newApp );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('RequirementsContainer').insert( newApp );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
|
||||
function removeRequirement( idToRemove )
|
||||
{
|
||||
idToRemove = parseInt(idToRemove);
|
||||
|
||||
if( $('requirementTitleRow_' + idToRemove ) != null )
|
||||
{
|
||||
$('requirementTitleRow_' + idToRemove ).remove();
|
||||
}
|
||||
|
||||
if( $('requirementRow_' + idToRemove ) != null )
|
||||
{
|
||||
$('requirementRow_' + idToRemove ).remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addAnotherFile()
|
||||
{
|
||||
elementIndex = parseInt(elementIndex) + 1;
|
||||
|
||||
var header = new Element( 'div', { 'class': 'tablesubheader' } );
|
||||
header.update( ipb.lang['hookfilenumber'] + elementIndex );
|
||||
var newFile = ipb.templates['new_hook_file'].evaluate({ index: elementIndex });
|
||||
|
||||
var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } );
|
||||
list.addClassName( 'acp-form' );
|
||||
list.addClassName( 'alternate_rows' );
|
||||
|
||||
$('fileTableContainer').insert( header );
|
||||
$('fileTableContainer').insert( list );
|
||||
|
||||
var li1 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filename'] + "</label><input type='text' name='file[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
|
||||
var li2 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_classname'] + "</label><input type='text' name='hook_classname[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
|
||||
var li3 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filetype'] + "</label><select name='hook_type[" + elementIndex + "]' id='hook_type[" + elementIndex + "]' onchange='selectHookType(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='commandHooks'>" + ipb.lang['hook_filetype_action'] + "</option><option value='skinHooks'>" + ipb.lang['hook_filetype_skin'] + "</option><option value='templateHooks'>" + ipb.lang['hook_filetype_template'] + "</option><option value='dataHooks'>" + ipb.lang['hook_filetype_data'] + "</option><option value='libraryHooks'>" + ipb.lang['hook_filetype_library'] + "</option></select>" );
|
||||
if ( $('fileTableContainer').down('tbody') )
|
||||
{
|
||||
$('fileTableContainer').down('tbody').insert( newFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTableContainer').insert( newFile );
|
||||
}
|
||||
}
|
||||
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
$('fileTable_' + elementIndex).insert( li2 );
|
||||
$('fileTable_' + elementIndex).insert( li3 );
|
||||
|
||||
doStriping();
|
||||
function removeFile( elementIndex )
|
||||
{
|
||||
elementIndex = parseInt(elementIndex);
|
||||
|
||||
if( $('fileRow_' + elementIndex ) != null )
|
||||
{
|
||||
$('fileRow_' + elementIndex ).remove();
|
||||
}
|
||||
}
|
||||
|
||||
function selectHookType( elementIndex )
|
||||
@@ -63,7 +110,6 @@ function selectHookType( elementIndex )
|
||||
$('tr_dataLocation[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
|
||||
if( $('tr_libApplication[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_libApplication[' + elementIndex + ']').remove();
|
||||
@@ -81,9 +127,16 @@ function selectHookType( elementIndex )
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
li1 = new Element( 'li', { 'id': 'tr_skinGroup[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skingroup'] + "</label>" + t.responseText );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
doStriping();
|
||||
var newRow = ipb.templates['hook_skinGroup'].evaluate({ index: elementIndex, dropdown: t.responseText });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
@@ -101,9 +154,16 @@ function selectHookType( elementIndex )
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
li1 = new Element( 'li', { 'id': 'tr_dataLocation[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_data_location'] + "</label>" + t.responseText );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
doStriping();
|
||||
var newRow = ipb.templates['hook_dataLocation'].evaluate({ index: elementIndex, dropdown: t.responseText });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
@@ -111,9 +171,6 @@ function selectHookType( elementIndex )
|
||||
}
|
||||
else if( type == 'libraryHooks' )
|
||||
{
|
||||
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
|
||||
// Show the data location dropdown now
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getApplications&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
|
||||
@@ -124,9 +181,17 @@ function selectHookType( elementIndex )
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
li1 = new Element( 'li', { 'id': 'tr_libApplication[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_application'] + "</label>" + t.responseText );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
doStriping();
|
||||
var replace = { index: elementIndex, dropdown: t.responseText };
|
||||
var newRow = ipb.templates['hook_classToOverload'].evaluate(replace) + ipb.templates['hook_libApplication'].evaluate(replace);
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
@@ -136,8 +201,16 @@ function selectHookType( elementIndex )
|
||||
{
|
||||
// Show the classToOverload field
|
||||
|
||||
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
var newRow = ipb.templates['hook_classToOverload'].evaluate({ index: elementIndex });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,27 +238,38 @@ function getTemplatesForAdd( elementIndex )
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getTemplatesForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
li1 = new Element( 'li', { 'id': 'tr_skinFunction[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skinfunc'] + "</label>" + t.responseText );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
doStriping();
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
/* Got a type? */
|
||||
if( type != '0' )
|
||||
{
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getTemplatesForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
var newRow = ipb.templates['hook_skinFunction'].evaluate({ index: elementIndex, dropdown: t.responseText });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function getTypeOfHook( elementIndex )
|
||||
{
|
||||
var type = $F('skinFunction[' + elementIndex + ']');
|
||||
|
||||
var template = $F('skinFunction[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
@@ -200,11 +284,21 @@ function getTypeOfHook( elementIndex )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
li1 = new Element( 'li', { 'id': 'tr_type[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_temptype'] + "</label><select name='type[" + elementIndex + "]' id='type[" + elementIndex + "]' onchange='getHookIds(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='foreach'>foreach loop</option><option value='if'>if statement</option></select>" );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
|
||||
doStriping();
|
||||
/* Insert the new hook type row */
|
||||
if ( template != '0' )
|
||||
{
|
||||
var newRow = ipb.templates['hook_pointTypes'].evaluate({ index: elementIndex });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getHookIds( elementIndex )
|
||||
@@ -222,34 +316,46 @@ function getHookIds( elementIndex )
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getHookIds&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
li1 = new Element( 'li', { 'id': 'tr_id[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_hookid'] + "</label>" + t.responseText );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
doStriping();
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
/* Got a type? */
|
||||
if( type != '0' )
|
||||
{
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getHookIds&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'GET',
|
||||
onSuccess: function (t )
|
||||
{
|
||||
var newRow = ipb.templates['hook_pointIds'].evaluate({ index: elementIndex, dropdown: t.responseText });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function getHookEntryPoints( elementIndex )
|
||||
{
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
Debug.write( type );
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
|
||||
var options = '';
|
||||
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
|
||||
|
||||
if( type == 'foreach' )
|
||||
{
|
||||
@@ -267,9 +373,18 @@ function getHookEntryPoints( elementIndex )
|
||||
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>";
|
||||
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>";
|
||||
}
|
||||
|
||||
var li1 = new Element( 'li', { 'id': 'tr_position[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_tempposi'] + "</label><select name='position[" + elementIndex + "]' id='position[" + elementIndex + "]'>" + options + "</select>" );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
|
||||
doStriping();
|
||||
/* Insert the new hook type row */
|
||||
//if ( type != '0' )
|
||||
//{
|
||||
var newRow = ipb.templates['hook_pointLocation'].evaluate({ index: elementIndex, hookPoints: options });
|
||||
|
||||
if ( $('fileTable_' + elementIndex).down('tbody') )
|
||||
{
|
||||
$('fileTable_' + elementIndex).down('tbody').insert( newRow );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fileTable_' + elementIndex).insert( newRow );
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ function IPBReplacements()
|
||||
* @var hash
|
||||
*/
|
||||
this.cssNames = {
|
||||
'replacementsRow' : 'tablerow2',
|
||||
'replacementsRow' : 'row2',
|
||||
'replacementsHover' : 'replacementsHover' };
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ function IPBTemplateSandR()
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=templatesandr&do=replace&&sessionID=" + this.sessionID + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
$('replaceButton').disabled = true;
|
||||
$('replaceButton').value = "Сохранение...";
|
||||
$('replaceButton').value = ipb.lang['tpl_savegeneric'];
|
||||
|
||||
new Ajax.Request( url.replace( /&/g, '&' ),
|
||||
{
|
||||
@@ -189,7 +189,7 @@ function IPBTemplateSandR()
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=templates&do=saveTemplateBit&setID=" + this.setData['set_id'] + '&template_id=' + template_id + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
/* Set up params */
|
||||
var params = { 'template_content' : $F('tplate_editBox_' + template_id ),
|
||||
var params = { 'template_content' : $F('tplate_editBox_' + template_id ).encodeParam(), /* Need to run encodeParam or urlencoding is lost on save - same as acp.templates.js */
|
||||
'template_data' : $F('tplate_dataBox_' + template_id ),
|
||||
'template_set' : this.setData['set_id'],
|
||||
'template_group' : IPB3TemplatesSandR.currentTemplateGroup,
|
||||
@@ -259,10 +259,7 @@ function IPBTemplateSandR()
|
||||
var _output = '';
|
||||
var _tplate = new Template( $('tplate_groupRow').innerHTML );
|
||||
var json = IPB3TemplatesSandR.templateGroups;
|
||||
|
||||
var ROW_ON_OFF = true;
|
||||
var CLASS_NAME = '';
|
||||
|
||||
|
||||
var _groups = Object.keys( json['groups'] ).sort();
|
||||
|
||||
/* Clear out any current listing */
|
||||
@@ -271,18 +268,7 @@ function IPBTemplateSandR()
|
||||
/* Format... */
|
||||
_groups.each( function( i )
|
||||
{
|
||||
if( ROW_ON_OFF)
|
||||
{
|
||||
ROW_ON_OFF = false;
|
||||
CLASS_NAME = 'acp-row-off';
|
||||
}
|
||||
else
|
||||
{
|
||||
ROW_ON_OFF = true;
|
||||
CLASS_NAME = 'acp-row-on';
|
||||
}
|
||||
|
||||
_output += _tplate.evaluate( { 'groupName' : i, '_matches' : Object.keys( json['groups'][i] ).length, 'classname' : CLASS_NAME } );
|
||||
_output += _tplate.evaluate( { 'groupName' : i, '_matches' : Object.keys( json['groups'][i] ).length } );
|
||||
} );
|
||||
|
||||
/* Write it out */
|
||||
@@ -300,8 +286,6 @@ function IPBTemplateSandR()
|
||||
$( 'groupRowCbox_' + i ).show();
|
||||
}
|
||||
} );
|
||||
|
||||
doStriping();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -315,17 +299,20 @@ function IPBTemplateSandR()
|
||||
|
||||
IPB3TemplatesSandR.currentTemplateGroup = groupName;
|
||||
|
||||
/* Clear out any current listing */
|
||||
$( 'groupRowTemplates_' + groupName ).update('');
|
||||
|
||||
/* Add in the new... */
|
||||
for( i = 0 ; i < json['templates'].length; i++ )
|
||||
{
|
||||
_output += _tplate.evaluate( json['templates'][i] );
|
||||
};
|
||||
|
||||
/* Clear out any current listing */
|
||||
$$( '#groupRowTemplates_' + groupName + " table.ipsTable" ).each( function(elem) {
|
||||
elem.update( _output );
|
||||
});
|
||||
//$( 'groupRowTemplates_' + groupName ).update('');
|
||||
|
||||
/* Write it out */
|
||||
$( 'groupRowTemplates_' + groupName ).update( _output );
|
||||
//$( 'groupRowTemplates_' + groupName ).update( _output );
|
||||
|
||||
/* Post process */
|
||||
for( i = 0 ; i < json['templates'].length; i++ )
|
||||
|
||||
@@ -48,9 +48,9 @@ function IPBTemplates()
|
||||
*/
|
||||
this.cssNames = { 'groupRowLit' : 'tplateLit',
|
||||
'groupHover' : 'groupHover',
|
||||
'groupRowLitMain' : 'tablerow1',
|
||||
'groupRow' : 'tablerow2',
|
||||
'templateRow' : 'tablerow2',
|
||||
'groupRowLitMain' : 'row1',
|
||||
'groupRow' : 'row2',
|
||||
'templateRow' : 'row2',
|
||||
'templateHover' : 'templateHover' };
|
||||
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ function IPBUAgents()
|
||||
IPB3UAgents.uAgentsData = json;
|
||||
IPB3UAgents.buildUAgentsList();
|
||||
|
||||
ipb.global.showInlineNotification( ipb.lang['useragent_saved'], { showClose: true } );
|
||||
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
@@ -132,11 +134,11 @@ function IPBUAgents()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
alert( ipb.lang['oops'] + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
onException: function( f,e ){ alert( ipb.lang['oops'] + e ); },
|
||||
onFailure: function( t ){ alert( ipb.lang['oops'] + t.responseText ); }
|
||||
} );
|
||||
};
|
||||
|
||||
@@ -146,7 +148,7 @@ function IPBUAgents()
|
||||
this.removeuAgent = function( uagent_id )
|
||||
{
|
||||
/* Make sure we're mean it... */
|
||||
if ( ! confirm( "Удалить user agent?\\nОн будет удален полностью из системы" ) )
|
||||
if ( ! confirm( ipb.lang['removeuseragent'] ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -183,11 +185,11 @@ function IPBUAgents()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
alert( ipb.lang['oops'] + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
onException: function( f,e ){ alert( ipb.lang['oops'] + e ); },
|
||||
onFailure: function( t ){ alert( ipb.lang['oops'] + t.responseText ); }
|
||||
} );
|
||||
};
|
||||
|
||||
@@ -235,7 +237,7 @@ function IPBUAgents()
|
||||
/* Adjust title */
|
||||
if ( ! uagent_id )
|
||||
{
|
||||
$('tplate_title_' + uagent_id ).update("Добавление User Agent");
|
||||
$('tplate_title_' + uagent_id ).update( ipb.lang['adduagenttitle'] );
|
||||
}
|
||||
|
||||
/* Select box type */
|
||||
@@ -290,7 +292,7 @@ function IPBUAgents()
|
||||
_groups.each( function( i )
|
||||
{
|
||||
json['uagents'][i]['_cssClass'] = IPB3UAgents.cssNames['uagentsRow'];
|
||||
|
||||
json['uagents'][i]['uagent_name'] = json['uagents'][i]['uagent_name'].replace("%20", " ");
|
||||
_output += _tplate.evaluate( json['uagents'][i] );
|
||||
|
||||
} );
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Template comparison
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-07-12 10:53:25 -0400 (Tue, 12 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 9208 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -29,35 +29,32 @@ class admin_core_ajax_compare extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
* HTML Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinDifferences( $registry );
|
||||
|
||||
@@ -73,68 +70,71 @@ class admin_core_ajax_compare extends ipsAjaxCommand
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'css':
|
||||
$this->_getCssDifferences();
|
||||
break;
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'css':
|
||||
$this->_getCssDifferences();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'differences':
|
||||
$this->_getDifferences();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get differences of a CSS file
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _getCssDifferences()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval($this->request['setID']);
|
||||
$fileID = intval($this->request['file_id']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Get requested
|
||||
//-----------------------------------------
|
||||
|
||||
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) );
|
||||
|
||||
if( $current['css_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the original
|
||||
//-----------------------------------------
|
||||
|
||||
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_group='{$current['css_group']}'" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$original['css_content'] = $current['css_content'];
|
||||
}
|
||||
case 'differences':
|
||||
$this->_getDifferences();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get differences of a CSS file
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getCssDifferences()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval($this->request['setID']);
|
||||
$fileID = intval($this->request['file_id']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Get requested
|
||||
//-----------------------------------------
|
||||
|
||||
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) );
|
||||
|
||||
if( $current['css_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the original
|
||||
//-----------------------------------------
|
||||
|
||||
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['css_set_id'] ) );
|
||||
|
||||
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
|
||||
|
||||
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_master_key='{$set['set_master_key']}' AND css_group='{$current['css_group']}'" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$original['css_content'] = $current['css_content'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$classDifference = new classDifference();
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
|
||||
$classDifference = new classDifference();
|
||||
$classDifference->method = 'PHP';
|
||||
|
||||
|
||||
$difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] );
|
||||
|
||||
|
||||
if( $classDifference->diff_found )
|
||||
{
|
||||
$difference = str_replace( "\n", "<br>", $difference );
|
||||
@@ -153,53 +153,56 @@ class admin_core_ajax_compare extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->html->differenceResult( $difference ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get differences of a template
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _getDifferences()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval($this->request['setID']);
|
||||
$templateID = intval($this->request['template_id']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Get requested
|
||||
//-----------------------------------------
|
||||
|
||||
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
|
||||
|
||||
if( $current['template_set_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the original
|
||||
//-----------------------------------------
|
||||
|
||||
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$original['template_content'] = $current['template_content'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get differences of a template
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getDifferences()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval($this->request['setID']);
|
||||
$templateID = intval($this->request['template_id']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Get requested
|
||||
//-----------------------------------------
|
||||
|
||||
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) );
|
||||
|
||||
if( $current['template_set_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the original
|
||||
//-----------------------------------------
|
||||
|
||||
$set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['template_set_id'] ) );
|
||||
|
||||
$set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root';
|
||||
|
||||
$original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_master_key='{$set['set_master_key']}' AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$original['template_content'] = $current['template_content'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$classDifference = new classDifference();
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/
|
||||
$classDifference = new classDifference();
|
||||
$classDifference->method = 'PHP';
|
||||
|
||||
|
||||
$difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'] );
|
||||
|
||||
|
||||
if( $classDifference->diff_found )
|
||||
{
|
||||
$difference = str_replace( "\n", "<br>", $difference );
|
||||
@@ -218,6 +221,6 @@ class admin_core_ajax_compare extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->html->differenceResult( $difference ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -30,46 +30,44 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
$this->skinFunctions = new skinCaching( $registry );
|
||||
|
||||
/* Check... */
|
||||
if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getCSSGroups':
|
||||
$this->_getCSSGroups();
|
||||
break;
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getCSSGroups':
|
||||
$this->_getCSSGroups();
|
||||
break;
|
||||
case 'getCSSForEdit':
|
||||
$this->_getCSSForEdit();
|
||||
break;
|
||||
@@ -81,38 +79,37 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
$this->_revertCSS();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts CSS
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _revertCSS()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$cssID = intval( $this->request['css_id'] );
|
||||
protected function _revertCSS()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$cssID = intval( $this->request['css_id'] );
|
||||
$fromDelete = intval( $this->request['fromDelete'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $cssID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $cssID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -121,40 +118,39 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
$css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete );
|
||||
|
||||
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the CSS
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _saveCSS()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$cssID = intval( $this->request['css_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$css_content = $_POST['css_content'];
|
||||
$css_group = IPSText::alphanumericalClean( $_POST['_css_group'] );
|
||||
protected function _saveCSS()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$cssID = intval( $this->request['css_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$css_content = $_POST['css_content'];
|
||||
$css_group = IPSText::alphanumericalClean( $_POST['_css_group'] );
|
||||
$css_position = intval( $this->request['css_position'] );
|
||||
$css_attributes = $_POST['css_attributes'];
|
||||
$css_app = IPSText::alphanumericalClean( $_POST['css_app'] );
|
||||
$css_app_hide = intval( $this->request['css_app_hide'] );
|
||||
$css_modules = trim( $this->request['css_modules'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add checks
|
||||
@@ -165,8 +161,8 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
if ( ! $css_group )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -186,7 +182,7 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $err->getMessage() );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,32 +193,31 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
$css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a JSON list of template data ready for editing
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _getCSSForEdit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
protected function _getCSSForEdit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$cssID = intval( $this->request['css_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $cssID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $cssID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -231,31 +226,30 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
$css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'cssData' => $css ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fetch a JSON list of CSS group names
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _getCSSGroups()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
protected function _getCSSGroups()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get CSS
|
||||
@@ -276,5 +270,5 @@ class admin_core_ajax_css extends ipsAjaxCommand
|
||||
ksort( $css, SORT_NUMERIC );
|
||||
|
||||
$this->returnJsonArray( array( 'css' => $css ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,24 +3,24 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX Find Names functions
|
||||
* Last Updated: $Date: 2010-02-22 08:06:40 -0500 (Mon, 22 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5857 $
|
||||
* @version $Revision: 8644 $
|
||||
* @see public_core_ajax_findnames
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
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();
|
||||
@@ -31,9 +31,8 @@ class admin_core_ajax_findnames extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -48,10 +47,9 @@ class admin_core_ajax_findnames extends ipsAjaxCommand
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @access private
|
||||
* @return void Outputs to screen
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
private function _getMemberNames()
|
||||
protected function _getMemberNames()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -96,11 +94,16 @@ class admin_core_ajax_findnames extends ipsAjaxCommand
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSLib::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
if( !$r['members_display_name'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
|
||||
'img' => $photo['pp_thumb_photo'],
|
||||
'img' => $photo['pp_mini_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height']
|
||||
);
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Hooks (AJAX)
|
||||
* Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-10-07 22:31:51 -0400 (Fri, 07 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6980 $
|
||||
* @version $Revision: 9588 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -58,13 +58,13 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
*
|
||||
* @var object Hooks library
|
||||
*/
|
||||
private $hooksFunctions;
|
||||
protected $hooksFunctions;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -140,19 +140,29 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get applications
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getApplications()
|
||||
{
|
||||
$i = intval( $this->request['i'] );
|
||||
$apps = array();
|
||||
/* Init vars */
|
||||
$i = intval($this->request['i']);
|
||||
$name = empty($this->request['name']) ? 'libApplication' : trim($this->request['name']);
|
||||
$apps = array();
|
||||
|
||||
foreach( ipsRegistry::$applications as $dir => $appdata )
|
||||
{
|
||||
$apps[] = array( $dir, $appdata['app_title'] );
|
||||
}
|
||||
|
||||
$output = $this->registry->output->formDropdown( "libApplication[{$i}]", $apps );
|
||||
sort($apps);
|
||||
|
||||
/* A bit hackish.. */
|
||||
if ( $name != 'libApplication' )
|
||||
{
|
||||
array_unshift( $apps, array( 0, $this->lang->words['a_selectone'] ) );
|
||||
}
|
||||
|
||||
$output = $this->registry->output->formDropdown( "{$name}[{$i}]", $apps );
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
@@ -160,14 +170,13 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get data hook locations
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getDataLocationsForAdd()
|
||||
{
|
||||
$i = intval( $this->request['i'] );
|
||||
|
||||
$_locations = IPSLib::getDataHookLocations();
|
||||
$output = $this->registry->output->formDropdown( "dataLocation[{$i}]", $_locations );
|
||||
$i = intval( $this->request['i'] );
|
||||
$_locations = IPSLib::getDataHookLocations();
|
||||
$output = $this->registry->output->formDropdown( "dataLocation[{$i}]", $_locations );
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
@@ -175,24 +184,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get all hook ids for a template/type
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getHookIds()
|
||||
{
|
||||
$i = intval( $this->request['i'] );
|
||||
$template = IPSText::alphanumericalClean( $this->request['template'] );
|
||||
$type = IPSText::alphanumericalClean( $this->request['type'] );
|
||||
$return = $this->hooksFunctions->getHookIds( $template, $type );
|
||||
|
||||
$output = $this->registry->output->formDropdown( "id[{$i}]", $return, null, "id[{$i}]", "onchange='getHookEntryPoints({$i});'" );
|
||||
|
||||
$i = intval( $this->request['i'] );
|
||||
$template = IPSText::alphanumericalClean( $this->request['template'] );
|
||||
$type = IPSText::alphanumericalClean( $this->request['type'] );
|
||||
$return = $this->hooksFunctions->getHookIds( $template, $type );
|
||||
|
||||
$output = ( count($return) > 1 ) ? $this->registry->output->formDropdown( "id[{$i}]", $return, '', "id[{$i}]", "onchange='getHookEntryPoints({$i});'" ) : $this->lang->words['hook_no_hook_ids_found'];
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all skin files
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getGroupsForAdd()
|
||||
{
|
||||
@@ -207,7 +216,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get all skin templates
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getTemplatesForAdd()
|
||||
{
|
||||
@@ -223,7 +232,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get language strings in a given file
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getAjaxStrings()
|
||||
{
|
||||
@@ -244,7 +253,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get all language files
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getAjaxFiles()
|
||||
{
|
||||
@@ -264,7 +273,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get skin templates in a given file
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getAjaxTemplates()
|
||||
{
|
||||
@@ -285,7 +294,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Get all skin files
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _getAjaxSkins()
|
||||
{
|
||||
@@ -305,7 +314,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Save the form
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function save()
|
||||
{
|
||||
@@ -370,8 +379,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['settingGroups'] = $toSave['settingGroups'];
|
||||
$this->data['settings'] = $toSave['settings'];
|
||||
if( count($toSave['settingGroups']) )
|
||||
{
|
||||
$this->data['settingGroups'] = $toSave['settingGroups'];
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['settingGroups']);
|
||||
}
|
||||
|
||||
if( count($toSave['settings']) )
|
||||
{
|
||||
$this->data['settings'] = $toSave['settings'];
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['settings']);
|
||||
}
|
||||
|
||||
if( count($toDisplay['settingGroups']) )
|
||||
{
|
||||
@@ -388,7 +412,14 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= "{$this->lang->words['hook_settings']} " . implode( ', ', $toDisplay['settings'] );
|
||||
}
|
||||
|
||||
$this->data['display']['settings'] = $output;
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['settings'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['settings']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -425,12 +456,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
}
|
||||
}
|
||||
|
||||
if( !count($this->data['language']) )
|
||||
{
|
||||
unset($this->data['language']);
|
||||
}
|
||||
|
||||
if( count($toDisplay) )
|
||||
{
|
||||
$output .= implode( '<br />', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['display']['language'] = $output;
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['language'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['language']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -463,8 +506,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= "{$this->lang->words['hook_modules']} " . implode( ', ', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['modules'] = $toSave;
|
||||
$this->data['display']['modules'] = $output;
|
||||
if( count($toSave) )
|
||||
{
|
||||
$this->data['modules'] = $toSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['modules']);
|
||||
}
|
||||
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['modules'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['modules']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -497,8 +555,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= "{$this->lang->words['hook_help']} " . implode( ', ', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['help'] = $toSave;
|
||||
$this->data['display']['help'] = $output;
|
||||
if( count($toSave) )
|
||||
{
|
||||
$this->data['help'] = $toSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['help']);
|
||||
}
|
||||
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['help'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['help']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -521,7 +594,17 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
if( preg_match( "/^skin_(\d+)$/", $k, $matches ) )
|
||||
{
|
||||
$files[ $matches[1] ] = $v;
|
||||
$templates[ $matches[1] ] = $this->request[ 'templates_' . $matches[1] ];
|
||||
|
||||
$_templates = array();
|
||||
|
||||
foreach( $this->request[ 'templates_' . $matches[1] ] as $v )
|
||||
{
|
||||
if( $v )
|
||||
{
|
||||
$templates[ $matches[1] ][] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$ids[ $matches[1] ] = $matches[1];
|
||||
}
|
||||
}
|
||||
@@ -535,12 +618,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
}
|
||||
}
|
||||
|
||||
if( !count($this->data['templates']) )
|
||||
{
|
||||
unset($this->data['templates']);
|
||||
}
|
||||
|
||||
if( count($toDisplay) )
|
||||
{
|
||||
$output .= implode( '<br />', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['display']['templates'] = $output;
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['templates'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['templates']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -577,8 +672,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
/* Save */
|
||||
$this->data['css'] = $toSave;
|
||||
$this->data['display']['css'] = $output;
|
||||
if( count($toSave) )
|
||||
{
|
||||
$this->data['css'] = $toSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['css']);
|
||||
}
|
||||
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['css'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['css']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $this->data ) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -612,8 +722,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= "{$this->lang->words['hook_tasks']} " . implode( ', ', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['tasks'] = $toSave;
|
||||
$this->data['display']['tasks'] = $output;
|
||||
if( count($toSave) )
|
||||
{
|
||||
$this->data['tasks'] = $toSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['tasks']);
|
||||
}
|
||||
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['tasks'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['tasks']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -683,7 +808,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
|
||||
if( $tabletype )
|
||||
{
|
||||
$text .= " TYPE=" . $tabletype;
|
||||
$text .= " ENGINE=" . $tabletype;
|
||||
}
|
||||
|
||||
$toDisplay[] = nl2br($text);
|
||||
@@ -817,7 +942,19 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= implode( '<br />', $toDisplay );
|
||||
}
|
||||
|
||||
$this->data['display']['database'] = $output;
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['database'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['database']);
|
||||
}
|
||||
|
||||
if( !count($this->data['database']) )
|
||||
{
|
||||
unset($this->data['database']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -843,8 +980,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
$output .= "install_" . $toDisplay;
|
||||
}
|
||||
|
||||
$this->data['custom'] = $toSave;
|
||||
$this->data['display']['custom'] = $output;
|
||||
if( $toSave )
|
||||
{
|
||||
$this->data['custom'] = $toSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['custom']);
|
||||
}
|
||||
|
||||
if( $output )
|
||||
{
|
||||
$this->data['display']['custom'] = $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->data['display']['custom']);
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId );
|
||||
|
||||
@@ -867,7 +1019,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Live Search
|
||||
* Last Updated: $Date: 2010-08-17 11:38:47 -0400 (Tue, 17 Aug 2010) $
|
||||
* Last Updated: $Date: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6763 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9404 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -26,28 +26,11 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* HTML to output
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $output;
|
||||
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -55,170 +38,95 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_ajax' ) );
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_livesearch');
|
||||
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'search':
|
||||
$this->doSearchRequest();
|
||||
break;
|
||||
|
||||
case 'template':
|
||||
default:
|
||||
$this->getTemplate();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->returnHtml( $this->output );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the live search template
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTemplate()
|
||||
{
|
||||
$this->output .= $this->html->liveSearchTemplate();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handles the live search
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doSearchRequest()
|
||||
{
|
||||
/* INI */
|
||||
$search_term = $this->request['search_term'];
|
||||
|
||||
$results = array();
|
||||
$return = array( 'members' => null, 'groups' => false, 'settings' => null, 'forums' => null, 'location' => null );
|
||||
|
||||
/* Do search here */
|
||||
$results = $this->_getSettings( $search_term, $results );
|
||||
$results = $this->_getFromXML( $search_term, $results );
|
||||
$results = $this->_getMembers( $search_term, $results );
|
||||
$results = $this->_checkGroups( $search_term, $results );
|
||||
$results = $this->_checkForums( $search_term, $results );
|
||||
|
||||
//-----------------------------------------
|
||||
// Members
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
$search_term = $this->request['search_term'];
|
||||
$results = array();
|
||||
$results = array( 'members' => array(), 'groups' => array(), 'groupLangs' => false, 'settings' => array(), 'forums' => array(), 'location' => array() );
|
||||
|
||||
if( isset( $results['members'] ) AND is_array( $results['members'] ) AND count($results['members']))
|
||||
if ( IPSLib::appIsInstalled('nexus') )
|
||||
{
|
||||
foreach( $results['members'] as $members )
|
||||
{
|
||||
$secCount++;
|
||||
$return['members'] .= $this->html->searchRowMember( $members, $secCount );
|
||||
}
|
||||
$results['nexus'] = array();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Group settings?
|
||||
// Search
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
$results = $this->_getSettings( $search_term, $results );
|
||||
$results = $this->_getFromXML( $search_term, $results );
|
||||
$results = $this->_getMembers( $search_term, $results );
|
||||
$results = $this->_checkGroups( $search_term, $results );
|
||||
$results = $this->_checkForums( $search_term, $results );
|
||||
|
||||
if( $results['groups'] )
|
||||
if ( IPSLib::appIsInstalled('nexus') )
|
||||
{
|
||||
foreach( $results['groups'] as $group )
|
||||
{
|
||||
$secCount++;
|
||||
$return['groups'] .= $this->html->searchRowGroupsTitles( $group, $secCount );
|
||||
}
|
||||
$results = $this->_checkNexus( $search_term, $results );
|
||||
}
|
||||
|
||||
if( $results['groupLangs'] )
|
||||
{
|
||||
$return['groups'] .= $this->html->searchRowGroups();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Settings
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( isset( $results['settings'] ) AND is_array( $results['settings'] ) AND count($results['settings']) )
|
||||
{
|
||||
foreach( $results['settings'] as $setting )
|
||||
{
|
||||
$secCount++;
|
||||
$return['settings'] .= $this->html->searchRowSetting( $setting, $secCount );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Forums
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( isset( $results['forums'] ) AND is_array( $results['forums'] ) AND count($results['forums']))
|
||||
{
|
||||
foreach( $results['forums'] as $forum )
|
||||
{
|
||||
$secCount++;
|
||||
$return['forums'] .= $this->html->searchRowForums( $forum, $secCount );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Locations
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( isset( $results['location'] ) AND is_array( $results['location'] ) AND count($results['location']))
|
||||
{
|
||||
foreach( $results['location'] as $location )
|
||||
{
|
||||
$secCount++;
|
||||
$return['location'] .= $this->html->searchRowLocation( $location, $secCount );
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->html->liveSearchDisplay( $return, $search_term );
|
||||
|
||||
$this->returnJsonArray( $results );
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for matching members
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _getMembers( $term, $results )
|
||||
protected function _getMembers( $term, $results )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, members_display_name, name, members_l_username, members_l_display_name, email',
|
||||
'from' => 'members',
|
||||
'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'",
|
||||
) );
|
||||
$this->DB->build( array('select' => 'm.*, pp.*, g.g_title',
|
||||
'from' => array('members' => 'm'),
|
||||
'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'",
|
||||
'limit' => array(0, 250 ),
|
||||
'add_join' => array( array( 'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
'type' => 'left' ),
|
||||
array( 'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=m.member_id',
|
||||
'type' => 'left' ) )
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
while( $member = $this->DB->fetch() )
|
||||
{
|
||||
$_matched = '';
|
||||
$member = $r = IPSMember::buildProfilePhoto( $member );
|
||||
$r = array();
|
||||
|
||||
if( $r['members_l_display_name'] AND mb_strpos( $r['members_l_display_name'], $term ) !== false )
|
||||
if( $member['members_l_display_name'] AND mb_strpos( $term, $member['members_l_display_name'] ) !== false )
|
||||
{
|
||||
$r['_matched'] = 'members_display_name';
|
||||
}
|
||||
else if( $r['members_l_username'] AND mb_strpos( $r['members_l_username'], $term ) !== false )
|
||||
else if( $member['members_l_username'] AND mb_strpos( $term, $member['members_l_username'] ) !== false )
|
||||
{
|
||||
$r['_matched'] = 'name';
|
||||
}
|
||||
@@ -226,7 +134,14 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
{
|
||||
$r['_matched'] = 'email';
|
||||
}
|
||||
|
||||
|
||||
$r['name'] = $member['members_display_name'];
|
||||
$r['extra'] = $member['g_title'];
|
||||
$r['img'] = $member['pp_mini_photo'];
|
||||
$r['url'] = $this->settings['_base_url']."&app=members&module=members&section=members&do=viewmember&member_id=".$member['member_id'];
|
||||
|
||||
/* Trim out what we don't need */
|
||||
|
||||
$results['members'][] = $r;
|
||||
}
|
||||
|
||||
@@ -236,15 +151,13 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
/**
|
||||
* Check if search term is found in groups language file or in the group_cache.g_title
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _checkGroups( $term, $results )
|
||||
protected function _checkGroups( $term, $results )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
$results['groups'] = false;
|
||||
$term = mb_strtolower($term);
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_groups' ), 'members' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
@@ -254,9 +167,11 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
|
||||
foreach( $this->lang->words as $k => $v )
|
||||
{
|
||||
if( strpos( $k, 'gf_' ) !== false AND strpos( $v, $term ) !== false )
|
||||
if( strpos( $k, 'gf_' ) !== false AND mb_strpos( $v, $term ) !== false )
|
||||
{
|
||||
$results['groupLangs'] = true;
|
||||
IPSDebug::fireBug( 'info', array( 'Group key found: ' . $k . ': ' . $v ) );
|
||||
|
||||
$results['groupLangs'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -272,7 +187,10 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
|
||||
if ( preg_match( "#" . $_term . "#iu", $data['g_title'] ) )
|
||||
{
|
||||
$results['groups'][] = $data;
|
||||
$results['groups'][] = array(
|
||||
'name' => IPSMember::makeNameFormatted( $data['g_title'], $data['g_id'] ),
|
||||
'url' => $this->settings['_base_url'] . "&app=members&module=groups&section=groups&do=edit&id=" . $data['g_id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,12 +201,11 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
/**
|
||||
* Check if search term is found in groups language file
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _checkForums( $term, $results )
|
||||
protected function _checkForums( $term, $results )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
$results['forums'] = false;
|
||||
@@ -306,6 +223,8 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
|
||||
if ( preg_match( "#" . $_term . "#iu", $data['name'] ) )
|
||||
{
|
||||
$data['extra'] = ( ( $data['posts'] == null ) ? 0 : $data['posts'] ) . " сообщений";
|
||||
$data['url'] = $this->settings['_base_url']."&app=forums&module=forums&section=forums&do=edit&f=".$data['id'];
|
||||
$results['forums'][] = $data;
|
||||
}
|
||||
}
|
||||
@@ -316,43 +235,39 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
/**
|
||||
* Searches the settings table
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _getSettings( $term, $results )
|
||||
protected function _getSettings( $term, $results )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
|
||||
if( !IN_DEV )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords',
|
||||
'from' => array( 'core_sys_conf_settings' => 'c' ),
|
||||
'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'core_sys_settings_titles' => 't' ),
|
||||
'where' => 't.conf_title_id=c.conf_group',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->build( array( 'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords',
|
||||
'from' => array( 'core_sys_conf_settings' => 'c' ),
|
||||
'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')",
|
||||
'add_join' => array( array( 'from' => array( 'core_sys_settings_titles' => 't' ),
|
||||
'where' => 't.conf_title_id=c.conf_group',
|
||||
'type' => 'left' ) )
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => 'conf_group, conf_title, conf_description, conf_keywords',
|
||||
'from' => 'core_sys_conf_settings',
|
||||
'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'",
|
||||
) );
|
||||
$this->DB->build( array( 'select' => 'conf_group, conf_title, conf_description, conf_keywords',
|
||||
'from' => 'core_sys_conf_settings',
|
||||
'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'",
|
||||
) );
|
||||
}
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['name'] = $r['conf_title'];
|
||||
$r['url'] = $this->settings['_base_url']."&app=core&module=settings&section=settings&do=setting_view&conf_group=" . $r['conf_group'] . "&search=" . $this->request['search_term'];
|
||||
|
||||
$results['settings'][] = $r;
|
||||
}
|
||||
|
||||
@@ -360,44 +275,226 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches the XML Files
|
||||
* Searches Nexus
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _getFromXML( $term, $results )
|
||||
protected function _checkNexus( $term, $results )
|
||||
{
|
||||
foreach( $this->cache->getCache('app_menu_cache') as $app => $cache )
|
||||
$textTerm = $this->DB->addSlashes( mb_strtolower( $term ) );
|
||||
$intTerm = intval( $term );
|
||||
$encodedTerm = urlencode( $encodedTerm );
|
||||
|
||||
$tempResults = array();
|
||||
|
||||
require_once( IPSLib::getAppDir('nexus') . '/sources/customer.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Is it a number?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( (string) $term == (string) $intTerm )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( $app ) )
|
||||
/* Invoice? */
|
||||
$invoice = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_invoices', 'where' => "i_id={$intTerm}" ) );
|
||||
if ( $invoice['i_id'] )
|
||||
{
|
||||
foreach( $cache as $entry )
|
||||
$tempResults['invoice'] = array( 'name' => $invoice['i_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=invoices&do=view_invoice&id={$invoice['i_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/invoice.png' );
|
||||
}
|
||||
|
||||
/* Purchase? */
|
||||
$purchase = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_purchases', 'where' => "ps_id={$intTerm}" ) );
|
||||
if ( $purchase['ps_id'] )
|
||||
{
|
||||
if( count($entry['items']) )
|
||||
$tempResults['purchase'] = array( 'name' => $purchase['ps_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$purchase['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/purchase.png' );
|
||||
}
|
||||
|
||||
/* Support */
|
||||
$support = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_support_requests', 'where' => "r_id={$intTerm}" ) );
|
||||
if ( $support['r_id'] )
|
||||
{
|
||||
$tempResults['support'] = array( 'name' => $support['r_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=tickets&section=view&id={$support['r_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/support.png' );
|
||||
}
|
||||
|
||||
/* Customer */
|
||||
$customer = $this->DB->buildAndFetch( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "member_id={$intTerm}" ) );
|
||||
if ( $customer['member_id'] )
|
||||
{
|
||||
if ( !preg_replace( '/\s/', '', $customer['members_display_name'] ) )
|
||||
{
|
||||
foreach( $entry['items'] as $item )
|
||||
{
|
||||
if( $item['section'] )
|
||||
{
|
||||
$item['url'] = "section={$item['section']}&" . $item['url'];
|
||||
}
|
||||
$customer['members_display_name'] = '?????';
|
||||
}
|
||||
|
||||
$tempResults['member'] = array( 'name' => $customer['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$customer['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
}
|
||||
|
||||
if( isset($item['keywords']) AND mb_stripos( $item['keywords'], $term ) !== false )
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Nope - text
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
/* License Key */
|
||||
$lkey = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_licensekeys', 'where' => $this->DB->buildLower('lkey_key') ."='{$textTerm}'" ) );
|
||||
if ( $lkey['lkey_key'] )
|
||||
{
|
||||
$tempResults['lkey'] = array( 'name' => $lkey['lkey_key'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$lkey['lkey_purchase']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/lkey.png' );
|
||||
}
|
||||
|
||||
/* Customers */
|
||||
$customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) );
|
||||
if ( $customer['count'] )
|
||||
{
|
||||
if ( $customer['count'] > 50 )
|
||||
{
|
||||
$tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id, email', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$tempResults['member'][] = array( 'name' => $row['email'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) );
|
||||
if ( $customer['count'] )
|
||||
{
|
||||
if ( $customer['count'] > 50 )
|
||||
{
|
||||
$tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$tempResults['member'][] = array( 'name' => $row['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Hosting Accounts */
|
||||
if ( strpos( $textTerm, '.' ) === FALSE )
|
||||
{
|
||||
$hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) );
|
||||
if ( $hosting['count'] )
|
||||
{
|
||||
if ( $hosting['count'] > 50 )
|
||||
{
|
||||
$tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=username", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'ps_id, account_username', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$item['url'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
$tempResults['hosting'][] = array( 'name' => $row['account_username'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' );
|
||||
}
|
||||
else if( mb_stripos( $item['title'], $term ) !== false )
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( empty( $tempResults['hosting'] ) )
|
||||
{
|
||||
$hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) );
|
||||
if ( $hosting['count'] )
|
||||
{
|
||||
if ( $hosting['count'] > 50 )
|
||||
{
|
||||
$tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=domain", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'ps_id, account_domain', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$item['fullurl'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
$tempResults['hosting'][] = array( 'name' => $row['account_domain'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return results
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
foreach ( array( 'invoice', 'purchase', 'lkey', 'support', 'member', 'hosting' ) as $k )
|
||||
{
|
||||
if ( isset( $tempResults[ $k ] ) )
|
||||
{
|
||||
if ( isset( $tempResults[ $k ][0] ) )
|
||||
{
|
||||
foreach ( $tempResults[ $k ] as $l )
|
||||
{
|
||||
$results['nexus'][] = $l;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$results['nexus'][] = $tempResults[ $k ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches the XML Files
|
||||
*
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
protected function _getFromXML( $term, $results )
|
||||
{
|
||||
foreach( $this->cache->getCache('app_menu_cache') as $app => $cache )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( $app ) )
|
||||
{
|
||||
foreach( $cache as $entry )
|
||||
{
|
||||
if( count($entry['items']) )
|
||||
{
|
||||
foreach( $entry['items'] as $item )
|
||||
{
|
||||
if( $item['section'] )
|
||||
{
|
||||
$item['url'] = "section={$item['section']}&" . $item['url'];
|
||||
}
|
||||
|
||||
if( isset($item['keywords']) AND mb_stripos( $item['keywords'], $term ) !== false )
|
||||
{
|
||||
$item['name'] = $item['title'];
|
||||
$item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
else if( mb_stripos( $item['title'], $term ) !== false )
|
||||
{
|
||||
$item['name'] = $item['title'];
|
||||
$item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,43 +32,41 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinCaching( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'saveReplacement':
|
||||
/* Check... */
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'replacements_manage', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
$this->_saveReplacement();
|
||||
break;
|
||||
@@ -77,7 +75,7 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'replacements_delete', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
$this->_revertReplacement();
|
||||
break;
|
||||
@@ -87,54 +85,52 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'easy_logo', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
$this->getEasyLogo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get logo image replacement for a skin
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getEasyLogo()
|
||||
{
|
||||
$setID = intval( $this->request['value'] );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get logo image replacement for a skin
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function getEasyLogo()
|
||||
{
|
||||
$setID = intval( $this->request['value'] );
|
||||
|
||||
$replacements = $this->skinFunctions->fetchReplacements( $setID );
|
||||
$currentUrl = $replacements['logo_img']['replacement_content'];
|
||||
$currentId = $replacements['logo_img']['replacement_id'];
|
||||
|
||||
$this->returnJsonArray( array( 'url' => $currentUrl, 'id' => $currentId ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts replacement
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _revertReplacement()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
protected function _revertReplacement()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$replacementID = intval( $this->request['replacement_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $replacementID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $replacementID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -143,35 +139,34 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
$replacements = $this->skinFunctions->revertReplacement( $replacementID, $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'replacements' => $replacements, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the CSS
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _saveReplacement()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$replacementID = intval( $this->request['replacement_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$replacement_content = $this->convertUnicode( $_POST['replacement_content'] );
|
||||
$replacement_key = $this->convertUnicode( $_POST['_replacement_key'] );
|
||||
protected function _saveReplacement()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $replacementID ) )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$replacementID = intval( $this->request['replacement_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$replacement_content = $this->convertUnicode( $_POST['replacement_content'] );
|
||||
$replacement_key = $this->convertUnicode( $_POST['_replacement_key'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $replacementID ) )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add checks
|
||||
@@ -182,8 +177,8 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
if ( ! $replacement_key )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -203,7 +198,7 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $err->getMessage() );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,5 +209,5 @@ class admin_core_ajax_replacements extends ipsAjaxCommand
|
||||
$replacements = $this->skinFunctions->fetchReplacements( $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'replacements' => $replacements, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
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_core_ajax_skinsets extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @param object registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=templates&section=skinsets';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=templates§ion=skinsets';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
$this->skinFunctions = new skinCaching( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'showAddDialogue':
|
||||
$this->_showAddDialogue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the add dialogue
|
||||
*
|
||||
* @return string Json
|
||||
*/
|
||||
protected function _showAddDialogue()
|
||||
{
|
||||
$this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* @file tabs.php AJAX storage of tab order preference
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 8th Feb 2011
|
||||
* $LastChangedDate: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8021 $
|
||||
*/
|
||||
|
||||
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_core_ajax_tabs
|
||||
* @brief AJAX storage of tab order preference
|
||||
*
|
||||
*/
|
||||
class admin_core_ajax_tabs extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Array of valid tab keys
|
||||
*
|
||||
* @var $tabKeys
|
||||
*/
|
||||
protected $tabKeys = array( 'core', 'forums', 'members', 'lookfeel', 'support', 'reports', 'other' );
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_tools' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'save':
|
||||
$this->_saveTabs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save tab preference order
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveTabs()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Store order
|
||||
//-----------------------------------------
|
||||
|
||||
$order = array();
|
||||
$append = array();
|
||||
|
||||
foreach( $this->tabKeys as $pos => $key )
|
||||
{
|
||||
if( $this->request['pos_' . $key ] )
|
||||
{
|
||||
$order[ $this->request['pos_' . $key ] ] = $key;
|
||||
}
|
||||
else
|
||||
{
|
||||
$append[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
if( count($append) )
|
||||
{
|
||||
$order = array_merge( $order, $append );
|
||||
}
|
||||
|
||||
ksort($order);
|
||||
|
||||
//-----------------------------------------
|
||||
// Save preference
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->staffSaveCookie( 'tabOrder', $order );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return new order
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'order' => $order ) );
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2010-09-13 17:28:12 -0400 (Mon, 13 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: terabyte $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 6863 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,17 +32,15 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -52,9 +50,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinDifferences( $registry );
|
||||
|
||||
@@ -99,10 +97,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Grab a version to show
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
* @return @e void
|
||||
*/
|
||||
private function _viewVersion()
|
||||
protected function _viewVersion()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
@@ -159,10 +156,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Save diff
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
* @return @e void
|
||||
*/
|
||||
private function _saveEdit()
|
||||
protected function _saveEdit()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$content = $_POST['content'];
|
||||
@@ -194,10 +190,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Save diff
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
* @return @e void
|
||||
*/
|
||||
private function _resolveAllSingle()
|
||||
protected function _resolveAllSingle()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
@@ -224,9 +219,8 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Build a desc string
|
||||
*
|
||||
* @access private
|
||||
* @param array Item data
|
||||
* @param string String
|
||||
* @return string String
|
||||
*/
|
||||
public function _buildDescString( $item )
|
||||
{
|
||||
@@ -281,10 +275,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Grab a diff to edit
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
* @return @e void
|
||||
*/
|
||||
private function _editDiff()
|
||||
protected function _editDiff()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
|
||||
@@ -315,10 +308,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Grab a diff to show
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
* @return @e void
|
||||
*/
|
||||
private function _viewDiff()
|
||||
protected function _viewDiff()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
@@ -358,10 +350,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Process
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _process()
|
||||
protected function _process()
|
||||
{
|
||||
/* INIT */
|
||||
$pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10;
|
||||
@@ -556,10 +547,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
/**
|
||||
* Process merge
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _merge()
|
||||
protected function _merge()
|
||||
{
|
||||
/* INIT */
|
||||
$pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10;
|
||||
@@ -575,11 +565,10 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
if ( $session === FALSE )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_invalidsession'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Load merge class */
|
||||
require_once( IPS_KERNEL_PATH . 'classMerge.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classMerge.php' );/*noLibHook*/
|
||||
|
||||
/* Are we doing templates or CSS? */
|
||||
if ( $session['merge_m_templates_togo'] )
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
|
||||
* Last Updated: $Date: 2011-07-12 17:54:40 -0400 (Tue, 12 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 6314 $
|
||||
* @version $Revision: 9218 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,28 +32,26 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinCaching( $registry );
|
||||
|
||||
@@ -61,21 +59,20 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getTemplateBitList':
|
||||
$this->_getTemplateBitList();
|
||||
break;
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getTemplateBitList':
|
||||
$this->_getTemplateBitList();
|
||||
break;
|
||||
case 'getTemplateGroupList':
|
||||
$this->_getTemplateGroupList();
|
||||
break;
|
||||
$this->_getTemplateGroupList();
|
||||
break;
|
||||
case 'getTemplateForEdit':
|
||||
$this->_getTemplateForEdit();
|
||||
break;
|
||||
@@ -87,37 +84,35 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
$this->_revertTemplateBit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts a template bit
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _revertTemplateBit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$templateID = intval( $this->request['template_id'] );
|
||||
protected function _revertTemplateBit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$templateID = intval( $this->request['template_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -126,39 +121,39 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
$template = $this->skinFunctions->revertTemplateBit( $templateID, $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the template bit
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _saveTemplateBit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
protected function _saveTemplateBit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$test = $_POST['_template_name'];
|
||||
$setID = intval( $this->request['template_set'] );
|
||||
$templateID = intval( $this->request['template_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$template_content = $_POST['template_content'];
|
||||
$template_group = IPSText::alphanumericalClean( $_POST['template_group'] );
|
||||
$setID = intval( $this->request['template_set'] );
|
||||
$templateID = intval( $this->request['template_id'] );
|
||||
$type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit';
|
||||
$template_content = $_POST['template_content'];
|
||||
$template_group = IPSText::alphanumericalClean( $_POST['template_group'] );
|
||||
$ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) );
|
||||
$template_name = IPSText::alphanumericalClean( $_POST['_template_name'] );
|
||||
$template_data = $_POST['template_data'];
|
||||
$template_name = IPSText::alphanumericalClean( $_POST['_template_name'] );
|
||||
$template_data = $_POST['template_data'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add checks
|
||||
@@ -169,8 +164,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
if ( ! $template_name )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -186,7 +180,6 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -195,12 +188,11 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
try
|
||||
{
|
||||
$template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name );
|
||||
$template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name );
|
||||
}
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );// . ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,32 +207,30 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a JSON list of template data ready for editing
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _getTemplateForEdit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
protected function _getTemplateForEdit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$templateID = intval( $this->request['template_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -249,31 +239,29 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
$template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID );
|
||||
|
||||
$this->returnJsonArray( array( 'templateData' => $template ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a JSON list of template groups
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _getTemplateGroupList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
protected function _getTemplateGroupList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get templates
|
||||
@@ -294,32 +282,30 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'groups' => $templateGroups ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fetch a JSON list of template bits for the template group
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _getTemplateBitList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
protected function _getTemplateBitList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateGroup )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateGroup )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get templates
|
||||
@@ -328,6 +314,6 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
$templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup );
|
||||
|
||||
$this->returnJsonArray( array( 'templates' => array_values( $templates ),
|
||||
'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) );
|
||||
}
|
||||
'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) );
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 6314 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,29 +32,27 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
protected $skinFunctions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinDifferences( $registry );
|
||||
|
||||
@@ -62,40 +60,38 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'getTemplateBitList':
|
||||
$this->_getTemplateBitList();
|
||||
break;
|
||||
case 'getTemplateBitList':
|
||||
$this->_getTemplateBitList();
|
||||
break;
|
||||
case 'replace':
|
||||
$this->_replace();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a JSON list of template bits for the template group
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _replace()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
protected function _replace()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$finalIDs = array();
|
||||
$templates = array();
|
||||
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
|
||||
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
|
||||
|
||||
$sessionData = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'template_sandr',
|
||||
@@ -107,7 +103,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
{
|
||||
foreach( $templateData as $_group => $_data )
|
||||
{
|
||||
if ( isset( $_POST['groups'][ $_group ] ) AND $_POST['groups'][ $_group ] )
|
||||
if ( !empty( $_POST['groups'][ $_group ] ) )
|
||||
{
|
||||
foreach( $_data as $_name => $_id )
|
||||
{
|
||||
@@ -118,7 +114,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
{
|
||||
foreach( $_data as $_name => $_id )
|
||||
{
|
||||
if ( isset( $_POST['templates'][ $_id ] ) AND $_POST['templates'][ $_id ] )
|
||||
if ( !empty( $_POST['templates'][ $_id ] ) )
|
||||
{
|
||||
$finalIDs[] = $_id;
|
||||
}
|
||||
@@ -131,7 +127,6 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
if ( ! count( $finalIDs ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Load templates */
|
||||
@@ -168,35 +163,32 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
|
||||
/* Done */
|
||||
$this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a JSON list of template bits for the template group
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _getTemplateBitList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
protected function _getTemplateBitList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$setID = intval( $this->request['setID'] );
|
||||
$templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] );
|
||||
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
|
||||
$sessionID = IPSText::md5Clean( $this->request['sessionID'] );
|
||||
$templates = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateGroup or ! $sessionID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $setID OR ! $templateGroup or ! $sessionID )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get templates
|
||||
@@ -221,5 +213,5 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'templates' => $templates ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 6980 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,22 +32,20 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
/**
|
||||
* User agent functions
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $userAgentFunctions;
|
||||
protected $userAgentFunctions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
@@ -55,17 +53,16 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' );
|
||||
$this->userAgentFunctions = new $classToLoad( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'saveuAgent':
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_manage', ipsRegistry::$current_application, 'tools' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
}
|
||||
$this->_saveuAgent();
|
||||
break;
|
||||
@@ -73,36 +70,33 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) )
|
||||
{
|
||||
$this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] );
|
||||
exit();
|
||||
}
|
||||
$this->_removeuAgent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts replacement
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _removeuAgent()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$uagent_id = intval( $this->request['uagent_id'] );
|
||||
protected function _removeuAgent()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$uagent_id = intval( $this->request['uagent_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $uagent_id )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $uagent_id )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template data
|
||||
@@ -111,38 +105,36 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
$userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id );
|
||||
|
||||
$this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the user agent
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
* @return @e void
|
||||
*/
|
||||
private function _saveuAgent()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
protected function _saveuAgent()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$uagent_id = intval( $this->request['uagent_id'] );
|
||||
$uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] );
|
||||
$uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] );
|
||||
$uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] );
|
||||
$uagent_regex_capture = intval( $this->request['uagent_regex_capture'] );
|
||||
$uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] );
|
||||
$uagent_position = intval( $this->request['uagent_position'] );
|
||||
$uagent_position = intval( $this->request['uagent_position'] );
|
||||
$type = $this->request['type'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'edit' AND ! $uagent_id )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'edit' AND ! $uagent_id )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Other checks
|
||||
@@ -151,8 +143,7 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Save it
|
||||
@@ -167,7 +158,6 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -179,16 +169,13 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
catch( Exception $err )
|
||||
{
|
||||
$this->returnJsonError( $err->getMessage() );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Data
|
||||
//-----------------------------------------
|
||||
|
||||
$userAgents = $this->userAgentFunctions->fetchAgents();
|
||||
|
||||
$this->returnJsonArray( array( 'uagents' => $userAgents, 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Blog Application
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th Aug 2004
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,14 +30,13 @@ class admin_core_applications_blog extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
$this->registry->output->showInsideIframe("http://myipb.in/products/blog/");
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Blog Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7126 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -27,14 +27,13 @@ class admin_core_applications_ccs extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
$this->registry->output->showInsideIframe("http://myipb.in/products/content/");
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Download Manager Application
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-11 12:57:46 -0400 (Wed, 11 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 17 February 2003
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8727 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ class admin_core_applications_copyright extends ipsCommand
|
||||
/**
|
||||
* HTML skin
|
||||
*
|
||||
* @access public
|
||||
* @var object Skin file
|
||||
*/
|
||||
public $html;
|
||||
@@ -38,9 +37,8 @@ class admin_core_applications_copyright extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -65,6 +63,6 @@ class admin_core_applications_copyright extends ipsCommand
|
||||
// Just redirect to the setting
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&module=tools§ion=settings&do=setting_view&conf_title_keyword=ipbcopyright' );
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&module=settings&section=settings&do=setting_view&conf_title_keyword=ipbcopyright' );
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default applications section
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'applications' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'applications';
|
||||
$DEFAULT_SECTION = 'applications';
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Download Manager Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Who knows...
|
||||
* @version $Revision: 7126 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,14 +30,13 @@ class admin_core_applications_downloads extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
$this->registry->output->showInsideIframe("http://myipb.in/products/downloads/");
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Gallery Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Who knows...
|
||||
* @version $Revision: 7126 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,14 +30,13 @@ class admin_core_applications_gallery extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
$this->registry->output->showInsideIframe("http://myipb.in/products/gallery/");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Nexus Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7126 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -28,12 +28,12 @@ class admin_core_applications_nexus extends ipsCommand
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
$this->registry->output->showInsideIframe("http://myipb.in/products/nexus/");
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Application Installation
|
||||
* Last Updated: $Date: 2010-10-19 11:43:08 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-08-01 09:21:24 -0400 (Mon, 01 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6996 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9340 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -30,41 +30,41 @@ class admin_core_applications_setup extends ipsCommand
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Current app path
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
private $app_full_path;
|
||||
protected $app_full_path;
|
||||
|
||||
/**
|
||||
* Product information
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $product_information;
|
||||
protected $product_information;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -80,7 +80,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=applications§ion=setup';
|
||||
|
||||
/* Get the setup class */
|
||||
require IPS_ROOT_PATH . "setup/sources/base/setup.php";
|
||||
require( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/
|
||||
|
||||
/* Set the path */
|
||||
$this->app_full_path = IPSLib::getAppDir( $this->request['app_directory'] ) . '/';
|
||||
@@ -105,7 +105,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
# Settings
|
||||
# Template Cache
|
||||
# Caches / Done
|
||||
*/
|
||||
*/
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
@@ -158,137 +158,27 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Rebuild PHP Templates Cache
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function recacheTemplates()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Determine if we need to recache templates
|
||||
//-----------------------------------------
|
||||
/* Flag skins for recache */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
$skinCaching = new skinCaching( $this->registry );
|
||||
|
||||
$vars = $this->getVars();
|
||||
$hasSkin = false;
|
||||
/* Flag all for recache */
|
||||
$skinCaching->flagSetForRecache();
|
||||
|
||||
if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) )
|
||||
{
|
||||
$hasSkin = true;
|
||||
}
|
||||
$data = $this->getVars();
|
||||
|
||||
if( !$hasSkin )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// We'll check for any of the default 3
|
||||
//-----------------------------------------
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_root_templates.xml' ) OR
|
||||
file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_lofi_templates.xml' ) OR
|
||||
file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_xmlskin_templates.xml' ) )
|
||||
{
|
||||
$hasSkin = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( !$hasSkin )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// We'll check for any of the default 3
|
||||
//-----------------------------------------
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_root_css.xml' ) OR
|
||||
file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_lofi_css.xml' ) OR
|
||||
file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_xmlskin_css.xml' ) )
|
||||
{
|
||||
$hasSkin = true;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// See if any hooks were installed..
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$hasSkin )
|
||||
{
|
||||
if( is_dir( $this->app_full_path . 'xml/hooks' ) )
|
||||
{
|
||||
$files = scandir( $this->app_full_path . 'xml/hooks' );
|
||||
|
||||
foreach( $files as $file )
|
||||
{
|
||||
if( $file != '.' AND $file != '..' )
|
||||
{
|
||||
$hasSkin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !$hasSkin )
|
||||
{
|
||||
$this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['redir__no_template_re'] ) , '', $this->getNextURL( 'finish', $vars ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( $this->request['_recache_done'] == 'true' )
|
||||
{
|
||||
$this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recache_done'] ) , '', $this->getNextURL( 'finish', $vars ) );
|
||||
return;
|
||||
}
|
||||
|
||||
/* INIT */
|
||||
$setID = intval( $this->request['setID'] );
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );
|
||||
|
||||
$skinFunctions = new skinImportExport( $this->registry );
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
/* Get first set id */
|
||||
if( ! $setID )
|
||||
{
|
||||
ksort( $this->registry->output->allSkins );
|
||||
$_skins = $this->registry->output->allSkins;
|
||||
$_set = array_shift( $_skins );
|
||||
$setID = $_set['set_id'];
|
||||
}
|
||||
|
||||
/* Rebuild */
|
||||
$skinFunctions->rebuildPHPTemplates( $setID );
|
||||
$skinFunctions->rebuildCSS( $setID );
|
||||
$skinFunctions->rebuildReplacementsCache( $setID );
|
||||
$skinFunctions->rebuildSkinSetsCache();
|
||||
|
||||
/* Fetch next id */
|
||||
$nextID = $setID;
|
||||
|
||||
ksort( $this->registry->output->allSkins );
|
||||
|
||||
foreach( $this->registry->output->allSkins as $id => $data )
|
||||
{
|
||||
if ( $id > $nextID )
|
||||
{
|
||||
$nextID = $id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $nextID != $setID )
|
||||
{
|
||||
$this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ), '', $this->getNextURL( 'tplcache&setID=' . $nextID, $vars ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ), '', $this->getNextURL( 'tplcache&_recache_done=true', $vars ) );
|
||||
}
|
||||
|
||||
$this->showRedirectScreen( $data['app_directory'], array( $this->lang->words['install_skins_flag_recache'] ), '', $this->getNextURL( 'finish', $data ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalizes installation and rebuilds caches
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
@@ -313,14 +203,15 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$this->cache->rebuildCache( 'app_menu_cache', 'global' );
|
||||
$this->cache->rebuildCache( 'group_cache', 'global' );
|
||||
$this->cache->rebuildCache( 'notifications', 'global' );
|
||||
$this->cache->rebuildCache( 'report_plugins', 'global' );
|
||||
|
||||
/* Rebuild application specific caches */
|
||||
$_file = $this->app_full_path . 'extensions/coreVariables.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
$CACHE = array();
|
||||
require( $_file );
|
||||
require( $_file );/*noLibHook*/
|
||||
|
||||
if( is_array( $CACHE ) AND count( $CACHE ) )
|
||||
{
|
||||
@@ -331,8 +222,18 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild GLOBAL CACHES! */
|
||||
try
|
||||
{
|
||||
IPSLib::cacheGlobalCaches();
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
// Show an error?
|
||||
}
|
||||
|
||||
/* Rebuild FURLs */
|
||||
if( file_exists( $this->app_full_path . 'extensions/furlTemplates.php' ) )
|
||||
if( is_file( $this->app_full_path . 'extensions/furlTemplates.php' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -351,7 +252,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Next Check
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function nextCheck()
|
||||
{
|
||||
@@ -379,30 +280,32 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$new_pos = intval( $pos['pos'] ) + 1;
|
||||
|
||||
/* Insert details into the DB */
|
||||
$this->DB->insert( 'core_applications', array(
|
||||
'app_title' => $this->product_information['name'],
|
||||
'app_public_title' => $this->product_information['public_name'],
|
||||
'app_author' => $this->product_information['author'],
|
||||
'app_description' => $this->product_information['description'],
|
||||
'app_hide_tab' => intval($this->product_information['hide_tab']),
|
||||
'app_version' => $_numbers['latest'][1],
|
||||
'app_long_version' => $_numbers['latest'][0],
|
||||
'app_directory' => $vars['app_directory'],
|
||||
'app_location' => $vars['app_location'],
|
||||
'app_added' => time(),
|
||||
'app_position' => $new_pos,
|
||||
'app_protected' => 0,
|
||||
'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1
|
||||
$this->DB->insert( 'core_applications', array( 'app_title' => $this->product_information['name'],
|
||||
'app_public_title' => $this->product_information['public_name'],
|
||||
'app_author' => $this->product_information['author'],
|
||||
'app_description' => $this->product_information['description'],
|
||||
'app_hide_tab' => intval($this->product_information['hide_tab']),
|
||||
'app_version' => $_numbers['latest'][1],
|
||||
'app_long_version' => $_numbers['latest'][0],
|
||||
'app_directory' => $vars['app_directory'],
|
||||
'app_location' => $vars['app_location'],
|
||||
'app_added' => time(),
|
||||
'app_position' => $new_pos,
|
||||
'app_protected' => 0,
|
||||
'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1,
|
||||
'app_website' => trim($this->product_information['website']),
|
||||
'app_update_check' => trim($this->product_information['update_check']),
|
||||
'app_global_caches' => trim($this->product_information['global_caches']),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->DB->insert( 'upgrade_history', array(
|
||||
'upgrade_version_id' => $_numbers['latest'][0],
|
||||
'upgrade_version_human' => $_numbers['latest'][1],
|
||||
'upgrade_date' => time(),
|
||||
'upgrade_notes' => '',
|
||||
'upgrade_mid' => $this->memberData['member_id'],
|
||||
'upgrade_app' => $vars['app_directory']
|
||||
'upgrade_app' => $vars['app_directory'],
|
||||
) );
|
||||
|
||||
/* Insert the modules */
|
||||
@@ -413,14 +316,16 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'core_applications', array(
|
||||
'app_title' => $this->product_information['name'],
|
||||
$this->DB->update( 'core_applications', array( 'app_title' => $this->product_information['name'],
|
||||
'app_public_title' => $this->product_information['public_name'],
|
||||
'app_author' => $this->product_information['author'],
|
||||
'app_description' => $this->product_information['description'],
|
||||
'app_hide_tab' => intval($this->product_information['hide_tab']),
|
||||
'app_version' => $_numbers['current'][1],
|
||||
'app_long_version' => $_numbers['current'][0],
|
||||
'app_website' => trim($this->product_information['website']),
|
||||
'app_update_check' => trim($this->product_information['update_check']),
|
||||
'app_global_caches' => trim($this->product_information['global_caches']),
|
||||
), "app_directory='" . $vars['app_directory'] . "'" );
|
||||
|
||||
/* Update the modules */
|
||||
@@ -453,7 +358,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import Hooks
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function hooks()
|
||||
{
|
||||
@@ -465,7 +370,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) );
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/hooks.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/hooks.xml' ) )
|
||||
{
|
||||
/* Get the hooks class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
|
||||
@@ -494,7 +399,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import Settings
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function settings()
|
||||
{
|
||||
@@ -504,12 +409,12 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$errors = array();
|
||||
$knownSettings = array();
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ), 'core' );
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) )
|
||||
{
|
||||
/* Get the settings class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php', 'admin_core_tools_settings' );
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' );
|
||||
$settings = new $classToLoad();
|
||||
$settings->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
@@ -530,9 +435,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
|
||||
/* Fetch known settings */
|
||||
if ( file_exists( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) )
|
||||
if ( is_file( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) )
|
||||
{
|
||||
require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' );
|
||||
require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
$settings->importAllSettings( 1, 1, $knownSettings );
|
||||
@@ -555,7 +460,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import tasks
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function tasks()
|
||||
{
|
||||
@@ -564,7 +469,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php', 'admin_core_system_taskmanager' );
|
||||
@@ -586,7 +491,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import bbcode
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function bbcode()
|
||||
{
|
||||
@@ -595,7 +500,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' );
|
||||
@@ -607,7 +512,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$output[] = $this->lang->words['bbcode_and_media'];
|
||||
}
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' );
|
||||
@@ -634,7 +539,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import help
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function help()
|
||||
{
|
||||
@@ -643,7 +548,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php', 'admin_core_tools_help' );
|
||||
$help = new $classToLoad();
|
||||
@@ -666,7 +571,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Language Import
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languages()
|
||||
{
|
||||
@@ -710,7 +615,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Install templates
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function templates()
|
||||
{
|
||||
@@ -719,9 +624,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
|
||||
$skinFunctions = new skinImportExport( $this->registry );
|
||||
$skinCaching = new skinCaching( $this->registry );
|
||||
|
||||
@@ -746,7 +651,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
/* Skin files first */
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) )
|
||||
if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) )
|
||||
{
|
||||
$return = $skinFunctions->importTemplateAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'], TRUE );
|
||||
|
||||
@@ -754,7 +659,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
|
||||
/* Then CSS files */
|
||||
if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) )
|
||||
if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
@@ -766,7 +671,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
|
||||
/* And we can support replacements for good measure */
|
||||
if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) )
|
||||
if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
@@ -796,7 +701,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Runs any additional sql files
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function sqlSteps()
|
||||
{
|
||||
@@ -809,16 +714,16 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$sql_files = array();
|
||||
|
||||
/* Any "extra" configs required for this driver? */
|
||||
if( file_exists( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) )
|
||||
if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/
|
||||
|
||||
$extra_install = new install_extra( $this->registry );
|
||||
}
|
||||
|
||||
|
||||
/* Run any sql files we found */
|
||||
if( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) )
|
||||
if( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) )
|
||||
{
|
||||
/* INIT */
|
||||
$new_id = $id + 1;
|
||||
@@ -826,7 +731,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$SQL = array();
|
||||
|
||||
/* Get the sql file */
|
||||
require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' );
|
||||
require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' );/*noLibHook*/
|
||||
|
||||
$this->DB->return_die = 1;
|
||||
|
||||
@@ -872,7 +777,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Creates Tables, Runs Inserts, and Indexes
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function sqlBasics()
|
||||
{
|
||||
@@ -884,9 +789,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$count = 0;
|
||||
|
||||
/* Any "extra" configs required for this driver? */
|
||||
if( file_exists( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) )
|
||||
if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );
|
||||
require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/
|
||||
|
||||
$extra_install = new install_extra( $this->registry );
|
||||
}
|
||||
@@ -897,10 +802,10 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
$this->DB->return_die = 1;
|
||||
|
||||
if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) )
|
||||
if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) )
|
||||
{
|
||||
$TABLE = array();
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' );
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' );/*noLibHook*/
|
||||
|
||||
if ( is_array( $TABLE ) and count( $TABLE ) )
|
||||
{
|
||||
@@ -910,7 +815,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
// Is this a create?
|
||||
//-----------------------------------------
|
||||
|
||||
preg_match("/CREATE TABLE (\S+)(\s)?\(/", $q, $match);
|
||||
preg_match("/CREATE TABLE\s+(\S+)(\s)?\(/", str_ireplace( 'if not exists', '', $q ), $match);
|
||||
|
||||
if( $match[1] AND $vars['dupe_tables'] == 'drop' )
|
||||
{
|
||||
@@ -972,10 +877,10 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
if ( $this->DB->checkFulltextSupport() )
|
||||
{
|
||||
if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) )
|
||||
if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) )
|
||||
{
|
||||
$INDEX = array();
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' );
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' );/*noLibHook*/
|
||||
|
||||
$count = 0;
|
||||
|
||||
@@ -1011,13 +916,13 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
|
||||
/* INSERTS */
|
||||
if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) )
|
||||
if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) )
|
||||
{
|
||||
$INSERT = array();
|
||||
$count = 0;
|
||||
|
||||
/* Get the SQL File */
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' );
|
||||
include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' );/*noLibHook*/
|
||||
|
||||
foreach( $INSERT as $q )
|
||||
{
|
||||
@@ -1057,7 +962,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Begin installation
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function start()
|
||||
{
|
||||
@@ -1112,7 +1017,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
{
|
||||
if ( $data['dir'] )
|
||||
{
|
||||
if ( ! @mkdir( $_path, 0777, TRUE ) )
|
||||
if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) )
|
||||
{
|
||||
$info['notexist'][] = $_path;
|
||||
}
|
||||
@@ -1124,7 +1029,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
}
|
||||
else if ( ! is_writeable( $_path ) )
|
||||
{
|
||||
if ( ! @chmod( $_path, 0777 ) )
|
||||
if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) )
|
||||
{
|
||||
$info['notwrite'][] = $_path;
|
||||
}
|
||||
@@ -1175,7 +1080,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
foreach( $required_xml as $r )
|
||||
{
|
||||
if( ! file_exists( $this->app_full_path . "xml/{$r}.xml" ) )
|
||||
if( ! is_file( $this->app_full_path . "xml/{$r}.xml" ) )
|
||||
{
|
||||
$errors[] = sprintf( $this->lang->words['error__file_needed'], $this->app_full_path . "xml/{$r}.xml" );
|
||||
}
|
||||
@@ -1190,7 +1095,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getVars()
|
||||
protected function getVars()
|
||||
{
|
||||
/* INIT */
|
||||
$env = array();
|
||||
@@ -1227,7 +1132,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
* @param array $env
|
||||
* @return string
|
||||
*/
|
||||
private function getNextURL( $next_action, $env )
|
||||
protected function getNextURL( $next_action, $env )
|
||||
{
|
||||
return $this->settings['base_url'] . $this->form_code . '&do=' . $next_action . '&app_directory=' . $env['app_directory'] . '&type=' . $env['type'] . '&version=' . $env['version'];
|
||||
}
|
||||
@@ -1239,9 +1144,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
* @param string $output
|
||||
* @param string $errors
|
||||
* @param string $next_url
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function showRedirectScreen( $app_directory, $output, $errors, $next_url )
|
||||
protected function showRedirectScreen( $app_directory, $output, $errors, $next_url )
|
||||
{
|
||||
/* Init Data */
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] );
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,22 +6,24 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Список модулей</subitemtitle>
|
||||
<subitemlang>manage_apps_modules</subitemlang>
|
||||
<subsection>applications</subsection>
|
||||
<subitemurl>do=applications_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>app_manage</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<item>
|
||||
<title>Управление хуками (hooks)</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Список хуков</subitemtitle>
|
||||
<subitemlang>manage_hooks</subitemlang>
|
||||
<subsection>hooks</subsection>
|
||||
<subitemurl>do=hooks_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>hooks_manage</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление приложениями</grouptitle>
|
||||
<grouplang>core_manage_apps</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>app_manage</key>
|
||||
@@ -23,6 +24,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление модулями</grouptitle>
|
||||
<grouplang>core_manage_modules</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>module_manage</key>
|
||||
@@ -36,6 +38,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Покупка приложений</grouptitle>
|
||||
<grouplang>core_purchase_app</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>purchase_app</key>
|
||||
@@ -45,6 +48,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление модификациями</grouptitle>
|
||||
<grouplang>core_manage_hooks</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>hooks_manage</key>
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default diagnostics section
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'diagnostics' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'diagnostics';
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Diagnostic tools
|
||||
* Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6990 $
|
||||
* @version $Revision: 9487 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -31,62 +31,42 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Directory separator
|
||||
*
|
||||
* @var string Directory separator
|
||||
*/
|
||||
private $dir_split = "/";
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Db tools
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
private $dbTools;
|
||||
protected $dbTools;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
/* Load skin and setup stuff */
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_diagnostics');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=diagnostics&section=diagnostics';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=diagnostics§ion=diagnostics';
|
||||
|
||||
if( strpos( strtolower( PHP_OS ), 'win' ) === 0 )
|
||||
{
|
||||
$this->dir_split = "\\";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Some of these functions can take a while..
|
||||
//-----------------------------------------
|
||||
@@ -97,7 +77,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ), 'core' );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
@@ -162,9 +142,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Test outbound connections
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _checkConnections()
|
||||
public function _checkConnections()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Turn errors on so we can view them
|
||||
@@ -175,188 +155,22 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$_files = new $classToLoad();
|
||||
$_files->use_sockets = 1;
|
||||
|
||||
$_test = $_files->getFileContents( "http://yandex.ru/" );
|
||||
$_test = $_files->getFileContents( "http://www.google.com/" );
|
||||
$_headers = $_files->raw_headers;
|
||||
|
||||
$_test1 = $_files->getFileContents( "https://yandex.ru/" );
|
||||
$_test1 = $_files->getFileContents( "https://www.google.com/" );
|
||||
$_headers1 = $_files->raw_headers;
|
||||
|
||||
|
||||
$this->registry->output->html .= $this->html->connectionCheckerResult( $_headers, $_test, $_headers1, $_test1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a log entry
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmViewLog()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$marker_microtime = base64_decode( trim( $this->request['_id'] ) );
|
||||
|
||||
/* Fetch row */
|
||||
$data = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'core_topicmarker_debug',
|
||||
'where' => 'marker_member_id=' . $member_id . ' AND marker_microtime=\'' . $marker_microtime . '\'' ) );
|
||||
|
||||
/* Format date */
|
||||
if ( $data )
|
||||
{
|
||||
$data['_marker_timestamp'] = $this->registry->class_localization->getDate( $data['marker_timestamp'], 'long' );
|
||||
}
|
||||
|
||||
/* unserialize */
|
||||
if ( $data['marker_data_storage'] AND strstr( 'a:', $data['marker_data_storage'] ) )
|
||||
{
|
||||
$data['_marker_data_storage'] = unserialize( $data['marker_data_storage'] );
|
||||
}
|
||||
|
||||
/* unserialize */
|
||||
if ( $data['marker_data_memory'] AND strstr( 'a:', $data['marker_data_memory'] ) )
|
||||
{
|
||||
$data['_marker_data_memory'] = unserialize( $data['marker_data_memory'] );
|
||||
}
|
||||
|
||||
/* unserialize */
|
||||
if ( $data['marker_data_freezer'] AND strstr( 'a:', $data['marker_data_freezer'] ) )
|
||||
{
|
||||
$data['_marker_data_freezer'] = unserialize( $data['marker_data_freezer'] );
|
||||
}
|
||||
|
||||
/* unserialize */
|
||||
foreach( array( 1,2,3,4,5 ) as $n )
|
||||
{
|
||||
if ( $data['marker_data_' . $n ] AND strstr( 'a:', $data['marker_data_' . $n ] ) )
|
||||
{
|
||||
$data['marker_data_' . $n ] = unserialize( $data['marker_data_' . $n ] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Print pop-up window */
|
||||
$this->registry->output->html .= $this->html->topicMarkers_viewLog( $data );
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a member's session
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmMemberIndex()
|
||||
{
|
||||
/* INIT */
|
||||
$markers = array();
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$marker_session_key = trim( $this->request['marker_session_key'] );
|
||||
$st = intval( $this->request['st'] );
|
||||
$perpage = 100;
|
||||
$query = array();
|
||||
$url = array();
|
||||
|
||||
/* Load member */
|
||||
$member = IPSMember::buildDisplayData( $member_id );
|
||||
|
||||
/* Generate SQL */
|
||||
$query[] = 't.marker_member_id=' . $member_id;
|
||||
$url[] = 'member_id=' . $member_id;
|
||||
|
||||
if ( $marker_session_key )
|
||||
{
|
||||
$query[] = 't.marker_session_key=\'' . $marker_session_key. '\'';
|
||||
$url[] = 'marker_session_key=' . $marker_session_key;
|
||||
}
|
||||
|
||||
/* Fetch count */
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count',
|
||||
'from' => 'core_topicmarker_debug t',
|
||||
'where' => implode( " AND ", $query ) ) );
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $count['count'],
|
||||
'itemsPerPage' => $perpage,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}&do=" . $this->request['do'] . '&' . implode( "&", $url ),
|
||||
) );
|
||||
/* Grab members */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'core_topicmarker_debug t',
|
||||
'where' => implode( " AND ", $query ),
|
||||
'limit' => array( $st, $perpage ),
|
||||
'order' => 't.marker_timestamp ASC, t.marker_microtime ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Barney and Luke rule the world <-- Debbie typed that */
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$markers[] = $row;
|
||||
}
|
||||
|
||||
/* Send to output */
|
||||
$this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_index", "Topic Marker Debugging" );
|
||||
|
||||
if ( count( $query ) > 1 )
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_memberindex&member_id=" . $member_id, "Log Overview (Unfiltered)" );
|
||||
}
|
||||
|
||||
$this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_memberindex" . '&' . implode( "&", $url ), "Log Overview" );
|
||||
|
||||
$this->registry->output->html .= $this->html->topicMarkers_membersIndex( $member, $markers, $pages );
|
||||
}
|
||||
|
||||
/**
|
||||
* List topic marking debugging index screen (shows members)
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmIndex()
|
||||
{
|
||||
/* INIT */
|
||||
$_debug = array();
|
||||
$debug = array();
|
||||
$members = array();
|
||||
|
||||
/* Grab members */
|
||||
$this->DB->build( array( 'select' => 't.*, COUNT(*) as count, MAX(t.marker_timestamp) as max_ts',
|
||||
'from' => array( 'core_topicmarker_debug' => 't' ),
|
||||
'group' => 't.marker_member_id',
|
||||
'order' => 'm.members_l_display_name',
|
||||
'add_join' => array( array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=t.marker_member_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Barney and Luke rule the world <-- Debbie typed that */
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$members[] = $row['marker_member_id'];
|
||||
$_debug[] = $row;
|
||||
}
|
||||
|
||||
/* Grab members */
|
||||
$loadedMembers = IPSMember::load( $members );
|
||||
|
||||
/* Parse 'em */
|
||||
foreach( $_debug as $row )
|
||||
{
|
||||
$row['_memberData'] = IPSMember::buildDisplayData( $loadedMembers[ $row['marker_member_id'] ] );
|
||||
|
||||
$debug[] = $row;
|
||||
}
|
||||
|
||||
/* Send to output */
|
||||
$this->registry->output->html .= $this->html->topicMarkers_index( $debug );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check file versions
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _versionCheck()
|
||||
public function _versionCheck()
|
||||
{
|
||||
$file_versions = array();
|
||||
$upgrade_history = array();
|
||||
@@ -380,8 +194,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
// Got real version number?
|
||||
//-----------------------------------------
|
||||
|
||||
$version['version'] = (IPB_VERSION == '3.1.4') ? $latest_version['upgrade_version_human'] : IPB_VERSION;
|
||||
$version['version_full'] = (IPB_LONG_VERSION == '31007') ? $latest_version['upgrade_version_id'] : IPB_LONG_VERSION;
|
||||
$version['version'] = ( IPB_VERSION == '3.2.3' ) ? $latest_version['upgrade_version_human'] : IPB_VERSION;
|
||||
$version['version_full'] = ( IPB_LONG_VERSION == '32006' ) ? $latest_version['upgrade_version_id'] : IPB_LONG_VERSION;
|
||||
|
||||
//-----------------------------------------
|
||||
// Version History
|
||||
@@ -406,15 +220,17 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
* @param string Directory to check
|
||||
* @return array Files => Versions
|
||||
*/
|
||||
private function _versionDirRecurse($dir)
|
||||
public function _versionDirRecurse($dir)
|
||||
{
|
||||
$skip_dirs = array( 'public',
|
||||
/* Init some vars */
|
||||
$files = array();
|
||||
$skip_dirs = array( PUBLIC_DIRECTORY,
|
||||
'cache',
|
||||
'uploads',
|
||||
'images',
|
||||
'i18n',
|
||||
'PEAR',
|
||||
'hooks',
|
||||
rtrim( str_replace( DOC_IPS_ROOT_PATH, '', IPS_HOOKS_PATH ), '/\\' ),
|
||||
'facebook-client',
|
||||
'FirePHPCore',
|
||||
'facebook',
|
||||
@@ -427,18 +243,15 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
'Auth'
|
||||
);
|
||||
|
||||
$skip_files = array( 'conf_global.php',
|
||||
$skip_files = array('conf_global.php',
|
||||
'conf.php',
|
||||
$this->settings['sql_driver'] . '_updates.php',
|
||||
$this->settings['sql_driver'] . '_install.php',
|
||||
$this->settings['sql_driver'] . '_fulltext.php',
|
||||
'versionnumbers.php',
|
||||
'recaptcha.php',
|
||||
'classGraph.php', // This is Wizzy's
|
||||
);
|
||||
|
||||
$files = array();
|
||||
|
||||
/* Check files */
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( $dir ) as $directory )
|
||||
@@ -453,8 +266,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
continue;
|
||||
}
|
||||
|
||||
$newpath = $dir . $this->dir_split . $directory->getFilename();
|
||||
$level = explode( $this->dir_split, $newpath );
|
||||
$newpath = $dir . '/' . $directory->getFilename();
|
||||
$level = explode( '/', $newpath );
|
||||
|
||||
if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) )
|
||||
{
|
||||
@@ -466,7 +279,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
{
|
||||
$file = file_get_contents($newpath);
|
||||
|
||||
preg_match( "#IP\.Board v([\d\.]+?)\\n#i", $file, $matches );
|
||||
preg_match( "#@version\s+?v(.+?)\\n#i", $file, $matches );
|
||||
|
||||
$files[ $newpath ] = isset($matches[1]) ? $matches[1] : '';
|
||||
}
|
||||
@@ -480,25 +293,23 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check file permissions
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _permissionsCheck()
|
||||
{
|
||||
$checkdirs = array(
|
||||
'public',
|
||||
'public' . $this->dir_split . 'style_images',
|
||||
'public' . $this->dir_split . 'style_css',
|
||||
'public' . $this->dir_split . 'style_emoticons',
|
||||
public function _permissionsCheck()
|
||||
{
|
||||
$checkdirs = array( PUBLIC_DIRECTORY . '/style_images',
|
||||
PUBLIC_DIRECTORY . '/style_css',
|
||||
PUBLIC_DIRECTORY . '/style_emoticons',
|
||||
'cache',
|
||||
'cache' . $this->dir_split . 'skin_cache',
|
||||
'cache' . $this->dir_split . 'lang_cache',
|
||||
'cache' . $this->dir_split . 'tmp',
|
||||
'cache' . $this->dir_split . 'openid',
|
||||
'cache/skin_cache',
|
||||
'cache/lang_cache',
|
||||
'cache/tmp',
|
||||
'cache/openid',
|
||||
'uploads',
|
||||
'uploads' . $this->dir_split . 'profile',
|
||||
'hooks',
|
||||
'uploads/profile',
|
||||
rtrim( str_replace( DOC_IPS_ROOT_PATH, '', IPS_HOOKS_PATH ), '/\\' ),
|
||||
);
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Get language directories
|
||||
//-----------------------------------------
|
||||
@@ -507,16 +318,16 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
{
|
||||
foreach( $this->cache->getCache('lang_data') as $v )
|
||||
{
|
||||
$this_lang = 'cache' . $this->dir_split . 'lang_cache' . $this->dir_split . $v['lang_id'];
|
||||
$checkdirs[] = $this_lang;
|
||||
$this_lang = 'cache/lang_cache/' . $v['lang_id'];
|
||||
$checkdirs[] = $this_lang;
|
||||
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $this_lang ) as $file )
|
||||
foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $this_lang ) as $file )
|
||||
{
|
||||
if( $file->isFile() )
|
||||
{
|
||||
$checkdirs[] = $this_lang . $this->dir_split . $file->getFilename();
|
||||
$checkdirs[] = $this_lang . '/' . $file->getFilename();
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
@@ -529,16 +340,16 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
while( $v = $this->DB->fetch() )
|
||||
{
|
||||
$this_lang = 'cache' . $this->dir_split . 'lang_cache' . $this->dir_split . $v['lang_id'];
|
||||
$this_lang = 'cache/lang_cache/' . $v['lang_id'];
|
||||
$checkdirs[] = $this_lang;
|
||||
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $this_lang ) as $file )
|
||||
foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $this_lang ) as $file )
|
||||
{
|
||||
if( $file->isFile() )
|
||||
{
|
||||
$checkdirs[] = $this_lang . $this->dir_split . $file->getFilename();
|
||||
$checkdirs[] = $this_lang . '/' . $file->getFilename();
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
@@ -553,7 +364,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
{
|
||||
foreach( $this->cache->getCache('emoticons') as $v )
|
||||
{
|
||||
$checkdirs[] = 'public' . $this->dir_split . 'style_emoticons' . $this->dir_split . $v['emo_set'];
|
||||
$checkdirs[] = PUBLIC_DIRECTORY . '/style_emoticons/' . $v['emo_set'];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -563,7 +374,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
while( $v = $this->DB->fetch() )
|
||||
{
|
||||
$checkdirs[] = 'public' . $this->dir_split . 'style_emoticons' . $this->dir_split . $v['emo_set'];
|
||||
$checkdirs[] = PUBLIC_DIRECTORY . '/style_emoticons/' . $v['emo_set'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,7 +393,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
continue;
|
||||
}
|
||||
|
||||
$checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $v['set_id'];
|
||||
$checkdirs[] = 'cache/skin_cache/cacheid_' . $v['set_id'];
|
||||
$skin_dirs[] = $v['set_skin_set_id'];
|
||||
}
|
||||
}
|
||||
@@ -593,7 +404,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
while( $v = $this->DB->fetch() )
|
||||
{
|
||||
$checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $v['set_id'];
|
||||
$checkdirs[] = 'cache/skin_cache/cacheid_' . $v['set_id'];
|
||||
$skin_dirs[] = $v['set_skin_set_id'];
|
||||
}
|
||||
}
|
||||
@@ -602,18 +413,17 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
// Get skin files
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => $this->DB->buildDistinct( 'template_group' ),
|
||||
'from' => 'skin_templates',
|
||||
'group' => 'template_group',
|
||||
) );
|
||||
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ),
|
||||
'from' => 'skin_templates',
|
||||
'group' => 'template_group',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $v = $this->DB->fetch() )
|
||||
{
|
||||
foreach( $skin_dirs as $dir )
|
||||
{
|
||||
$checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $dir . $this->dir_split . $v['group_name'] . '.php';
|
||||
$checkdirs[] = 'cache/skin_cache/cacheid_' . $dir . '/' . $v['group_name'] . '.php';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,7 +432,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
foreach( $checkdirs as $dir_to_check )
|
||||
{
|
||||
if( !file_exists( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check ) )
|
||||
if( !file_exists( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $dir_to_check ) )
|
||||
{
|
||||
# Could be skin files from custom skins for components they don't own
|
||||
# or they could be using safe_mode skins
|
||||
@@ -630,56 +440,44 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
if( !strpos( $dir_to_check, 'skin_' ) OR !strpos( $dir_to_check, '.php' ) )
|
||||
{
|
||||
$output[] = "<span style='color:red;font-weight:bold;'>{$this->lang->words['d_p404']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . "</span>";
|
||||
$output[] = "<span style='color:red;font-weight:bold;'>{$this->lang->words['d_p404']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check}</span>";
|
||||
}
|
||||
}
|
||||
else if( !is_writeable( DOC_IPS_ROOT_PATH . $this->dir_split . $dir_to_check ) )
|
||||
else
|
||||
{
|
||||
$output[] = "<span style='color:red;font-weight:bold;'>{$this->lang->words['d_pno']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . "</span>";
|
||||
}
|
||||
else if( is_writeable( DOC_IPS_ROOT_PATH . $this->dir_split . $dir_to_check ) )
|
||||
{
|
||||
$output[] = "<span style='color:green;'>" . rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . " {$this->lang->words['d_pyes']}</span>";
|
||||
$output[] = ( is_writable( DOC_IPS_ROOT_PATH . '/' . $dir_to_check ) ) ? "<span style='color:green;'>" . rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check} {$this->lang->words['d_pyes']}</span>" : "<span style='color:red;font-weight:bold;'>{$this->lang->words['d_pno']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check}</span>";;
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->permissionsResults( $output );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Whitespace checking
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _whitespaceCheck()
|
||||
public function _whitespaceCheck()
|
||||
{
|
||||
$files_with_junk = array();
|
||||
$files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) );
|
||||
//$files_with_junk = $this->_whitespaceDirRecurse( '/var/' );
|
||||
$files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) );
|
||||
|
||||
$this->registry->output->html .= $this->html->whitespaceResults( $files_with_junk );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recurse over a directory
|
||||
*
|
||||
* @param string Directory to check
|
||||
* @return array Array of files with whitespace in them
|
||||
*/
|
||||
private function _whitespaceDirRecurse( $dir )
|
||||
public function _whitespaceDirRecurse( $dir )
|
||||
{
|
||||
$skip_dirs = array(
|
||||
'uploads',
|
||||
'gallery_setup',
|
||||
'blog_setup',
|
||||
'idm_setup',
|
||||
'public',
|
||||
'js',
|
||||
'images',
|
||||
$skip_dirs = array( 'uploads',
|
||||
PUBLIC_DIRECTORY,
|
||||
'js',
|
||||
'images',
|
||||
);
|
||||
|
||||
|
||||
$files = array();
|
||||
|
||||
try
|
||||
@@ -696,8 +494,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
continue;
|
||||
}
|
||||
|
||||
$newpath = $dir . $this->dir_split . $directory->getFilename();
|
||||
$level = explode( $this->dir_split, $newpath );
|
||||
$newpath = $dir . '/' . $directory->getFilename();
|
||||
$level = explode( '/', $newpath );
|
||||
|
||||
if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) )
|
||||
{
|
||||
@@ -716,7 +514,14 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
}
|
||||
else if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -2 ) != '?>' )
|
||||
{
|
||||
$has_whitespace = true;
|
||||
//-----------------------------------------
|
||||
// PHP explicitly allows one newline after closing tag
|
||||
//-----------------------------------------
|
||||
|
||||
if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -3 ) != "?>\n" )
|
||||
{
|
||||
$has_whitespace = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( $has_whitespace )
|
||||
@@ -737,7 +542,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
* @param void
|
||||
* @return array Table files
|
||||
*/
|
||||
private function _getDbTools()
|
||||
public function _getDbTools()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// First we get the SQL definitions for each app
|
||||
@@ -749,7 +554,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
{
|
||||
$_file = IPSLib::getAppDir( $app['app_directory'] ) . '/setup/versions/install/sql/' . $app['app_directory'] . '_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tables.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
$sql_table_files[ $app['app_title'] ] = $_file;
|
||||
}
|
||||
@@ -768,9 +573,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check the database for missing indexes
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _indexCheck()
|
||||
public function _indexCheck()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// First we get the SQL definitions for each app
|
||||
@@ -788,7 +593,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
foreach( $sql_table_files as $app_title => $sql_file )
|
||||
{
|
||||
$TABLE = array();
|
||||
require_once( $sql_file );
|
||||
require_once( $sql_file );/*noLibHook*/
|
||||
|
||||
if ( is_array( $TABLE ) AND count( $TABLE ) )
|
||||
{
|
||||
@@ -806,7 +611,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
$tables_array[$app_title] = $output['results'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->indexChecker( $errors_array, $tables_array );
|
||||
@@ -815,10 +620,10 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check the database for missing tables/columns
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
* @todo [Future] Functionality to show EXTRA columns/tables?
|
||||
*/
|
||||
private function _dbCheck()
|
||||
public function _dbCheck()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// First we get the SQL definitions for each app
|
||||
@@ -836,7 +641,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
foreach( $sql_table_files as $app_title => $sql_file )
|
||||
{
|
||||
$TABLE = array();
|
||||
require_once( $sql_file );
|
||||
require_once( $sql_file );/*noLibHook*/
|
||||
|
||||
$output = $this->dbTools->dbTableDiag( $TABLE, $this->request['fix'] );
|
||||
|
||||
@@ -863,9 +668,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Show the overview page
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _listFunctions()
|
||||
public function _listFunctions()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Stats
|
||||
@@ -886,35 +691,31 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
$lock = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as mems' , 'from' => 'members', 'where' => 'failed_login_count >= ' . $this->settings['ipb_bruteforce_attempts'] ) );
|
||||
}
|
||||
|
||||
$coppa = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as coppa', 'from' => 'validating', 'where' => 'coppa_user=1' ) );
|
||||
|
||||
$my_timestamp = time() - $this->settings['au_cutoff'] * 60;
|
||||
|
||||
$online = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as sessions', 'from' => 'sessions', 'where' => 'running_time>' . $my_timestamp ) );
|
||||
|
||||
$pending = $this->DB->buildAndFetch( array( 'select' => 'SUM(queued_topics) as topics, SUM(queued_posts) as posts', 'from' => 'forums' ) );
|
||||
|
||||
$spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count, MAX(joined) as joined',
|
||||
$spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count',
|
||||
'from' => 'members',
|
||||
//'where' => IPSBWOptions::sql( 'bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has' ) ) );
|
||||
'where' => "members_bitoptions = '1'" ) );
|
||||
|
||||
$statsbox = $this->html->acp_stats_wrapper( array( 'topics' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']),
|
||||
'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']),
|
||||
'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']),
|
||||
'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']),
|
||||
'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']),
|
||||
'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ),
|
||||
'spammer' => array( ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ), ipsRegistry::getClass('class_localization')->formatNumber( $spammers['joined'] ) ),
|
||||
'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ),
|
||||
'coppa' => ipsRegistry::getClass('class_localization')->formatNumber( $coppa['coppa'] ),
|
||||
'sql_driver' => strtoupper(SQL_DRIVER),
|
||||
'sql_version' => $this->DB->true_version,
|
||||
'php_version' => phpversion(),
|
||||
'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']),
|
||||
'php_sapi' => @php_sapi_name(),
|
||||
'ipb_version' => ipsRegistry::$version,
|
||||
'ipb_id' => ipsRegistry::$vn_full ) );
|
||||
'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']),
|
||||
'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']),
|
||||
'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']),
|
||||
'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']),
|
||||
'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ),
|
||||
'spammer' => ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ),
|
||||
'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ),
|
||||
'sql_driver' => strtoupper(SQL_DRIVER),
|
||||
'sql_version' => $this->DB->true_version,
|
||||
'php_version' => phpversion(),
|
||||
'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']),
|
||||
'php_sapi' => @php_sapi_name(),
|
||||
'ipb_version' => ipsRegistry::$version,
|
||||
'ipb_id' => ipsRegistry::$vn_full ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// PHP INFO?
|
||||
@@ -946,7 +747,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
#PREVENT WRAP: Cookie , split
|
||||
$php_body = preg_replace( "#,(\d+),#", ",<br />\\1," , $php_body );
|
||||
|
||||
$this->registry->output->html = $this->html->phpInfo( $php_body );
|
||||
$this->registry->output->html .= $this->html->phpInfo( $php_body );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1117,6 +918,4 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
$this->registry->output->html .= $this->html->acp_version_history_wrapper( $thiscontent );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,8 +6,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Обзор системы</subitemtitle>
|
||||
<subitemlang>diag_overview</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -17,8 +19,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка версий файлов</subitemtitle>
|
||||
<subitemlang>version_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=fileversions</subitemurl>
|
||||
<subitemrolekey>version_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -28,8 +32,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Поиск файлов содержащих лишние пробелы</subitemtitle>
|
||||
<subitemlang>whitespace_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=whitespace</subitemurl>
|
||||
<subitemrolekey>whitespace_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -39,8 +45,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка прав доступа к файлам</subitemtitle>
|
||||
<subitemlang>permissions_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=filepermissions</subitemurl>
|
||||
<subitemrolekey>permission_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -50,8 +58,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка сетевых соединений</subitemtitle>
|
||||
<subitemlang>connection_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=connections</subitemurl>
|
||||
<subitemrolekey>connection_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -61,8 +71,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка структуры базы данных</subitemtitle>
|
||||
<subitemlang>db_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=dbchecker</subitemurl>
|
||||
<subitemrolekey>database_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -72,8 +84,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка индексов базы данных</subitemtitle>
|
||||
<subitemlang>dbi_checker</subitemlang>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=dbindex</subitemurl>
|
||||
<subitemrolekey>index_checker</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Инструменты диагностики</grouptitle>
|
||||
<grouplang>core_diag_tools</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>index_checker</key>
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default help section
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'help' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'quickhelp';
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Quick help - shows popups with help information
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,18 +30,16 @@ class admin_core_help_quickhelp extends ipsCommand
|
||||
/**
|
||||
* Array of help text
|
||||
*
|
||||
* @access private
|
||||
* @var array Help texts
|
||||
*/
|
||||
private $help_text = array();
|
||||
protected $help_text = array();
|
||||
|
||||
/**
|
||||
* Initialize the help text array
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _initText()
|
||||
protected function _initText()
|
||||
{
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
|
||||
|
||||
@@ -82,9 +80,8 @@ class admin_core_help_quickhelp extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -110,41 +107,36 @@ class admin_core_help_quickhelp extends ipsCommand
|
||||
/**
|
||||
* Redirect offsite for more help/options
|
||||
*
|
||||
* @access private
|
||||
* @param string 'key' to redirect to
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _redirect( $id )
|
||||
{
|
||||
switch( $id )
|
||||
{
|
||||
case 'docs':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/docs-ipb";
|
||||
break;
|
||||
|
||||
case 'kb':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/wiki";
|
||||
$url = "http://myipb.in/docs-ipb";
|
||||
break;
|
||||
|
||||
case 'resources':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/forums";
|
||||
$url = "http://myipb.in/forums";
|
||||
break;
|
||||
|
||||
case 'contact':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/contact";
|
||||
$url = "http://myipb.in/contact";
|
||||
break;
|
||||
|
||||
case 'features':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/suggestfeatures";
|
||||
$url = "http://myipb.in/suggestfeatures";
|
||||
break;
|
||||
|
||||
case 'bugs':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/bugtrack";
|
||||
$url = "http://myipb.in/bugtrack";
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'support':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/clientarea";
|
||||
$url = "http://myipb.in/clientarea";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,28 +6,20 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Документация</subitemtitle>
|
||||
<subitemlang>help_documentation</subitemlang>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=docs</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>База знаний</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>База знаний</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=kb</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
<item>
|
||||
<title>Тех. поддержка</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Техническая поддержка</subitemtitle>
|
||||
<subitemlang>help_support</subitemlang>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=support</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
@@ -39,6 +31,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Форумы IBResource</subitemtitle>
|
||||
<subitemlang>help_resources</subitemlang>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=resources</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
@@ -50,6 +43,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Контактная информация</subitemtitle>
|
||||
<subitemlang>help_contact</subitemlang>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=contact</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
@@ -61,6 +55,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Сообщить об ошибке</subitemtitle>
|
||||
<subitemlang>help_bugs</subitemlang>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=bugs</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default languages section
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'languages' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'manage_languages';
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Language Pack Management
|
||||
* Last Updated: $LastChangedDate: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-09-19 20:56:02 -0400 (Mon, 19 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6990 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9511 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -30,12 +31,40 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
* @var bool
|
||||
*/
|
||||
private $__daily = false;
|
||||
|
||||
/**
|
||||
* Tab buttons
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $tab_buttons = array();
|
||||
|
||||
/**
|
||||
* Tabs
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $tab_tabs = array();
|
||||
|
||||
/**
|
||||
* Javascript action to execute on tab click
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $tab_js_action = '';
|
||||
|
||||
/**
|
||||
* Default tab
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $default_tab = '';
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -43,16 +72,15 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Get skin and language file
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_system' );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) );
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_system', 'core' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_system' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set urls
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=languages&section=manage_languages';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages';
|
||||
$this->form_code = $this->html->form_code = 'module=languages&section=manage_languages&';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages&';
|
||||
|
||||
//-----------------------------------------
|
||||
// Go
|
||||
@@ -62,7 +90,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
{
|
||||
case 'copy_lang_pack':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' );
|
||||
$this->languageCopy( 'edit' );
|
||||
$this->languageCopy();
|
||||
break;
|
||||
|
||||
case 'edit_word_entry':
|
||||
@@ -120,6 +148,11 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->handleLanguageInformationForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'language_swap':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' );
|
||||
$this->swapLanguages();
|
||||
break;
|
||||
|
||||
case 'revert':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' );
|
||||
$this->languageDoRevertWord();
|
||||
@@ -198,10 +231,37 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Swap member language choice globally
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function swapLanguages()
|
||||
{
|
||||
/* INIT */
|
||||
$langFrom = intval( $this->request['lang_from'] );
|
||||
$langTo = intval( $this->request['lang_to'] );
|
||||
|
||||
/* Run query... */
|
||||
if( !$langFrom )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : '' ), "language='' OR language " . $this->DB->buildIsNull( true ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : '' ), "language='{$langFrom}'" );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->global_message = $this->lang->words['mem_lang_choice_swapped'];
|
||||
$this->languagesList();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish a session and remove data
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function translateKill()
|
||||
{
|
||||
@@ -248,7 +308,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Translate externally import changed files
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function translateImport()
|
||||
{
|
||||
@@ -355,7 +415,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Translate externally splash
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function translateExtSplash()
|
||||
{
|
||||
@@ -480,7 +540,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
{
|
||||
fwrite( $fh, $to_write, strlen( $to_write ) );
|
||||
fclose( $fh );
|
||||
@chmod( $mainDir . '/' . $_file, 0777 );
|
||||
@chmod( $mainDir . '/' . $_file, IPS_FILE_PERMISSION );
|
||||
|
||||
$mtime = @filemtime( $mainDir . '/' . $_file );
|
||||
|
||||
@@ -577,13 +637,13 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$counts[ $f ] = array();
|
||||
|
||||
if ( ! file_exists( $mainDir . $f ) )
|
||||
if ( ! is_file( $mainDir . $f ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Require the file */
|
||||
require( $mainDir . $f );
|
||||
require( $mainDir . $f );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop
|
||||
@@ -771,7 +831,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Recaches a language pack
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function recacheLangPack()
|
||||
{
|
||||
@@ -785,15 +845,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$this->cacheToDisk( $lang_id );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['language_recache_done'] . "<br />" . implode( "<br />", $this->cache_errors );
|
||||
$this->registry->output->global_message = $this->lang->words['language_recache_done'] . ( !empty( $this->cache_errors ) ? ( "<br />" . implode( "<br />", $this->cache_errors ) ) : '' );
|
||||
$this->languagesList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a word entry
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function removeWordEntry()
|
||||
{
|
||||
@@ -828,7 +887,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Remove a word pack
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function removeWordPack()
|
||||
{
|
||||
@@ -853,7 +912,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$_file = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' . $pack[0] . '_' . $pack[1] . '.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
@unlink( $_file );
|
||||
}
|
||||
@@ -877,7 +936,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Rebuilds language from XML files
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildFromXml()
|
||||
{
|
||||
@@ -897,7 +956,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if ( ! is_writeable( IPS_CACHE_PATH . 'cache/lang_cache/' . $id ) )
|
||||
{
|
||||
$this->registry->output->global_message = "Cannot write to cache/lang_cache/" . $id;
|
||||
$this->registry->output->global_error = $this->lang->words['cannot_write_to_cache'] ? sprintf( $this->lang->words['cannot_write_to_cache'], $id ) : "Cannot write to cache/lang_cache/" . $id;
|
||||
$this->languagesList();
|
||||
return;
|
||||
}
|
||||
@@ -906,7 +965,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Get setup class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" );
|
||||
require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Get apps
|
||||
@@ -954,7 +1013,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Off to next setp
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg );
|
||||
$this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg . '<br>' . $this->registry->output->global_message );
|
||||
$this->registry->output->global_message = '';
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -964,7 +1025,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Onto admin languages
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] );
|
||||
$this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -972,7 +1034,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// And we're done
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['lang_reimport_done'] );
|
||||
$this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['lang_reimport_done'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1025,8 +1087,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->cacheToDisk( $new_id );
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['l_copied'] );
|
||||
$this->registry->class_localization->rebuildLanguagesCache();
|
||||
|
||||
$this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_copied'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1069,7 +1132,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Delete from disk
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->adminFunctions->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' );
|
||||
$fileManagement = new $classToLoad();
|
||||
$fileManagement->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update member default choice
|
||||
@@ -1078,22 +1143,17 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->DB->update( 'members', array( 'language' => intval($default['lang_id']) ), "language={$id}" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update cache
|
||||
// Update cache and redirect
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->rebuildLanguagesCache();
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['l_removed'] );
|
||||
$this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_removed'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Revert a word pack entry to the default value
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languageDoRevertWord()
|
||||
{
|
||||
@@ -1129,7 +1189,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Saves new language edits
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languageEditWordPackValues()
|
||||
{
|
||||
@@ -1170,14 +1230,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$this->cacheToDisk( $id );
|
||||
|
||||
$this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] );
|
||||
$this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the word entry form
|
||||
*
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function handleWordEntryForm( $mode='add' )
|
||||
{
|
||||
@@ -1195,21 +1255,21 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if( ! $this->request['word_pack_db'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['l_packreq'];
|
||||
$this->registry->output->global_error = $this->lang->words['l_packreq'];
|
||||
$this->languageWordEntryForm( $mode );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ! $this->request['word_key'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['l_keyreq'];
|
||||
$this->registry->output->global_error = $this->lang->words['l_keyreq'];
|
||||
$this->languageWordEntryForm( $mode );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ! $this->request['word_default'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['l_textreq'];
|
||||
$this->registry->output->global_error = $this->lang->words['l_textreq'];
|
||||
$this->languageWordEntryForm( $mode );
|
||||
return;
|
||||
}
|
||||
@@ -1240,6 +1300,16 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if( $mode == 'add' )
|
||||
{
|
||||
/* Check for a duplicate */
|
||||
$_check = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}' AND word_key='{$db_array['word_key']}'" ) );
|
||||
|
||||
if( $_check['word_id'] )
|
||||
{
|
||||
$this->registry->output->global_error = $this->lang->words['l_textexistsalready'];
|
||||
$this->languageWordEntryForm( $mode );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->DB->insert( 'core_sys_lang_words', $db_array );
|
||||
|
||||
$text = $this->lang->words['l_added'];
|
||||
@@ -1264,7 +1334,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
* Form for adding/editing a word entry
|
||||
*
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languageWordEntryForm( $mode='add' )
|
||||
{
|
||||
@@ -1306,10 +1376,10 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Set defaults
|
||||
//-----------------------------------------
|
||||
|
||||
$data['word_app'] = ( isset( $this->request['word_app'] ) && $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app'];
|
||||
$data['word_pack'] = ( isset( $this->request['word_pack_db'] ) && $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack'];
|
||||
$data['word_key'] = ( isset( $this->request['word_key'] ) && $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key'];
|
||||
$data['word_default'] = ( isset( $this->request['word_default'] ) && $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default'];
|
||||
$data['word_app'] = !empty( $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app'];
|
||||
$data['word_pack'] = !empty( $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack'];
|
||||
$data['word_key'] = !empty( $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key'];
|
||||
$data['word_default'] = !empty( $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Applications dropdown
|
||||
@@ -1322,19 +1392,104 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$_apps[] = array( $app, $appdata['app_title'] );
|
||||
}
|
||||
|
||||
$data['word_app'] = $this->registry->output->compileSelectOptions( $_apps, $data['word_app'] );
|
||||
$data['word_app'] = $this->compileSelectOptions( $_apps, $data['word_app'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Output form
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->languageWordEntryForm( $op, $word_id, $lang_id, $title, $header, $data, $button );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an option list for select tags
|
||||
*
|
||||
* @param array $options Array of values/text for dropdown
|
||||
* @param mixed [$selected] Selected value or array of selected values
|
||||
* @return string
|
||||
*/
|
||||
public function compileSelectOptions( $options, $selected='' )
|
||||
{
|
||||
if( ! is_array( $selected ) )
|
||||
{
|
||||
$selected = array( $selected );
|
||||
}
|
||||
|
||||
$html = '';
|
||||
if( is_array( $options ) )
|
||||
{
|
||||
foreach( $options as $option )
|
||||
{
|
||||
$sel = ( $option[0] AND in_array( $option[0], $selected ) ) ? ' selected="selected"' : '';
|
||||
$val = ( $option[0] == 'disabled' ) ? 'disabled="disabled"' : "value='{$option[0]}'";
|
||||
|
||||
$html .= "<option {$val}{$sel}>{$option[1]}</option>";
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the button and content to the tab list for this object
|
||||
*
|
||||
* @param string $button
|
||||
* @param string $content
|
||||
* @param string [$js_action]
|
||||
* @return @e void
|
||||
*/
|
||||
public function addTab( $button, $content, $js_action='', $default_tab=0 )
|
||||
{
|
||||
$this->tab_buttons[] = $button;
|
||||
$this->tab_tabs[] = $content;
|
||||
$this->tab_js_action[] = $js_action;
|
||||
|
||||
if( $default_tab )
|
||||
{
|
||||
$this->default_tab = count( $this->tab_tabs ) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the html for the tabbed area
|
||||
*
|
||||
* @return string Tab HTML
|
||||
*/
|
||||
public function buildTabs()
|
||||
{
|
||||
/* Buttons */
|
||||
$i = 0;
|
||||
$tabs = array();
|
||||
foreach( $this->tab_buttons as $i => $button )
|
||||
{
|
||||
/* Tab Button */
|
||||
$js = ( $this->tab_js_action[$i] ) ? 'onmousedown="'.$this->tab_js_action[$i].'"' : '';
|
||||
$class = ( $i == 0 ) ? 'mini_tab_on' : 'mini_tab_off';
|
||||
$tabs[] = array( 'id' => $i, 'class' => $class, 'text' => $button, 'js' => $js );
|
||||
}
|
||||
|
||||
/* Tab Contents */
|
||||
$i = 0;
|
||||
$content = array();
|
||||
foreach( $this->tab_tabs as $tab )
|
||||
{
|
||||
/* Create the pane */
|
||||
$content[] = array( 'id' => $i, 'content' => $tab );
|
||||
$i++;
|
||||
}
|
||||
|
||||
$default_tab = ( $this->default_tab ) ? $this->default_tab : '';
|
||||
|
||||
/* End of tab pane */
|
||||
$tabs = $this->html->ui_content_tabs( $tabs, $content, $default_tab );
|
||||
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit the entries in a word pack
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languageEditWordPack()
|
||||
{
|
||||
@@ -1419,7 +1574,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* List the word packs available for the selected language set
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @author Josh
|
||||
*/
|
||||
public function languageListWordPacks()
|
||||
@@ -1449,10 +1604,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Some init before looping
|
||||
//-----------------------------------------
|
||||
|
||||
$_packs = array();
|
||||
$_missing = array();
|
||||
$_stats = array();
|
||||
$_menus = array();
|
||||
$_packs = array();
|
||||
$_missing = array();
|
||||
$_stats = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
@@ -1476,11 +1630,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
if( ! in_array( $r['word_pack'], $_packs[$r['word_app']] ) )
|
||||
{
|
||||
$_packs[$r['word_app']][] = $r['word_pack'];
|
||||
$_menus[$r['word_app']][$r['word_pack']] = $this->registry->output->buildJavascriptMenu( array(
|
||||
array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=edit_word_pack&id={$id}", $this->lang->words['edit'], 'edit' ),
|
||||
array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=add_word_entry&id={$id}&word_app={$r['word_app']}", "{$this->lang->words['l_addnew']}...", 'add' ),
|
||||
array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=remove_word_pack&id={$id}&word_app={$r['word_app']}", "{$this->lang->words['l_remove_pack']}...", 'delete' ),
|
||||
) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1515,7 +1664,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$default_tab = ( $app == $this->request['app'] ) ? 1 : 0;
|
||||
asort($_packs[$app]);
|
||||
|
||||
$this->registry->output->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app], $_menus[$app] ), '', $default_tab );
|
||||
$this->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app] ), '', $default_tab );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1523,14 +1672,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->languageWordPackList( $id, $this->registry->output->buildTabs(), $data['app_title'] );
|
||||
$this->registry->output->html .= $this->html->languageWordPackList( $id, $this->buildTabs(), $data['app_title'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the language information form submit
|
||||
*
|
||||
* @param string $mode Either new or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function handleLanguageInformationForm( $mode='new' )
|
||||
{
|
||||
@@ -1597,9 +1746,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Create directory
|
||||
//-----------------------------------------
|
||||
|
||||
@mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, 0777 );
|
||||
@mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION );
|
||||
@file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/index.html', '' );
|
||||
@chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, 0777 );
|
||||
@chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION );
|
||||
|
||||
//-----------------------------------------
|
||||
// Copy over language bits from default lang
|
||||
@@ -1665,7 +1814,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
* Builds the language information form
|
||||
*
|
||||
* @param string $mode new or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languageInformationForm( $mode='new' )
|
||||
{
|
||||
@@ -1706,10 +1855,10 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Set some defaults
|
||||
//-----------------------------------------
|
||||
|
||||
$data['lang_title'] = ( isset( $this->request['lang_title'] ) && $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title'];
|
||||
$data['lang_short'] = ( isset( $this->request['lang_short'] ) && $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short'];
|
||||
$data['lang_default'] = ( isset( $this->request['lang_default'] ) && $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default'];
|
||||
$data['lang_isrtl'] = ( isset( $this->request['lang_isrtl'] ) && $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl'];
|
||||
$data['lang_title'] = !empty( $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title'];
|
||||
$data['lang_short'] = !empty( $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short'];
|
||||
$data['lang_default'] = !empty( $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default'];
|
||||
$data['lang_isrtl'] = !empty( $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl'];
|
||||
|
||||
$data['lang_default'] = $this->registry->output->formYesNo( 'lang_default', $data['lang_default'] );
|
||||
$data['lang_isrtl'] = $this->registry->output->formYesNo( 'lang_isrtl', $data['lang_isrtl'] );
|
||||
@@ -1725,13 +1874,13 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Lists currently installed languages
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function languagesList()
|
||||
{
|
||||
/* Do we have a valid translation session? */
|
||||
$session = $this->DB->buildandFetch( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='translate_session'" ) );
|
||||
$sessionData = ( strstr( $session['cs_value'], 'a:' ) ) ? unserialize( $session['cs_value'] ) : array();
|
||||
$sessionData = IPSLib::isSerialized($session['cs_value']) ? unserialize( $session['cs_value'] ) : array();
|
||||
$hasTranslate = false;
|
||||
|
||||
/* Check */
|
||||
@@ -1765,58 +1914,48 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->registry->class_localization->local_data = localeconv();
|
||||
|
||||
$_menu = array();
|
||||
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=edit_lang_info&id={$r['lang_id']}", $this->lang->words['edit'], 'edit' );
|
||||
|
||||
|
||||
if( $r['lang_protected'] && ! IN_DEV )
|
||||
{
|
||||
$_menu[] = array( "", $this->lang->words['lang_pack_protected'], 'edit' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' );
|
||||
|
||||
/* If we don't have a current session... */
|
||||
if ( ! $hasTranslate )
|
||||
{
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' );
|
||||
}
|
||||
|
||||
if( ! $r['lang_default'] )
|
||||
{
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=remove_language&id={$r['lang_id']}", $this->lang->words['delete'], 'delete', 1 );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' );
|
||||
}
|
||||
}
|
||||
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] );
|
||||
$_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=recache_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_recache'] );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] );
|
||||
|
||||
$_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'] );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'], 'export' );
|
||||
|
||||
if ( $r['lang_id'] )
|
||||
{
|
||||
$_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] );
|
||||
}
|
||||
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
{
|
||||
$_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'] );
|
||||
$_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'], 'export' );
|
||||
}
|
||||
|
||||
$menu = $this->registry->output->buildJavascriptMenu( $_menu );
|
||||
|
||||
//-----------------------------------------
|
||||
// Data for output
|
||||
//-----------------------------------------
|
||||
|
||||
$rows[] = array(
|
||||
'title' => $r['lang_title'],
|
||||
'local' => $r['lang_short'],
|
||||
'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '<br />' . $this->registry->class_localization->getDate( time(), 'short', 1 ),
|
||||
'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ),
|
||||
'default' => ( $r['lang_default'] ) ? "<img src='{$this->settings['skin_acp_url']}/_newimages/icons/tick.png' alt='{$this->lang->words['yes']}' />" : '',
|
||||
'menu' => $menu,
|
||||
'id' => $r['lang_id'],
|
||||
$rows[] = array( 'title' => $r['lang_title'],
|
||||
'local' => $r['lang_short'],
|
||||
'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '<br />' . $this->registry->class_localization->getDate( time(), 'short', 1 ),
|
||||
'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ),
|
||||
'default' => $r['lang_default'],
|
||||
'menu' => $_menu,
|
||||
'id' => $r['lang_id'],
|
||||
'protected'=> $r['lang_protected'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1839,7 +1978,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
* Updates the cached language files from the database
|
||||
*
|
||||
* @param integer ID of the language pack to export
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function cacheToDisk( $lang_id )
|
||||
{
|
||||
@@ -1871,7 +2010,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if( ! is_dir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' ) )
|
||||
{
|
||||
mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', 0777 );
|
||||
mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', IPS_FOLDER_PERMISSION );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1904,6 +2043,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
foreach( $words as $word )
|
||||
{
|
||||
$word[1] = str_replace( "\\", "\\\\", $word[1] );
|
||||
$word[1] = str_replace( '"', '\\"', $word[1] );
|
||||
$to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n";
|
||||
}
|
||||
@@ -1915,6 +2055,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
foreach( $words as $word )
|
||||
{
|
||||
$word[1] = str_replace( "\\", "\\\\", $word[1] );
|
||||
$word[1] = str_replace( '"', '\\"', $word[1] );
|
||||
$to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n";
|
||||
}
|
||||
@@ -1930,8 +2071,9 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
foreach( $words as $word )
|
||||
{
|
||||
$word[1] = str_replace( "\\", "\\\\", $word[1] );
|
||||
$word[1] = str_replace( '"', '\\"', $word[1] );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Protect swapped sprintf arguments
|
||||
// @link http://community.invisionpower.com/tracker/issue-22240-lang-strings-using-sprintf-argument-swapping/
|
||||
@@ -1951,13 +2093,16 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$_dir = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/';
|
||||
|
||||
@unlink( $_dir . $_file );
|
||||
if( is_file($_dir . $_file) )
|
||||
{
|
||||
@unlink( $_dir . $_file );
|
||||
}
|
||||
|
||||
if ( $fh = @fopen( $_dir . $_file, 'wb' ) )
|
||||
{
|
||||
fwrite( $fh, $to_write, strlen( $to_write ) );
|
||||
fclose( $fh );
|
||||
@chmod( $_dir . $_file, 0777 );
|
||||
@chmod( $_dir . $_file, IPS_FILE_PERMISSION );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2015,7 +2160,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! file_exists( $this->request['file_location'] ) )
|
||||
if ( ! is_file( $this->request['file_location'] ) )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['l_noopen'] . $this->request['file_location'];
|
||||
$this->languagesList();
|
||||
@@ -2045,7 +2190,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Extract archive
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );
|
||||
require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/
|
||||
$xmlarchive = new classXMLArchive();
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2121,7 +2266,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Extract archive
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );
|
||||
require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/
|
||||
$xmlarchive = new classXMLArchive();
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2176,7 +2321,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( $skip_charset ? 'utf-8' : IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
@@ -2227,7 +2372,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
if( @mkdir( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId ) )
|
||||
{
|
||||
@file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $insertId . '/index.html', '' );
|
||||
@chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, 0777 );
|
||||
@chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, IPS_FOLDER_PERMISSION );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2308,6 +2453,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
foreach( $lang_ids as $_lang_id )
|
||||
{
|
||||
$lang_entry = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Build db array
|
||||
//-----------------------------------------
|
||||
@@ -2319,8 +2466,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
'word_key' => $lang['word_key'],
|
||||
'word_default' => $lang['word_default'],
|
||||
'word_custom' => $in_dev && !$ru ? '' : $lang['word_custom'],
|
||||
'word_js' => $lang['word_js'],
|
||||
'word_default_version' => ( $lang['word_default_version'] >= 30000 ) ? $lang['word_default_version'] : $LATESTVERSION['long'],
|
||||
'word_js' => intval($lang['word_js']),
|
||||
'word_default_version' => $lang['word_default_version'] ? $lang['word_default_version'] : $LATESTVERSION['long'],
|
||||
'word_custom_version' => $lang['word_custom_version'],
|
||||
);
|
||||
|
||||
@@ -2389,7 +2536,10 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Don't update default version
|
||||
//-----------------------------------------
|
||||
|
||||
unset( $db_array['word_default_version'] );
|
||||
// This causes no languages to show "out of date" on upgrade
|
||||
// @link http://community.invisionpower.com/tracker/issue-31637-no-out-of-date-entries-for-language-string-updates
|
||||
// This WAS added to fix a previously reported bug, however, so need to watch out for this
|
||||
// unset( $db_array['word_default_version'] );
|
||||
|
||||
$counts['updates']++;
|
||||
$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
|
||||
@@ -2513,7 +2663,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Create the XML library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'languageexport' );
|
||||
@@ -2553,16 +2703,35 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$content = array();
|
||||
$_strings++;
|
||||
|
||||
$content = array(
|
||||
'word_app' => $r['word_app'],
|
||||
'word_pack' => $r['word_pack'],
|
||||
'word_key' => $r['word_key'],
|
||||
'word_default' => $r['word_default'],
|
||||
'word_custom' => $r['word_custom'],
|
||||
'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'],
|
||||
'word_custom_version' => $r['word_custom_version'],
|
||||
'word_js' => $r['word_js']
|
||||
);
|
||||
if( $disk )
|
||||
{
|
||||
$content = array(
|
||||
'word_app' => $r['word_app'],
|
||||
'word_pack' => $r['word_pack'],
|
||||
'word_key' => $r['word_key'],
|
||||
'word_default' => $r['word_default'],
|
||||
//'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'],
|
||||
//'word_js' => $r['word_js']
|
||||
);
|
||||
|
||||
if( $r['word_js'] )
|
||||
{
|
||||
$content['word_js'] = $r['word_js'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content = array(
|
||||
'word_app' => $r['word_app'],
|
||||
'word_pack' => $r['word_pack'],
|
||||
'word_key' => $r['word_key'],
|
||||
'word_default' => $r['word_default'],
|
||||
'word_custom' => $r['word_custom'],
|
||||
'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'],
|
||||
'word_custom_version' => $r['word_custom_version'],
|
||||
'word_js' => $r['word_js']
|
||||
);
|
||||
}
|
||||
|
||||
$xml->addElementAsRecord( 'languagegroup', 'lang', $content );
|
||||
}
|
||||
@@ -2601,7 +2770,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Create xml archive
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/
|
||||
$xmlArchive = new classXMLArchive();
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2623,7 +2792,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
* Builds the language db entries from cache
|
||||
*
|
||||
* @param boolean return as normal
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @author Josh
|
||||
*/
|
||||
public function importFromCacheFiles( $returnAsNormal=TRUE )
|
||||
@@ -2701,7 +2870,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
require( $_dir . $f );
|
||||
require( $_dir . $f );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop
|
||||
@@ -2724,7 +2893,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->DB->insert( 'core_sys_lang_words', $insert );
|
||||
}
|
||||
|
||||
$msg[] = "Imported {$f} ({$inserted} added, {$updated} updated)...";
|
||||
$msg[] = sprintf( $this->lang->words['indev_lang_import'], $f, $inserted, $updated );
|
||||
}
|
||||
else if( preg_match( '/(\.js)$/', $f ) AND $app == 'core' )
|
||||
{
|
||||
@@ -2802,7 +2971,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if ( $returnAsNormal === TRUE )
|
||||
{
|
||||
$this->registry->output->global_message = implode( "<br />", $msg );
|
||||
$this->registry->output->setMessage( implode( "<br />", $msg ), true );
|
||||
|
||||
if ( ! $this->__daily )
|
||||
{
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Языки системы</subitemtitle>
|
||||
<subitemlang>languages</subitemlang>
|
||||
<subsection>manage_languages</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subisredirect>0</subisredirect>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление языками</grouptitle>
|
||||
<grouplang>core_languages</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>lang_words</key>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* ACP Login/Logout Routines
|
||||
* Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 17th August 2004
|
||||
* @version $Revision: 6990 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -57,7 +57,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Initiate login handler
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function initHanLogin()
|
||||
{
|
||||
@@ -73,7 +73,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @param string Validation message
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry, $validationMessage='' )
|
||||
{
|
||||
@@ -114,7 +114,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Check and verify the login was successful
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function loginComplete()
|
||||
{
|
||||
@@ -216,6 +216,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
$extra_query = str_replace( "/admin" , "" , $extra_query );
|
||||
$extra_query = str_replace( '&' , '&', $extra_query );
|
||||
$extra_query = preg_replace( "#&{1,}#" , "&", $extra_query );
|
||||
$extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -242,7 +243,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
'session_url' => '',
|
||||
) );
|
||||
|
||||
$this->request[ 'adsess'] = $sess_id ;
|
||||
$this->request['adsess'] = $sess_id;
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect...
|
||||
@@ -252,14 +253,15 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
|
||||
$this->_writeToLog( $this->request['username'], 'ok' );
|
||||
|
||||
ipsRegistry::getClass('output')->redirect( $url, $this->lang->words['login_successful'] );
|
||||
ipsRegistry::getClass('output')->global_message = '';
|
||||
ipsRegistry::getClass('output')->silentRedirect( $url );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the user out
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function loginOut()
|
||||
{
|
||||
@@ -280,7 +282,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
* Log the user out
|
||||
*
|
||||
* @param string Message to show on the form
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function loginForm( $message='' )
|
||||
{
|
||||
@@ -347,9 +349,9 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
$this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
|
||||
ipsRegistry::getClass('output')->html_main = str_replace( '<%CONTENT%>', ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data ), ipsRegistry::getClass('output')->global_template->global_main_wrapper_no_furniture() );
|
||||
ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main );
|
||||
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
|
||||
ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data );
|
||||
ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main );
|
||||
|
||||
@header("Content-type: text/html");
|
||||
print ipsRegistry::getClass('output')->html_main;
|
||||
@@ -361,7 +363,8 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
*
|
||||
* @param string Username
|
||||
* @param string ok/fail flag
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log
|
||||
*/
|
||||
private function _writeToLog( $username='', $flag='fail' )
|
||||
{
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Admin logs
|
||||
* Last Updated: $LastChangedDate: 2010-06-15 21:25:19 -0400 (Tue, 15 Jun 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-06-01 22:13:27 -0400 (Wed, 01 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6539 $
|
||||
* @version $Rev: 8938 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -26,18 +26,9 @@ if ( ! defined( 'IN_ACP' ) )
|
||||
|
||||
class admin_core_logs_adminlogs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Generate some pretty colors for the logs
|
||||
*
|
||||
* @access protected
|
||||
* @var array Different colors for different actions
|
||||
*/
|
||||
protected $colours = array();
|
||||
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
@@ -45,9 +36,8 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -79,22 +69,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools§ion=logsSplash', $this->lang->words['nav_logssplash'] );
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=adminlogs', $this->lang->words['alog_adminlogs'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Add some colors from the paintbucket
|
||||
//-----------------------------------------
|
||||
|
||||
$this->colours = array(
|
||||
"cat" => "green",
|
||||
"forum" => "darkgreen",
|
||||
"mem" => "red",
|
||||
'group' => "purple",
|
||||
'mod' => 'orange',
|
||||
'op' => 'darkred',
|
||||
'help' => 'darkorange',
|
||||
'modlog' => 'steelblue',
|
||||
);
|
||||
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
@@ -125,8 +100,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* View all logs for a given admin
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _view()
|
||||
{
|
||||
@@ -134,7 +108,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
///----------------------------------------
|
||||
// No mid or search string?
|
||||
@@ -147,17 +121,17 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
|
||||
|
||||
///----------------------------------------
|
||||
// mid?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] )
|
||||
{
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view";
|
||||
$query = "{$this->form_code}&mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'admin_logs' => 'm' ),
|
||||
@@ -165,7 +139,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( $start, 20 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.member_id, mem.members_display_name',
|
||||
array( 'select' => 'mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
@@ -181,7 +155,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
|
||||
else
|
||||
{
|
||||
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
|
||||
if( !$this->DB->checkForField( $this->request['search_type'], 'admin_logs' ) )
|
||||
{
|
||||
@@ -197,11 +171,9 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
|
||||
}
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']);
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) );
|
||||
|
||||
$query = "{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']);
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'admin_logs' => 'm' ),
|
||||
@@ -209,7 +181,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( $start, 20 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.member_id, mem.members_display_name',
|
||||
array( 'select' => 'mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
@@ -223,7 +195,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
@@ -236,9 +208,17 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
|
||||
$row['color'] = $this->colours[ $row['act'] ];
|
||||
if( !$row['member_id'] )
|
||||
{
|
||||
$row['member_id'] = 'zero';
|
||||
}
|
||||
|
||||
if( !$row['members_display_name'] )
|
||||
{
|
||||
$row['members_display_name'] = $this->lang->words['noname_availabl'];
|
||||
}
|
||||
|
||||
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
@@ -247,32 +227,31 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->adminlogsView( $rows, $links );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by an admin
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
if ( $this->request['mid'] == "" )
|
||||
if ( !$this->request['mid'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 );
|
||||
}
|
||||
|
||||
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
|
||||
|
||||
$this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) );
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
@@ -284,24 +263,22 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'admin_logs' => 'm' ),
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( 5 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.member_id, mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
'from' => array( 'admin_logs' => 'm' ),
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( 5 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
|
||||
$row['color'] = $this->colours[ $row['act'] ];
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
@@ -310,34 +287,34 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, count(member_id) as act_count',
|
||||
'from' => 'admin_logs',
|
||||
'group' => 'member_id',
|
||||
'order' => 'act_count DESC'
|
||||
) );
|
||||
|
||||
'select' => 'count(l.member_id) as act_count, l.member_id',
|
||||
'from' => array( 'admin_logs' => 'l' ),
|
||||
'group' => 'l.member_id',
|
||||
'order' => 'act_count DESC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=l.member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
$_members = array();
|
||||
$_store = array();
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['member_id'];
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id, members_display_name',
|
||||
'from' => 'members',
|
||||
'where' => 'member_id IN (' . implode( ',', $_members ) . ')',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
if( !$r['member_id'] )
|
||||
{
|
||||
$admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] );
|
||||
$r['member_id'] = 'zero';
|
||||
}
|
||||
|
||||
if( !$r['members_display_name'] )
|
||||
{
|
||||
$r['members_display_name'] = $this->lang->words['noname_availabl'];
|
||||
}
|
||||
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default logs section
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'logs' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'adminlogs';
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Email error logs
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -29,17 +29,15 @@ class admin_core_logs_emailerrorlogs extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -103,10 +101,9 @@ class admin_core_logs_emailerrorlogs extends ipsCommand
|
||||
/**
|
||||
* Remove email logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
protected function _remove()
|
||||
{
|
||||
if ( $this->request['type'] == 'all' )
|
||||
{
|
||||
@@ -147,10 +144,9 @@ class admin_core_logs_emailerrorlogs extends ipsCommand
|
||||
/**
|
||||
* List the current logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
protected function _listCurrent()
|
||||
{
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
@@ -163,8 +159,6 @@ class admin_core_logs_emailerrorlogs extends ipsCommand
|
||||
|
||||
if ( $this->request['type'] AND $this->request['type'] != "" )
|
||||
{
|
||||
$this->registry->output->html_help_title .= $this->lang->words['erlog_results'];
|
||||
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
@@ -245,12 +239,11 @@ class admin_core_logs_emailerrorlogs extends ipsCommand
|
||||
/**
|
||||
* View an individual email
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _viewEmail()
|
||||
protected function _viewEmail()
|
||||
{
|
||||
if ( $this->request['id'] == "" )
|
||||
if ( !$this->request['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
|
||||
}
|
||||
|
||||
@@ -1,428 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Email logs
|
||||
* 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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
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_core_logs_emaillogs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_emaillogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=emaillogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=emaillogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix up navigation bar
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->core_nav = array();
|
||||
$this->registry->output->ignoreCoreNav = true;
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] );
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools§ion=logsSplash', $this->lang->words['nav_logssplash'] );
|
||||
$this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=emaillogs', $this->lang->words['elog_emaillogs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
case 'viewemail':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_view' );
|
||||
$this->_viewEmail();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove email logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
{
|
||||
if ( $this->request['type'] == 'all' )
|
||||
{
|
||||
$this->DB->delete( 'email_logs' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ids = array();
|
||||
|
||||
foreach ( $this->request as $k => $v )
|
||||
{
|
||||
if ( preg_match( "/^id_(\d+)$/", $k, $match ) )
|
||||
{
|
||||
if ($this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_noneselected'], 11119 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'email_logs', "email_id IN (" . implode( ',', $ids ) . ")" );
|
||||
}
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['elog_removed'] );
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
{
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Check URL parameters
|
||||
//-----------------------------------------
|
||||
|
||||
$url_query = array();
|
||||
$db_query = array();
|
||||
|
||||
if ( $this->request['type'] AND $this->request['type'] != "" )
|
||||
{
|
||||
$this->registry->output->html_help_title .= $this->lang->words['elog_results'];
|
||||
|
||||
switch( $this->request['type'] )
|
||||
{
|
||||
case 'fromid':
|
||||
$url_query[] = 'type=fromid';
|
||||
$url_query[] = 'id=' . intval($this->request['id']);
|
||||
$db_query[] = 'email.from_member_id=' . intval($this->request['id']);
|
||||
break;
|
||||
|
||||
case 'toid':
|
||||
$url_query[] = 'type=toid';
|
||||
$url_query[] = 'id=' . intval($this->request['id']);
|
||||
$db_query[] = 'email.to_member_id=' . intval($this->request['id']);
|
||||
break;
|
||||
|
||||
case 'subject':
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11120 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "email.email_subject LIKE '%{$string}%'" : "email.email_subject='{$string}'";
|
||||
break;
|
||||
|
||||
case 'content':
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11121 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "email.email_content LIKE '%{$string}%'" : "email.email_content='{$string}'";
|
||||
break;
|
||||
|
||||
case 'email_from':
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11122 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "email.from_email_address LIKE '%{$string}%'" : "email.from_email_address='{$string}'";
|
||||
break;
|
||||
|
||||
case 'email_to':
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11123 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "email.to_email_address LIKE '%{$string}%'" : "email.to_email_address='{$string}'";
|
||||
break;
|
||||
|
||||
case 'name_from':
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11124 );
|
||||
}
|
||||
|
||||
if ( $this->request['match'] == 'loose' )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name LIKE '%{$string}%'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $this->DB->getTotalRows() )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_nomatches'], 111160 );
|
||||
}
|
||||
|
||||
$ids = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ids[] = $r['member_id'];
|
||||
}
|
||||
|
||||
$db_query[] = 'email.from_member_id IN(' . implode( ',', $ids ) . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name='{$string}'" ) );
|
||||
|
||||
if ( ! $r['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_nomatches'], 11125 );
|
||||
}
|
||||
|
||||
$db_query[] = 'email.from_member_id=' . $r['member_id'];
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
break;
|
||||
|
||||
case 'name_to':
|
||||
$string = urldecode($this->request['string']);
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_notsearched'], 11126 );
|
||||
}
|
||||
|
||||
if ( $this->request['match'] == 'loose' )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name LIKE '%{$string}%'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $this->DB->getTotalRows() )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_nomatches'], 11127 );
|
||||
}
|
||||
|
||||
$ids = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ids[] = $r['member_id'];
|
||||
}
|
||||
|
||||
$db_query[] = 'email.to_member_id IN(' . implode( ',', $ids ) . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name='{$string}'" ) );
|
||||
|
||||
if ( ! $r['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_nomatches'], 11128 );
|
||||
}
|
||||
|
||||
$db_query[] = 'email.to_member_id=' . $r['member_id'];
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->request['match'] )
|
||||
{
|
||||
$url_query[] = 'match=' . $this->request['match'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// LIST 'EM
|
||||
//-----------------------------------------
|
||||
|
||||
$dbe = "";
|
||||
$url = "";
|
||||
|
||||
if ( count($db_query) > 0 )
|
||||
{
|
||||
$dbe = implode(' AND ', $db_query );
|
||||
}
|
||||
|
||||
if ( count($url_query) > 0 )
|
||||
{
|
||||
$url = '&' . implode( '&', $url_query );
|
||||
}
|
||||
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'count(email.email_id) as cnt',
|
||||
'from' => 'email_logs email',
|
||||
'where' => $dbe ) );
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count['cnt'],
|
||||
'itemsPerPage' => 25,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url,
|
||||
)
|
||||
);
|
||||
|
||||
$this->DB->build( array( 'select' => 'email.*',
|
||||
'from' => array( 'email_logs' => 'email' ),
|
||||
'where' => $dbe,
|
||||
'order' => 'email.email_date DESC',
|
||||
'limit' => array( $start, 25 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.member_id, m.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=email.from_member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'mem.member_id as to_id, mem.members_display_name as to_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=email.to_member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['email_date'], 'SHORT' );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->emaillogsWrapper( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* View a single email
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _viewEmail()
|
||||
{
|
||||
if ( $this->request['id'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_log_404'], 11129 );
|
||||
}
|
||||
|
||||
$id = intval($this->request['id']);
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'email.*',
|
||||
'from' => array( 'email_logs' => 'email' ),
|
||||
'where' => 'email.email_id=' . $id,
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.member_id, m.members_display_name as name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=email.from_member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'mem.member_id as to_id, mem.members_display_name as to_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=email.to_member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
|
||||
if ( ! $row['email_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['elog_log_404'], 11130 );
|
||||
}
|
||||
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['email_date'], 'LONG' );
|
||||
|
||||
$this->registry->output->html .= $this->html->emaillogsEmail( $row );
|
||||
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Error logs
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -29,17 +29,15 @@ class admin_core_logs_errorlogs extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -98,10 +96,9 @@ class admin_core_logs_errorlogs extends ipsCommand
|
||||
/**
|
||||
* Remove email logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
protected function _remove()
|
||||
{
|
||||
if( $this->request['type'] == 'all' )
|
||||
{
|
||||
@@ -142,10 +139,9 @@ class admin_core_logs_errorlogs extends ipsCommand
|
||||
/**
|
||||
* List the current logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
protected function _listCurrent()
|
||||
{
|
||||
$start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0;
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<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>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* @file logsSplash.php Logs splash screen
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 8th Feb 2011
|
||||
* $LastChangedDate: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9483 $
|
||||
*/
|
||||
|
||||
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_core_logs_logsSplash
|
||||
* @brief Logs splash screen
|
||||
*
|
||||
*/
|
||||
class admin_core_logs_logsSplash extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object shortcut
|
||||
*
|
||||
* @var $html
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* String for the screen url bit
|
||||
*
|
||||
* @var $form_code
|
||||
*/
|
||||
public $form_code = '';
|
||||
|
||||
/**
|
||||
* String for the JS url bit
|
||||
*
|
||||
* @var $form_code_js
|
||||
*/
|
||||
public $form_code_js = '';
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Template */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_adminlogs' );
|
||||
|
||||
/* Load Language */
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) );
|
||||
|
||||
/* URL Bits */
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=splash';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=splash';
|
||||
|
||||
/* Get the splash screen */
|
||||
$this->registry->output->html .= $this->html->logSplashScreen();
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Mobile Notification logs
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -28,17 +28,15 @@ class admin_core_logs_mobilelogs extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -94,8 +92,7 @@ class admin_core_logs_mobilelogs extends ipsCommand
|
||||
/**
|
||||
* Remove log
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
@@ -136,8 +133,7 @@ class admin_core_logs_mobilelogs extends ipsCommand
|
||||
/**
|
||||
* List the current logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Moderator logs
|
||||
* Last Updated: $LastChangedDate: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6915 $
|
||||
* @version $Rev: 9495 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -29,7 +29,6 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
@@ -37,9 +36,8 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -102,8 +100,7 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
/**
|
||||
* View all logs for a given moderator
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _view()
|
||||
{
|
||||
@@ -111,7 +108,7 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
///----------------------------------------
|
||||
// No mid or search string?
|
||||
@@ -124,17 +121,17 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
|
||||
|
||||
///----------------------------------------
|
||||
// mid?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] )
|
||||
{
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view";
|
||||
$query = "{$this->form_code}&mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
@@ -156,6 +153,11 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// search string?
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
@@ -174,29 +176,27 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
$dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'";
|
||||
}
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) );
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=".urlencode($this->request['search_string']);
|
||||
$query = "{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']);
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'where' => $dbq,
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( $start, 20 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
array( 'select' => 'f.id as forum_id, f.name',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=m.forum_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'where' => $dbq,
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( $start, 20 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'mem.members_display_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=m.member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
array( 'select' => 'f.id as forum_id, f.name',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=m.forum_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'],
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
@@ -218,6 +218,16 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( !$row['member_id'] )
|
||||
{
|
||||
$row['member_id'] = 'zero';
|
||||
}
|
||||
|
||||
if( !$row['members_display_name'] )
|
||||
{
|
||||
$row['members_display_name'] = $this->lang->words['noname_availablm'];
|
||||
}
|
||||
|
||||
$row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' );
|
||||
$row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : ' ';
|
||||
$row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] );
|
||||
@@ -235,28 +245,28 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
/**
|
||||
* Remove logs by a moderator
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
if ( $this->request['mid'] == "" )
|
||||
if ( !$this->request['mid'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 );
|
||||
}
|
||||
|
||||
$this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid'];
|
||||
|
||||
$this->DB->delete( 'moderator_logs', "member_id=" . intval($this->request['mid']) );
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['mlog_removed'] . $this->request['mid'] );
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" );
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
@@ -298,36 +308,36 @@ class admin_core_logs_modlogs extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// All mods
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, count(member_id) as act_count',
|
||||
'from' => 'moderator_logs',
|
||||
'group' => 'member_id',
|
||||
'order' => 'act_count DESC'
|
||||
) );
|
||||
|
||||
'select' => 'count(l.member_id) as act_count, l.member_id',
|
||||
'from' => array( 'moderator_logs' => 'l' ),
|
||||
'group' => 'l.member_id',
|
||||
'order' => 'act_count DESC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=l.member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
$_members = array();
|
||||
$_store = array();
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['member_id'];
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id, members_display_name',
|
||||
'from' => 'members',
|
||||
'where' => 'member_id IN (' . implode( ',', $_members ) . ')',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
if( !$r['member_id'] )
|
||||
{
|
||||
$admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] );
|
||||
$r['member_id'] = 'zero';
|
||||
}
|
||||
|
||||
if( !$r['members_display_name'] )
|
||||
{
|
||||
$r['members_display_name'] = $this->lang->words['noname_availablm'];
|
||||
}
|
||||
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
Loaded 100 of 2641 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user