Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* API: Core
|
||||
* Last Updated: $Date: 2009-05-11 17:39:45 -0400 (Mon, 11 May 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4628 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
class apiCore
|
||||
|
||||
+211
-193
@@ -1,194 +1,212 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Blog API file
|
||||
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Gallery
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 3887 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'apiCore' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
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 */
|
||||
require_once( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php' );
|
||||
$this->registry->setClass( 'blogFunctions', new blogFunctions( $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();
|
||||
$extra = "";
|
||||
$allowguests = "";
|
||||
|
||||
/* Build permissions */
|
||||
$this->registry->blogFunctions->buildPerms();
|
||||
|
||||
/* Got permission to view blog entries? */
|
||||
if ( $this->memberData['g_blog_settings']['g_blog_allowview'] )
|
||||
{
|
||||
/* Private club? */
|
||||
if( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$allowguests .= " AND b.blog_allowguests = 1";
|
||||
}
|
||||
|
||||
if( ! $this->memberData['_blogmod']['moderate_can_view_private'] )
|
||||
{
|
||||
$extra = " AND ( ( ( b.blog_owner_only=1 AND b.member_id={$this->memberData['member_id']} ) OR b.blog_owner_only=0 ) AND ( b.blog_authorized_users LIKE '%,{$this->memberData['member_id']},%' OR b.blog_authorized_users IS NULL ) ) ";
|
||||
}
|
||||
|
||||
$qtype = $type == 'member' ? "b.member_id={$id}" : "b.blog_id={$id}";
|
||||
|
||||
$this->DB->build( array( 'select' => "e.*",
|
||||
'from' => array('blog_entries' => 'e'),
|
||||
'where' => "{$qtype} AND b.blog_type='local' AND e.entry_status='published'".$allowguests.$extra,
|
||||
'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) )
|
||||
{
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Forums topic view API file
|
||||
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-10-25 11:20:47 -0400 (Mon, 25 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 3887 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7036 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
@@ -22,6 +24,11 @@ if ( ! class_exists( 'apiCore' ) )
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiTopicView class
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
*/
|
||||
class apiTopicView extends apiCore
|
||||
{
|
||||
/**
|
||||
@@ -58,8 +65,8 @@ class apiTopicView extends apiCore
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$appClass = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,7 +193,7 @@ class apiTopicView extends apiCore
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN (" . implode( ",", $this->attach_pids ) . ")"
|
||||
) );
|
||||
|
||||
$this->DB->execute;
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $a = $this->DB->fetch() )
|
||||
{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Gallery API file
|
||||
* Last Updated: $Date: 2009-11-11 11:00:08 -0500 (Wed, 11 Nov 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage IP.Gallery
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5351 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
@@ -22,6 +23,10 @@ if ( ! class_exists( 'apiCore' ) )
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiGallery class
|
||||
* @package IP.Gallery
|
||||
*/
|
||||
class apiGallery extends apiCore
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,97 +1,99 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2009-08-20 18:20:40 -0400 (Thu, 20 Aug 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5035 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_member_form__core implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
$array = array();
|
||||
|
||||
if( $member['failed_login_count'] )
|
||||
{
|
||||
$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' => "Сбросить" );
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array() )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
return array( 'core' => array(), 'extendedProfile' => array() );
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2010-01-15 14:28:09 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5715 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_member_form__core implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
$array = array();
|
||||
|
||||
if( $member['failed_login_count'] )
|
||||
{
|
||||
$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'] );
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array(), $tabsUsed=5 )
|
||||
{
|
||||
return array( 'tabs' => '', 'content' => '', 'tabsUsed' => 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
return array( 'core' => array(), 'extendedProfile' => array() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,106 +1,108 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Core Sessions
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main loader class
|
||||
*/
|
||||
class publicSessions__core
|
||||
{
|
||||
/**
|
||||
* Return session variables for this application
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
public function getSessionVariables()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$array = array( 'location_1_type' => '',
|
||||
'location_1_id' => 0,
|
||||
'location_2_type' => '',
|
||||
'location_2_id' => 0 );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function parseOnlineEntries( $rows )
|
||||
{
|
||||
if( !is_array($rows) OR !count($rows) )
|
||||
{
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$final = array();
|
||||
|
||||
foreach( $rows as $row )
|
||||
{
|
||||
if( $row['current_appcomponent'] == 'core' )
|
||||
{
|
||||
if( $row['current_module'] == 'global' )
|
||||
{
|
||||
if( $row['current_section'] == 'login' )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_login'];
|
||||
}
|
||||
}
|
||||
else if( $row['current_module'] == 'search' )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_search'];
|
||||
}
|
||||
else if( $row['current_module'] == 'reports' )
|
||||
{
|
||||
$rcCache = ipsRegistry::cache()->getCache('report_cache');
|
||||
|
||||
if( is_array( $rcCache ) )
|
||||
{
|
||||
if( $rcCache['group_access'][ ipsRegistry::member()->getProperty('member_group_id') ] == true )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_reports'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$final[ $row['id'] ] = $row;
|
||||
}
|
||||
|
||||
return $final;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Core Sessions
|
||||
* Last Updated: $Date: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5732 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main loader class
|
||||
*/
|
||||
class publicSessions__core
|
||||
{
|
||||
/**
|
||||
* Return session variables for this application
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
public function getSessionVariables()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$array = array( 'location_1_type' => '',
|
||||
'location_1_id' => 0,
|
||||
'location_2_type' => '',
|
||||
'location_2_id' => 0 );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function parseOnlineEntries( $rows )
|
||||
{
|
||||
if( !is_array($rows) OR !count($rows) )
|
||||
{
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$final = array();
|
||||
|
||||
foreach( $rows as $row )
|
||||
{
|
||||
if( $row['current_appcomponent'] == 'core' )
|
||||
{
|
||||
if( $row['current_module'] == 'global' )
|
||||
{
|
||||
if( $row['current_section'] == 'login' )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_login'];
|
||||
}
|
||||
}
|
||||
else if( $row['current_module'] == 'search' )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_search'];
|
||||
}
|
||||
else if( $row['current_module'] == 'reports' )
|
||||
{
|
||||
$rcCache = ipsRegistry::cache()->getCache('report_cache');
|
||||
|
||||
if( is_array( $rcCache ) )
|
||||
{
|
||||
if( $rcCache['group_access'][ ipsRegistry::member()->getProperty('member_group_id') ] == true )
|
||||
{
|
||||
$row['where_line'] = ipsRegistry::getClass( 'class_localization' )->words['WHERE_reports'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$final[ $row['id'] ] = $row;
|
||||
}
|
||||
|
||||
return $final;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Core registered caches, redirect resets and bitwise settings
|
||||
* Last Updated: $Date: 2009-11-25 17:27:38 -0500 (Wed, 25 Nov 2009) $
|
||||
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5477 $
|
||||
* @version $Rev: 6882 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,26 +29,30 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*/
|
||||
$_LOAD = array();
|
||||
|
||||
if ( $_GET['module'] == 'search' )
|
||||
if( isset($_GET['module']) )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
}
|
||||
|
||||
if ( $_GET['module'] == 'reports' )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
}
|
||||
|
||||
if( $_GET['module'] == 'usercp' )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
if ( $_GET['module'] == 'search' )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['attachtypes'] = 1;
|
||||
}
|
||||
|
||||
if ( $_GET['module'] == 'reports' )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['bbcode'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
}
|
||||
|
||||
if( $_GET['module'] == 'usercp' )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
$_LOAD['emoticons'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* 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
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6980 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main loader class
|
||||
*/
|
||||
class dashboardNotifications__core
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $settings;
|
||||
public $lang;
|
||||
public $cache;
|
||||
public $caches;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->settings = ipsRegistry::fetchSettings();
|
||||
$this->lang = ipsRegistry::getClass('class_localization');
|
||||
$this->caches =& ipsRegistry::cache()->fetchCaches();
|
||||
$this->cache = ipsRegistry::cache();
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
/* INIT */
|
||||
$entries = array();
|
||||
|
||||
/* FURL cache OOD? */
|
||||
if ( file_exists( 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' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
|
||||
|
||||
if ( $_mtime > $mtime )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['furlcache_outofdate'], sprintf( $this->lang->words['furlcache_outofdate_desc'], $application['app_title'] ) . "<a href='" . $this->settings['base_url'] . "app=core&module=applications&section=applications&do=seoRebuild'>{$this->lang->words['rebuild_furl_cache']}</a>" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Minify on but /cache/tmp not writeable? */
|
||||
if ( isset( $this->settings['_use_minify'] ) AND $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 ( ! @file_exists( 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' );
|
||||
$versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
|
||||
|
||||
if( $versions['current'][0] != $versions['latest'][0] )
|
||||
{
|
||||
$this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] );
|
||||
|
||||
$entries[] = array( $this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning'] );
|
||||
}
|
||||
|
||||
/* PHP Version Check */
|
||||
if( PHP_VERSION < '5.1.0' )
|
||||
{
|
||||
$entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] );
|
||||
}
|
||||
|
||||
/* 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>" );
|
||||
}
|
||||
|
||||
/* 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>" );
|
||||
}
|
||||
|
||||
/* Make sure the profile directory is writable */
|
||||
if( ! is_dir( $this->settings['upload_dir'] . '/profile/' ) || ! is_writable( $this->settings['upload_dir'] . '/profile/' ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_profilephotoerr_title'], sprintf( $this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/' ) );
|
||||
}
|
||||
|
||||
/* Check for upgrade finish folder */
|
||||
if( is_dir( IPS_ROOT_PATH . 'upgradeFinish/' ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_upgradefinishfolder'], sprintf( $this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/' ) );
|
||||
}
|
||||
|
||||
/* Check to see if GD is intalled */
|
||||
if(! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg'] );
|
||||
}
|
||||
|
||||
/* Performance mode check */
|
||||
$perfMode = $this->cache->getCache('performanceCache');
|
||||
|
||||
if( is_array( $perfMode ) && count( $perfMode ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg'] );
|
||||
}
|
||||
|
||||
/* Suhosin check */
|
||||
if( extension_loaded( 'suhosin' ) )
|
||||
{
|
||||
$_postMaxVars = @ini_get('suhosin.post.max_vars');
|
||||
$_reqMaxVars = @ini_get('suhosin.request.max_vars');
|
||||
$_postMaxLen = @ini_get('suhosin.post.max_value_length');
|
||||
$_reqMaxLen = @ini_get('suhosin.request.max_value_length');
|
||||
|
||||
if( $_postMaxVars < 4096 )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue1'], $_postMaxVars ) );
|
||||
}
|
||||
|
||||
if( $_reqMaxVars < 4096 )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue2'], $_reqMaxVars ) );
|
||||
}
|
||||
|
||||
if( $_postMaxLen < 1000000 )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue3'], $_postMaxLen ) );
|
||||
}
|
||||
|
||||
if( $_reqMaxLen < 1000000 )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue4'], $_reqMaxLen ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* SQL error check */
|
||||
if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
{
|
||||
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
|
||||
|
||||
if ( $unix )
|
||||
{
|
||||
$mtime = gmdate( 'd-j-Y', $unix );
|
||||
$now = gmdate( 'd-j-Y', time() );
|
||||
|
||||
if ( $mtime == $now )
|
||||
{
|
||||
/* Display a message */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'],
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5732 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'],
|
||||
);
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.2
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6596 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* SEO templates
|
||||
*
|
||||
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
|
||||
*
|
||||
* OUT FORMAT REGEX:
|
||||
* First array element is a regex to run to see if we've a match for the URL
|
||||
* The second array element is the template to use the results of the parenthesis capture
|
||||
*
|
||||
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
|
||||
*
|
||||
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
|
||||
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
|
||||
*
|
||||
* IN FORMAT REGEX
|
||||
*
|
||||
* This allows the registry to piece back together a URL based on the template regex
|
||||
* So, for example: "/user/(\d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
|
||||
* of the parenthesis capture #1
|
||||
*/
|
||||
$_SEOTEMPLATES = array(
|
||||
|
||||
'section=register' => array( 'app' => 'core',
|
||||
'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' ) ) ) ),
|
||||
|
||||
'section=rss' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)$#i', 'rss/$4/' ),
|
||||
'in' => array( 'regex' => "#/rss/(\w+?)/$#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ) ) ) ),
|
||||
|
||||
'section=rss2' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)(&|&)id=(\w+?)$#i', 'rss/$4/$6-#{__title__}/' ),
|
||||
'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)-#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ), array( 'id', '$2' ) ) ) ),
|
||||
|
||||
# Changed section=rss2 id matching to use \w for more flexibility
|
||||
|
||||
);
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2009-03-04 15:08:31 +0000 (Wed, 04 Mar 2009) $
|
||||
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4136 $
|
||||
* @version $Rev: 6596 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,7 +49,7 @@ $_SEOTEMPLATES = array(
|
||||
'section=register' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=register(&|&|$)#i', 'register/$3' ),
|
||||
'in' => array( 'regex' => "#/register/?(.+?)?$#i",
|
||||
'in' => array( 'regex' => "#/register(/|$|\?)#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ),
|
||||
|
||||
'section=rss' => array( 'app' => 'core',
|
||||
@@ -58,10 +60,11 @@ $_SEOTEMPLATES = array(
|
||||
|
||||
'section=rss2' => array( 'app' => 'core',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)(&|&)id=(\d+?)$#i', 'rss/$4/$6-#{__title__}/' ),
|
||||
'in' => array( 'regex' => "#/rss/(\w+?)/(\d+?)-#i",
|
||||
'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)(&|&)id=(\w+?)$#i', 'rss/$4/$6-#{__title__}/' ),
|
||||
'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)-#i",
|
||||
'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ), array( 'id', '$2' ) ) ) ),
|
||||
|
||||
#http://81.98.113.31/invisionboard3/index.php?app=core&module=global§ion=rss&type=forums&id=1
|
||||
|
||||
# Changed section=rss2 id matching to use \w for more flexibility
|
||||
|
||||
);
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2010-10-25 10:10:56 -0400 (Mon, 25 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 7030 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 core_notifications
|
||||
{
|
||||
public function getConfiguration()
|
||||
{
|
||||
/**
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_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' => 'new_comment' , 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => false, 'icon' => 'notify_profilecomment' ),
|
||||
);
|
||||
return $_NOTIFY;
|
||||
}
|
||||
|
||||
public function report_center()
|
||||
{
|
||||
return $this->memberData['access_report_center'];
|
||||
}
|
||||
}
|
||||
+490
-497
@@ -1,498 +1,491 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Report Center :: Default plugin
|
||||
* Last Updated: $LastChangedDate: 2009-06-08 16:27:31 -0400 (Mon, 08 Jun 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4736 $
|
||||
*/
|
||||
|
||||
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 default_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
*
|
||||
* @access private
|
||||
* @var array Data specific to the plugin
|
||||
*/
|
||||
public $_extra;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make object
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function displayAdminForm( $plugin_data, &$html )
|
||||
{
|
||||
$req_input = '';
|
||||
$return = '';
|
||||
|
||||
if( is_array($plugin_data['required_input']) && count($plugin_data['required_input']) > 0 )
|
||||
{
|
||||
foreach( $plugin_data['required_input'] as $key => $value )
|
||||
{
|
||||
if( $req_input != '' )
|
||||
{
|
||||
$req_input .= "\r\n";
|
||||
}
|
||||
|
||||
$req_input .= $key . ' ' . $value;
|
||||
}
|
||||
}
|
||||
|
||||
$return .= $html->addRow( "Название секции",
|
||||
"Помогает определить модуль форума из которого была отправлена жалоба.",
|
||||
$this->registry->output->formInput('section_title', $plugin_data['section_title'])
|
||||
);
|
||||
|
||||
$return .= $html->addRow( "URL секции",
|
||||
"Ссылка на секцию из которой пришла жалоба.",
|
||||
$this->registry->output->formInput('section_url', $plugin_data['section_url'])
|
||||
);
|
||||
|
||||
$desc = <<<EOF
|
||||
Здесь вы можете определить формат заполннения полей при отправке жалобы.
|
||||
Каждое поле описывается на одной строке. В начале идет id поле,
|
||||
пробел, регульрное выражение для проверки значения. Если срабатывает регулярное выражение - отправителю жалобы показывается ошибка.<br /><br />Например:<br />
|
||||
<div style="border: 1px solid #999; padding: 3px; margin-top: 2px;">content_id [^0-9]<br />title [^A-Za-z0-9]</div>
|
||||
EOF;
|
||||
|
||||
$return .= $html->addRow( "Формат полей",
|
||||
$desc,
|
||||
$this->registry->output->formTextarea('required_input', $req_input, 50, 9)
|
||||
);
|
||||
|
||||
$return .= $html->addRow( "URL",
|
||||
"Сслыка на саму публикацию. Если не указан 'http://' будет подставлен базовый URL форума. Можно использовать данные из входных параметров: {input_id}",
|
||||
$this->registry->output->formInput('string_url', $plugin_data['string_url'])
|
||||
);
|
||||
|
||||
$return .= $html->addRow( "Название",
|
||||
"Название жалобы. Можно использовать данные из входных параметров: {input_id}. Можно использовать #PAGE_TITLE#",
|
||||
$this->registry->output->formInput('string_title', $plugin_data['string_title'])
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the plugin's form fields for saving
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data for save
|
||||
* @return string Error message
|
||||
*/
|
||||
public function processAdminForm( &$save_data_array )
|
||||
{
|
||||
if( ! $_POST['string_url'] )
|
||||
{
|
||||
return "Поле 'URL' должно быть заполнено";
|
||||
}
|
||||
|
||||
if( ! $_POST['string_title'] )
|
||||
{
|
||||
return "Поле 'Название' должно быть заполнено. Не можете придумать - используйте #PAGE_TITLE#";
|
||||
}
|
||||
|
||||
$req_in_a = array();
|
||||
|
||||
if( $_POST['required_input'] )
|
||||
{
|
||||
$req_i = explode( "<br />", $this->request['required_input'] );
|
||||
|
||||
foreach( $req_i as $line )
|
||||
{
|
||||
$line_inp = explode( ' ', $line, 2 );
|
||||
$req_in_a[ $line_inp[0] ] = $line_inp[1];
|
||||
}
|
||||
}
|
||||
|
||||
$save_data_array['required_input'] = $req_in_a;
|
||||
$save_data_array['string_url'] = str_replace("&", "&", $this->request['string_url']);
|
||||
$save_data_array['string_title'] = $this->request['string_title'];
|
||||
$save_data_array['section_title'] = $this->request['section_title'];
|
||||
$save_data_array['section_url'] = $this->request['section_url'];
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Update timestamp for report
|
||||
*
|
||||
* @access public
|
||||
* @param array New reports
|
||||
* @param array New members cache
|
||||
* @return boolean
|
||||
*/
|
||||
public function updateReportsTimestamp( $new_reports, &$new_members_cache )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report permissions
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of perms to check
|
||||
* @param array Permissions data
|
||||
* @param array group ids
|
||||
* @param string Special permissions
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReportPermissions( $check, $com_dat, $group_ids, &$to_return )
|
||||
{
|
||||
if( $this->_extra['report_bypass'] == 0 || $this->memberData['g_is_supmod'] == 1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the report form for this module
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @return string HTML form information
|
||||
*/
|
||||
public function reportForm( $com_dat )
|
||||
{
|
||||
$this->registry->output->setTitle( $this->lang->words['report_basic_title'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['report_basic_title'], '' );
|
||||
|
||||
$url = '';
|
||||
$title = '';
|
||||
$ex_form_data = array();
|
||||
|
||||
$this->processBasicForumData( $com_dat, $url, $title, $ex_form_data );
|
||||
|
||||
//-----------------------------------------
|
||||
// Title, URL Extra Data (Array)
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->registry->getClass('reportLibrary')->showReportForm( $title, $url, $ex_form_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the basic forum data
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @param string URL
|
||||
* @param string Title
|
||||
* @param array Extra form data
|
||||
* @return mixed Could show page error, or set $url, $title and $ex_form_data
|
||||
*/
|
||||
public function processBasicForumData( $com_dat, &$url, &$title, &$ex_form_data )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Process required input information
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_array($this->_extra['required_input']) && count($this->_extra['required_input']) > 0 )
|
||||
{
|
||||
foreach( $this->_extra['required_input'] as $key => $regex )
|
||||
{
|
||||
if( ! $this->request[ $key ] || ( trim($regex) != '' && preg_match( "/{$regex}/" , $this->request[ $key ] ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10157 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ex_form_data[ $key ] = $this->request[ $key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format URL String with inputs
|
||||
//-----------------------------------------
|
||||
|
||||
if( ! $this->_extra['string_url'] )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10158 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $this->_extra['string_url'];
|
||||
|
||||
while( preg_match("/\{([a-z0-9_\-]+)\}/i", $url, $matched) )
|
||||
{
|
||||
$url = str_replace( '{' . $matched[1] . '}', $ex_form_data[$matched[1]], $url);
|
||||
}
|
||||
}
|
||||
|
||||
if( strpos( $url, 'http://' ) !== 0 )
|
||||
{
|
||||
$url = $this->settings['base_url'] . $url;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format Title String with inputs, etc..
|
||||
//-----------------------------------------
|
||||
|
||||
if( ! $this->_extra['string_title'] )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10159 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $this->_extra['string_title'];
|
||||
|
||||
while( preg_match("/\{([a-z0-9_\-]+)\}/i", $title, $matched) )
|
||||
{
|
||||
$title = str_replace( '{' . $matched[1] . '}', $ex_form_data[$matched[1]], $title);
|
||||
}
|
||||
|
||||
if( strpos( $title, "#PAGE_TITLE#" ) !== false )
|
||||
{
|
||||
$page_title = $this->_getPageTitle( $url );
|
||||
$title = str_replace( "#PAGE_TITLE#", $page_title, $title );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->setTitle( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get section and link
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Section/link
|
||||
*/
|
||||
public function giveSectionLinkTitle( $report_row )
|
||||
{
|
||||
return array(
|
||||
'title' => $this->_extra['section_title'],
|
||||
'url' => $this->_extra['section_url'],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a report and save the data appropriate
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Data from saving the report
|
||||
*/
|
||||
public function processReport( $com_dat )
|
||||
{
|
||||
$this->processBasicForumData( $com_dat, $url, $title, $ex_form_data );
|
||||
|
||||
$return_data = array();
|
||||
$a_url = str_replace( "&", "&", $url );
|
||||
$uid = md5( $url . '_' . $com_dat['com_id'] );
|
||||
|
||||
$status = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'status, is_new, is_complete',
|
||||
'from' => 'rc_status',
|
||||
'where' => "is_new=1 OR is_complete=1",
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( $row['is_new'] == 1 )
|
||||
{
|
||||
$status['new'] = $row['status'];
|
||||
}
|
||||
elseif( $row['is_complete'] == 1 )
|
||||
{
|
||||
$status['complete'] = $row['status'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'id', 'from' => 'rc_reports_index', 'where' => "uid='{$uid}'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if( $this->DB->getTotalRows() == 0 )
|
||||
{
|
||||
$built_report_main = array(
|
||||
'uid' => $uid,
|
||||
'title' => $title,
|
||||
'status' => $status['new'],
|
||||
'url' => $a_url,
|
||||
'rc_class' => $com_dat['com_id'],
|
||||
'updated_by' => $this->memberData['member_id'],
|
||||
'date_updated' => time(),
|
||||
'date_created' => time(),
|
||||
);
|
||||
|
||||
$this->DB->insert( 'rc_reports_index', $built_report_main );
|
||||
$rid = $this->DB->getInsertId();
|
||||
}
|
||||
else
|
||||
{
|
||||
$the_report = $this->DB->fetch();
|
||||
$rid = $the_report['id'];
|
||||
|
||||
$this->DB->update( 'rc_reports_index', array( 'date_updated' => time(), 'status' => $status['new'] ), "id='{$rid}'" );
|
||||
}
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'reports';
|
||||
|
||||
$build_report = array(
|
||||
'rid' => $rid,
|
||||
'report' => IPSText::getTextClass('bbcode')->preDbParse( $this->request['message'] ),
|
||||
'report_by' => $this->memberData['member_id'],
|
||||
'date_reported' => time(),
|
||||
);
|
||||
|
||||
$this->DB->insert( 'rc_reports', $build_report );
|
||||
|
||||
$reports = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'rc_reports', 'where' => "rid='{$rid}'" ) );
|
||||
|
||||
$this->DB->update( 'rc_reports_index', array( 'num_reports' => $reports['total'] ), "id='{$rid}'" );
|
||||
|
||||
$return_data['REDIRECT_URL'] = $a_url;
|
||||
$return_data['REPORT_INDEX'] = $rid;
|
||||
$return_data['SAVED_URL'] = $url;
|
||||
$return_data['REPORT'] = $build_report['report'];
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_sending'], $this->settings['base_url'] . $report_data['REDIRECT_URL'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an HTML page and grabs its title
|
||||
*
|
||||
* @access private
|
||||
* @param string Web URL
|
||||
* @return string
|
||||
*/
|
||||
private function _getPageTitle( $URL )
|
||||
{
|
||||
$html_code = file_get_contents( $URL );
|
||||
|
||||
# I just hope the page is html...
|
||||
if( preg_match("/\<title\>(.+?)\<\/title\>/i", $html_code, $match ) )
|
||||
{
|
||||
return htmlentities( $match[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->lang->words['report_page_title_unknown'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getNotificationList( $group_ids, $report_data )
|
||||
{
|
||||
$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',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
if( $this->DB->getTotalRows() > 0 )
|
||||
{
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( $row['by_pm'] == 1 )
|
||||
{
|
||||
$notify['PM'][] = $row;
|
||||
}
|
||||
if( $row['by_email'] == 1 )
|
||||
{
|
||||
$notify['EMAIL'][] = $row;
|
||||
}
|
||||
|
||||
$notify['RSS'][] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
return $notify;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Report Center :: Default plugin
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class default_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
*
|
||||
* @access private
|
||||
* @var array Data specific to the plugin
|
||||
*/
|
||||
public $_extra;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make object
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function displayAdminForm( $plugin_data, &$html )
|
||||
{
|
||||
$req_input = '';
|
||||
$return = '';
|
||||
|
||||
if( is_array($plugin_data['required_input']) && count($plugin_data['required_input']) > 0 )
|
||||
{
|
||||
foreach( $plugin_data['required_input'] as $key => $value )
|
||||
{
|
||||
if( $req_input != '' )
|
||||
{
|
||||
$req_input .= "\r\n";
|
||||
}
|
||||
|
||||
$req_input .= $key . ' ' . $value;
|
||||
}
|
||||
}
|
||||
|
||||
$return .= $html->addRow( "Section Title",
|
||||
"This helps you distinguish generally what part of your site a report came from.",
|
||||
$this->registry->output->formInput('section_title', $plugin_data['section_title'])
|
||||
);
|
||||
|
||||
$return .= $html->addRow( "Section URL",
|
||||
"This helps you distinguish generally what part of your site a report came from.",
|
||||
$this->registry->output->formInput('section_url', $plugin_data['section_url'])
|
||||
);
|
||||
|
||||
$desc = <<<EOF
|
||||
Here you can specify what inputs are required in order for a report to be made.
|
||||
As you can see by the example each input is broken up by line. Each line contains an input id,
|
||||
a single space, and then a regex pattern. If the regex pattern is matched an error is displayed.<br /><br />Example:<br />
|
||||
<div style="border: 1px solid #999; padding: 3px; margin-top: 2px;">content_id [^0-9]<br />title [^A-Za-z0-9]</div>
|
||||
EOF;
|
||||
|
||||
$return .= $html->addRow( "Required Input",
|
||||
$desc,
|
||||
$this->registry->output->formTextarea('required_input', $req_input, 50, 9)
|
||||
);
|
||||
|
||||
$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'])
|
||||
);
|
||||
|
||||
$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'])
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the plugin's form fields for saving
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data for save
|
||||
* @return string Error message
|
||||
*/
|
||||
public function processAdminForm( &$save_data_array )
|
||||
{
|
||||
if( ! $_POST['string_url'] )
|
||||
{
|
||||
return "You need to at least have the 'URL String'";
|
||||
}
|
||||
|
||||
if( ! $_POST['string_title'] )
|
||||
{
|
||||
return "You need to have a 'Title String'. If not sure, just use #PAGE_TITLE#";
|
||||
}
|
||||
|
||||
$req_in_a = array();
|
||||
|
||||
if( $_POST['required_input'] )
|
||||
{
|
||||
$req_i = explode( "<br />", $this->request['required_input'] );
|
||||
|
||||
foreach( $req_i as $line )
|
||||
{
|
||||
$line_inp = explode( ' ', $line, 2 );
|
||||
$req_in_a[ $line_inp[0] ] = $line_inp[1];
|
||||
}
|
||||
}
|
||||
|
||||
$save_data_array['required_input'] = $req_in_a;
|
||||
$save_data_array['string_url'] = str_replace("&", "&", $this->request['string_url']);
|
||||
$save_data_array['string_title'] = $this->request['string_title'];
|
||||
$save_data_array['section_title'] = $this->request['section_title'];
|
||||
$save_data_array['section_url'] = $this->request['section_url'];
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Update timestamp for report
|
||||
*
|
||||
* @access public
|
||||
* @param array New reports
|
||||
* @param array New members cache
|
||||
* @return boolean
|
||||
*/
|
||||
public function updateReportsTimestamp( $new_reports, &$new_members_cache )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report permissions
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of perms to check
|
||||
* @param array Permissions data
|
||||
* @param array group ids
|
||||
* @param string Special permissions
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReportPermissions( $check, $com_dat, $group_ids, &$to_return )
|
||||
{
|
||||
if( $this->_extra['report_bypass'] == 0 || $this->memberData['g_is_supmod'] == 1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the report form for this module
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @return string HTML form information
|
||||
*/
|
||||
public function reportForm( $com_dat )
|
||||
{
|
||||
$this->registry->output->setTitle( $this->lang->words['report_basic_title'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['report_basic_title'], '' );
|
||||
|
||||
$url = '';
|
||||
$title = '';
|
||||
$ex_form_data = array();
|
||||
|
||||
$this->processBasicForumData( $com_dat, $url, $title, $ex_form_data );
|
||||
|
||||
//-----------------------------------------
|
||||
// Title, URL Extra Data (Array)
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->registry->getClass('reportLibrary')->showReportForm( $title, $url, $ex_form_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the basic forum data
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @param string URL
|
||||
* @param string Title
|
||||
* @param array Extra form data
|
||||
* @return mixed Could show page error, or set $url, $title and $ex_form_data
|
||||
*/
|
||||
public function processBasicForumData( $com_dat, &$url, &$title, &$ex_form_data )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Process required input information
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_array($this->_extra['required_input']) && count($this->_extra['required_input']) > 0 )
|
||||
{
|
||||
foreach( $this->_extra['required_input'] as $key => $regex )
|
||||
{
|
||||
if( ! $this->request[ $key ] || ( trim($regex) != '' && preg_match( "/{$regex}/" , $this->request[ $key ] ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10157 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ex_form_data[ $key ] = $this->request[ $key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format URL String with inputs
|
||||
//-----------------------------------------
|
||||
|
||||
if( ! $this->_extra['string_url'] )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10158 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = $this->_extra['string_url'];
|
||||
|
||||
while( preg_match("/\{([a-z0-9_\-]+)\}/i", $url, $matched) )
|
||||
{
|
||||
$url = str_replace( '{' . $matched[1] . '}', $ex_form_data[$matched[1]], $url);
|
||||
}
|
||||
}
|
||||
|
||||
if( strpos( $url, 'http://' ) !== 0 )
|
||||
{
|
||||
$url = $this->settings['base_url'] . $url;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format Title String with inputs, etc..
|
||||
//-----------------------------------------
|
||||
|
||||
if( ! $this->_extra['string_title'] )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_input_not_match', 10159 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $this->_extra['string_title'];
|
||||
|
||||
while( preg_match("/\{([a-z0-9_\-]+)\}/i", $title, $matched) )
|
||||
{
|
||||
$title = str_replace( '{' . $matched[1] . '}', $ex_form_data[$matched[1]], $title);
|
||||
}
|
||||
|
||||
if( strpos( $title, "#PAGE_TITLE#" ) !== false )
|
||||
{
|
||||
$page_title = $this->_getPageTitle( $url );
|
||||
$title = str_replace( "#PAGE_TITLE#", $page_title, $title );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->setTitle( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get section and link
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Section/link
|
||||
*/
|
||||
public function giveSectionLinkTitle( $report_row )
|
||||
{
|
||||
return array(
|
||||
'title' => $this->_extra['section_title'],
|
||||
'url' => $this->_extra['section_url'],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a report and save the data appropriate
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Data from saving the report
|
||||
*/
|
||||
public function processReport( $com_dat )
|
||||
{
|
||||
$this->processBasicForumData( $com_dat, $url, $title, $ex_form_data );
|
||||
|
||||
$return_data = array();
|
||||
$a_url = str_replace( "&", "&", $url );
|
||||
$uid = md5( $url . '_' . $com_dat['com_id'] );
|
||||
|
||||
$status = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'status, is_new, is_complete',
|
||||
'from' => 'rc_status',
|
||||
'where' => "is_new=1 OR is_complete=1",
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( $row['is_new'] == 1 )
|
||||
{
|
||||
$status['new'] = $row['status'];
|
||||
}
|
||||
elseif( $row['is_complete'] == 1 )
|
||||
{
|
||||
$status['complete'] = $row['status'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'id', 'from' => 'rc_reports_index', 'where' => "uid='{$uid}'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if( $this->DB->getTotalRows() == 0 )
|
||||
{
|
||||
$built_report_main = array(
|
||||
'uid' => $uid,
|
||||
'title' => $title,
|
||||
'status' => $status['new'],
|
||||
'url' => $a_url,
|
||||
'rc_class' => $com_dat['com_id'],
|
||||
'updated_by' => $this->memberData['member_id'],
|
||||
'date_updated' => time(),
|
||||
'date_created' => time(),
|
||||
);
|
||||
|
||||
$this->DB->insert( 'rc_reports_index', $built_report_main );
|
||||
$rid = $this->DB->getInsertId();
|
||||
}
|
||||
else
|
||||
{
|
||||
$the_report = $this->DB->fetch();
|
||||
$rid = $the_report['id'];
|
||||
|
||||
$this->DB->update( 'rc_reports_index', array( 'date_updated' => time(), 'status' => $status['new'] ), "id='{$rid}'" );
|
||||
}
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'reports';
|
||||
|
||||
$build_report = array(
|
||||
'rid' => $rid,
|
||||
'report' => IPSText::getTextClass('bbcode')->preDbParse( $this->request['message'] ),
|
||||
'report_by' => $this->memberData['member_id'],
|
||||
'date_reported' => time(),
|
||||
);
|
||||
|
||||
$this->DB->insert( 'rc_reports', $build_report );
|
||||
|
||||
$reports = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'rc_reports', 'where' => "rid='{$rid}'" ) );
|
||||
|
||||
$this->DB->update( 'rc_reports_index', array( 'num_reports' => $reports['total'] ), "id='{$rid}'" );
|
||||
|
||||
$return_data['REDIRECT_URL'] = $a_url;
|
||||
$return_data['REPORT_INDEX'] = $rid;
|
||||
$return_data['SAVED_URL'] = $url;
|
||||
$return_data['REPORT'] = $build_report['report'];
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_sending'], $this->settings['base_url'] . $report_data['REDIRECT_URL'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an HTML page and grabs its title
|
||||
*
|
||||
* @access private
|
||||
* @param string Web URL
|
||||
* @return string
|
||||
*/
|
||||
private function _getPageTitle( $URL )
|
||||
{
|
||||
$html_code = file_get_contents( $URL );
|
||||
|
||||
# I just hope the page is html...
|
||||
if( preg_match("/\<title\>(.+?)\<\/title\>/i", $html_code, $match ) )
|
||||
{
|
||||
return htmlentities( $match[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->lang->words['report_page_title_unknown'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getNotificationList( $group_ids, $report_data )
|
||||
{
|
||||
$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',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
if( $this->DB->getTotalRows() > 0 )
|
||||
{
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$notify[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
return $notify;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,119 +1,118 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* RSS output plugin :: report center
|
||||
* Last Updated: $Date: 2009-03-12 13:47:14 -0400 (Thu, 12 Mar 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 4206 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class rss_output_core
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @access private
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
private $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// As this is member specific, hardcoded
|
||||
// into output library
|
||||
//-----------------------------------------
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @access public
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$secure_key = IPSText::md5Clean( ipsRegistry::$request['rss_key'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
|
||||
if( $secure_key and $member_id )
|
||||
{
|
||||
if( $member_id == ipsRegistry::member()->getProperty('member_id') )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'rss_cache',
|
||||
'from' => 'rc_modpref',
|
||||
'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'" ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_cache'] )
|
||||
{
|
||||
return $rss_data['rss_cache'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Create a dummy one
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' );
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classRss.php' );
|
||||
$rss = new classRss();
|
||||
$channel_id = $rss->createNewChannel( array( 'title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'],
|
||||
'link' => ipsRegistry::$settings['board_url'],
|
||||
'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'],
|
||||
'pubDate' => $rss->formatDate( time() )
|
||||
) );
|
||||
$rss->createRssDocument();
|
||||
|
||||
return $rss->rss_document;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @access public
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return time() + 3600;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* RSS output plugin :: report center
|
||||
* Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 6980 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class rss_output_core
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
private $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// As this is member specific, hardcoded
|
||||
// into output library
|
||||
//-----------------------------------------
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$secure_key = IPSText::md5Clean( ipsRegistry::$request['rss_key'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
|
||||
if( $secure_key and $member_id )
|
||||
{
|
||||
if( $member_id == ipsRegistry::member()->getProperty('member_id') )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'rss_cache',
|
||||
'from' => 'rc_modpref',
|
||||
'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'"
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_cache'] )
|
||||
{
|
||||
return $rss_data['rss_cache'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Create a dummy one
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_reports' ), 'core' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classRss.php', 'classRss' );
|
||||
$rss = new $classToLoad();
|
||||
|
||||
$channel_id = $rss->createNewChannel( array( 'title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'],
|
||||
'link' => ipsRegistry::$settings['board_url'],
|
||||
'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'],
|
||||
'pubDate' => $rss->formatDate( time() )
|
||||
) );
|
||||
$rss->createRssDocument();
|
||||
|
||||
return $rss->rss_document;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return time() + 3600;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Config file
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 0;
|
||||
|
||||
/* Can fetch active content with this app */
|
||||
$CONFIG['can_activeContent'] = 0;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 0;
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Basic Forum Search
|
||||
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5861 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class search_engine_core extends search_engine
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
parent::__construct( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a search.
|
||||
* Returns an array of a total count (total number of matches)
|
||||
* and an array of IDs ( 0 => 1203, 1 => 928, 2 => 2938 ).. matching the required number based on pagination. The ids returned would be based on the filters and type of search
|
||||
*
|
||||
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
|
||||
*
|
||||
* @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';
|
||||
}
|
||||
|
||||
/* Sorting */
|
||||
switch( $sort_by )
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = ( $content_title_only ) ? 'id' : 'id';
|
||||
$sortType = 'numerical';
|
||||
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' ) ) ) );
|
||||
|
||||
|
||||
|
||||
/* Fetch data */
|
||||
$this->DB->build( array( 'select' => 'h.*',
|
||||
'from' => array( 'faq' => 'h' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'group' => $group_by,
|
||||
'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 */
|
||||
while ( $_row = $this->DB->fetch() )
|
||||
{
|
||||
$rows[ $got ] = $_row;
|
||||
|
||||
$got++;
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
return array( 'count' => $count['total_results'], 'resultSet' => $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
/* INI */
|
||||
$where_clause = array();
|
||||
|
||||
if( $search_term )
|
||||
{
|
||||
if( $content_title_only )
|
||||
{
|
||||
$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}%')";
|
||||
}
|
||||
}
|
||||
|
||||
/* Add in AND where conditions */
|
||||
if( isset( $this->whereConditions['AND'] ) && count( $this->whereConditions['AND'] ) )
|
||||
{
|
||||
$where_clause = array_merge( $where_clause, $this->whereConditions['AND'] );
|
||||
}
|
||||
|
||||
/* ADD in OR where conditions */
|
||||
if( isset( $this->whereConditions['OR'] ) && count( $this->whereConditions['OR'] ) )
|
||||
{
|
||||
$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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap standard columns (Apps can override )
|
||||
*
|
||||
* @access public
|
||||
* @param string $column sql table column for this condition
|
||||
* @return string column
|
||||
* @return void
|
||||
*/
|
||||
public function remapColumn( $column )
|
||||
{
|
||||
if ( $column == 'member_id' )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return $column;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class search_form_core
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
{
|
||||
$array = array( 'date' => $this->lang->words['s_search_type_0'],
|
||||
'title' => $this->lang->words['forum_sort_title'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Formats forum search results
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class search_format_core extends search_format
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
parent::__construct( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse search results
|
||||
*
|
||||
* @access private
|
||||
* @param array $r Search result
|
||||
* @return array $html Blocks of HTML
|
||||
*/
|
||||
public function parseAndFetchHtmlBlocks( $rows )
|
||||
{
|
||||
return parent::parseAndFetchHtmlBlocks( $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$rows = array();
|
||||
|
||||
foreach( $ids as $i => $d )
|
||||
{
|
||||
$rows[ $i ] = $this->genericizeResults( $d );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reassigns fields in a generic way for results output
|
||||
*
|
||||
* @param array $r
|
||||
* @return array
|
||||
**/
|
||||
public function genericizeResults( $r )
|
||||
{
|
||||
$r['app'] = 'core';
|
||||
$r['content'] = $r['title'];
|
||||
$r['content_title'] = $r['description'];
|
||||
$r['updated'] = 0;
|
||||
$r['type_2'] = 'help';
|
||||
$r['type_id_2'] = $r['id'];
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Formats help file search results
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4948 $
|
||||
**/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class coreSearchDisplay implements iSearchDisplay
|
||||
{
|
||||
/**
|
||||
* The search plugin for this app
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $search_plugin;
|
||||
|
||||
/**
|
||||
* Formats the member search result for display
|
||||
*
|
||||
* @access public
|
||||
* @param array $search_row Array of data from search_index
|
||||
* @return string Formatted content, ready for display
|
||||
**/
|
||||
public function formatContent( $search_row )
|
||||
{
|
||||
return ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $search_row, $this->search_plugin->onlyTitles );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retuns the html for displaying the member filter on the advanced search page
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
**/
|
||||
public function getFilterHTML()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies the SQL query
|
||||
*
|
||||
* @access public
|
||||
* @param array
|
||||
* @return array
|
||||
**/
|
||||
public function buildFilterSQL( $data )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
@@ -1,387 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Basic Help Files Search
|
||||
* Last Updated: $Date: 2009-01-09 15:37:32 -0500 (Fri, 09 Jan 2009) $
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 3627 $
|
||||
*/
|
||||
|
||||
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 searchCorePlugin implements iSearchIndexPlugin
|
||||
{
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $DB;
|
||||
|
||||
/**
|
||||
* Date range restriction start
|
||||
*
|
||||
* @access private
|
||||
* @var integer
|
||||
*/
|
||||
private $search_begin_timestamp = 0;
|
||||
|
||||
/**
|
||||
* Date range restriction end
|
||||
*
|
||||
* @access private
|
||||
* @var integer
|
||||
*/
|
||||
private $search_end_timestamp = 0;
|
||||
|
||||
/**
|
||||
* Array of conditions for this search
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $whereConditions = array();
|
||||
|
||||
/**
|
||||
* Remoe self from search results
|
||||
*
|
||||
* @access public
|
||||
* @var boolean
|
||||
*/
|
||||
public $removeSelf = false;
|
||||
|
||||
/**
|
||||
* Only display title
|
||||
*
|
||||
* @access public
|
||||
* @var boolean
|
||||
*/
|
||||
public $onlyTitles = false;
|
||||
|
||||
/**
|
||||
* Setup registry objects
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry $registry
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->DB = $registry->DB();
|
||||
$this->member = $registry->member();
|
||||
$this->memberData =& $registry->member()->fetchMemberData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs search and returns an array of results
|
||||
*
|
||||
* @access public
|
||||
* @param string $search_term
|
||||
* @param array $limit_clause The erray should be array( begin, end )
|
||||
* @param string $sort_by Column to sort by
|
||||
* @param string $group_by Column to group by
|
||||
* @param bool $content_title_only Only search title records
|
||||
* @return array
|
||||
*/
|
||||
public function getSearchResults( $search_term, $limit_clause, $sort_by, $group_by='', $content_title_only=false, $sort_order='' )
|
||||
{
|
||||
/* User prefs */
|
||||
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
|
||||
|
||||
/* Group By */
|
||||
if( $group_by )
|
||||
{
|
||||
$group_by = 'h.' . $group_by;
|
||||
}
|
||||
|
||||
/* Do the search */
|
||||
$this->DB->build( array(
|
||||
'select' => "h.*",
|
||||
'from' => array( 'faq' => 'h' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'limit' => $limit_clause,
|
||||
'order' => 'h.id ' . $order_dir,
|
||||
'group' => $group_by,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'permission_index' => 'i' ),
|
||||
'where' => "i.perm_type='help' AND i.perm_type_id=1",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Build result array */
|
||||
$rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Reassign stuff to match the search_index */
|
||||
$rows[] = $this->formatFieldsForIndex( $r );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs live search and returns an array of results
|
||||
* NOT AVAILABLE IN BASIC SEARCH
|
||||
*
|
||||
* @access public
|
||||
* @param string $search_term
|
||||
* @return array
|
||||
*/
|
||||
public function getLiveSearchResults( $search_term )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number of results the search will return
|
||||
*
|
||||
* @access public
|
||||
* @param string $search_term Search term
|
||||
* @param string $group_by Column to group by
|
||||
* @param bool $content_title_only Only search title records
|
||||
* @return integer
|
||||
*/
|
||||
public function getSearchCount( $search_term, $group_by='', $content_title_only=false )
|
||||
{
|
||||
/* Group By */
|
||||
if( $group_by )
|
||||
{
|
||||
$group_by = 'h.' . $group_by;
|
||||
}
|
||||
|
||||
/* Query the count */
|
||||
$this->DB->build( 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',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
$search = $this->DB->fetch();
|
||||
|
||||
/* Return the count */
|
||||
return $search['total_results'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Restrict the date range that the search is performed on
|
||||
*
|
||||
* @access public
|
||||
* @param int $begin Start timestamp
|
||||
* @param int [$end] End timestamp
|
||||
* @return void
|
||||
*/
|
||||
public function setDateRange( $begin, $end=0 )
|
||||
{
|
||||
$this->search_begin_timestamp = $begin;
|
||||
$this->search_end_timestamp = $end;
|
||||
}
|
||||
|
||||
/**
|
||||
* mySQL function for adding special search conditions
|
||||
*
|
||||
* @access public
|
||||
* @param string $column sql table column for this condition
|
||||
* @param string $operator Operation to perform for this condition, ex: =, <>, IN, NOT IN
|
||||
* @param mixed $value Value to check with
|
||||
* @param string $comp Comparison type
|
||||
* @return void
|
||||
*/
|
||||
public function setCondition( $column, $operator, $value, $comp='AND' )
|
||||
{
|
||||
/* Remap */
|
||||
return;
|
||||
|
||||
/* Build the condition based on operator */
|
||||
switch( strtoupper( $operator ) )
|
||||
{
|
||||
case 'IN':
|
||||
case 'NOT IN':
|
||||
$this->whereConditions[$comp][] = "h.{$column} {$operator} ( {$value} )";
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->whereConditions[$comp][] = "h.{$column} {$operator} {$value}";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to specify multiple conditions that are chained together
|
||||
*
|
||||
* @access public
|
||||
* @param array $conditions Array of conditions, each element has 3 keys: column, operator, value, see the setCondition function for information on each
|
||||
* @param string $inner_comp Comparison operator to use inside the chain
|
||||
* @param string $outer_comp Comparison operator to use outside the chain
|
||||
* @return void
|
||||
*/
|
||||
public function setMultiConditions( $conditions, $inner_comp='OR', $outer_comp='AND' )
|
||||
{
|
||||
return;
|
||||
|
||||
/* Loop through the conditions to build the statement */
|
||||
$_temp = array();
|
||||
|
||||
foreach( $conditions as $r )
|
||||
{
|
||||
switch( strtoupper( $r['operator'] ) )
|
||||
{
|
||||
case 'IN':
|
||||
case 'NOT IN':
|
||||
$_temp[] = "h.{$r['column']} {$r['operator']} ( {$r['value']} )";
|
||||
break;
|
||||
|
||||
default:
|
||||
$_temp[] = "h.{$r['column']} {$r['operator']} {$r['value']}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->whereConditions[$outer_comp][] = '( ' . implode( $_temp, ' ' . $inner_comp . ' ' ) . ' ) ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set search conditions for "View unread content"
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setUnreadConditions()
|
||||
{
|
||||
$this->removeSelf = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
/* INI */
|
||||
$where_clause = array();
|
||||
|
||||
if( $search_term )
|
||||
{
|
||||
if( $content_title_only )
|
||||
{
|
||||
$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}%'";
|
||||
}
|
||||
}
|
||||
|
||||
/* Add in AND where conditions */
|
||||
if( isset( $this->whereConditions['AND'] ) && count( $this->whereConditions['AND'] ) )
|
||||
{
|
||||
$where_clause = array_merge( $where_clause, $this->whereConditions['AND'] );
|
||||
}
|
||||
|
||||
/* ADD in OR where conditions */
|
||||
if( isset( $this->whereConditions['OR'] ) && count( $this->whereConditions['OR'] ) )
|
||||
{
|
||||
$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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Reassigns fields in a way the index exepcts
|
||||
*
|
||||
* @param array $r
|
||||
* @return array
|
||||
**/
|
||||
public function formatFieldsForIndex( $r )
|
||||
{
|
||||
$r['app'] = 'core';
|
||||
$r['content'] = $r['title'];
|
||||
$r['content_title'] = $r['description'];
|
||||
$r['updated'] = time();
|
||||
$r['type_2'] = 'help';
|
||||
$r['type_id_2'] = $r['id'];
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function grabs the actual results for display
|
||||
*
|
||||
* @param array $ids
|
||||
* @return query result
|
||||
**/
|
||||
public function getResultsForSphinx( $ids )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => "h.*",
|
||||
'from' => array( 'faq' => 'h' ),
|
||||
'where' => 'h.id IN( ' . implode( ',', $ids ) . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'i.*',
|
||||
'from' => array( 'permission_index' => 'i' ),
|
||||
'where' => "i.perm_type='help' AND i.perm_type_id=1",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
return $this->DB->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the field this search index uses for dates.... >_<
|
||||
*
|
||||
* @return string
|
||||
**/
|
||||
public function getDateField()
|
||||
{
|
||||
return 'search_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets field names for other conditions
|
||||
*
|
||||
* @param string Column
|
||||
* @return string
|
||||
**/
|
||||
public function getConditionField( $column )
|
||||
{
|
||||
return $column;
|
||||
}
|
||||
}
|
||||
@@ -1,86 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4948 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
$appSphinxTemplate = <<<EOF
|
||||
|
||||
############################### --- CORE --- ################################
|
||||
|
||||
source core_search_main : 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() )
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
source core_search_delta : core_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
|
||||
}
|
||||
|
||||
index core_search_main
|
||||
{
|
||||
source = core_search_main
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
}
|
||||
|
||||
index core_search_delta : core_search_main
|
||||
{
|
||||
source = core_search_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_delta
|
||||
}
|
||||
|
||||
|
||||
EOF;
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Sphinx template 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.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
$appSphinxTemplate = <<<EOF
|
||||
|
||||
############################### --- CORE --- ################################
|
||||
|
||||
source core_search_main : 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() )
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
source core_search_delta : core_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
|
||||
}
|
||||
|
||||
index core_search_main
|
||||
{
|
||||
source = core_search_main
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
}
|
||||
|
||||
index core_search_delta : core_search_main
|
||||
{
|
||||
source = core_search_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/core_search_delta
|
||||
}
|
||||
|
||||
|
||||
EOF;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,621 @@
|
||||
/**
|
||||
* INVISION POWER BOARD v3
|
||||
*
|
||||
* Topics View Javascript File
|
||||
* @author Matt Mecham, Brandon Farber, Josh Williams
|
||||
* @since 2008
|
||||
*/
|
||||
|
||||
/**
|
||||
* "ACP" Class. Designed for ... ACP Template Diff Functions
|
||||
* @author (v.1.0.0) Matt Mecham
|
||||
*/
|
||||
|
||||
/* Prototype Ajax Global Responders
|
||||
* Based on code from: http://codejanitor.com/wp/2006/03/23/ajax-timeouts-with-prototype/
|
||||
* Aborts ajax after a 5 minute delay of nothing happening
|
||||
*/
|
||||
|
||||
var IPB3TemplateDiffResults = new IPB3TemplateDiffResults;
|
||||
|
||||
function IPB3TemplateDiffResults()
|
||||
{
|
||||
this.popUps = {};
|
||||
this.cookieArray = new Array();
|
||||
this.defaultCookieArray = new Array( 'merged', 'conflicted', 'uncommitted', 'committed' );
|
||||
|
||||
/**
|
||||
* INIT
|
||||
*/
|
||||
this.init = function()
|
||||
{
|
||||
document.observe("dom:loaded", function()
|
||||
{
|
||||
/* Set up cbox all */
|
||||
$('cboxall').observe( 'click', IPB3TemplateDiffResults.toggleSelectAll );
|
||||
|
||||
/* Set up cbox handler */
|
||||
ipb.delegate.register(".__cbx", IPB3TemplateDiffResults.cboxEvent);
|
||||
|
||||
cookie = ipb.Cookie.get('acp_mergecenter');
|
||||
Debug.write( cookie );
|
||||
|
||||
/* Set a fairly good default */
|
||||
if ( cookie )
|
||||
{
|
||||
IPB3TemplateDiffResults.cookieArray = cookie.split( ',' );
|
||||
}
|
||||
|
||||
if ( ! IPB3TemplateDiffResults.cookieArray.length )
|
||||
{
|
||||
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
|
||||
}
|
||||
|
||||
/* Update the view */
|
||||
IPB3TemplateDiffResults.updateView();
|
||||
} );
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Event when dude or dudette clicks a checko-boxo
|
||||
*/
|
||||
this.cboxEvent = function( e, elem )
|
||||
{
|
||||
newArray = new Array();
|
||||
|
||||
$$('.__cbx').each(
|
||||
function(x)
|
||||
{
|
||||
if ( x.checked )
|
||||
{
|
||||
newArray.push( x.id.replace( '_cb_', '' ) );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if ( ! newArray.length )
|
||||
{
|
||||
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
|
||||
}
|
||||
else
|
||||
{
|
||||
IPB3TemplateDiffResults.cookieArray = newArray;
|
||||
}
|
||||
|
||||
/* Set cookie */
|
||||
ipb.Cookie.set( 'acp_mergecenter', IPB3TemplateDiffResults.cookieArray.join( ',' ) );
|
||||
|
||||
/* Update view */
|
||||
IPB3TemplateDiffResults.updateView(e);
|
||||
};
|
||||
|
||||
/**
|
||||
* View options
|
||||
*/
|
||||
this.updateView = function( e )
|
||||
{
|
||||
/* Check */
|
||||
if ( ! IPB3TemplateDiffResults.cookieArray.length )
|
||||
{
|
||||
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
|
||||
}
|
||||
|
||||
/* reset all headers */
|
||||
$$('.__group').invoke('show');
|
||||
|
||||
/* reset all items */
|
||||
$$('.__diffRow').invoke('hide');
|
||||
|
||||
/* Reset view cboxes */
|
||||
$$('.__cbx').each( function(x) { x.checked = false; } );
|
||||
|
||||
for( i = 0 ; i <= IPB3TemplateDiffResults.cookieArray.length ; i++ )
|
||||
{
|
||||
opt = IPB3TemplateDiffResults.cookieArray[ i ];
|
||||
|
||||
switch( opt )
|
||||
{
|
||||
case 'nocustom':
|
||||
$$('._nochanges').invoke('show');
|
||||
$('_cb_nocustom').checked = true;
|
||||
break;
|
||||
case 'merged':
|
||||
$$('.__canMerge').invoke('show');
|
||||
$('_cb_merged').checked = true;
|
||||
break;
|
||||
case 'conflicted':
|
||||
$$('.__conflicts').invoke('show');
|
||||
$('_cb_conflicted').checked = true;
|
||||
break;
|
||||
case 'uncommitted':
|
||||
$$('._uncommitted').invoke('show');
|
||||
$('_cb_uncommitted').checked = true;
|
||||
break;
|
||||
case 'committed':
|
||||
$$('.__committed').invoke('show');
|
||||
$('_cb_committed').checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Go through and remove any group titles */
|
||||
$$('.__group').each( function( i )
|
||||
{
|
||||
/* Extract group key */
|
||||
if ( $( i ).className.match( /_xgid/ ) )
|
||||
{
|
||||
_g = $( i ).className.match( '_xgid([0-9a-zA-Z]+)' );
|
||||
|
||||
if ( _g != null && ! Object.isUndefined( _g ) )
|
||||
{
|
||||
_groupKey = _g[1];
|
||||
|
||||
if ( _groupKey )
|
||||
{
|
||||
_c = 0;
|
||||
|
||||
$$('._xgid' + _groupKey).each( function(y)
|
||||
{
|
||||
if ( $(y).visible() )
|
||||
{
|
||||
_c++;
|
||||
}
|
||||
} );
|
||||
|
||||
if ( _c < 2 )
|
||||
{
|
||||
$(i).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Select all
|
||||
*/
|
||||
this.toggleSelectAll = function( e )
|
||||
{
|
||||
/* Wot do we have? */
|
||||
var status = $('cboxall').checked;
|
||||
|
||||
/* unselect? */
|
||||
if ( status == false )
|
||||
{
|
||||
$$('.__xBox').each( function(x) { x.checked = false; } );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Just select non-hidden items */
|
||||
$$('.__diffRow').each( function( i )
|
||||
{
|
||||
if ( $(i).visible() )
|
||||
{
|
||||
_g = $( i ).className.match( '__rowId([0-9]+)' );
|
||||
|
||||
if ( _g != null && ! Object.isUndefined( _g ) )
|
||||
{
|
||||
$$('.__cBox' + _g[1]).each( function(x) { if ( ! x.disabled ) { x.checked = true; } } );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View version
|
||||
*/
|
||||
this.viewVersion = function( changeId, type )
|
||||
{
|
||||
/* Grab it via ajax */
|
||||
var _url = ipb.vars['base_url'] + "&app=core&module=ajax§ion=templatediff&do=viewVersion&change_id=" + changeId + '&type=' + type + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function (t)
|
||||
{
|
||||
/* Not a JSON response? */
|
||||
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + t.responseText );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Process results */
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + json['error'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Type */
|
||||
switch( type )
|
||||
{
|
||||
default:
|
||||
case 'orig':
|
||||
_text = 'Старый';
|
||||
break;
|
||||
case 'new':
|
||||
_text = 'Новый';
|
||||
break;
|
||||
case 'custom':
|
||||
_text = 'Пользовательский';
|
||||
break;
|
||||
}
|
||||
|
||||
/* otherwise... */
|
||||
if ( json['data_content'] )
|
||||
{
|
||||
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>';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
|
||||
max = document.viewport.getHeight();
|
||||
max = ( max < 600 ) ? max : 600;
|
||||
|
||||
popup = new ipb.Popup('VPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '600px', h: max + 'px', initial: content } );
|
||||
popup.show();
|
||||
}
|
||||
},
|
||||
onFailure: function()
|
||||
{
|
||||
return false;
|
||||
},
|
||||
onException: function()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* View diff preview
|
||||
*/
|
||||
this.viewDiff = function( changeId, type )
|
||||
{
|
||||
/* Grab it via ajax */
|
||||
var _url = ipb.vars['base_url'] + "&app=core&module=ajax§ion=templatediff&do=viewDiff&change_id=" + changeId + '&type=' + type + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function (t)
|
||||
{
|
||||
/* Not a JSON response? */
|
||||
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + t.responseText );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Process results */
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + json['error'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Type */
|
||||
switch( type )
|
||||
{
|
||||
default:
|
||||
case 'diff':
|
||||
_text = 'Различия';
|
||||
break;
|
||||
case 'merge':
|
||||
_text = 'Препросмотр объединения';
|
||||
break;
|
||||
}
|
||||
|
||||
/* otherwise... */
|
||||
if ( json['change_data_content'] )
|
||||
{
|
||||
/* 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>";
|
||||
}
|
||||
else
|
||||
{
|
||||
_qb = '';
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
max = document.viewport.getHeight();
|
||||
max = ( max < 600 ) ? max : 600;
|
||||
|
||||
IPB3TemplateDiffResults.popUps['preview-' + changeId ] = new ipb.Popup('diffPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: max + 'px', initial: content } );
|
||||
IPB3TemplateDiffResults.popUps['preview-' + changeId ].show();
|
||||
|
||||
/* Observe */
|
||||
if ( type == 'merge' )
|
||||
{
|
||||
$('mergeResolveCustom').observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
|
||||
$('mergeResolveNew').observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
|
||||
$('mergeEditCustom').observe( 'click', IPB3TemplateDiffResults.goEdit );
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onFailure: function()
|
||||
{
|
||||
return false;
|
||||
},
|
||||
onException: function()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* View diff preview
|
||||
*/
|
||||
this.editBit = function( changeId )
|
||||
{
|
||||
/* Grab it via ajax */
|
||||
var _url = ipb.vars['base_url'] + "&app=core&module=ajax§ion=templatediff&do=editDiff&change_id=" + changeId + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function (t)
|
||||
{
|
||||
/* Not a JSON response? */
|
||||
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + t.responseText );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Process results */
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( ipb.lang['sk_error'] + json['error'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* otherwise... */
|
||||
if ( json['change_merge_content'] )
|
||||
{
|
||||
/* Ok, for some reason Safari (and possibly others) doesn't show the pop-up when viewing a
|
||||
template bit. I presume it's because prototype/javascript will not insert invalid HTML into a node even
|
||||
though it's encoded properly. After a few days working on merge, this is a quick hack to get it done
|
||||
Force a 750px div in to position pop-up correctly on the screen, then once the pop-up has been created
|
||||
shove the content in.
|
||||
<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>';
|
||||
|
||||
if ( json['change_data_type'] == 'css' )
|
||||
{
|
||||
content = '<h3>' + json['change_data_title'] + '.css' + '</h3><div style="padding:4px;">' + _tb + '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
content = '<h3>' + json['change_data_group'] + ' > ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</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>' } );
|
||||
IPB3TemplateDiffResults.popUps['edit-' + changeId ].show();
|
||||
|
||||
$('diffEditPopUp_' + _tmp + '_inner').update( content );
|
||||
|
||||
/* Observe */
|
||||
$('mergeSubmit').observe( 'click', IPB3TemplateDiffResults.saveEdit );
|
||||
|
||||
$('mergeResolveCustom_' + _tmp ).observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
|
||||
$('mergeResolveNew_' + _tmp ).observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
|
||||
|
||||
}
|
||||
},
|
||||
onFailure: function()
|
||||
{
|
||||
return false;
|
||||
},
|
||||
onException: function()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* View diff preview
|
||||
*/
|
||||
this.goEdit = function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
|
||||
/* fetch ID */
|
||||
var test = $( elem ).className.match('__re([0-9]+)');
|
||||
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
|
||||
|
||||
var changeId = test[1];
|
||||
|
||||
/* Close preview pop-up */
|
||||
if ( IPB3TemplateDiffResults.popUps['preview-' + changeId ] )
|
||||
{
|
||||
IPB3TemplateDiffResults.popUps['preview-' + changeId ].hide();
|
||||
}
|
||||
|
||||
/* Fire edit */
|
||||
IPB3TemplateDiffResults.editBit( changeId );
|
||||
};
|
||||
|
||||
/**
|
||||
* View diff preview
|
||||
*/
|
||||
this.resolveAllSingle = function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
var _type = '';
|
||||
|
||||
/* fetch ID */
|
||||
if ( $( elem ).className.match( /__rc/ ) )
|
||||
{
|
||||
var test = $( elem ).className.match('__rc([0-9]+)');
|
||||
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
|
||||
_type = 'custom';
|
||||
}
|
||||
else
|
||||
{
|
||||
var test = $( elem ).className.match('__rn([0-9]+)');
|
||||
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
|
||||
_type = 'new';
|
||||
}
|
||||
|
||||
var changeId = test[1];
|
||||
|
||||
/* Grab it via ajax */
|
||||
var _url = ipb.vars['base_url'] + "&app=core&module=ajax§ion=templatediff&do=resolveAllSingle&change_id=" + changeId + '&type=' + _type + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function (t)
|
||||
{
|
||||
if ( t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( json['error'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Close pop-up */
|
||||
if ( IPB3TemplateDiffResults.popUps['edit-' + changeId ] )
|
||||
{
|
||||
IPB3TemplateDiffResults.popUps['edit-' + changeId ].hide();
|
||||
}
|
||||
|
||||
if ( IPB3TemplateDiffResults.popUps['preview-' + changeId ] )
|
||||
{
|
||||
IPB3TemplateDiffResults.popUps['preview-' + changeId ].hide();
|
||||
}
|
||||
|
||||
/* Update desc string */
|
||||
$('mDesc-' + changeId).update( json['desc'] );
|
||||
|
||||
/* Hide merge available data */
|
||||
$$('.__whenHasMerge' + changeId).each( function(m){
|
||||
m.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onFailure: function()
|
||||
{
|
||||
return false;
|
||||
},
|
||||
onException: function()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* View diff preview
|
||||
*/
|
||||
this.saveEdit = function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
|
||||
/* fetch ID */
|
||||
var test = $( elem ).className.match('__i([0-9]+)');
|
||||
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
|
||||
|
||||
var changeId = test[1];
|
||||
var content = $('mergeContent').value;
|
||||
|
||||
/* Test to see if we've left in merge stuff */
|
||||
if ( content.match( '<<<<<<<<<<' ) || content.match( '>>>>>>>>>' ) )
|
||||
{
|
||||
alert( 'Нельзя сохранить пока не будут устранены все конфликты' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fire it of to Ajaxia for central processing */
|
||||
var url = ipb.vars['base_url'] + "&app=core&module=ajax§ion=templatediff&do=saveEdit&change_id=" + changeId + '&secure_key=' + ipb.vars['md5_hash'];
|
||||
|
||||
/* Set up params */
|
||||
var params = { 'content' : content };
|
||||
|
||||
new Ajax.Request( url.replace( /&/g, '&' ),
|
||||
{
|
||||
method: 'POST',
|
||||
parameters: params,
|
||||
onSuccess: function (t )
|
||||
{
|
||||
if ( t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( json['error'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Close pop-up */
|
||||
IPB3TemplateDiffResults.popUps['edit-' + changeId ].hide();
|
||||
|
||||
/* Update desc string */
|
||||
$('mDesc-' + changeId).update( json['desc'] );
|
||||
|
||||
/* Hide merge available data */
|
||||
$$('.__whenHasMerge' + changeId).each( function(m){
|
||||
m.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
IPB3TemplateDiffResults.init();
|
||||
@@ -1,43 +1,44 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.global.js - Global functionality */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
ACPEasyLogo = {
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.easylogo.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$('skin').observe( "change", ACPEasyLogo.resetMacro );
|
||||
});
|
||||
},
|
||||
|
||||
resetMacro: function(e)
|
||||
{
|
||||
var value = $F('skin');
|
||||
|
||||
//Get hits
|
||||
new Ajax.Request(
|
||||
ipb.vars['base_url'] + "app=core&module=ajax§ion=replacements&do=retrieve&secure_key=" + ipb.vars['md5_hash'] + "&value=" + value ,
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t){
|
||||
if ( t.responseJSON['url'] )
|
||||
{
|
||||
$('logo_url').value = t.responseJSON['url'];
|
||||
$('replacementId').value = t.responseJSON['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.global.js - Global functionality */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
ACPEasyLogo = {
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.easylogo.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$('skin').observe( "change", ACPEasyLogo.resetMacro );
|
||||
});
|
||||
},
|
||||
|
||||
resetMacro: function(e)
|
||||
{
|
||||
var value = $F('skin');
|
||||
|
||||
//Get hits
|
||||
new Ajax.Request(
|
||||
ipb.vars['base_url'] + "app=core&module=ajax§ion=replacements&do=retrieve&secure_key=" + ipb.vars['md5_hash'] + "&value=" + value ,
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t){
|
||||
if ( t.responseJSON['url'] )
|
||||
{
|
||||
$('logo_url').value = t.responseJSON['url'];
|
||||
$('replacementId').value = t.responseJSON['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ACPEasyLogo.init();
|
||||
@@ -1,35 +1,31 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.homepage.js - Homepage javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPHomepage = {
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.homepage.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ACPHomepage.autoComplete = new ipb.Autocomplete( $('members_display_name'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
});
|
||||
},
|
||||
|
||||
editMember: function()
|
||||
{
|
||||
if ( $('members_display_name').value == "" )
|
||||
{
|
||||
alert("Нужно ввести имя пользователя!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.homepage.js - Homepage javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPHomepage = {
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.homepage.js");
|
||||
},
|
||||
|
||||
editMember: function()
|
||||
{
|
||||
if ( $('members_display_name').value == "" )
|
||||
{
|
||||
alert("Нужно ввести имя пользователя!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
ACPHomepage.init();
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -51,7 +51,7 @@ function IPBCSS()
|
||||
{
|
||||
/* Build CSS list */
|
||||
this.buildCSSList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load css groups
|
||||
@@ -88,10 +88,10 @@ function IPBCSS()
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save CSS
|
||||
@@ -146,10 +146,10 @@ function IPBCSS()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Revert css
|
||||
@@ -205,10 +205,10 @@ function IPBCSS()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load template bits
|
||||
@@ -242,10 +242,10 @@ function IPBCSS()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add CSS form
|
||||
@@ -253,7 +253,7 @@ function IPBCSS()
|
||||
this.addCSSForm = function()
|
||||
{
|
||||
IPB3CSS.showCSSEditor( { 'cssData' : { 'css_id' : 0, 'css_group' : '', 'css_content' : '', 'css_added_to' : 0, '_type' : 'new' } } );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -279,7 +279,7 @@ function IPBCSS()
|
||||
}
|
||||
|
||||
ipb.positionCenter( 'tplate_editor_' + json['cssData']['css_id'] );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -298,7 +298,7 @@ function IPBCSS()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of CSS groups (files)
|
||||
@@ -374,7 +374,7 @@ function IPBCSS()
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -407,6 +407,5 @@ function IPBCSS()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,207 +1,275 @@
|
||||
|
||||
function addAnotherFile()
|
||||
{
|
||||
elementIndex = parseInt(elementIndex) + 1;
|
||||
|
||||
var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } );
|
||||
list.addClassName( 'acp-form' );
|
||||
list.addClassName( 'alternate_rows' );
|
||||
$('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></select>" );
|
||||
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
$('fileTable_' + elementIndex).insert( li2 );
|
||||
$('fileTable_' + elementIndex).insert( li3 );
|
||||
}
|
||||
|
||||
function selectHookType( elementIndex )
|
||||
{
|
||||
var type = $F('hook_type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_classToOverload[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_classToOverload[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_skinGroup[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinGroup[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_skinFunction[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinFunction[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( type == 'templateHooks' )
|
||||
{
|
||||
// Show the skin dropdown now
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getGroupsForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
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 );
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
} );
|
||||
}
|
||||
else if( type != '0' )
|
||||
{
|
||||
// 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 );
|
||||
}
|
||||
}
|
||||
|
||||
function getTemplatesForAdd( elementIndex )
|
||||
{
|
||||
var type = $F('skinGroup[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_skinFunction[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinFunction[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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 );
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
} );
|
||||
}
|
||||
|
||||
function getTypeOfHook( elementIndex )
|
||||
{
|
||||
var type = $F('skinFunction[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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 );
|
||||
}
|
||||
|
||||
function getHookIds( elementIndex )
|
||||
{
|
||||
var template = $F('skinFunction[' + elementIndex + ']');
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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 );
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
} );
|
||||
}
|
||||
|
||||
function getHookEntryPoints( elementIndex )
|
||||
{
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
var options = '';
|
||||
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
|
||||
|
||||
if( type == 'foreach' )
|
||||
{
|
||||
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>";
|
||||
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>";
|
||||
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>";
|
||||
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>";
|
||||
}
|
||||
else
|
||||
{
|
||||
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>";
|
||||
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>";
|
||||
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>";
|
||||
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>";
|
||||
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_temptype'] + "</label><select name='position[" + elementIndex + "]' id='position[" + elementIndex + "]'>" + options + "</select>" );
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
|
||||
function addAnotherFile()
|
||||
{
|
||||
elementIndex = parseInt(elementIndex) + 1;
|
||||
|
||||
var header = new Element( 'div', { 'class': 'tablesubheader' } );
|
||||
header.update( ipb.lang['hookfilenumber'] + 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>" );
|
||||
|
||||
$('fileTable_' + elementIndex).insert( li1 );
|
||||
$('fileTable_' + elementIndex).insert( li2 );
|
||||
$('fileTable_' + elementIndex).insert( li3 );
|
||||
|
||||
doStriping();
|
||||
}
|
||||
|
||||
function selectHookType( elementIndex )
|
||||
{
|
||||
var type = $F('hook_type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_classToOverload[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_classToOverload[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_skinGroup[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinGroup[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_skinFunction[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinFunction[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_dataLocation[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_dataLocation[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
|
||||
if( $('tr_libApplication[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_libApplication[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( type == 'templateHooks' )
|
||||
{
|
||||
// Show the skin dropdown now
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getGroupsForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
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();
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
else if( type == 'dataHooks' )
|
||||
{
|
||||
// Show the data location dropdown now
|
||||
|
||||
url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getDataLocationsForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
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();
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
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;
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
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();
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
else if( type != '0' )
|
||||
{
|
||||
// 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 );
|
||||
}
|
||||
}
|
||||
|
||||
function getTemplatesForAdd( elementIndex )
|
||||
{
|
||||
var type = $F('skinGroup[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_skinFunction[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_skinFunction[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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 ); }
|
||||
} );
|
||||
}
|
||||
|
||||
function getTypeOfHook( elementIndex )
|
||||
{
|
||||
var type = $F('skinFunction[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_type[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_type[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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();
|
||||
}
|
||||
|
||||
function getHookIds( elementIndex )
|
||||
{
|
||||
var template = $F('skinFunction[' + elementIndex + ']');
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_id[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_id[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('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 ); }
|
||||
} );
|
||||
}
|
||||
|
||||
function getHookEntryPoints( elementIndex )
|
||||
{
|
||||
var type = $F('type[' + elementIndex + ']');
|
||||
|
||||
if( $('tr_position[' + elementIndex + ']') != null )
|
||||
{
|
||||
$('tr_position[' + elementIndex + ']').remove();
|
||||
}
|
||||
|
||||
var options = '';
|
||||
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
|
||||
|
||||
if( type == 'foreach' )
|
||||
{
|
||||
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>";
|
||||
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>";
|
||||
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>";
|
||||
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>";
|
||||
}
|
||||
else
|
||||
{
|
||||
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>";
|
||||
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>";
|
||||
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>";
|
||||
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>";
|
||||
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();
|
||||
}
|
||||
@@ -51,7 +51,7 @@ function IPBReplacements()
|
||||
{
|
||||
/* Build Replacements list */
|
||||
this.buildReplacementsList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load css groups
|
||||
@@ -88,10 +88,10 @@ function IPBReplacements()
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save Replacements
|
||||
@@ -144,10 +144,10 @@ function IPBReplacements()
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Revert css
|
||||
@@ -204,10 +204,10 @@ function IPBReplacements()
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Exception: " + e ); },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add Replacements form
|
||||
@@ -215,7 +215,7 @@ function IPBReplacements()
|
||||
this.addReplacementsForm = function()
|
||||
{
|
||||
IPB3Replacements.showReplacementsEditor( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -263,7 +263,7 @@ function IPBReplacements()
|
||||
}
|
||||
|
||||
ipb.positionCenter( 'tplate_editor_' + replacement_id );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Preview the replacement
|
||||
@@ -301,7 +301,7 @@ function IPBReplacements()
|
||||
document.body.appendChild( _div );
|
||||
|
||||
ipb.positionCenter( 'tplate_preview_' + _data['replacement_id'] );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Close Preview
|
||||
@@ -315,7 +315,7 @@ function IPBReplacements()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -334,7 +334,7 @@ function IPBReplacements()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of Replacements groups (files)
|
||||
@@ -405,7 +405,7 @@ function IPBReplacements()
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -442,6 +442,5 @@ function IPBReplacements()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -63,8 +63,11 @@ function IPBTemplateDiff()
|
||||
/**
|
||||
* URLS
|
||||
*/
|
||||
this.baseUrl = '';
|
||||
this.imageUrl = '';
|
||||
this.baseUrl = '';
|
||||
this.baseUrlMerge = '';
|
||||
this.imageUrl = '';
|
||||
this.doneUrl = '';
|
||||
this.currentAction = 'process';
|
||||
|
||||
/*
|
||||
* Stored JSON
|
||||
@@ -96,7 +99,7 @@ function IPBTemplateDiff()
|
||||
this.beginDiff = function()
|
||||
{
|
||||
/* Start text output.. */
|
||||
this.updateCounter( 0 );
|
||||
this.updateCounter( '' );
|
||||
|
||||
/* Reset progress bar */
|
||||
this.updateProgressBar( false );
|
||||
@@ -106,7 +109,7 @@ function IPBTemplateDiff()
|
||||
|
||||
/* Start off with the SQL */
|
||||
this.fireAjax( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the progress bar
|
||||
@@ -170,9 +173,9 @@ function IPBTemplateDiff()
|
||||
if ( IPB3TemplateDiff.currentImage != _img )
|
||||
{
|
||||
$( 'diffStatusImage' ).src = IPB3TemplateDiff.imageUrl + _img;
|
||||
IPB3TemplateDiff.currentImage = _img;
|
||||
IPB3TemplateDiff.currentImage = _img;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Fire Ajax
|
||||
@@ -182,7 +185,7 @@ function IPBTemplateDiff()
|
||||
/* Update image */
|
||||
this.updateProgressImage( 'send' );
|
||||
|
||||
new Ajax.Request( this.baseUrl + '&do=process',
|
||||
new Ajax.Request( this.baseUrl.replace( /&/g, '&' ) + '&do=' + this.currentAction,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: this.processAjax.bind(this),
|
||||
@@ -214,14 +217,14 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.timeOutAjax = function( t )
|
||||
{
|
||||
if ( confirm( "No response from the webserver.\nDo you wish to continue waiting?" ) )
|
||||
if ( confirm( "Нет ответа от сервера.\nХотите подождать?" ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
t.transport.abort();
|
||||
alert( "Request Cancelled" );
|
||||
alert( "Запрос отменен" );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -230,7 +233,7 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.failureAjax = function( t )
|
||||
{
|
||||
alert( "Failure: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -238,8 +241,8 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.exceptionAjax = function( t )
|
||||
{
|
||||
alert( "Exception: " + t.responseText );
|
||||
}
|
||||
alert( "Исключение: " + t.responseText );
|
||||
};
|
||||
|
||||
/**
|
||||
* Process Ajax (Success)
|
||||
@@ -252,7 +255,8 @@ function IPBTemplateDiff()
|
||||
/* Not a JSON response? */
|
||||
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
alert( "Error:\n" + t.responseText );
|
||||
alert( "Ошибка:\n" + t.responseText );
|
||||
Debug.write( t );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -261,16 +265,24 @@ function IPBTemplateDiff()
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( "An error occured: " . json['error'] );
|
||||
alert( "Ошибка: " . json['error'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* All good: Update status message... */
|
||||
this.updateCounter( json['processed'] );
|
||||
this.updateCounter( json['title'], json['message'] );
|
||||
|
||||
/* Update progress bar */
|
||||
this.updateProgressBar( json['processed'] );
|
||||
|
||||
if ( json['perGo'] )
|
||||
{
|
||||
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + json['perGo'] );
|
||||
this.perGo = json['perGo'];
|
||||
}
|
||||
|
||||
this.totalBits = json['totalBits'] ? json['totalBits'] : this.totalBits;
|
||||
|
||||
/* Finish? If so - say all done and go tubby-bye-bye */
|
||||
if ( json['completed'] != 1 )
|
||||
{
|
||||
@@ -279,21 +291,33 @@ function IPBTemplateDiff()
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All Done */
|
||||
this.updateProgressBar( -1 );
|
||||
this.updateProgressImage( 'ready' );
|
||||
/* Diff? Then merge */
|
||||
if ( this.currentAction == 'process' )
|
||||
{
|
||||
this.currentAction = 'merge';
|
||||
this.perGo = 10;
|
||||
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + this.perGo );
|
||||
/* Go ahead */
|
||||
this.beginDiff();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All Done */
|
||||
this.updateProgressBar( -1 );
|
||||
this.updateProgressImage( 'ready' );
|
||||
|
||||
/* Show done thing */
|
||||
$( 'diffDone' ).show();
|
||||
/* Show done thing */
|
||||
window.location = this.doneUrl.replace( /&/g, '&' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Write to Log
|
||||
*/
|
||||
this.updateCounter = function( count )
|
||||
this.updateCounter = function( title, msg )
|
||||
{
|
||||
$( 'diffLogProcessed' ).innerHTML = count;
|
||||
$( 'diffLogTitle' ).update( title );
|
||||
$( 'diffLogText' ).update( msg );
|
||||
};
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ function IPBTemplateSandR()
|
||||
{
|
||||
cbox.checked = checked;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check group check box
|
||||
@@ -71,7 +71,7 @@ function IPBTemplateSandR()
|
||||
});
|
||||
|
||||
$( 'cbox_group_' + groupName ).checked = ( _allCount == _checkedCount ) ? true : false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load template bits
|
||||
@@ -105,10 +105,10 @@ function IPBTemplateSandR()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -128,7 +128,7 @@ function IPBTemplateSandR()
|
||||
document.body.appendChild( _div );
|
||||
|
||||
ipb.positionCenter( 'tplate_editor_' + json['templateData']['template_id'] );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Peform the placements
|
||||
@@ -175,10 +175,10 @@ function IPBTemplateSandR()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save template bit
|
||||
@@ -201,7 +201,7 @@ function IPBTemplateSandR()
|
||||
parameters: params,
|
||||
onSuccess: function (t )
|
||||
{
|
||||
if ( t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
if ( t.responseText.match( /^(\s*?)?\{/ ) )
|
||||
{
|
||||
eval( "var json = " + t.responseText );
|
||||
|
||||
@@ -231,10 +231,10 @@ function IPBTemplateSandR()
|
||||
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
|
||||
//onException: function( f,e ){ alert( "Исключение: " + e ) },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -248,7 +248,7 @@ function IPBTemplateSandR()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of template groups
|
||||
@@ -389,5 +389,5 @@ function IPBTemplateSandR()
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -66,7 +66,7 @@ function IPBTemplates()
|
||||
$('tplate_bitList').setStyle( { 'height' : $('tplate_groupList').getHeight() + 'px', 'overflow' : 'auto'} );
|
||||
|
||||
this.loadTemplateBits( this.currentTemplateGroup );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load template groups
|
||||
@@ -103,13 +103,13 @@ function IPBTemplates()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load template bits
|
||||
@@ -169,13 +169,13 @@ function IPBTemplates()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save template bit
|
||||
@@ -222,23 +222,23 @@ function IPBTemplates()
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
|
||||
alert("Ошибка: " + json['errors'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("UGLY ALERT BOX SAYS: Saved!");
|
||||
alert("Сохранено!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Revert template bit
|
||||
@@ -248,14 +248,14 @@ function IPBTemplates()
|
||||
/* Make sure we're mean it... */
|
||||
if ( $('tplate_templaterow_' + template_id ).hasClassName( 'tplateRow_new') )
|
||||
{
|
||||
if ( ! confirm( "REMOVE template bit?\n This will remove this template bit in ALL skins!" ) )
|
||||
if ( ! confirm( "Удалить шаблон?\n Произойдет удаление шаблона из ВСЕХ стилей!" ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! confirm( "Revert template bit?\n All changes WILL be lost!" ) )
|
||||
if ( ! confirm( "Откатить изменения?\n Все изменения БУДУТ УТРАЧЕНЫ!" ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -295,19 +295,19 @@ function IPBTemplates()
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
|
||||
alert("Ошибка: " + json['errors'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load template bits
|
||||
@@ -338,13 +338,13 @@ function IPBTemplates()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the new template bit form
|
||||
@@ -369,7 +369,7 @@ function IPBTemplates()
|
||||
ipb.positionCenter( 'tplate_editor_0' );
|
||||
|
||||
IPB3Templates.currentTemplateBit = _data;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -389,7 +389,7 @@ function IPBTemplates()
|
||||
document.body.appendChild( _div );
|
||||
|
||||
ipb.positionCenter( 'tplate_editor_' + json['templateData']['template_id'] );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -408,7 +408,7 @@ function IPBTemplates()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows a group entry as 'lit'
|
||||
@@ -430,7 +430,7 @@ function IPBTemplates()
|
||||
$('tplate_grouprow_' + templateGroup ).removeClassName( IPB3Templates.cssNames['groupRow'] );
|
||||
$('tplate_grouprow_' + templateGroup ).addClassName( IPB3Templates.cssNames['groupRowLitMain'] );
|
||||
$('tplate_grouprow_' + templateGroup ).addClassName( IPB3Templates.cssNames['groupRowLit'] );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of template groups
|
||||
@@ -455,7 +455,7 @@ function IPBTemplates()
|
||||
|
||||
/* Write it out */
|
||||
$('tplate_groupList').update( _output );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of template bits
|
||||
@@ -520,8 +520,7 @@ function IPBTemplates()
|
||||
$('tplate_templateRow_' + json['templates'][i]['template_id'] + '_revert').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -554,7 +553,7 @@ function IPBTemplates()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Group Mouse Event
|
||||
@@ -578,6 +577,5 @@ function IPBTemplates()
|
||||
|
||||
IPB3Templates.loadTemplateBits( _groupName );
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -52,7 +52,7 @@ function IPBUAgents()
|
||||
{
|
||||
/* Build uagents list */
|
||||
this.buildUAgentsList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* INIT User Agent Form
|
||||
@@ -79,7 +79,7 @@ function IPBUAgents()
|
||||
|
||||
/* Build uagents list that are already in the group */
|
||||
this.buildGroupAgentsUsedList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save uagents
|
||||
@@ -122,23 +122,23 @@ function IPBUAgents()
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
|
||||
alert("Ошибка: " + json['errors'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("UGLY ALERT BOX SAYS: Saved!");
|
||||
alert("Сохранено!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Revert css
|
||||
@@ -146,7 +146,7 @@ function IPBUAgents()
|
||||
this.removeuAgent = function( uagent_id )
|
||||
{
|
||||
/* Make sure we're mean it... */
|
||||
if ( ! confirm( "Remove user agent?\\nThis will be removed permanently" ) )
|
||||
if ( ! confirm( "Удалить user agent?\\nОн будет удален полностью из системы" ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -177,19 +177,19 @@ function IPBUAgents()
|
||||
if ( json['errors'] )
|
||||
{
|
||||
/* Something inline would be very nice here.. rather than this ugly alert */
|
||||
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
|
||||
alert("Ошибка: " + json['errors'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
}
|
||||
},
|
||||
onException: function( f,e ){ alert( "Exception: " + e ) },
|
||||
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
|
||||
onException: function( f,e ){ alert( "Исключение: " + e ); },
|
||||
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add uagents form
|
||||
@@ -197,7 +197,7 @@ function IPBUAgents()
|
||||
this.adduAgentForm = function()
|
||||
{
|
||||
IPB3UAgents.showuAgentsEditor( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the template editor
|
||||
@@ -235,7 +235,7 @@ function IPBUAgents()
|
||||
/* Adjust title */
|
||||
if ( ! uagent_id )
|
||||
{
|
||||
$('tplate_title_' + uagent_id ).update("Adding User Agent");
|
||||
$('tplate_title_' + uagent_id ).update("Добавление User Agent");
|
||||
}
|
||||
|
||||
/* Select box type */
|
||||
@@ -250,7 +250,7 @@ function IPBUAgents()
|
||||
};
|
||||
|
||||
ipb.positionCenter( 'tplate_editor_' + uagent_id );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Close the editor
|
||||
@@ -269,7 +269,7 @@ function IPBUAgents()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of uagents groups (files)
|
||||
@@ -304,7 +304,7 @@ function IPBUAgents()
|
||||
/* Image. Can't use #{...} inline as it parses as HTML entities. Most annoying */
|
||||
$('tplate_img_' + json['uagents'][i]['uagent_id'] ).src += 'type_' + json['uagents'][i]['uagent_type'] + '.png';
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -337,7 +337,7 @@ function IPBUAgents()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of USED uagents
|
||||
@@ -395,7 +395,7 @@ function IPBUAgents()
|
||||
|
||||
/* Update hidden field */
|
||||
$('uAgentsData').value = Object.toJSON( _save );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save user agent form
|
||||
@@ -403,7 +403,7 @@ function IPBUAgents()
|
||||
this.saveGroupForm = function()
|
||||
{
|
||||
$('uAgentsForm').submit();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -436,7 +436,7 @@ function IPBUAgents()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Close the editor
|
||||
@@ -455,7 +455,7 @@ function IPBUAgents()
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the versions editor
|
||||
@@ -483,7 +483,7 @@ function IPBUAgents()
|
||||
document.body.appendChild( _div );
|
||||
|
||||
ipb.positionCenter( 'tplate_versions_' + uagent_id );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Save agent version info
|
||||
@@ -498,7 +498,7 @@ function IPBUAgents()
|
||||
|
||||
/* Close any open editors */
|
||||
IPB3UAgents.cancelAgentVersion();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add user agent to the list
|
||||
@@ -516,7 +516,7 @@ function IPBUAgents()
|
||||
|
||||
/* Build uagents list that are already in the group */
|
||||
IPB3UAgents.buildGroupAgentsUsedList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add user agent to the list
|
||||
@@ -535,7 +535,7 @@ function IPBUAgents()
|
||||
|
||||
/* Build uagents list that are already in the group */
|
||||
IPB3UAgents.buildGroupAgentsUsedList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Template Mouse Event
|
||||
@@ -559,7 +559,7 @@ function IPBUAgents()
|
||||
IPB3UAgents.groupAddToList( _uagent_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a list of uagents
|
||||
@@ -599,6 +599,5 @@ function IPBUAgents()
|
||||
$('tplate_agentimg_' + json['uagents'][i]['uagent_id'] ).src += 'type_' + json['uagents'][i]['uagent_type'] + '.png';
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,221 +1,223 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Template comparison
|
||||
* Last Updated: $Date: 2009-02-18 12:02:42 -0500 (Wed, 18 Feb 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 4036 $
|
||||
*/
|
||||
|
||||
|
||||
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_compare extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
|
||||
/**
|
||||
* HTML Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
*/
|
||||
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' );
|
||||
|
||||
$this->skinFunctions = new skinDifferences( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
|
||||
|
||||
//-----------------------------------------
|
||||
// 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'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$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 );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
else
|
||||
{
|
||||
$difference = htmlspecialchars($current['css_content']);
|
||||
$difference = str_replace( ' ', ' ', $difference );
|
||||
$difference = str_replace( "\r", '<br />', $difference );
|
||||
$difference = str_replace( "\n", '<br />', $difference );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
|
||||
$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 Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$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 );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
else
|
||||
{
|
||||
$difference = htmlspecialchars($current['template_content']);
|
||||
$difference = str_replace( ' ', ' ', $difference );
|
||||
$difference = str_replace( "\r", '<br />', $difference );
|
||||
$difference = str_replace( "\n", '<br />', $difference );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->html->differenceResult( $difference ) );
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Template comparison
|
||||
* 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
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5713 $
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_core_ajax_compare extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Skin functions object handle
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $skinFunctions;
|
||||
|
||||
/**
|
||||
* HTML Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main executable
|
||||
*
|
||||
* @access public
|
||||
* @param object registry object
|
||||
* @return void
|
||||
*/
|
||||
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' );
|
||||
|
||||
$this->skinFunctions = new skinDifferences( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_templates');
|
||||
|
||||
//-----------------------------------------
|
||||
// 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'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$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 );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
else
|
||||
{
|
||||
$difference = htmlspecialchars($current['css_content']);
|
||||
$difference = str_replace( ' ', ' ', $difference );
|
||||
$difference = str_replace( "\r", '<br />', $difference );
|
||||
$difference = str_replace( "\n", '<br />', $difference );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
|
||||
$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 Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$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 );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
else
|
||||
{
|
||||
$difference = htmlspecialchars($current['template_content']);
|
||||
$difference = str_replace( ' ', ' ', $difference );
|
||||
$difference = str_replace( "\r", '<br />', $difference );
|
||||
$difference = str_replace( "\n", '<br />', $difference );
|
||||
$difference = str_replace( "><", ">\n<" ,$difference );
|
||||
$difference = str_replace( "\t", " ", $difference );
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->html->differenceResult( $difference ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2009-09-30 10:45:37 -0400 (Wed, 30 Sep 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5183 $
|
||||
* @version $Revision: 5713 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Login handler abstraction : AJAX Find Names functions
|
||||
* Last Updated: $Date: 2010-02-22 08:06:40 -0500 (Mon, 22 Feb 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5857 $
|
||||
* @see public_core_ajax_findnames
|
||||
*
|
||||
*/
|
||||
|
||||
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_findnames extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'get-member-names':
|
||||
$this->_getMemberNames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @access private
|
||||
* @return void Outputs to screen
|
||||
*/
|
||||
private function _getMemberNames()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = IPSText::convertUnicode( $this->convertAndMakeSafe( ipsRegistry::$request['name'], 0 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check length
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::mbstrlen( $name ) < 3 )
|
||||
{
|
||||
$this->returnJsonError( 'requestTooShort' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Try query...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'",
|
||||
'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
|
||||
'limit' => array( 0, 15 ),
|
||||
'add_join' => array( array( 'select' => 'p.*',
|
||||
'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => 'p.pp_member_id=m.member_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any results?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->DB->getTotalRows() )
|
||||
{
|
||||
$this->returnJsonArray( array( ) );
|
||||
}
|
||||
|
||||
$return = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSLib::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_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height']
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,229 +1,405 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Live Search
|
||||
* Last Updated: $Date: 2009-09-30 10:45:37 -0400 (Wed, 30 Sep 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5183 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_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]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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'] )
|
||||
{
|
||||
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
|
||||
*/
|
||||
public function doSearchRequest()
|
||||
{
|
||||
/* INI */
|
||||
$search_term = $this->request['search_term'];
|
||||
|
||||
$results = array();
|
||||
$return = array( 'settings' => null, 'location' => null );
|
||||
$max = 20;
|
||||
$count = 0;
|
||||
$secCount = 0;
|
||||
|
||||
/* Do search here */
|
||||
$results = $this->_getSettings( $search_term, $results );
|
||||
|
||||
$results = $this->_getFromXML( $search_term, $results );
|
||||
if( isset( $results['settings'] ) AND is_array( $results['settings'] ) AND count($results['settings']) )
|
||||
{
|
||||
foreach( $results['settings'] as $setting )
|
||||
{
|
||||
$count++;
|
||||
$secCount++;
|
||||
$return['settings'] .= $this->html->searchRowSetting( $setting, $count, $secCount );
|
||||
|
||||
/*if( $count >= $max )
|
||||
{
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( isset( $results['location'] ) AND is_array( $results['location'] ) AND count($results['location']))
|
||||
{
|
||||
foreach( $results['location'] as $location )
|
||||
{
|
||||
$count++;
|
||||
$secCount++;
|
||||
$return['location'] .= $this->html->searchRowLocation( $location, $count, $secCount );
|
||||
|
||||
/*if( $count >= $max )
|
||||
{
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->html->liveSearchDisplay( $return, $search_term );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$term = 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'
|
||||
)
|
||||
)
|
||||
) );
|
||||
}
|
||||
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->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$results['settings'][] = $r;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches the XML Files
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private function _getFromXML( $term, $results )
|
||||
{
|
||||
foreach( $this->cache->getCache('app_menu_cache') as $app => $cache )
|
||||
{
|
||||
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 stripos( $item['keywords'], $term ) !== false )
|
||||
{
|
||||
$item['url'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
else if( stripos( $item['title'], $term ) !== false )
|
||||
{
|
||||
$item['fullurl'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Live Search
|
||||
* Last Updated: $Date: 2010-08-17 11:38:47 -0400 (Tue, 17 Aug 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
|
||||
* @version $Rev: 6763 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_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]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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'] )
|
||||
{
|
||||
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
|
||||
*/
|
||||
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
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( isset( $results['members'] ) AND is_array( $results['members'] ) AND count($results['members']))
|
||||
{
|
||||
foreach( $results['members'] as $members )
|
||||
{
|
||||
$secCount++;
|
||||
$return['members'] .= $this->html->searchRowMember( $members, $secCount );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Group settings?
|
||||
//-----------------------------------------
|
||||
|
||||
$secCount = 0;
|
||||
|
||||
if( $results['groups'] )
|
||||
{
|
||||
foreach( $results['groups'] as $group )
|
||||
{
|
||||
$secCount++;
|
||||
$return['groups'] .= $this->html->searchRowGroupsTitles( $group, $secCount );
|
||||
}
|
||||
}
|
||||
|
||||
if( $results['groupLangs'] )
|
||||
{
|
||||
$return['groups'] .= $this->html->searchRowGroups();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Settings
|
||||
//-----------------------------------------
|
||||
|
||||
$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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$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->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_matched = '';
|
||||
|
||||
if( $r['members_l_display_name'] AND mb_strpos( $r['members_l_display_name'], $term ) !== false )
|
||||
{
|
||||
$r['_matched'] = 'members_display_name';
|
||||
}
|
||||
else if( $r['members_l_username'] AND mb_strpos( $r['members_l_username'], $term ) !== false )
|
||||
{
|
||||
$r['_matched'] = 'name';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_matched'] = 'email';
|
||||
}
|
||||
|
||||
$results['members'][] = $r;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
$results['groups'] = false;
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_groups' ), 'members' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_gallery' ), 'gallery' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_blog' ), 'blog' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_downloads' ), 'downloads' );
|
||||
|
||||
foreach( $this->lang->words as $k => $v )
|
||||
{
|
||||
if( strpos( $k, 'gf_' ) !== false AND strpos( $v, $term ) !== false )
|
||||
{
|
||||
$results['groupLangs'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now check group names */
|
||||
$groups = $this->cache->getCache('group_cache');
|
||||
|
||||
if ( is_array( $groups ) AND count( $groups ) )
|
||||
{
|
||||
foreach( $groups as $id => $data )
|
||||
{
|
||||
$_term = preg_quote( $term, '#' );
|
||||
|
||||
if ( preg_match( "#" . $_term . "#iu", $data['g_title'] ) )
|
||||
{
|
||||
$results['groups'][] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$term = mb_strtolower($term);
|
||||
$results['forums'] = false;
|
||||
|
||||
/* Fetch forums lib */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$forums = new $classToLoad( $this->registry );
|
||||
$forums->strip_invisible = 1;
|
||||
$forums->forumsInit();
|
||||
|
||||
/* Now check forum titles names */
|
||||
foreach( $forums->forum_by_id as $id => $data )
|
||||
{
|
||||
$_term = preg_quote( $term, '#' );
|
||||
|
||||
if ( preg_match( "#" . $_term . "#iu", $data['name'] ) )
|
||||
{
|
||||
$results['forums'][] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
$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'
|
||||
)
|
||||
)
|
||||
) );
|
||||
}
|
||||
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->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$results['settings'][] = $r;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches the XML Files
|
||||
*
|
||||
* @access private
|
||||
* @param string Search term
|
||||
* @param array Existing search results
|
||||
* @return array New search results
|
||||
*/
|
||||
private 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['url'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
else if( mb_stripos( $item['title'], $term ) !== false )
|
||||
{
|
||||
$item['fullurl'] = "&app={$app}&module={$item['module']}&{$item['url']}";
|
||||
$results['location'][] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2009-05-15 21:17:56 -0400 (Fri, 15 May 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 4663 $
|
||||
* @version $Revision: 5713 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2009-05-15 21:17:56 -0400 (Fri, 15 May 2009) $
|
||||
* Last Updated: $Date: 2010-09-13 17:28:12 -0400 (Mon, 13 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 4663 $
|
||||
* @version $Revision: 6863 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -72,13 +74,244 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
default:
|
||||
case 'process':
|
||||
$this->_process();
|
||||
break;
|
||||
case 'merge':
|
||||
$this->_merge();
|
||||
break;
|
||||
case 'viewDiff':
|
||||
$this->_viewDiff();
|
||||
break;
|
||||
case 'editDiff':
|
||||
$this->_editDiff();
|
||||
break;
|
||||
case 'saveEdit':
|
||||
$this->_saveEdit();
|
||||
break;
|
||||
case 'viewVersion':
|
||||
$this->_viewVersion();
|
||||
break;
|
||||
case 'resolveAllSingle':
|
||||
$this->_resolveAllSingle();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab a version to show
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
*/
|
||||
private function _viewVersion()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get data
|
||||
//-----------------------------------------
|
||||
|
||||
$diff_row = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => "change_id=" . intval( $change_id ) ) );
|
||||
|
||||
|
||||
if ( ! $diff_row['change_key'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nokeyfound'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Fetch session */
|
||||
$session = $this->skinFunctions->fetchSession( $diff_row['change_session_id'] );
|
||||
|
||||
/* Start things off? */
|
||||
$return = array( 'data_title' => $diff_row['change_data_title'],
|
||||
'data_group' => $diff_row['change_data_group'],
|
||||
'data_type' => $diff_row['change_data_type'],
|
||||
'data_master_key' => $session['merge_master_key'],
|
||||
'data_content' => '' );
|
||||
|
||||
/* What to get? */
|
||||
switch( $type )
|
||||
{
|
||||
default:
|
||||
case 'original':
|
||||
$return['data_content'] = $this->skinFunctions->fetchOriginalItem( $return );
|
||||
break;
|
||||
case 'custom':
|
||||
$return['data_content'] = $this->skinFunctions->fetchCustomItem( $return );
|
||||
break;
|
||||
case 'new':
|
||||
$return['data_content'] = $this->skinFunctions->fetchNewItem( $return );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Formatting */
|
||||
$return['data_content'] = htmlspecialchars( $return['data_content'] );
|
||||
$return['data_content'] = str_replace( "\n", "<br>", $return['data_content']);
|
||||
$return['data_content'] = str_replace( "><", ">\n<" ,$return['data_content']);
|
||||
$return['data_content'] = str_replace( "\t", " ", $return['data_content'] );
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save diff
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
*/
|
||||
private function _saveEdit()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$content = $_POST['content'];
|
||||
|
||||
/* Re-format */
|
||||
$content = str_replace( '\\"', '\\\"', $content );
|
||||
$content = IPSText::formToText( $content );
|
||||
|
||||
/* Load item from DB */
|
||||
$item = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => 'change_id=' . intval( $change_id ) ) );
|
||||
|
||||
if ( ! $item )
|
||||
{
|
||||
/* Oops */
|
||||
$this->returnJsonError( $this->lang->words['ajax_nosuchitemid'] );
|
||||
}
|
||||
|
||||
|
||||
/* Save to db */
|
||||
$this->DB->update( 'skin_merge_changes', array( 'change_final_content' => $content ), 'change_id=' . intval( $change_id ) );
|
||||
|
||||
|
||||
/* Done */
|
||||
$this->returnJsonArray( array( 'ok' => true, 'desc' => $this->_buildDescString( $item ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save diff
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
*/
|
||||
private function _resolveAllSingle()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
|
||||
/* Load item from DB */
|
||||
$item = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => 'change_id=' . intval( $change_id ) ) );
|
||||
|
||||
if ( ! $item )
|
||||
{
|
||||
/* Oops */
|
||||
$this->returnJsonError( $this->lang->words['ajax_nosuchitemid'] );
|
||||
}
|
||||
|
||||
/* Resolve it! */
|
||||
$this->skinFunctions->resolveConflict( array( $change_id ), $type );
|
||||
|
||||
/* Done */
|
||||
$this->returnJsonArray( array( 'ok' => true, 'desc' => $this->_buildDescString( $item ) ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a desc string
|
||||
*
|
||||
* @access private
|
||||
* @param array Item data
|
||||
* @param string String
|
||||
*/
|
||||
public function _buildDescString( $item )
|
||||
{
|
||||
/* INIT */
|
||||
$_desc = '';
|
||||
|
||||
/* Fetch basic stats */
|
||||
if ( $item['change_data_content'] )
|
||||
{
|
||||
$item['_diffs'] = substr_count( $item['change_data_content'], '-ips-match:1' );
|
||||
}
|
||||
|
||||
if ( $item['change_merge_content'] AND stristr( $item['change_merge_content'], '<ips:conflict' ) )
|
||||
{
|
||||
$item['_conflicts'] = substr_count( $item['change_merge_content'], '<ips:conflict' );
|
||||
}
|
||||
|
||||
/* Build text string */
|
||||
if ( $item['change_is_new'] == 'new' )
|
||||
{
|
||||
$_desc = $this->lang->words['ajax_newitem4thisv'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_desc = $item['_diffs'] . ' differences';
|
||||
|
||||
if ( intval( $item['_conflicts'] ) > 0 )
|
||||
{
|
||||
if ( $item['change_final_content'] )
|
||||
{
|
||||
$_desc .= ', <strong>' . $item['_conflicts'] . '</strong>' . $this->lang->words['ajax_resolvedconflicts'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_desc .= ', <strong>' . $item['_conflicts'] . '</strong>' . $this->lang->words['ajax_mergeconflicts'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_desc .= ',' . $this->lang->words['ajax_noconflicts'];
|
||||
}
|
||||
|
||||
if ( $item['change_changes_applied'] )
|
||||
{
|
||||
$_desc .= $this->lang->words['ajax_changescommitted'];
|
||||
}
|
||||
}
|
||||
|
||||
return $_desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab a diff to edit
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON
|
||||
*/
|
||||
private function _editDiff()
|
||||
{
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get data
|
||||
//-----------------------------------------
|
||||
|
||||
$diff_row = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => "change_id=" . intval( $change_id ) ) );
|
||||
|
||||
|
||||
if ( ! $diff_row['change_key'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_nokeyfound'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Prevent two lots of data going through */
|
||||
$diff_row['change_data_content'] = '';
|
||||
|
||||
/* Convert inline mark-up */
|
||||
$diff_row['change_merge_content'] = $this->skinFunctions->formatMergeForEdit( $diff_row['change_merge_content'] );
|
||||
|
||||
$this->returnJsonArray( $diff_row );
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab a diff to show
|
||||
*
|
||||
@@ -87,27 +320,37 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
*/
|
||||
private function _viewDiff()
|
||||
{
|
||||
$key = trim( $this->request['key'] );
|
||||
$change_id = trim( $this->request['change_id'] );
|
||||
$type = trim( $this->request['type'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get data
|
||||
//-----------------------------------------
|
||||
|
||||
$diff_row = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'template_diff_changes',
|
||||
'where' => "diff_change_key='" . $this->DB->addslashes($key) . "'" ) );
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => "change_id=" . intval( $change_id ) ) );
|
||||
|
||||
|
||||
if ( ! $diff_row['diff_change_key'] )
|
||||
if ( ! $diff_row['change_key'] )
|
||||
{
|
||||
$this->returnJsonError('No Key Found');
|
||||
$this->returnJsonError( $this->lang->words['ajax_nokeyfound'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
$diff_row['diff_change_content'] = str_replace( "\n", "<br>", $diff_row['diff_change_content']);
|
||||
$diff_row['diff_change_content'] = str_replace( "><", ">\n<" ,$diff_row['diff_change_content']);
|
||||
$diff_row['diff_change_content'] = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$diff_row['diff_change_content']);
|
||||
$diff_row['diff_change_content'] = str_replace( "\t", " ", $diff_row['diff_change_content'] );
|
||||
/* Diff */
|
||||
if ( $type != 'merge' )
|
||||
{
|
||||
$diff_row['change_data_content'] = str_replace( "\n", "<br>", $diff_row['change_data_content']);
|
||||
$diff_row['change_data_content'] = str_replace( "><", ">\n<" ,$diff_row['change_data_content']);
|
||||
$diff_row['change_data_content'] = preg_replace( "#(?<!(\<del|\<ins)) {1}(?!:style)#i", " " ,$diff_row['change_data_content']);
|
||||
$diff_row['change_data_content'] = str_replace( "\t", " ", $diff_row['change_data_content'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert inline mark-up */
|
||||
$diff_row['change_data_content'] = $this->skinFunctions->formatMergeForPreview( $diff_row['change_merge_content'] );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $diff_row );
|
||||
}
|
||||
@@ -119,140 +362,353 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand
|
||||
* @return string Json
|
||||
*/
|
||||
private function _process()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
{
|
||||
/* INIT */
|
||||
$pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10;
|
||||
$diffSessionID = intval( $this->request['sessionID'] );
|
||||
$completed = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch current session
|
||||
//-----------------------------------------
|
||||
$type = 'template';
|
||||
$items = array();
|
||||
$completed = 0;
|
||||
|
||||
/* Fetch current session */
|
||||
$session = $this->skinFunctions->fetchSession( $diffSessionID );
|
||||
|
||||
if ( $session === FALSE )
|
||||
{
|
||||
$this->returnJsonError('Could not locate a valid differences session');
|
||||
$this->returnJsonError( $this->lang->words['ajax_invalidsession'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Diff library
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classDifference.php' );
|
||||
$classDifference = new classDifference();
|
||||
$classDifference->method = 'PHP';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get template bits to check
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_templates',
|
||||
'where' => 'template_set_id=0',
|
||||
'order' => 'template_id ASC',
|
||||
'limit' => array( intval( $session['diff_session_done'] ), intval( $pergo ) ) ) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
if ( ! $this->DB->getTotalRows( $outer ) )
|
||||
/* Are we doing templates or CSS? */
|
||||
if ( $session['merge_templates_togo'] )
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_templates',
|
||||
'where' => 'template_set_id=0 AND template_master_key=\'' . $session['merge_master_key'] . '\'',
|
||||
'order' => 'template_id ASC',
|
||||
'limit' => array( intval( $session['merge_templates_done'] ), intval( $pergo ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$type = 'template';
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$items[] = array( 'data_group' => $row['template_group'],
|
||||
'data_title' => $row['template_name'],
|
||||
'data_content' => $row['template_content'],
|
||||
'data_master_key' => $session['merge_master_key'],
|
||||
'data_set_id' => $session['merge_set_id'],
|
||||
'data_type' => 'template' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* If we're here, set to templates but no templates, check CSS */
|
||||
if ( ! count( $items ) AND $type == 'template' )
|
||||
{
|
||||
$type = 'css';
|
||||
$pergo = 1;
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_css',
|
||||
'where' => 'css_set_id=0 AND css_master_key=\'' . $session['merge_master_key'] . '\'',
|
||||
'order' => 'css_id ASC',
|
||||
'limit' => array( intval( $session['merge_css_done'] ), intval( $pergo ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$items[] = array( 'data_group' => $row['css_app'],
|
||||
'data_title' => $row['css_group'],
|
||||
'data_content' => $row['css_content'],
|
||||
'data_master_key' => $session['merge_master_key'],
|
||||
'data_set_id' => $session['merge_set_id'],
|
||||
'data_type' => 'css' );
|
||||
}
|
||||
}
|
||||
|
||||
/* If we don't have items, we're probably done */
|
||||
if ( ! count( $items ) )
|
||||
{
|
||||
/* Fetch some counts templates */
|
||||
$templates = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => 'change_is_diff=1 AND change_is_new=0 AND change_data_type=\'template\' AND change_session_id=\'' . $diffSessionID . '\'' ) );
|
||||
|
||||
/* Fetch some counts CSS */
|
||||
$css = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => 'change_is_diff=1 AND change_is_new=0 AND change_data_type=\'css\' AND change_session_id=\'' . $diffSessionID . '\'' ) );
|
||||
|
||||
|
||||
$this->DB->update( 'skin_merge_session', array( 'merge_m_templates_togo' => $templates['count'],
|
||||
'merge_m_css_togo' => $css['count'],
|
||||
'merge_diff_done' => 1 ), 'merge_id=' . intval( $diffSessionID ) );
|
||||
/* Flag as completed */
|
||||
$completed = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
while( $row = $this->DB->fetch( $outer ) )
|
||||
foreach( $items as $item )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get corresponding row from diff table
|
||||
//-----------------------------------------
|
||||
/* Fetch templates to compare */
|
||||
$new = $item['data_content'];
|
||||
$original = $this->skinFunctions->fetchOriginalItem( $item );
|
||||
$custom = $this->skinFunctions->fetchCustomItem( $item );
|
||||
|
||||
$diff_row = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'templates_diff_import',
|
||||
'where' => "diff_func_group='{$row['template_group']}' AND diff_func_name='{$row['template_name']}' AND diff_session_id=".$diffSessionID ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
//-----------------------------------------
|
||||
/* Other data */
|
||||
$key = $diffSessionID.':'.$item['data_group'].':'.$item['data_title'];
|
||||
|
||||
if ( $diff_row['diff_key'] )
|
||||
/* Got an original bit? */
|
||||
if ( $original !== FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get difference
|
||||
//-----------------------------------------
|
||||
|
||||
$difference = $classDifference->getDifferences( $diff_row['diff_func_content'], $row['template_content'] );
|
||||
/* Check difference */
|
||||
$difference = $this->skinFunctions->fetchDifferences( $original, $new );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any differences?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $classDifference->diff_found )
|
||||
if ( $difference !== FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get corresponding row from diff table
|
||||
//-----------------------------------------
|
||||
|
||||
$diff_check = $this->DB->buildAndFetch( array( 'select' => 'diff_change_key',
|
||||
'from' => 'template_diff_changes',
|
||||
'where' => "diff_change_key='" . $diffSessionID.':'.$row['template_group'].':'.$row['template_name'] . "'" ) );
|
||||
/* Prevent dupes */
|
||||
$diffCheck = $this->DB->buildAndFetch( array( 'select' => 'change_id, change_key',
|
||||
'from' => 'skin_merge_changes',
|
||||
'where' => "change_key='" . $key . "'" ) );
|
||||
|
||||
if ( $diff_check['diff_change_key'] )
|
||||
if ( $diffCheck['change_id'] )
|
||||
{
|
||||
$this->DB->update( 'template_diff_changes', array( 'diff_change_func_group' => $row['template_group'],
|
||||
'diff_change_func_name' => $row['template_name'],
|
||||
'diff_change_content' => $difference,
|
||||
'diff_change_type' => 1,
|
||||
'diff_session_id' => $diffSessionID ),
|
||||
"diff_change_key='" . $diffSessionID.':'.$row['template_group'].':'.$row['template_name'] . "'" );
|
||||
$this->DB->update( 'skin_merge_changes', array( 'change_key' => $key,
|
||||
'change_session_id' => $diffSessionID,
|
||||
'change_updated' => time(),
|
||||
'change_data_group' => $item['data_group'],
|
||||
'change_data_title' => $item['data_title'],
|
||||
'change_data_content' => $difference,
|
||||
'change_data_type' => $item['data_type'],
|
||||
'change_is_diff' => 1,
|
||||
'change_is_new' => 0,
|
||||
'change_can_merge' => ( $custom ) ? 1 : 0 ), 'change_id=' . intval( $diffCheck['change_id'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'template_diff_changes', array( 'diff_change_key' => $diffSessionID.':'.$row['template_group'].':'.$row['template_name'],
|
||||
'diff_change_func_group' => $row['template_group'],
|
||||
'diff_change_func_name' => $row['template_name'],
|
||||
'diff_change_content' => $difference,
|
||||
'diff_change_type' => 1,
|
||||
'diff_session_id' => $diffSessionID ) );
|
||||
$this->DB->insert( 'skin_merge_changes', array( 'change_key' => $key,
|
||||
'change_session_id' => $diffSessionID,
|
||||
'change_updated' => time(),
|
||||
'change_data_group' => $item['data_group'],
|
||||
'change_data_title' => $item['data_title'],
|
||||
'change_data_content' => $difference,
|
||||
'change_data_type' => $item['data_type'],
|
||||
'change_is_diff' => 1,
|
||||
'change_is_new' => 0,
|
||||
'change_can_merge' => ( $custom ) ? 1 : 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! $session['diff_session_ignore_missing'] )
|
||||
{
|
||||
$this->DB->insert( 'template_diff_changes', array( 'diff_change_key' => $diffSessionID.':'.$row['template_group'].':'.$row['template_name'],
|
||||
'diff_change_func_group' => $row['template_group'],
|
||||
'diff_change_func_name' => $row['template_name'],
|
||||
'diff_change_content' => htmlspecialchars($row['template_content']),
|
||||
'diff_change_type' => 0,
|
||||
'diff_session_id' => $diffSessionID ) );
|
||||
}
|
||||
|
||||
$this->DB->insert( 'skin_merge_changes', array( 'change_key' => $key,
|
||||
'change_session_id' => $diffSessionID,
|
||||
'change_updated' => time(),
|
||||
'change_data_group' => $item['data_group'],
|
||||
'change_data_title' => $item['data_title'],
|
||||
'change_data_content' => htmlspecialchars( $item['data_content'] ),
|
||||
'change_data_type' => $item['data_type'],
|
||||
'change_is_diff' => 0,
|
||||
'change_is_new' => 1,
|
||||
'change_can_merge' => 0 ) );
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Increment
|
||||
//-----------------------------------------
|
||||
|
||||
$session['diff_session_done']++;
|
||||
/* Increment */
|
||||
if ( $type == 'template' )
|
||||
{
|
||||
$session['merge_templates_done']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$session['merge_css_done']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Update current session
|
||||
//-----------------------------------------
|
||||
/* Update current session */
|
||||
$this->DB->update( 'skin_merge_session', array( 'merge_templates_done' => intval( $session['merge_templates_done'] ), 'merge_css_done' => intval( $session['merge_css_done'] ) ), 'merge_id='.$diffSessionID );
|
||||
|
||||
$this->DB->update( 'template_diff_session', array( 'diff_session_done' => intval( $session['diff_session_done'] ) ), 'diff_session_id='.$diffSessionID );
|
||||
$done = intval( $session['merge_templates_done'] ) + intval( $session['merge_css_done'] );
|
||||
$total = $session['merge_templates_togo'] + $session['merge_css_togo'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Done or more?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'processed' => $session['diff_session_done'], 'completed' => $completed, 'message' => $session['diff_session_done'] . ' template bits processed...' ) );
|
||||
/* Messages */
|
||||
if ( $type == 'template' )
|
||||
{
|
||||
$title = $this->lang->words['ajax_tbdlll'];
|
||||
$message = sprintf( $this->lang->words['ajax_tbdprocess'], $session['merge_templates_done'], $session['merge_templates_togo'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $this->lang->words['ajax_cssdlll'];
|
||||
$message = sprintf( $this->lang->words['ajax_cssdprocess'], $session['merge_css_done'], $session['merge_css_togo'] );
|
||||
}
|
||||
|
||||
/* Give Jason back (L or H?) */
|
||||
$this->returnJsonArray( array( 'processed' => $done, 'completed' => $completed, 'title' => $title, 'message' => $message, 'perGo' => $pergo ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process merge
|
||||
*
|
||||
* @access private
|
||||
* @return string Json
|
||||
*/
|
||||
private function _merge()
|
||||
{
|
||||
/* INIT */
|
||||
$pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10;
|
||||
$diffSessionID = intval( $this->request['sessionID'] );
|
||||
$completed = 0;
|
||||
$type = 'template';
|
||||
$items = array();
|
||||
$completed = 0;
|
||||
|
||||
/* Fetch current session */
|
||||
$session = $this->skinFunctions->fetchSession( $diffSessionID );
|
||||
|
||||
if ( $session === FALSE )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_invalidsession'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Load merge class */
|
||||
require_once( IPS_KERNEL_PATH . 'classMerge.php' );
|
||||
|
||||
/* Are we doing templates or CSS? */
|
||||
if ( $session['merge_m_templates_togo'] )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'c.*',
|
||||
'from' => array( 'skin_merge_changes' => 'c' ),
|
||||
'where' => 'change_session_id=' . intval( $diffSessionID ) . ' AND change_data_type=\'template\' AND change_is_diff=1 AND change_is_new=0',
|
||||
'order' => 'change_id ASC',
|
||||
'limit' => array( intval( $session['merge_m_templates_done'] ), intval( $pergo ) ),
|
||||
'add_join' => array( array( 'select' => 's.*',
|
||||
'from' => array( 'skin_templates' => 's' ),
|
||||
'where' => 's.template_set_id=0 AND s.template_master_key=\'' . $session['merge_master_key'] . '\' AND s.template_group=c.change_data_group AND s.template_name=c.change_data_title',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$type = 'template';
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$items[] = array( 'data_group' => $row['template_group'],
|
||||
'data_title' => $row['template_name'],
|
||||
'data_content' => $row['template_content'],
|
||||
'data_master_key' => $session['merge_master_key'],
|
||||
'data_set_id' => $session['merge_set_id'],
|
||||
'data_type' => 'template' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* If we're here, set to templates but no templates, check CSS */
|
||||
if ( ! count( $items ) AND $type == 'template' )
|
||||
{
|
||||
$type = 'css';
|
||||
$pergo = 1;
|
||||
|
||||
$this->DB->build( array( 'select' => 'c.*',
|
||||
'from' => array( 'skin_merge_changes' => 'c' ),
|
||||
'where' => 'change_session_id=' . intval( $diffSessionID ) . ' AND change_data_type=\'css\' AND change_is_diff=1 AND change_is_new=0',
|
||||
'order' => 'change_id ASC',
|
||||
'limit' => array( intval( $session['merge_m_css_done'] ), intval( $pergo ) ),
|
||||
'add_join' => array( array( 'select' => 's.*',
|
||||
'from' => array( 'skin_css' => 's' ),
|
||||
'where' => 's.css_set_id=0 AND s.css_master_key=\'' . $session['merge_master_key'] . '\' AND s.css_app=c.change_data_group AND s.css_group=c.change_data_title',
|
||||
'type' => 'left' ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$items[] = array( 'data_group' => $row['css_app'],
|
||||
'data_title' => $row['css_group'],
|
||||
'data_content' => $row['css_content'],
|
||||
'data_master_key' => $session['merge_master_key'],
|
||||
'data_set_id' => $session['merge_set_id'],
|
||||
'data_type' => 'css' );
|
||||
}
|
||||
}
|
||||
|
||||
/* If we don't have items, we're probably done */
|
||||
if ( ! count( $items ) )
|
||||
{
|
||||
/* Flag as completed */
|
||||
$completed = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $items as $item )
|
||||
{
|
||||
/* Fetch templates to compare */
|
||||
$new = $item['data_content'];
|
||||
$original = $this->skinFunctions->fetchOriginalItem( $item );
|
||||
$custom = $this->skinFunctions->fetchCustomItem( $item );
|
||||
|
||||
/* Other data */
|
||||
$key = $diffSessionID.':'.$item['data_group'].':'.$item['data_title'];
|
||||
|
||||
/* Got all the required data? */
|
||||
if ( $new AND $original AND $custom )
|
||||
{
|
||||
/* Run the merge */
|
||||
$merge = new ThreeWayMerge( $original, $new, $custom, ( $type == 'template' ) ? 'lite' : 'full' );
|
||||
|
||||
$result = $merge->merge();
|
||||
|
||||
if ( $result !== FALSE )
|
||||
{
|
||||
/* Check for conflicts */
|
||||
$conflicts = ( stristr( $result, '<ips:conflict' ) ) ? 1 : 0;
|
||||
|
||||
$this->DB->update( 'skin_merge_changes', array( 'change_updated' => time(),
|
||||
'change_merge_content' => $result,
|
||||
'change_is_conflict' => $conflicts,
|
||||
'change_can_merge' => 1 ), 'change_key=\'' . $key . '\'' );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Increment */
|
||||
if ( $type == 'template' )
|
||||
{
|
||||
$session['merge_m_templates_done']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$session['merge_m_css_done']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update current session */
|
||||
$this->DB->update( 'skin_merge_session', array( 'merge_m_templates_done' => intval( $session['merge_m_templates_done'] ), 'merge_m_css_done' => intval( $session['merge_m_css_done'] ) ), 'merge_id=' . $diffSessionID );
|
||||
|
||||
$done = intval( $session['merge_m_templates_done'] ) + intval( $session['merge_m_css_done'] );
|
||||
$total = $session['merge_m_templates_togo'] + $session['merge_m_css_togo'];
|
||||
|
||||
/* Messages */
|
||||
if ( $type == 'template' )
|
||||
{
|
||||
$title = $this->lang->words['ajax_tbmlll'];
|
||||
$message = sprintf( $this->lang->words['ajax_tbdprocess'], $session['merge_m_templates_done'], $session['merge_m_templates_togo'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $this->lang->words['ajax_cssmlll'];
|
||||
$message = sprintf( $this->lang->words['ajax_cssdprocess'], $session['merge_m_css_done'], $session['merge_m_css_togo'] );
|
||||
}
|
||||
|
||||
/* Give Jason back (L or H?) */
|
||||
$this->returnJsonArray( array( 'processed' => $done, 'completed' => $completed, 'title' => $title, 'message' => $message, 'perGo' => $pergo, 'totalBits' => $total ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2009-09-21 18:02:56 -0400 (Mon, 21 Sep 2009) $
|
||||
* Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 5135 $
|
||||
* @version $Revision: 6314 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -113,7 +115,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -154,7 +156,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -166,7 +168,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
{
|
||||
if ( ! $template_name )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -236,7 +238,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID OR ! $templateID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -269,7 +271,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -315,7 +317,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID OR ! $templateGroup )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3Templates.js file
|
||||
* Last Updated: $Date: 2009-05-15 21:17:56 -0400 (Fri, 15 May 2009) $
|
||||
* Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 4663 $
|
||||
* @version $Revision: 6314 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -128,7 +130,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
/* Check... */
|
||||
if ( ! count( $finalIDs ) )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -192,7 +194,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand
|
||||
|
||||
if ( ! $setID OR ! $templateGroup or ! $sessionID )
|
||||
{
|
||||
$this->returnJsonError('Missing Data');
|
||||
$this->returnJsonError( $this->lang->words['ajax_missing_data'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* AJAX Functions For applications/core/js/ipb3CSS.js file
|
||||
* Last Updated: $Date: 2009-07-06 21:23:35 -0400 (Mon, 06 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* Author: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* @version $Revision: 4843 $
|
||||
* @version $Revision: 6980 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -49,10 +51,9 @@ class admin_core_ajax_uagents extends ipsAjaxCommand
|
||||
//-----------------------------------------
|
||||
// Load functions and cache classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php' );
|
||||
|
||||
$this->userAgentFunctions = new userAgentFunctions( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' );
|
||||
$this->userAgentFunctions = new $classToLoad( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// What shall we do?
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Group management
|
||||
* Last Updated: $Date: 2009-11-09 16:42:49 -0500 (Mon, 09 Nov 2009) $
|
||||
* Last Updated: $Date: 2010-11-16 11:26:43 -0500 (Tue, 16 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Monday 15th January 2007 (15:01)
|
||||
* @version $Revision: 5341 $
|
||||
* @version $Revision: 7195 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -27,7 +28,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
@@ -35,7 +35,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
@@ -43,7 +42,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
@@ -51,7 +49,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -60,7 +57,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_applications');
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) );
|
||||
|
||||
@@ -184,7 +181,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Toggle application enabled/disabled
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function toggleAppEnabled()
|
||||
@@ -208,10 +204,25 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$this->registry->output->showError( $this->lang->words['cannot_find_tog_app'], 111161 );
|
||||
}
|
||||
|
||||
if( in_array( $application['app_directory'], array( 'core', 'forums', 'members' ) ) AND $application['app_enabled'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.1 );
|
||||
}
|
||||
|
||||
$this->DB->update( 'core_applications', array( 'app_enabled' => $application['app_enabled'] ? 0 : 1 ), 'app_id=' . $app_id );
|
||||
|
||||
$this->moduleRecacheAll(1);
|
||||
|
||||
//-----------------------------------------
|
||||
// FURL templates
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
IPSLib::cacheFurlTemplates();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['app_toggled_ok'];
|
||||
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' );
|
||||
@@ -220,7 +231,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Build the FURL templates file into cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function seoRebuild()
|
||||
@@ -254,7 +264,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Build the sphinx conf file and give for download
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildSphinx()
|
||||
@@ -267,7 +276,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* IN DEV Tool to rebuild all data via XML
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function inDevRebuildAll()
|
||||
@@ -303,7 +311,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* IN DEV Tool to rebuild all data via XML
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function inDevExportAll()
|
||||
@@ -335,7 +342,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Remove a module
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function moduleRemove()
|
||||
@@ -388,12 +394,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Update all children...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'core_sys_module', array( 'sys_module_parent' => '' ), "sys_module_parent='". $module['sys_module_key'] . "'" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove...
|
||||
//-----------------------------------------
|
||||
@@ -418,7 +418,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Import a module
|
||||
*
|
||||
* @access public
|
||||
* @param string [Optional] XML content
|
||||
* @param integer IN_DEV override
|
||||
* @return void [Outputs to screen]
|
||||
@@ -448,12 +447,12 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
if ( $in_dev )
|
||||
{
|
||||
$_FILES['FILE_UPLOAD']['name'] = '';
|
||||
$this->request[ 'file_location'] = IPSLib::getAppDir( $this->request['_app'] ) . '/xml/' . $this->request['_app'] . '_modules.xml';
|
||||
$_FILES['FILE_UPLOAD']['name'] = '';
|
||||
$this->request['file_location'] = IPSLib::getAppDir( $this->request['_app'] ) . '/xml/' . $this->request['_app'] . '_modules.xml';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->request[ 'file_location'] = IPS_ROOT_PATH . $this->request['file_location'] ;
|
||||
$this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location'] ;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -571,8 +570,8 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// pArse
|
||||
//-----------------------------------------
|
||||
|
||||
$fields = array( 'sys_module_title' , 'sys_module_application', 'sys_module_key' , 'sys_module_description', 'sys_module_version', 'sys_module_parent',
|
||||
'sys_module_protected', 'sys_module_visible' , 'sys_module_tables', 'sys_module_hooks' , 'sys_module_position', 'sys_module_admin' );
|
||||
$fields = array( 'sys_module_title' , 'sys_module_application', 'sys_module_key' , 'sys_module_description', 'sys_module_version',
|
||||
'sys_module_protected', 'sys_module_visible' , 'sys_module_position', 'sys_module_admin' );
|
||||
|
||||
foreach( $xml->fetchElements( 'module' ) as $xmlelement )
|
||||
{
|
||||
@@ -646,7 +645,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Export modules
|
||||
*
|
||||
* @access public
|
||||
* @param integer Return the XML [1] or print to browser [0]
|
||||
* @return mixed XML content or outputs to screen
|
||||
*/
|
||||
@@ -730,7 +728,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Save a module
|
||||
*
|
||||
* @access private
|
||||
* @param string Type [add|edit]
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -747,7 +744,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$sys_module_key = IPSText::alphanumericalClean( trim( $this->request['sys_module_key'] ) );
|
||||
$sys_module_description = trim( $this->request['sys_module_description'] );
|
||||
$sys_module_version = trim( $this->request['sys_module_version'] );
|
||||
$sys_module_parent = IPSText::alphanumericalClean( trim( $this->request['sys_module_parent'] ) );
|
||||
$sys_module_protected = intval( $this->request['sys_module_protected'] );
|
||||
$sys_module_visible = intval( $this->request['sys_module_visible'] );
|
||||
$application = array();
|
||||
@@ -796,7 +792,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
if ( $test['sys_module_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['a_already'], $system_module_key );
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['a_already'], $sys_module_key );
|
||||
$this->modules_overview();
|
||||
return;
|
||||
}
|
||||
@@ -823,7 +819,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
'sys_module_key' => $sys_module_key,
|
||||
'sys_module_description' => $sys_module_description,
|
||||
'sys_module_version' => $sys_module_version,
|
||||
'sys_module_parent' => $sys_module_parent,
|
||||
'sys_module_visible' => $sys_module_visible,
|
||||
'sys_module_admin' => $sys_module_admin );
|
||||
|
||||
@@ -871,7 +866,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Add/Edit module form
|
||||
*
|
||||
* @access private
|
||||
* @param string Type [add|edit]
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -888,7 +882,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$modules = array( 'root' => array() );
|
||||
$application = array();
|
||||
$form = array();
|
||||
$apps = array( 0 => array( 0, $this->lang->words['a_noparent'] ) );
|
||||
$module_type = array( 0 => array( 0, $this->lang->words['a_public'] ), 1 => array( 1, $this->lang->words['a_admin'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -905,21 +898,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$this->applicationsOverview();
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get root modules...
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::$modules_by_section [ $application['app_directory'] ] = is_array( ipsRegistry::$modules_by_section [ $application['app_directory'] ] ) ? ipsRegistry::$modules_by_section [ $application['app_directory'] ] : array();
|
||||
|
||||
foreach( ipsRegistry::$modules_by_section [ $application['app_directory'] ] as $key => $data )
|
||||
{
|
||||
if ( ! $data['sys_module_parent'] AND $data['sys_module_admin'] == $sys_module_admin AND ( $sys_module_id AND $sys_module_id != $data['sys_module_id'] ) )
|
||||
{
|
||||
$apps[] = array( $data['sys_module_key'], $data['sys_module_title'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Add or edit?
|
||||
//-----------------------------------------
|
||||
@@ -927,8 +906,8 @@ class admin_core_applications_applications extends ipsCommand
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$formcode = 'module_add_do';
|
||||
$title = "Add New Module";
|
||||
$button = "Add New Module";
|
||||
$title = $this->lang->words['addnewmodule_apps'];
|
||||
$button = $this->lang->words['addnewmodule_apps'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -957,7 +936,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$form['sys_module_description'] = $this->registry->output->formInput( 'sys_module_description', $_POST['sys_module_description'] ? $_POST['sys_module_description'] : $module['sys_module_description'] );
|
||||
$form['sys_module_key'] = $this->registry->output->formInput( 'sys_module_key' , $_POST['sys_module_key'] ? $_POST['sys_module_key'] : $module['sys_module_key'] );
|
||||
$form['sys_module_version'] = $this->registry->output->formInput( 'sys_module_version' , $_POST['sys_module_version'] ? $_POST['sys_module_version'] : $module['sys_module_version'] );
|
||||
$form['sys_module_parent'] = $this->registry->output->formDropdown( 'sys_module_parent' , $apps, $_POST['sys_module_parent'] ? $_POST['sys_module_parent'] : $module['sys_module_parent'] );
|
||||
$form['sys_module_protected'] = $this->registry->output->formYesNo( 'sys_module_protected' , $_POST['sys_module_protected'] ? $_POST['sys_module_protected'] : $module['sys_module_protected'] );
|
||||
$form['sys_module_visible'] = $this->registry->output->formYesNo( 'sys_module_visible' , $_POST['sys_module_visible'] ? $_POST['sys_module_visible'] : $module['sys_module_visible'] );
|
||||
$form['sys_module_admin'] = $this->registry->output->formDropdown( 'sys_module_admin' , $module_type, $_POST['sys_module_admin'] ? $_POST['sys_module_admin'] : $module['sys_module_admin'] );
|
||||
@@ -966,7 +944,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// Nav
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . '&do=applications_overview', $application['app_title'] );
|
||||
$this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $application['app_id'] . '&sys_module_admin=' . $module['sys_module_admin'], $application['app_title'] );
|
||||
|
||||
$this->registry->output->html .= $this->html->module_form( $form, $title, $formcode, $button, $module, $application );
|
||||
}
|
||||
@@ -974,7 +952,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Move a module up/down
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function moduleManagePosition()
|
||||
@@ -985,8 +962,8 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
|
||||
$ajax = new classAjax();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$ajax = new $classToLoad();
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
@@ -1029,7 +1006,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Recache modules
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function moduleRecache()
|
||||
@@ -1072,7 +1048,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Recache apps, modules and menus
|
||||
*
|
||||
* @access public
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function moduleRecacheAll( $return=0 )
|
||||
@@ -1092,7 +1067,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* View al module
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function modules_overview()
|
||||
@@ -1101,15 +1075,14 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$sys_module_admin = intval( $this->request['sys_module_admin'] );
|
||||
$app_id = intval( $this->request['app_id'] );
|
||||
$application = array();
|
||||
$modules = array();
|
||||
$_modules = array();
|
||||
$_parents = array( '_root' => array() );
|
||||
$seen_count = 0;
|
||||
$total_items = array( '_root' => 0 );
|
||||
$_modules_admin = ( $sys_module_admin ) ? 'modules_admin' : 'modules_public';
|
||||
$sys_module_admin = intval( $this->request['sys_module_admin'] );
|
||||
$app_id = intval( $this->request['app_id'] );
|
||||
$application = array();
|
||||
$modules = array();
|
||||
$_modules = array();
|
||||
$_parents = array();
|
||||
$seen_count = 0;
|
||||
$_modules_admin = ( $sys_module_admin ) ? 'modules_admin' : 'modules_public';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get application
|
||||
@@ -1159,29 +1132,14 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
$_modules[ $row['sys_module_id'] ] = $row;
|
||||
|
||||
if ( $row['sys_module_parent'] )
|
||||
{
|
||||
$_parents[ $row['sys_module_parent'] ][ $row['sys_module_id'] ] = $row['sys_module_id'];
|
||||
$total_items[ $row['sys_module_parent'] ]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_parents[ '_root' ][ $row['sys_module_id'] ] = $row['sys_module_id'];
|
||||
$total_items['_root']++;
|
||||
}
|
||||
$_parents[ $row['sys_module_id'] ] = $row['sys_module_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up..
|
||||
//-----------------------------------------
|
||||
|
||||
$total_items = count( $_parents[ '_root' ] );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop...
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $_parents[ '_root' ] as $_sys_module_id => $sys_module_id )
|
||||
foreach( $_parents as $_sys_module_id => $sys_module_id )
|
||||
{
|
||||
$row = $_modules[ $_sys_module_id ];
|
||||
|
||||
@@ -1191,30 +1149,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// Add to row
|
||||
//-----------------------------------------
|
||||
|
||||
$modules['root'][] = $row;
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any children?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $_parents[ $row['sys_module_key'] ] ) AND count( $_parents[ $row['sys_module_key'] ] ) )
|
||||
{
|
||||
$_seen_count = 0;
|
||||
$_total_items = count( $_parents[ $row['sys_module_key'] ] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $_parents[ $row['sys_module_key'] ] as $___sys_module_id => $__sys_module_id )
|
||||
{
|
||||
$child_row = $_modules[ $___sys_module_id ];
|
||||
|
||||
$_seen_count++;
|
||||
|
||||
$modules[ $row['sys_module_key'] ][] = $child_row;
|
||||
}
|
||||
}
|
||||
$modules[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1227,7 +1162,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Remove an application (confirm screen)
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function applicationRemoveSplash()
|
||||
@@ -1250,7 +1184,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Remove an application
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function applicationRemove()
|
||||
@@ -1313,6 +1246,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
if ( file_exists( $_file ) )
|
||||
{
|
||||
$CACHE = array();
|
||||
require( $_file );
|
||||
|
||||
if ( is_array( $CACHE ) AND count( $CACHE ) )
|
||||
@@ -1332,6 +1266,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
{
|
||||
$TABLE = array();
|
||||
require( $_file );
|
||||
|
||||
foreach( $TABLE as $q )
|
||||
@@ -1378,6 +1313,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
{
|
||||
$QUERY = array();
|
||||
require( $_file );
|
||||
|
||||
if ( is_array( $QUERY ) AND count( $QUERY ) )
|
||||
@@ -1405,12 +1341,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$this->DB->delete( 'tags_index' , "app='{$application['app_directory']}'" );
|
||||
$this->DB->delete( 'faq' , "app='{$application['app_directory']}'" );
|
||||
$this->DB->delete( 'custom_bbcode' , "bbcode_app='{$application['app_directory']}'" );
|
||||
|
||||
if( $this->DB->checkForTable( 'search_index' ) )
|
||||
{
|
||||
$this->DB->delete( 'search_index' , "app='{$application['app_directory']}'" );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Get all hook files
|
||||
//-----------------------------------------
|
||||
@@ -1628,10 +1559,21 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$this->moduleRecacheAll(1);
|
||||
|
||||
$this->cache->rebuildCache( 'settings', 'global' );
|
||||
$this->cache->rebuildCache( 'notifications', 'global' );
|
||||
|
||||
/* Delete from upgrade */
|
||||
$this->DB->delete( 'upgrade_history', "upgrade_app='{$application['app_directory']}'" );
|
||||
|
||||
//-----------------------------------------
|
||||
// FURL templates
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
IPSLib::cacheFurlTemplates();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sphinx involved?
|
||||
//-----------------------------------------
|
||||
@@ -1653,7 +1595,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Export an application
|
||||
*
|
||||
* @access private
|
||||
* @param integer Return XML [1] or print to browser [0]
|
||||
* @return mixed XML content or void [Outputs to screen]
|
||||
*/
|
||||
@@ -1709,7 +1650,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Save an application
|
||||
*
|
||||
* @access private
|
||||
* @param string Type [add|edit]
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -1776,6 +1716,11 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$array['app_protected'] = $app_protected;
|
||||
}
|
||||
|
||||
if( in_array( $array['app_directory'], array( 'core', 'forums', 'members' ) ) AND !$array['app_enabled'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.2 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Save...
|
||||
//-----------------------------------------
|
||||
@@ -1814,6 +1759,12 @@ class admin_core_applications_applications extends ipsCommand
|
||||
$this->applicationsRecache();
|
||||
$this->applicationsMenuDataRecache();
|
||||
|
||||
try
|
||||
{
|
||||
IPSLib::cacheFurlTemplates();
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sphinx involved?
|
||||
//-----------------------------------------
|
||||
@@ -1833,7 +1784,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Add/edit application form
|
||||
*
|
||||
* @access private
|
||||
* @param string Type [add|edit]
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -1895,7 +1845,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Move an application up/down
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function applicationManagePosition()
|
||||
@@ -1904,8 +1853,8 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'classAjax.php' );
|
||||
$ajax = new classAjax();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$ajax = new $classToLoad();
|
||||
|
||||
//-----------------------------------------
|
||||
// Checks...
|
||||
@@ -1927,7 +1876,9 @@ class admin_core_applications_applications extends ipsCommand
|
||||
{
|
||||
foreach( $this->request['apps'] as $this_id )
|
||||
{
|
||||
$this->DB->update( 'core_applications', array( 'app_position' => $position ), 'app_id=' . $this_id );
|
||||
$location = $this->DB->buildAndFetch( array( 'select' => 'app_location', 'from' => 'core_applications', 'where' => 'app_id=' . $this_id ) );
|
||||
$buffer = array( 'root' => 0, 'ips' => 100, 'other' => 200 );
|
||||
$this->DB->update( 'core_applications', array( 'app_position' => $position+$buffer[ $location['app_location'] ] ), 'app_id=' . $this_id );
|
||||
|
||||
$position++;
|
||||
}
|
||||
@@ -1943,7 +1894,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* List applications
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function applicationsOverview()
|
||||
@@ -1952,12 +1902,11 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$folders = array();
|
||||
$application = array();
|
||||
$_apps = array();
|
||||
$seen_count = 0;
|
||||
$total_items = 0;
|
||||
$uninstalled = array();
|
||||
$folders = array();
|
||||
$application = array();
|
||||
$_apps = array();
|
||||
$seen_count = 0;
|
||||
$uninstalled = array();
|
||||
|
||||
/* Get the setup class */
|
||||
require IPS_ROOT_PATH . "setup/sources/base/setup.php";
|
||||
@@ -1974,7 +1923,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$_apps[ IPSLib::getAppFolder( $row['app_directory'] ) . '/' . $row['app_directory'] ] = $row;
|
||||
$total_items++;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2052,7 +2000,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
{
|
||||
if ( ! in_array( $filepath, array_keys( $_apps ) ) )
|
||||
{
|
||||
$info = IPSSetUp::fetchXmlAppInformation( $_file );
|
||||
$info = IPSSetUp::fetchXmlAppInformation( $_file, $this->settings['gb_char_set'] );
|
||||
|
||||
/* OK, we're making no effort to conceal the secret behind the ipskey. It's an honourable setting - do not abuse it.
|
||||
We only mildly obfuscate it to stop copy and paste mistakes in information.xml
|
||||
@@ -2074,11 +2022,14 @@ class admin_core_applications_applications extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
$uninstalled[ $_file ] = array( 'title' => $info['name'],
|
||||
'author' => $info['author'],
|
||||
'path' => $filepath,
|
||||
'okToGo' => $okToGo,
|
||||
'directory' => $_file );
|
||||
if ( $info['name'] )
|
||||
{
|
||||
$uninstalled[ $_file ] = array( 'title' => $info['name'],
|
||||
'author' => $info['author'],
|
||||
'path' => $filepath,
|
||||
'okToGo' => $okToGo,
|
||||
'directory' => $_file );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2092,30 +2043,118 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Recache applications
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function applicationsRecache()
|
||||
{
|
||||
$apps = array();
|
||||
$apps = array();
|
||||
$incomingEmails = FALSE;
|
||||
|
||||
/* Rebuild Applications Cache */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'core_applications',
|
||||
'order' => 'app_position ASC' ) );
|
||||
$this->DB->execute();
|
||||
'from' => 'core_applications',
|
||||
'order' => 'app_position ASC' ) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
while( $row = $this->DB->fetch($outer) )
|
||||
{
|
||||
$apps[ $row['app_directory'] ] = $row;
|
||||
|
||||
/* Search */
|
||||
if( IPSSearchIndex::appIsSearchable( $row['app_directory'] ) )
|
||||
{
|
||||
$_file = IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/search/config.php';
|
||||
|
||||
if ( file_exists( $_file ) )
|
||||
{
|
||||
$CONFIG = array();
|
||||
require( $_file );
|
||||
|
||||
if ( is_array( $CONFIG ) AND count( $CONFIG ) )
|
||||
{
|
||||
$apps[ $row['app_directory'] ]['search'] = $CONFIG;
|
||||
|
||||
unset( $CONFIG );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Supports like system? */
|
||||
if ( is_dir( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/like' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/like' ) as $file )
|
||||
{
|
||||
if ( !$file->isDot() AND !$file->isDir() )
|
||||
{
|
||||
$_name = $file->getFileName();
|
||||
|
||||
if ( substr( $_name, -4 ) == '.php' )
|
||||
{
|
||||
$apps[ $row['app_directory'] ]['_supports_likes'] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
|
||||
/* incomingEmails? */
|
||||
if ( file_exists( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/incomingEmails.php' ) )
|
||||
{
|
||||
$incomingEmails = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'app_cache', $apps, array( 'array' => 1 ) );
|
||||
|
||||
/* Do we have an incomingEmails extension anywhere? */
|
||||
$systemvars = $this->cache->getCache('systemvars');
|
||||
$systemvars['incomingEmails'] = $incomingEmails;
|
||||
$this->cache->setCache( 'systemvars', $systemvars, array( 'array' => 1 ) );
|
||||
|
||||
/* Rebuild navigation tabs too */
|
||||
$tabs = array();
|
||||
foreach ( $apps as $dir => $data )
|
||||
{
|
||||
if ( ! $data['app_hide_tab'] )
|
||||
{
|
||||
$tabs[] = array(
|
||||
'app' => $dir,
|
||||
'module'=> '',
|
||||
'title' => $this->lang->words[ $data['app_public_title'] ] ? $this->lang->words[ $data['app_public_title'] ] : $data['app_public_title']
|
||||
);
|
||||
}
|
||||
|
||||
if ( file_exists( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' ) )
|
||||
{
|
||||
$extraTabs = array();
|
||||
require_once IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php';
|
||||
|
||||
if ( is_array($extraTabs) && count($extraTabs) )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_' . $dir ), $dir );
|
||||
|
||||
$_extraTabs = array();
|
||||
foreach ( $extraTabs as $t )
|
||||
{
|
||||
$t['title'] = $this->lang->words[ $t['title'] ];
|
||||
$_extraTabs[] = $t;
|
||||
}
|
||||
|
||||
$tabs = array_merge( $tabs, $_extraTabs );
|
||||
}
|
||||
unset( $extraTabs );
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'app_cache', $apps, array( 'array' => 1 ) );
|
||||
$this->cache->setCache( 'navigation_tabs', $tabs, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recache main version number
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function versionNumbersRecache()
|
||||
@@ -2128,7 +2167,6 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Recache menu data
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function applicationsMenuDataRecache()
|
||||
@@ -2172,7 +2210,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'classXML.php' );
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$content = @file_get_contents( $_file );
|
||||
@@ -2188,6 +2226,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
/**
|
||||
* Easiest way I could find to get the data in a proper multi-dimensional array
|
||||
*/
|
||||
|
||||
foreach( $menu as $id => $data )
|
||||
{
|
||||
foreach( $data as $dataKey => $dataValue )
|
||||
@@ -2206,7 +2245,7 @@ class admin_core_applications_applications extends ipsCommand
|
||||
{
|
||||
$subItemIndex = 0;
|
||||
|
||||
if( $_itemKey == 'title' )
|
||||
if( $_itemKey == 'title' or $_itemKey == 'condition' )
|
||||
{
|
||||
$item[ $itemIndex ][ $_itemKey ] = $_itemValue['#alltext'];
|
||||
}
|
||||
@@ -2292,12 +2331,21 @@ class admin_core_applications_applications extends ipsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach( $item as $id => $data )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $data['condition'] )
|
||||
{
|
||||
$func = create_function( '', $data['condition'] );
|
||||
if( ! $func() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$_cat_title = $data['title'];
|
||||
$_cat_title = str_replace( '&', '&', $_cat_title ); // Validation thing
|
||||
@@ -2345,8 +2393,5 @@ class admin_core_applications_applications extends ipsCommand
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'app_menu_cache', $app_menu_cache, array( 'array' => 1 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Blog Application
|
||||
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th Aug 2004
|
||||
* @version $Revision: 3887 $
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -36,6 +38,6 @@ class admin_core_applications_blog extends ipsCommand
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("");
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Blog Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7126 $
|
||||
*/
|
||||
|
||||
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_applications_ccs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Download Manager Application
|
||||
* Last Updated: $Date: 2009-02-12 13:32:01 -0500 (Thu, 12 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 17 February 2003
|
||||
* @version $Revision: 3944 $
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default applications section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Download Manager Application
|
||||
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Who knows...
|
||||
* @version $Revision: 3887 $
|
||||
* @version $Revision: 7126 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -36,6 +38,6 @@ class admin_core_applications_downloads extends ipsCommand
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("");
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Gallery Application
|
||||
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Who knows...
|
||||
* @version $Revision: 3887 $
|
||||
* @version $Revision: 7126 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -36,6 +38,6 @@ class admin_core_applications_gallery extends ipsCommand
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("");
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Nexus Application
|
||||
* Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7126 $
|
||||
*/
|
||||
|
||||
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_applications_nexus extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' );
|
||||
|
||||
$this->registry->output->showInsideIframe("http://betscms.ws");
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Application Installation
|
||||
* Last Updated: $Date: 2009-09-28 18:04:38 -0400 (Mon, 28 Sep 2009) $
|
||||
* Last Updated: $Date: 2010-10-19 11:43:08 -0400 (Tue, 19 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5170 $
|
||||
*
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6996 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -28,7 +28,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
@@ -36,7 +35,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
@@ -44,7 +42,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
@@ -52,7 +49,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Current app path
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $app_full_path;
|
||||
@@ -60,7 +56,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Product information
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
private $product_information;
|
||||
@@ -68,7 +63,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -92,7 +86,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$this->app_full_path = IPSLib::getAppDir( $this->request['app_directory'] ) . '/';
|
||||
|
||||
/* Set up product info from XML file */
|
||||
$this->product_information = IPSSetUp::fetchXmlAppInformation( $this->request['app_directory'] );
|
||||
$this->product_information = IPSSetUp::fetchXmlAppInformation( $this->request['app_directory'], $this->settings['gb_char_set'] );
|
||||
|
||||
if( ! $this->app_full_path OR ! $this->product_information['title'] )
|
||||
{
|
||||
@@ -164,7 +158,6 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Rebuild PHP Templates Cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function recacheTemplates()
|
||||
@@ -295,9 +288,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Finalizes installation and rebuilds caches
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -306,7 +298,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$errors = array();
|
||||
|
||||
/* Init Data */
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'] );
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] );
|
||||
$_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] );
|
||||
|
||||
/* Grab Data */
|
||||
@@ -320,12 +312,14 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$this->cache->rebuildCache( 'module_cache', 'global' );
|
||||
$this->cache->rebuildCache( 'app_menu_cache', 'global' );
|
||||
$this->cache->rebuildCache( 'group_cache', 'global' );
|
||||
$this->cache->rebuildCache( 'notifications', 'global' );
|
||||
|
||||
/* Rebuild application specific caches */
|
||||
$_file = $this->app_full_path . 'extensions/coreVariables.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
{
|
||||
$CACHE = array();
|
||||
require( $_file );
|
||||
|
||||
if( is_array( $CACHE ) AND count( $CACHE ) )
|
||||
@@ -340,7 +334,14 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/* Rebuild FURLs */
|
||||
if( file_exists( $this->app_full_path . 'extensions/furlTemplates.php' ) )
|
||||
{
|
||||
IPSLib::cacheFurlTemplates();
|
||||
try
|
||||
{
|
||||
IPSLib::cacheFurlTemplates();
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
// Show an error?
|
||||
}
|
||||
}
|
||||
|
||||
/* Show completed screen... */
|
||||
@@ -350,9 +351,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Next Check
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function nextCheck()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -361,9 +361,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$errors = array();
|
||||
|
||||
/* Init Data */
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'] );
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] );
|
||||
$_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] );
|
||||
$modules = IPSSetUp::fetchXmlAppModules( $vars['app_directory'] );
|
||||
$modules = IPSSetUp::fetchXmlAppModules( $vars['app_directory'], $this->settings['gb_char_set'] );
|
||||
|
||||
/* Grab Data */
|
||||
$data['app_directory'] = $vars['app_directory'];
|
||||
@@ -414,8 +414,13 @@ class admin_core_applications_setup extends ipsCommand
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'core_applications', array(
|
||||
'app_version' => $_numbers['current'][1],
|
||||
'app_long_version' => $_numbers['current'][0]
|
||||
'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_directory='" . $vars['app_directory'] . "'" );
|
||||
|
||||
/* Update the modules */
|
||||
@@ -448,9 +453,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import Hooks
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function hooks()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -464,8 +468,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
if( file_exists( $this->app_full_path . 'xml/hooks.xml' ) )
|
||||
{
|
||||
/* Get the hooks class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php' );
|
||||
$hooks = new admin_core_applications_hooks();
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' );
|
||||
$hooks = new $classToLoad();
|
||||
$hooks->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$return = $hooks->installAppHooks( $vars['app_directory'] );
|
||||
@@ -490,9 +494,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import Settings
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function settings()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -505,9 +508,9 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) )
|
||||
{
|
||||
/* Get the settings class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php' );
|
||||
$settings = new admin_core_tools_settings( $this->registry );
|
||||
/* Get the settings class */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php', 'admin_core_tools_settings' );
|
||||
$settings = new $classToLoad();
|
||||
$settings->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$this->request['app_dir'] = $vars['app_directory'];
|
||||
@@ -552,9 +555,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import tasks
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function tasks()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -565,8 +567,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php' );
|
||||
$task_obj = new admin_core_system_taskmanager( $this->registry );
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php', 'admin_core_system_taskmanager' );
|
||||
$task_obj = new $classToLoad();
|
||||
$task_obj->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$task_obj->tasksImportFromXML( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml', true );
|
||||
@@ -584,9 +586,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import bbcode
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function bbcode()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -597,8 +598,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php' );
|
||||
$bbcode = new admin_core_posts_bbcode();
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' );
|
||||
$bbcode = new $classToLoad();
|
||||
$bbcode->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$bbcode->bbcodeImportDo( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) );
|
||||
@@ -609,8 +610,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) )
|
||||
{
|
||||
/* Get the language class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php' );
|
||||
$bbcode = new admin_core_posts_media();
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' );
|
||||
$bbcode = new $classToLoad();
|
||||
$bbcode->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$bbcode->doMediaImport( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) );
|
||||
@@ -633,9 +634,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Import help
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function help()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -645,8 +645,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php' );
|
||||
$help = new admin_core_tools_help();
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php', 'admin_core_tools_help' );
|
||||
$help = new $classToLoad();
|
||||
$help->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$done = $help->helpFilesXMLImport_app( $vars['app_directory'] );
|
||||
@@ -666,9 +666,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Language Import
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function languages()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -680,8 +679,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) );
|
||||
|
||||
/* Get the language stuff */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );
|
||||
$lang = new admin_core_languages_manage_languages( $this->registry );
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' );
|
||||
$lang = new $classToLoad();
|
||||
$lang->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
/* Loop through the xml directory and look for lang packs */
|
||||
@@ -694,7 +693,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
if( preg_match( "#(.+?)_language_pack.xml#", $f->getFileName() ) )
|
||||
{
|
||||
$this->request['file_location'] = $_PATH . $f->getFileName();
|
||||
$lang->imprtFromXML( true, true, true, $vars['app_directory'] );
|
||||
$lang->imprtFromXML( true, true, true, $vars['app_directory'], false, 1 );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
@@ -711,9 +710,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Install templates
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function templates()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -774,7 +772,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
$return = $skinFunctions->importReplacementsXMLArchive( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) );
|
||||
$return = $skinFunctions->importReplacementsXMLArchive( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ), $skinKey );
|
||||
|
||||
$output[] = $this->lang->words['redir__replacements'];
|
||||
}
|
||||
@@ -784,6 +782,12 @@ class admin_core_applications_setup extends ipsCommand
|
||||
//$skinCaching->rebuildPHPTemplates( 0 );
|
||||
//$skinCaching->rebuildCSS( 0 );
|
||||
//$skinCaching->rebuildReplacementsCache( 0 );
|
||||
|
||||
/* No templates? Give some sort of feedback */
|
||||
if ( !count( $output ) )
|
||||
{
|
||||
$output[] = $this->lang->words['redir__no_templates'];
|
||||
}
|
||||
|
||||
/* Show redirect... */
|
||||
$this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'languages', $vars ) );
|
||||
@@ -792,9 +796,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Runs any additional sql files
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function sqlSteps()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -820,6 +823,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/* INIT */
|
||||
$new_id = $id + 1;
|
||||
$count = 0;
|
||||
$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' );
|
||||
@@ -868,9 +872,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Creates Tables, Runs Inserts, and Indexes
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function sqlBasics()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -896,6 +899,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
if ( file_exists( $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' );
|
||||
|
||||
if ( is_array( $TABLE ) and count( $TABLE ) )
|
||||
@@ -970,6 +974,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
{
|
||||
if ( file_exists( $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' );
|
||||
|
||||
$count = 0;
|
||||
@@ -1008,7 +1013,8 @@ 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' ) )
|
||||
{
|
||||
$count = 0;
|
||||
$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' );
|
||||
@@ -1037,6 +1043,12 @@ class admin_core_applications_setup extends ipsCommand
|
||||
|
||||
$output[] = sprintf( $this->lang->words['redir__sql_inserts'], $count );
|
||||
}
|
||||
|
||||
/* If we did no queries, show something here */
|
||||
if ( !count( $output ) )
|
||||
{
|
||||
$output[] = sprintf( $this->lang->words['redir__sql_run'], 0 );
|
||||
}
|
||||
|
||||
/* Show Redirect... */
|
||||
$this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql_steps', $vars ) );
|
||||
@@ -1045,9 +1057,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Begin installation
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function start()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -1060,7 +1071,7 @@ class admin_core_applications_setup extends ipsCommand
|
||||
$info = array();
|
||||
|
||||
/* Init Data */
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $app_directory );
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] );
|
||||
$_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory );
|
||||
$_files = IPSSetUp::fetchXmlAppWriteableFiles( $app_directory );
|
||||
|
||||
@@ -1177,9 +1188,8 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Get environment vars
|
||||
*
|
||||
* @access private
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
private function getVars()
|
||||
{
|
||||
/* INIT */
|
||||
@@ -1213,11 +1223,10 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Get next action URL
|
||||
*
|
||||
* @access private
|
||||
* @param string $next_action
|
||||
* @param array $env
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
private 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'];
|
||||
@@ -1226,17 +1235,16 @@ class admin_core_applications_setup extends ipsCommand
|
||||
/**
|
||||
* Show the redirect screen
|
||||
*
|
||||
* @access private
|
||||
* @param string $app_directory
|
||||
* @param string $output
|
||||
* @param string $errors
|
||||
* @param string $next_url
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
private function showRedirectScreen( $app_directory, $output, $errors, $next_url )
|
||||
{
|
||||
/* Init Data */
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $app_directory );
|
||||
$data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] );
|
||||
$_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory );
|
||||
|
||||
/* Grab Data */
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,10 +15,10 @@
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Управление модификациями (hooks)</title>
|
||||
<title>Управление хуками (hooks)</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Список модификаций</subitemtitle>
|
||||
<subitemtitle>Список хуков</subitemtitle>
|
||||
<subsection>hooks</subsection>
|
||||
<subitemurl>do=hooks_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default diagnostics section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Diagnostic tools
|
||||
* Last Updated: $Date: 2009-09-21 18:02:56 -0400 (Mon, 21 Sep 2009) $
|
||||
* Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5135 $
|
||||
* @version $Revision: 6990 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -28,7 +29,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
@@ -36,7 +36,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
@@ -44,7 +43,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
@@ -52,7 +50,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Directory separator
|
||||
*
|
||||
* @access private
|
||||
* @var string Directory separator
|
||||
*/
|
||||
private $dir_split = "/";
|
||||
@@ -60,7 +57,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Db tools
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $dbTools;
|
||||
@@ -68,7 +64,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -124,6 +119,11 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'whitespace_checker' );
|
||||
$this->_whitespaceCheck();
|
||||
break;
|
||||
|
||||
case 'connections':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'connection_checker' );
|
||||
$this->_checkConnections();
|
||||
break;
|
||||
|
||||
case 'filepermissions':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permission_checker' );
|
||||
@@ -159,10 +159,36 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test outbound connections
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _checkConnections()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Turn errors on so we can view them
|
||||
//-----------------------------------------
|
||||
|
||||
@ini_set( 'display_errors', 1 );
|
||||
error_reporting( E_ALL ^ E_NOTICE );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$_files = new $classToLoad();
|
||||
$_files->use_sockets = 1;
|
||||
|
||||
$_test = $_files->getFileContents( "http://yandex.ru/" );
|
||||
$_headers = $_files->raw_headers;
|
||||
|
||||
$_test1 = $_files->getFileContents( "https://yandex.ru/" );
|
||||
$_headers1 = $_files->raw_headers;
|
||||
|
||||
$this->registry->output->html .= $this->html->connectionCheckerResult( $_headers, $_test, $_headers1, $_test1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a log entry
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmViewLog()
|
||||
@@ -217,7 +243,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Displays a member's session
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmMemberIndex()
|
||||
@@ -284,7 +309,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* List topic marking debugging index screen (shows members)
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _tmIndex()
|
||||
@@ -330,7 +354,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check file versions
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _versionCheck()
|
||||
@@ -357,8 +380,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
// Got real version number?
|
||||
//-----------------------------------------
|
||||
|
||||
$version['version'] = (IPB_VERSION == '3.0.5') ? $latest_version['upgrade_version_human'] : IPB_VERSION;
|
||||
$version['version_full'] = (IPB_LONG_VERSION == '30012') ? $latest_version['upgrade_version_id'] : IPB_LONG_VERSION;
|
||||
$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 History
|
||||
@@ -380,7 +403,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check file versions
|
||||
*
|
||||
* @access private
|
||||
* @param string Directory to check
|
||||
* @return array Files => Versions
|
||||
*/
|
||||
@@ -458,7 +480,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check file permissions
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _permissionsCheck()
|
||||
@@ -629,7 +650,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Whitespace checking
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _whitespaceCheck()
|
||||
@@ -645,7 +665,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Recurse over a directory
|
||||
*
|
||||
* @access private
|
||||
* @param string Directory to check
|
||||
* @return array Array of files with whitespace in them
|
||||
*/
|
||||
@@ -715,7 +734,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Table and index checker basic stuff
|
||||
*
|
||||
* @access private
|
||||
* @param void
|
||||
* @return array Table files
|
||||
*/
|
||||
@@ -741,8 +759,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
// Get the library to run the checks
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'db_lib/' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tools.php' );
|
||||
$this->dbTools = new db_tools();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'db_lib/' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tools.php', 'db_tools' );
|
||||
$this->dbTools = new $classToLoad();
|
||||
|
||||
return $sql_table_files;
|
||||
}
|
||||
@@ -750,7 +768,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check the database for missing indexes
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _indexCheck()
|
||||
@@ -777,10 +794,10 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
{
|
||||
$output = $this->dbTools->dbIndexDiag( $TABLE, $this->request['fix'] );
|
||||
|
||||
if( !$output )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if( !$output )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $output['error_count'] > 0 )
|
||||
{
|
||||
@@ -798,7 +815,6 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Check the database for missing tables/columns
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
* @todo [Future] Functionality to show EXTRA columns/tables?
|
||||
*/
|
||||
@@ -847,11 +863,59 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
/**
|
||||
* Show the overview page
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listFunctions()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Stats
|
||||
//-----------------------------------------
|
||||
|
||||
$reg = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as reg' ,
|
||||
'from' => array( 'validating' => 'v' ),
|
||||
'where' => 'v.lost_pass <> 1 AND m.member_group_id=' . $this->settings['auth_group'],
|
||||
'add_join' => array( array(
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=v.member_id',
|
||||
'type' => 'left'
|
||||
) ) ) );
|
||||
|
||||
if( $this->settings['ipb_bruteforce_attempts'] )
|
||||
{
|
||||
$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',
|
||||
'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 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// PHP INFO?
|
||||
//-----------------------------------------
|
||||
@@ -901,6 +965,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
$server_load_found = 0;
|
||||
$total_memory = "--";
|
||||
$avail_memory = "--";
|
||||
$_disabled = @ini_get('disable_functions') ? explode( ',', @ini_get('disable_functions') ) : array();
|
||||
$_shellExecAvail = in_array( 'shell_exec', $_disabled ) ? false : true;
|
||||
|
||||
//-----------------------------------------
|
||||
// Check memory
|
||||
@@ -908,7 +974,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
if( strpos( strtolower( PHP_OS ), 'win' ) === 0 )
|
||||
{
|
||||
$mem = @shell_exec('systeminfo');
|
||||
$mem = $_shellExecAvail ? @shell_exec('systeminfo') : null;
|
||||
|
||||
if( $mem )
|
||||
{
|
||||
@@ -933,16 +999,25 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$mem = @shell_exec("free -m");
|
||||
$server_reply = explode( "\n", str_replace( "\r", "", $mem ) );
|
||||
$mem = array_slice( $server_reply, 1, 1 );
|
||||
$mem = preg_split( "#\s+#", $mem[0] );
|
||||
|
||||
$total_memory = ( $mem[1] ) ? $mem[1] . ' MB' : '--';
|
||||
$avail_memory = ( $mem[3] ) ? $mem[3] . ' MB' : '--';
|
||||
$mem = $_shellExecAvail ? @shell_exec("free -m") : null;
|
||||
|
||||
if( $mem )
|
||||
{
|
||||
$server_reply = explode( "\n", str_replace( "\r", "", $mem ) );
|
||||
$mem = array_slice( $server_reply, 1, 1 );
|
||||
$mem = preg_split( "#\s+#", $mem[0] );
|
||||
|
||||
$total_memory = ( $mem[1] ) ? $mem[1] . ' MB' : '--';
|
||||
$avail_memory = ( $mem[3] ) ? $mem[3] . ' MB' : '--';
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_memory = '--';
|
||||
$avail_memory = '--';
|
||||
}
|
||||
}
|
||||
|
||||
$disabled_functions = @ini_get('disable_functions') ? str_replace( ",", ", ", @ini_get('disable_functions') ) : $this->lang->words['d_anoinfo'];
|
||||
$disabled_functions = ( is_array($_disabled) && count($_disabled) ) ? implode( ', ', $_disabled ) : $this->lang->words['d_anoinfo'];
|
||||
$extensions = get_loaded_extensions();
|
||||
$extensions = array_combine( $extensions, $extensions );
|
||||
sort( $extensions, SORT_STRING );
|
||||
@@ -1004,20 +1079,27 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
'avail_memory' => $avail_memory,
|
||||
);
|
||||
|
||||
if( strpos( strtolower( PHP_OS ), 'win' ) === 0 )
|
||||
if( $_shellExecAvail )
|
||||
{
|
||||
$tasks = @shell_exec( "tasklist" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
}
|
||||
else if( strtolower( PHP_OS ) == 'darwin' )
|
||||
{
|
||||
$tasks = @shell_exec( "top -l 1" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
if( strpos( strtolower( PHP_OS ), 'win' ) === 0 )
|
||||
{
|
||||
$tasks = @shell_exec( "tasklist" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
}
|
||||
else if( strtolower( PHP_OS ) == 'darwin' )
|
||||
{
|
||||
$tasks = @shell_exec( "top -l 1" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
}
|
||||
else
|
||||
{
|
||||
$tasks = @shell_exec( "top -b -n 1" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tasks = @shell_exec( "top -b -n 1" );
|
||||
$tasks = str_replace( " ", " ", $tasks );
|
||||
$tasks = '';
|
||||
}
|
||||
|
||||
if( !$tasks )
|
||||
@@ -1031,7 +1113,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand
|
||||
|
||||
$data['tasks'] = $tasks;
|
||||
|
||||
$this->registry->output->html .= $this->html->diagnosticsOverview( $data );
|
||||
$this->registry->output->html .= $this->html->diagnosticsOverview( $data, $statsbox );
|
||||
|
||||
$this->registry->output->html .= $this->html->acp_version_history_wrapper( $thiscontent );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -44,12 +44,23 @@
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</item>
|
||||
<item>
|
||||
<title>Проверка сетевых соединений</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка сетевых соединений</subitemtitle>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=connections</subitemurl>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Проверка структуры базы</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Проверка структуры базы дынных</subitemtitle>
|
||||
<subitemtitle>Проверка структуры базы данных</subitemtitle>
|
||||
<subsection>diagnostics</subsection>
|
||||
<subitemurl>do=dbchecker</subitemurl>
|
||||
<subisredirect>0</subisredirect>
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
<key>version_checker</key>
|
||||
<string>Может проверять файлы на правильность версии?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>connection_checker</key>
|
||||
<string>Может использовать проверку сетевых соединений?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permission_checker</key>
|
||||
<string>Может проверять файлы и директории на правильность расстановки прав доступа?</string>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default help section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,158 +1,153 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Quick help - shows popups with help information
|
||||
* Last Updated: $Date: 2009-02-26 18:25:15 -0500 (Thu, 26 Feb 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 4115 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_help_quickhelp extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Array of help text
|
||||
*
|
||||
* @access private
|
||||
* @var array Help texts
|
||||
*/
|
||||
private $help_text = array();
|
||||
|
||||
/**
|
||||
* Initialize the help text array
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _initText()
|
||||
{
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
|
||||
|
||||
return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'],
|
||||
'body' => $this->lang->words['q_html_info'],
|
||||
),
|
||||
|
||||
'mod_mmod' => array( 'title' => $this->lang->words['q_multi'],
|
||||
'body' => $this->lang->words['q_multi_info'],
|
||||
),
|
||||
|
||||
'set_spider' => array( 'title' => $this->lang->words['q_bots'],
|
||||
'body' => $this->lang->words['q_bots_info'],
|
||||
),
|
||||
|
||||
'mg_upload' => array( 'title' => $this->lang->words['q_upload'],
|
||||
'body' => $this->lang->words['q_upload_info'],
|
||||
),
|
||||
|
||||
|
||||
'mg_promote' => array( 'title' => $this->lang->words['q_promote'],
|
||||
'body' => $this->lang->words['q_promote_info'],
|
||||
),
|
||||
's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'],
|
||||
'body' => $this->lang->words['q_captcha_info'],
|
||||
),
|
||||
|
||||
'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'],
|
||||
'body' => $this->lang->words['q_bulk_info'],
|
||||
),
|
||||
'comp_menu' => array ( 'title' => $this->lang->words['q_components'],
|
||||
'body' => $this->lang->words['q_components_info'],
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$id = $this->request['id'];
|
||||
/**
|
||||
* Èçìåíåíèå ðåäèðåêòà, ïðåäëîæåíî(çà ÷òî åìó áîëüøîå ñïàñèáî :)) $iD
|
||||
|
||||
if( $this->request['do'] == 'redirect' )
|
||||
{
|
||||
$this->_redirect( $id );
|
||||
}
|
||||
*/
|
||||
|
||||
$this->help_text = $this->_initText();
|
||||
|
||||
if ($this->help_text[ $id ]['title'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['q_nohelp'], 11148 );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->registry->output->global_template->quickHelp( $this->help_text[$id]['title'], $this->help_text[$id]['body'] );
|
||||
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect offsite for more help/options
|
||||
*
|
||||
* @access private
|
||||
* @param string 'key' to redirect to
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
/**
|
||||
* Èçìåíåíèå ðåäèðåêòà, ïðåäëîæåíî(çà ÷òî åìó áîëüøîå ñïàñèáî :)) $iD
|
||||
|
||||
private function _redirect( $id )
|
||||
{
|
||||
switch( $id )
|
||||
{
|
||||
case 'docs':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
case 'kb':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
case 'resources':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
case 'contact':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
case 'features':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
case 'bugs':
|
||||
$url = "";
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'support':
|
||||
$url = "";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->registry->output->silentRedirect( $url );
|
||||
}
|
||||
*/
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Quick help - shows popups with help information
|
||||
* 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
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 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_help_quickhelp extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Array of help text
|
||||
*
|
||||
* @access private
|
||||
* @var array Help texts
|
||||
*/
|
||||
private $help_text = array();
|
||||
|
||||
/**
|
||||
* Initialize the help text array
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _initText()
|
||||
{
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) );
|
||||
|
||||
return array( 'mg_dohtml' => array( 'title' => $this->lang->words['q_html'],
|
||||
'body' => $this->lang->words['q_html_info'],
|
||||
),
|
||||
|
||||
'mod_mmod' => array( 'title' => $this->lang->words['q_multi'],
|
||||
'body' => $this->lang->words['q_multi_info'],
|
||||
),
|
||||
|
||||
'set_spider' => array( 'title' => $this->lang->words['q_bots'],
|
||||
'body' => $this->lang->words['q_bots_info'],
|
||||
),
|
||||
|
||||
'mg_upload' => array( 'title' => $this->lang->words['q_upload'],
|
||||
'body' => $this->lang->words['q_upload_info'],
|
||||
),
|
||||
|
||||
|
||||
'mg_promote' => array( 'title' => $this->lang->words['q_promote'],
|
||||
'body' => $this->lang->words['q_promote_info'],
|
||||
),
|
||||
's_reg_antispam' => array ( 'title' => $this->lang->words['q_captcha'],
|
||||
'body' => $this->lang->words['q_captcha_info'],
|
||||
),
|
||||
|
||||
'm_bulkemail' => array ( 'title' => $this->lang->words['q_bulk'],
|
||||
'body' => $this->lang->words['q_bulk_info'],
|
||||
),
|
||||
'comp_menu' => array ( 'title' => $this->lang->words['q_components'],
|
||||
'body' => $this->lang->words['q_components_info'],
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$id = $this->request['id'];
|
||||
|
||||
if( $this->request['do'] == 'redirect' )
|
||||
{
|
||||
$this->_redirect( $id );
|
||||
}
|
||||
|
||||
$this->help_text = $this->_initText();
|
||||
|
||||
if ($this->help_text[ $id ]['title'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['q_nohelp'], 11148 );
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->registry->output->global_template->quickHelp( $this->help_text[$id]['title'], $this->help_text[$id]['body'] );
|
||||
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect offsite for more help/options
|
||||
*
|
||||
* @access private
|
||||
* @param string 'key' to redirect to
|
||||
* @return 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";
|
||||
break;
|
||||
|
||||
case 'resources':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/forums";
|
||||
break;
|
||||
|
||||
case 'contact':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/contact";
|
||||
break;
|
||||
|
||||
case 'features':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/suggestfeatures";
|
||||
break;
|
||||
|
||||
case 'bugs':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/bugtrack";
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'support':
|
||||
$url = "http://anonym.to/?http://external.iblink.ru/clientarea";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->registry->output->silentRedirect( $url );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,71 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Документация</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Документация</subitemtitle>
|
||||
<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>
|
||||
<title>Тех. поддержка</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Техническая поддержка</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=support</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Форумы</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Форумы IBResource</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=resources</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Контакты</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Контактная информация</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=contact</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Сообщить об ошибке</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Сообщить об ошибке</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=bugs</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Документация</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Документация</subitemtitle>
|
||||
<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>
|
||||
<title>Тех. поддержка</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Техническая поддержка</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=support</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Форумы</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Форумы IBResource</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=resources</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Контакты</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Контактная информация</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=contact</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Сообщить об ошибке</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Сообщить об ошибке</subitemtitle>
|
||||
<subsection>quickhelp</subsection>
|
||||
<subitemurl>do=redirect&id=bugs</subitemurl>
|
||||
<subisredirect>1</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default languages section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Language Pack Management
|
||||
* Last Updated: $LastChangedDate: 2009-12-01 22:25:25 -0500 (Tue, 01 Dec 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 5503 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6990 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -25,7 +27,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Daily flag
|
||||
*
|
||||
* @access public
|
||||
* @var bool
|
||||
*/
|
||||
private $__daily = false;
|
||||
@@ -33,7 +34,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -201,7 +201,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Finish a session and remove data
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function translateKill()
|
||||
@@ -231,14 +230,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
}
|
||||
|
||||
/* Load kernel class for file management */
|
||||
require_once( IPS_KERNEL_PATH . 'classFileManagement.php' );
|
||||
$classFileManagement = new classFileManagement();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Remove files */
|
||||
$classFileManagement->emptyDirectory( $mainDir );
|
||||
|
||||
/* Delete session */
|
||||
$session = $this->DB->delete( 'cache_store', 'cs_key=\'translate_session\'' );
|
||||
$session = $this->DB->delete( 'cache_store', "cs_key='translate_session'" );
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->global_message = $this->lang->words['ext_all_killed'];
|
||||
@@ -249,7 +248,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Translate externally import changed files
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function translateImport()
|
||||
@@ -260,6 +258,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$words_by_file = array();
|
||||
$errors = array();
|
||||
$filesToImport = array();
|
||||
$fileCount = 0;
|
||||
|
||||
/* Start top message */
|
||||
if ( ! is_dir( $mainDir ) )
|
||||
@@ -298,7 +297,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) );
|
||||
|
||||
/* Get current session if one */
|
||||
$session = $this->DB->buildandFetch( array( 'select' => '*', 'from' => 'cache_store', 'where' => 'cs_key=\'translate_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();
|
||||
|
||||
/* Check */
|
||||
@@ -338,7 +337,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$this->registry->output->global_message .= '<br />' . sprintf( $this->lang->words['ext_recache'], "{$this->settings['base_url']}&{$this->form_code}&do=recache_lang_pack&id={$sessionData['lang_id']}" );
|
||||
|
||||
/* Update session */
|
||||
$this->DB->update( 'cache_store', array( 'cs_value' => serialize( $sessionData ) ), 'cs_key=\'translate_session\'' );
|
||||
$this->DB->update( 'cache_store', array( 'cs_value' => serialize( $sessionData ) ), "cs_key='translate_session'" );
|
||||
|
||||
$this->translateExtSplash();
|
||||
return;
|
||||
@@ -356,7 +355,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Translate externally splash
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function translateExtSplash()
|
||||
@@ -385,14 +383,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
}
|
||||
|
||||
/* Load kernel class for file management */
|
||||
require_once( IPS_KERNEL_PATH . 'classFileManagement.php' );
|
||||
$classFileManagement = new classFileManagement();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Get lang */
|
||||
$lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) );
|
||||
|
||||
/* Get current session if one */
|
||||
$session = $this->DB->buildandFetch( array( 'select' => '*', 'from' => 'cache_store', 'where' => 'cs_key=\'translate_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();
|
||||
|
||||
/* No current session? */
|
||||
@@ -402,7 +400,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$classFileManagement->emptyDirectory( $mainDir );
|
||||
|
||||
/* Ensure it's gone, gone */
|
||||
$this->DB->delete( 'cache_store', 'cs_key=\'translate_session\'' );
|
||||
$this->DB->delete( 'cache_store', "cs_key='translate_session'" );
|
||||
$sessionData = $lang;
|
||||
$sessionData['files'] = array();
|
||||
$header = "/*******************************************************\nNOTE: This is a translatable file generated by IP.Board " . IPB_VERSION . " (" . IPB_LONG_VERSION . ") on " . date( "r" ) . " by " . $this->memberData['members_display_name'] . "\nPLEASE set your text editor to save this document as UTF-8 regardless of your board's character-set\n*******************************************************/\n\n";
|
||||
@@ -501,7 +499,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/* Save session */
|
||||
$this->DB->insert( 'cache_store', array( 'cs_key' => 'translate_session',
|
||||
'cs_value' => serialize( $sessionData ),
|
||||
'cs_extra' => '',
|
||||
'cs_array' => 1,
|
||||
'cs_updated' => time() ) );
|
||||
|
||||
@@ -527,7 +524,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Import files from disk
|
||||
*
|
||||
* @access Private
|
||||
* @param string Directory to look in
|
||||
* @param int Language ID to import into
|
||||
* @param array [Only import these files]
|
||||
@@ -720,7 +716,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Delete current words for this app and word pack
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->delete( 'core_sys_lang_words', 'lang_id=' . $langId .' AND word_app="core" AND word_pack=\'' . $_js_word_pack . '\'' );
|
||||
$this->DB->delete( 'core_sys_lang_words', 'lang_id=' . $langId . " AND word_app='core' AND word_pack='" . $_js_word_pack . "'" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get each line
|
||||
@@ -775,7 +771,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Recaches a language pack
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function recacheLangPack()
|
||||
@@ -798,7 +793,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Remove a word entry
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function removeWordEntry()
|
||||
@@ -834,7 +828,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Remove a word pack
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function removeWordPack()
|
||||
@@ -934,7 +927,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Get next app
|
||||
//-----------------------------------------
|
||||
|
||||
$next = IPSSetUp::fetchNextApplication( $previous );
|
||||
$next = IPSSetUp::fetchNextApplication( $previous, '', $this->settings['gb_char_set'] );
|
||||
|
||||
if ( $next['key'] )
|
||||
{
|
||||
@@ -952,7 +945,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
if ( preg_match( "#" . $_word . "_(.+?)_language_pack.xml#", $f->getFileName() ) )
|
||||
{
|
||||
$this->request['file_location'] = $_PATH . $f->getFileName();
|
||||
$this->imprtFromXML( 1, true, true, $next['key'] );
|
||||
$this->imprtFromXML( 1, true, true, $next['key'], false, 1 );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
@@ -1053,12 +1046,17 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Make sure this isn't default pack
|
||||
//-----------------------------------------
|
||||
|
||||
$default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => 'lang_default=1' ) );
|
||||
$langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) );
|
||||
|
||||
if( $id == $default['lang_id'] )
|
||||
if( $langCheck['lang_default'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['cannot_delete_default_lang'] );
|
||||
}
|
||||
|
||||
if( $langCheck['lang_protected'] AND !IN_DEV )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['cannot_delete_protected_lang'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete from database
|
||||
@@ -1076,8 +1074,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Update member default choice
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'members', array( 'language' => $default['lang_id'] ), "language={$id}" );
|
||||
$default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) );
|
||||
$this->DB->update( 'members', array( 'language' => intval($default['lang_id']) ), "language={$id}" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update cache
|
||||
@@ -1095,7 +1093,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Revert a word pack entry to the default value
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function languageDoRevertWord()
|
||||
@@ -1132,7 +1129,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Saves new language edits
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function languageEditWordPackValues()
|
||||
@@ -1142,6 +1138,13 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
$langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) );
|
||||
|
||||
if( $langCheck['lang_protected'] AND !IN_DEV )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['lang_pack_protected'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop through language bits submitted
|
||||
@@ -1156,7 +1159,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$v = IPSText::safeSlashes($v);
|
||||
$v = str_replace( '\', '\\', $v );
|
||||
|
||||
$this->DB->update( 'core_sys_lang_words', "word_custom='".$this->DB->addSlashes( $v )."', word_custom_version=word_default_version", "word_id=" . intval($k), false, true );
|
||||
$this->DB->update( 'core_sys_lang_words', "word_custom='" . $this->DB->addSlashes( $v ) . "', word_custom_version=word_default_version", "word_id=" . intval($k), false, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1173,7 +1176,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Handles the word entry form
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
*/
|
||||
@@ -1212,8 +1214,13 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
$this->request['word_app'] = strtolower($this->request['word_app']);
|
||||
$this->request['word_pack_db'] = str_replace( '/', '_', strtolower($this->request['word_pack_db']) );
|
||||
$this->request['word_app'] = mb_strtolower($this->request['word_app']);
|
||||
$this->request['word_pack_db'] = str_replace( '/', '_', mb_strtolower($this->request['word_pack_db']) );
|
||||
|
||||
if( $this->request['word_pack_db'] == 'admin_js' OR $this->request['word_pack_db'] == 'public_js' )
|
||||
{
|
||||
$this->request['word_app'] = 'core';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build DB insert array
|
||||
@@ -1256,7 +1263,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Form for adding/editing a word entry
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
*/
|
||||
@@ -1328,7 +1334,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Edit the entries in a word pack
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function languageEditWordPack()
|
||||
@@ -1338,6 +1343,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
/* Fix up for search */
|
||||
$keywordForPageLinks = $this->request['search'];
|
||||
$this->request['search'] = str_replace( "'", "\'", $this->request['search'] );
|
||||
|
||||
$id = intval( $this->request['id'] );
|
||||
@@ -1345,7 +1351,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
$per_page = 20;
|
||||
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
|
||||
$search = $this->request['search'] ? " AND ( word_default LIKE '%" . $this->request['search'] . "%' OR word_custom LIKE '%" . $this->request['search'] . "%' OR word_key LIKE '%" . $this->request['search'] . "%' )" : '';
|
||||
$filter = $this->request['filter'] ? ' AND word_custom_version < word_default_version AND word_custom <> \'\' ' : '';
|
||||
$filter = $this->request['filter'] ? " AND word_custom_version < word_default_version AND word_custom " . $this->DB->buildIsNull(false) . ' ' : '';
|
||||
$wp_query = $pack[0] && $pack[1] ? " AND word_app='{$pack[0]}' AND word_pack='{$pack[1]}' " : '';
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1372,7 +1378,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
'totalItems' => intval( $count['count'] ),
|
||||
'itemsPerPage' => $per_page,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "{$this->settings['base_url']}{$this->form_code}&do=edit_word_pack&word_pack=".implode( '/', $pack )."&id={$id}&search={$this->request['search']}&filter={$this->request['filter']}",
|
||||
'baseUrl' => "{$this->settings['base_url']}{$this->form_code}&do=edit_word_pack&word_pack=".implode( '/', $pack )."&id={$id}&search={$keywordForPageLinks}&filter={$this->request['filter']}",
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1413,7 +1419,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* List the word packs available for the selected language set
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @author Josh
|
||||
*/
|
||||
@@ -1431,6 +1436,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) );
|
||||
|
||||
$this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$data['lang_id']}", $data['lang_title'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get words
|
||||
//-----------------------------------------
|
||||
@@ -1522,7 +1529,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Handles the language information form submit
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either new or edit
|
||||
* @return void
|
||||
*/
|
||||
@@ -1658,7 +1664,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Builds the language information form
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode new or edit
|
||||
* @return void
|
||||
*/
|
||||
@@ -1720,13 +1725,12 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Lists currently installed languages
|
||||
*
|
||||
* @access public
|
||||
* @return 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\'' ) );
|
||||
$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();
|
||||
$hasTranslate = false;
|
||||
|
||||
@@ -1735,7 +1739,15 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
{
|
||||
$hasTranslate = true;
|
||||
}
|
||||
|
||||
|
||||
/* Fallback for the recache all button */
|
||||
$forceEnglish = IPSCookie::get('forceEnglish');
|
||||
|
||||
if ( !$this->lang->words['language_list_recache'] || $forceEnglish )
|
||||
{
|
||||
$this->lang->words['language_list_recache'] = 'Recache all...';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get languages
|
||||
//-----------------------------------------
|
||||
@@ -1748,23 +1760,32 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Get Local Data */
|
||||
setlocale( LC_ALL, $r['lang_short'] );
|
||||
//setlocale( LC_ALL, $r['lang_short'] );
|
||||
IPSLib::setlocale( $r['lang_short'] );
|
||||
$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' );
|
||||
$_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 )
|
||||
if( $r['lang_protected'] && ! IN_DEV )
|
||||
{
|
||||
$_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->lang->words['lang_pack_protected'], 'edit' );
|
||||
}
|
||||
|
||||
if( ! $r['lang_default'] )
|
||||
else
|
||||
{
|
||||
$_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=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=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] );
|
||||
@@ -1803,7 +1824,8 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Reset locale
|
||||
//-----------------------------------------
|
||||
|
||||
setlocale( LC_ALL, $this->registry->class_localization->local );
|
||||
IPSLib::setlocale( $this->registry->class_localization->local );
|
||||
//setlocale( LC_ALL, $this->registry->class_localization->local );
|
||||
$this->registry->class_localization->local_data = localeconv();
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1816,7 +1838,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Updates the cached language files from the database
|
||||
*
|
||||
* @access public
|
||||
* @param integer ID of the language pack to export
|
||||
* @return void
|
||||
*/
|
||||
@@ -1829,7 +1850,12 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Build where statement
|
||||
//-----------------------------------------
|
||||
|
||||
if( $lang_id AND $lang_id != 1 )
|
||||
if ( $lang_id == 'master' )
|
||||
{
|
||||
$lang_id = 'master_lang';
|
||||
$where = "lang_id=1";
|
||||
}
|
||||
else if( $lang_id AND $lang_id != 1 )
|
||||
{
|
||||
$where = "lang_id={$lang_id}";
|
||||
}
|
||||
@@ -1852,7 +1878,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Get the words
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => $where ) );
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => $where, 'order' => 'word_key ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$words_by_file = array();
|
||||
@@ -1905,6 +1931,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
foreach( $words as $word )
|
||||
{
|
||||
$word[1] = str_replace( '"', '\\"', $word[1] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Protect swapped sprintf arguments
|
||||
// @link http://community.invisionpower.com/tracker/issue-22240-lang-strings-using-sprintf-argument-swapping/
|
||||
//-----------------------------------------
|
||||
|
||||
$word[1] = str_replace( '$s', '\\$s', $word[1] );
|
||||
|
||||
$to_write .= "'{$word[0]}' => \"{$word[1]}\",\n";
|
||||
}
|
||||
|
||||
@@ -1936,14 +1970,14 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Imports language packs from an xml file and updates the database and recaches the languages
|
||||
*
|
||||
* @access public
|
||||
* @param integer $lang_id ID of the language pack to import
|
||||
* @param bool $in_dev Set to 1 for developer language import
|
||||
* @param bool $no_return If set to 1, this function will return a value, rather than outputting data
|
||||
* @param string $app_override Overrides the application for which languages are being imported
|
||||
* @param bool $skip_charset Skips charset conversion in the XML file (useful during upgrade routine as strings don't need to be converted)
|
||||
* @return mixed
|
||||
*/
|
||||
public function imprtFromXML( $lang_id=0, $in_dev=0, $no_return=0, $app_override='', $ru = '' )
|
||||
public function imprtFromXML( $lang_id=0, $in_dev=0, $no_return=0, $app_override='', $skip_charset=false, $ru = '' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set version..
|
||||
@@ -2144,7 +2178,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml = new classXML( $skip_charset ? 'utf-8' : IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2219,6 +2253,10 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
$this->registry->class_localization->rebuildLanguagesCache();
|
||||
}
|
||||
else
|
||||
{
|
||||
$insertId = $update_lang['lang_id'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -2320,12 +2358,22 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Didn't find any match? Must be importing
|
||||
// a new language pack, huh?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !isset( $lang_entry['word_id'] ) )
|
||||
{
|
||||
//continue 2;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If there is no new custom lang bit to insert
|
||||
// don't delete what is already there.
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$db_array['word_custom'] )
|
||||
if( !$db_array['word_custom'] || ( $insertId > 0 && $insertId != $_lang_id ) )
|
||||
{
|
||||
unset($db_array['word_custom']);
|
||||
unset($db_array['word_custom_version']);
|
||||
@@ -2417,7 +2465,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Export language entries to xml file
|
||||
*
|
||||
* @access public
|
||||
* @param integer $lang_id Language pack to export
|
||||
* @param bool $disk Save to disk instead
|
||||
* @return void
|
||||
@@ -2441,7 +2488,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
|
||||
if ( $app_dir )
|
||||
{
|
||||
$_where = ' AND word_app="' . $app_dir . '"';
|
||||
$_where = " AND word_app='" . $app_dir . "'";
|
||||
$_name = $app_dir . '_language_pack.xml';
|
||||
$doPack = false;
|
||||
}
|
||||
@@ -2450,12 +2497,12 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
{
|
||||
if ( $type == 'admin' )
|
||||
{
|
||||
$_where .= ' AND word_pack LIKE "admin_%"';
|
||||
$_where .= " AND word_pack LIKE 'admin_%'";
|
||||
$_name = 'admin_' . $_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_where .= ' AND word_pack LIKE "public_%"';
|
||||
$_where .= " AND word_pack LIKE 'public_%'";
|
||||
$_name = 'public_' . $_name;
|
||||
}
|
||||
|
||||
@@ -2575,7 +2622,6 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
/**
|
||||
* Builds the language db entries from cache
|
||||
*
|
||||
* @access public
|
||||
* @param boolean return as normal
|
||||
* @return void
|
||||
* @author Josh
|
||||
@@ -2646,7 +2692,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Delete current language bits
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->delete( 'core_sys_lang_words', 'lang_id=1 AND word_app="'.$app.'" AND word_pack=\'' . $word_pack . '\'' );
|
||||
$this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $word_pack . "'" );
|
||||
|
||||
if ( IPS_IS_SHELL )
|
||||
{
|
||||
@@ -2697,7 +2743,7 @@ class admin_core_languages_manage_languages extends ipsCommand
|
||||
// Delete current words for this app and word pack
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->delete( 'core_sys_lang_words', 'lang_id=1 AND word_app="'.$app.'" AND word_pack=\'' . $_js_word_pack . '\'' );
|
||||
$this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $_js_word_pack . "'" );
|
||||
|
||||
if ( IPS_IS_SHELL )
|
||||
{
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* ACP Login/Logout Routines
|
||||
* Last Updated: $Date: 2009-11-13 19:55:00 -0500 (Fri, 13 Nov 2009) $
|
||||
* Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 17th August 2004
|
||||
* @version $Revision: 5405 $
|
||||
*
|
||||
* @version $Revision: 6990 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -29,7 +29,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* HTML Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
@@ -37,7 +36,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**#@+
|
||||
* Registry objects
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
@@ -46,12 +44,12 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
public $request;
|
||||
public $lang;
|
||||
public $member;
|
||||
public $memberData;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Login handler object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
@@ -59,13 +57,13 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Initiate login handler
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function initHanLogin()
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/handlers/han_login.php' );
|
||||
$this->han_login = new han_login( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$this->han_login = new $classToLoad( $this->registry );
|
||||
|
||||
$this->han_login->is_admin_auth = 1;
|
||||
$this->han_login->init();
|
||||
}
|
||||
@@ -73,7 +71,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @param string Validation message
|
||||
* @return void [Outputs to screen/redirects]
|
||||
@@ -87,10 +84,9 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' );
|
||||
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->initHanLogin();
|
||||
|
||||
@@ -118,7 +114,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Check and verify the login was successful
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function loginComplete()
|
||||
@@ -136,13 +131,22 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
// Is this a username or email address?
|
||||
//-----------------------------------------
|
||||
|
||||
if( IPSText::checkEmailAddress( $this->request['username'] ) )
|
||||
$_type = $this->han_login->emailOrUsername();
|
||||
|
||||
switch( $_type )
|
||||
{
|
||||
$email = $this->request['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = $this->request['username'];
|
||||
case 1:
|
||||
$username = $this->request['username'];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$email = $this->request['username'];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$username = $this->request['username'];
|
||||
$email = $this->request['username'];
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -150,7 +154,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Check return code...
|
||||
//-----------------------------------------
|
||||
@@ -255,7 +259,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Log the user out
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function loginOut()
|
||||
@@ -265,13 +268,7 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Bash cookie
|
||||
//-----------------------------------------
|
||||
|
||||
IPSCookie::set("ipb3AcpSessionId", 'x', -1);
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Redirect...
|
||||
//-----------------------------------------
|
||||
@@ -282,7 +279,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Log the user out
|
||||
*
|
||||
* @access public
|
||||
* @param string Message to show on the form
|
||||
* @return void
|
||||
*/
|
||||
@@ -327,12 +323,12 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
{
|
||||
$login_methods[ $method['login_folder_name'] ] = $method['login_folder_name'];
|
||||
|
||||
if( $method['login_user_id'] == 'username' )
|
||||
if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_name = true;
|
||||
}
|
||||
|
||||
if( $method['login_user_id'] == 'email' )
|
||||
if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' )
|
||||
{
|
||||
$uses_email = true;
|
||||
}
|
||||
@@ -363,7 +359,6 @@ class admin_core_login_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Write to the admin log in loggy ma log
|
||||
*
|
||||
* @access private
|
||||
* @param string Username
|
||||
* @param string ok/fail flag
|
||||
* @return void
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Admin logs
|
||||
* Last Updated: $LastChangedDate: 2009-12-07 09:26:30 -0500 (Mon, 07 Dec 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-06-15 21:25:19 -0400 (Tue, 15 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5526 $
|
||||
* @version $Rev: 6539 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -27,18 +29,18 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* Generate some pretty colors for the logs
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var array Different colors for different actions
|
||||
*/
|
||||
private $colours = array();
|
||||
protected $colours = array();
|
||||
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
@@ -123,10 +125,10 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* View all logs for a given admin
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _view()
|
||||
protected function _view()
|
||||
{
|
||||
///----------------------------------------
|
||||
// Basic init
|
||||
@@ -251,10 +253,10 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* Remove logs by an admin
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
protected function _remove()
|
||||
{
|
||||
if ( $this->request['mid'] == "" )
|
||||
{
|
||||
@@ -269,10 +271,10 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
protected function _listCurrent()
|
||||
{
|
||||
$rows = array();
|
||||
$admins = array();
|
||||
@@ -321,7 +323,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['member_id'];
|
||||
$_store[ $r['member_id'] ] = $r;
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
@@ -334,7 +336,7 @@ class admin_core_logs_adminlogs extends ipsCommand
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$admins[] = array_merge( $r, $_store[ $r['member_id'] ] );
|
||||
$admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default logs section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,280 +1,282 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Email error logs
|
||||
* Last Updated: $LastChangedDate: 2009-08-18 03:26:21 -0400 (Tue, 18 Aug 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5023 $
|
||||
*/
|
||||
|
||||
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_emailerrorlogs 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_emailerrorlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=emailerrorlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=emailerrorlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=emailerrorlogs', $this->lang->words['elog_email_err_logs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
case 'viewemail':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_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( 'mail_error_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['erlog_noneselected'], 11115 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" );
|
||||
}
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_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['erlog_results'];
|
||||
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
|
||||
switch( $this->request['type'] )
|
||||
{
|
||||
case 'subject':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_subject LIKE '%". preg_replace_callback( '/([=_\?\x00-\x1F\x80-\xFF])/', create_function( '$match', 'return "=" . strtoupper( dechex( ord( "$match[1]" ) ) );' ), $string ) ."%'" : "mlog_subject='{$string}'";
|
||||
break;
|
||||
|
||||
case 'email_from':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_from LIKE '%{$string}%'" : "mlog_from='{$string}'";
|
||||
break;
|
||||
case 'email_to':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_to LIKE '%{$string}%'" : "mlog_to='{$string}'";
|
||||
break;
|
||||
case 'error':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_msg LIKE '%{$string}%' or mlog_smtp_msg LIKE '%{$string}%'" : "mlog_msg='{$string} or mlog_smtp_msg='{$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(*) as cnt', 'from' => 'mail_error_logs', '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' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' );
|
||||
|
||||
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject'];
|
||||
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
|
||||
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
|
||||
: $row['mlog_subject'];
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* View an individual email
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _viewEmail()
|
||||
{
|
||||
if ( $this->request['id'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
|
||||
}
|
||||
|
||||
$id = intval($this->request['id']);
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) );
|
||||
|
||||
if ( ! $row['mlog_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_404'], 11118 );
|
||||
}
|
||||
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' );
|
||||
$row['mlog_content'] = nl2br($row['mlog_content']);
|
||||
|
||||
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
|
||||
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
|
||||
: $row['mlog_subject'];
|
||||
|
||||
$row['mlog_msg'] = $row['mlog_msg'] ? $row['mlog_msg'] : $this->lang->words['erlog_noinfo'];
|
||||
$row['mlog_code'] = $row['mlog_code'] ? $row['mlog_code'] : $this->lang->words['erlog_noinfo'];
|
||||
$row['mlog_smtp_error'] = $row['mlog_smtp_error'] ? $row['mlog_smtp_error'] : $this->lang->words['erlog_noinfo'];
|
||||
|
||||
$this->registry->output->html .= $this->html->emailerrorlogsEmail( $row );
|
||||
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Email error 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_emailerrorlogs 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_emailerrorlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=emailerrorlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=emailerrorlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=emailerrorlogs', $this->lang->words['elog_email_err_logs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
case 'viewemail':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emailerrorlogs_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( 'mail_error_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['erlog_noneselected'], 11115 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'mail_error_logs', "mlog_id IN (" . implode( ',', $ids ) . ")" );
|
||||
}
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['erlog_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['erlog_results'];
|
||||
|
||||
$string = IPSText::parseCleanValue( urldecode($this->request['string']) );
|
||||
|
||||
if ( $string == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_enter_sumthang_yo'], 11116 );
|
||||
}
|
||||
|
||||
$url_query[] = 'type=' . $this->request['type'];
|
||||
$url_query[] = 'string=' . urlencode($string);
|
||||
|
||||
switch( $this->request['type'] )
|
||||
{
|
||||
case 'subject':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_subject LIKE '%". preg_replace_callback( '/([=_\?\x00-\x1F\x80-\xFF])/', create_function( '$match', 'return "=" . strtoupper( dechex( ord( "$match[1]" ) ) );' ), $string ) ."%'" : "mlog_subject='{$string}'";
|
||||
break;
|
||||
|
||||
case 'email_from':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_from LIKE '%{$string}%'" : "mlog_from='{$string}'";
|
||||
break;
|
||||
case 'email_to':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_to LIKE '%{$string}%'" : "mlog_to='{$string}'";
|
||||
break;
|
||||
case 'error':
|
||||
$db_query[] = $this->request['match'] == 'loose' ? "mlog_msg LIKE '%{$string}%' or mlog_smtp_msg LIKE '%{$string}%'" : "mlog_msg='{$string} or mlog_smtp_msg='{$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(*) as cnt', 'from' => 'mail_error_logs', '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' => '*', 'from' => 'mail_error_logs', 'where' => $dbe, 'order' => 'mlog_date DESC', 'limit' => array( $start, 25 ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'SHORT' );
|
||||
|
||||
$row['mlog_subject'] = ( empty( $row['mlog_subject'] ) ) ? '--' : $row['mlog_subject'];
|
||||
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
|
||||
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
|
||||
: $row['mlog_subject'];
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->emailerrorlogsWrapper( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* View an individual email
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _viewEmail()
|
||||
{
|
||||
if ( $this->request['id'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_404'], 11117 );
|
||||
}
|
||||
|
||||
$id = intval($this->request['id']);
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'where' => "mlog_id={$id}" ) );
|
||||
|
||||
if ( ! $row['mlog_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['erlog_404'], 11118 );
|
||||
}
|
||||
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['mlog_date'], 'LONG' );
|
||||
$row['mlog_content'] = nl2br($row['mlog_content']);
|
||||
|
||||
$row['mlog_subject'] = ( strpos( $row['mlog_subject'], "=?".IPS_DOC_CHAR_SET."?Q?" ) !== FALSE )
|
||||
? str_replace( "=?".IPS_DOC_CHAR_SET."?Q?", "", str_replace( "?=", "", preg_replace_callback( '/=([A-F0-9]{2})/', create_function( '$match', 'return chr( hexdec( "$match[1]" ) );' ), $row['mlog_subject'] ) ) )
|
||||
: $row['mlog_subject'];
|
||||
|
||||
$row['mlog_msg'] = $row['mlog_msg'] ? $row['mlog_msg'] : $this->lang->words['erlog_noinfo'];
|
||||
$row['mlog_code'] = $row['mlog_code'] ? $row['mlog_code'] : $this->lang->words['erlog_noinfo'];
|
||||
$row['mlog_smtp_error'] = $row['mlog_smtp_error'] ? $row['mlog_smtp_error'] : $this->lang->words['erlog_noinfo'];
|
||||
|
||||
$this->registry->output->html .= $this->html->emailerrorlogsEmail( $row );
|
||||
|
||||
$this->registry->output->printPopupWindow();
|
||||
}
|
||||
}
|
||||
@@ -1,426 +1,428 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Email logs
|
||||
* Last Updated: $LastChangedDate: 2009-08-18 03:26:21 -0400 (Tue, 18 Aug 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5023 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Error logs
|
||||
* Last Updated: $LastChangedDate: 2009-11-23 12:23:43 -0500 (Mon, 23 Nov 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5457 $
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Mobile Notification 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
|
||||
* @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_mobilelogs 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_mobilelogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=mobilelogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=mobilelogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=mobilelogs', $this->lang->words['mlog_mobilelogs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove log
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
if( $this->request['type'] == 'all' )
|
||||
{
|
||||
$this->DB->delete( 'mobile_notifications' );
|
||||
}
|
||||
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['erlog_noneselected'], 11115 );
|
||||
}
|
||||
|
||||
$this->DB->delete( 'mobile_notifications', "id IN (" . implode( ',', $ids ) . ")" );
|
||||
}
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
/* INIT */
|
||||
$rows = array();
|
||||
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
|
||||
$perPage = 25;
|
||||
|
||||
/* Pagination */
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'mobile_notifications' ) );
|
||||
|
||||
$pageLinks = $this->registry->output->generatePagination( array(
|
||||
'totalItems' => $total['logs'],
|
||||
'itemsPerPage' => $perPage,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => $this->settings['base_url'] . $this->form_code,
|
||||
) );
|
||||
|
||||
/* Query the logs */
|
||||
$this->DB->build( array(
|
||||
'select' => 'n.*',
|
||||
'from' => array( 'mobile_notifications' => 'n' ),
|
||||
'order' => 'n.notify_date DESC',
|
||||
'limit' => array( $st, $perPage ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=n.member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['_time'] = $this->registry->class_localization->getDate( $row['notify_date'], 'LONG' );
|
||||
$row['notify_title'] = strip_tags( $row['notify_title'] );
|
||||
$row['_sent'] = $row['notify_sent'] ? 'aff_tick.png' : 'aff_cross.png';
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->mobileLogsWrapper( $rows, $pageLinks );
|
||||
}
|
||||
}
|
||||
@@ -1,337 +1,339 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Moderator logs
|
||||
* Last Updated: $LastChangedDate: 2009-12-07 09:26:30 -0500 (Mon, 07 Dec 2009) $
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5526 $
|
||||
*/
|
||||
|
||||
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_modlogs 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_modlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=modlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=modlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=modlogs', $this->lang->words['mlog_modlogs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
|
||||
$this->_view();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* View all logs for a given moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _view()
|
||||
{
|
||||
///----------------------------------------
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
///----------------------------------------
|
||||
// No mid or search string?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] AND !$this->request['mid'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['mlog_nostring'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// 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_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval($this->request['mid']),
|
||||
'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();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
|
||||
if( !$this->DB->checkForField( $this->request['search_type'], 'moderator_logs' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mlog_whatfield'], 4111 );
|
||||
}
|
||||
|
||||
if( $this->request['search_type'] == 'topic_id' OR $this->request['search_type'] == 'forum_id' )
|
||||
{
|
||||
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$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_count = $row['count'];
|
||||
|
||||
$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',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
)
|
||||
);
|
||||
|
||||
///----------------------------------------
|
||||
// Get db results
|
||||
//-----------------------------------------
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$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'] );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->modlogsView( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by a moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
{
|
||||
if ( $this->request['mid'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 );
|
||||
}
|
||||
|
||||
$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}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
{
|
||||
$rows = array();
|
||||
$admins = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// VIEW LAST 5
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( 0, 5 ),
|
||||
'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();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$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'] );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$_members = array();
|
||||
$_store = array();
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['member_id'];
|
||||
$_store[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
{
|
||||
$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() )
|
||||
{
|
||||
$admins[] = array_merge( $r, $_store[ $r['member_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->modlogsWrapper( $rows, $admins );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Moderator logs
|
||||
* Last Updated: $LastChangedDate: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6915 $
|
||||
*/
|
||||
|
||||
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_modlogs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access protected
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $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_modlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=modlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=modlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=modlogs', $this->lang->words['mlog_modlogs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
|
||||
$this->_view();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'modlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* View all logs for a given moderator
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _view()
|
||||
{
|
||||
///----------------------------------------
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
///----------------------------------------
|
||||
// No mid or search string?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] AND !$this->request['mid'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['mlog_nostring'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// 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_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'where' => 'm.member_id=' . intval($this->request['mid']),
|
||||
'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();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
|
||||
if( !$this->DB->checkForField( $this->request['search_type'], 'moderator_logs' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mlog_whatfield'], 4111 );
|
||||
}
|
||||
|
||||
if( $this->request['search_type'] == 'topic_id' OR $this->request['search_type'] == 'forum_id' )
|
||||
{
|
||||
$dbq = "m." . $this->request['search_type'] . "='" . $this->request['search_string'] . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$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_count = $row['count'];
|
||||
|
||||
$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',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
)
|
||||
);
|
||||
|
||||
///----------------------------------------
|
||||
// Get db results
|
||||
//-----------------------------------------
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$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'] );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->modlogsView( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by a moderator
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
if ( $this->request['mid'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 );
|
||||
}
|
||||
|
||||
$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}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
$rows = array();
|
||||
$admins = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// VIEW LAST 5
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'm.*',
|
||||
'from' => array( 'moderator_logs' => 'm' ),
|
||||
'order' => 'm.ctime DESC',
|
||||
'limit' => array( 0, 5 ),
|
||||
'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();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$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'] );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
$_members = array();
|
||||
$_store = array();
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['member_id'];
|
||||
$admins[ $r['member_id'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
{
|
||||
$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() )
|
||||
{
|
||||
$admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->modlogsWrapper( $rows, $admins );
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Admin logs
|
||||
* Last Updated: $LastChangedDate$
|
||||
* Last Updated: $LastChangedDate: 2010-09-30 21:47:05 -0400 (Thu, 30 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author$
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev$
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6929 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -78,10 +80,6 @@ class admin_core_logs_spamlogs extends ipsCommand
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
case 'testapi':
|
||||
$this->_testApiConnection();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->_listCurrent();
|
||||
@@ -92,14 +90,6 @@ class admin_core_logs_spamlogs extends ipsCommand
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
protected function _testApiConnection()
|
||||
{
|
||||
/* Test the connection */
|
||||
$result = IPSMember::querySpamService( '', '', '', 1 );
|
||||
|
||||
$this->registry->output->html .= $this->html->spamServiceTest($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove log
|
||||
@@ -155,24 +145,38 @@ class admin_core_logs_spamlogs extends ipsCommand
|
||||
$rows = array();
|
||||
$st = $this->request['st'] ? intval( $this->request['st'] ) : 0;
|
||||
$perPage = 25;
|
||||
$where = '';
|
||||
$qs = '';
|
||||
|
||||
if( $this->request['search_term'] )
|
||||
{
|
||||
$where = "log_msg LIKE '%{$this->request['search_term']}%' OR email_address LIKE '%{$this->request['search_term']}%'";
|
||||
$qs = '&search_term=' . $this->request['search_term'];
|
||||
}
|
||||
|
||||
/* Pagination */
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'spam_service_log' ) );
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => 'spam_service_log', 'where' => $where ) );
|
||||
|
||||
if( $this->request['search_term'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['spamlog_sresults'], $total['logs'] );
|
||||
}
|
||||
|
||||
$pageLinks = $this->registry->output->generatePagination( array(
|
||||
'totalItems' => $total['logs'],
|
||||
'itemsPerPage' => $perPage,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => $this->settings['base_url'] . $this->form_code,
|
||||
'baseUrl' => $this->settings['base_url'] . $this->form_code . $qs,
|
||||
) );
|
||||
|
||||
/* Query the logs */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'spam_service_log',
|
||||
'order' => 'log_date DESC',
|
||||
'limit' => array( $st, $perPage ),
|
||||
) );
|
||||
'select' => '*',
|
||||
'from' => 'spam_service_log',
|
||||
'order' => 'log_date DESC',
|
||||
'where' => $where,
|
||||
'limit' => array( $st, $perPage ),
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
|
||||
@@ -1,287 +1,289 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Search Engine Spider logs
|
||||
* Last Updated: $LastChangedDate: 2009-12-07 09:26:30 -0500 (Mon, 07 Dec 2009) $
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5526 $
|
||||
*/
|
||||
|
||||
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_spiderlogs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Spider map
|
||||
*
|
||||
* @access private
|
||||
* @var array Spider keys to values
|
||||
*/
|
||||
private $bot_map = array();
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load bat names from the useragents cache */
|
||||
foreach( $this->cache->getCache( 'useragents' ) as $agent )
|
||||
{
|
||||
if( $agent['uagent_type'] == 'search' )
|
||||
{
|
||||
$this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=spiderlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=spiderlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=spiderlogs', $this->lang->words['slog_spider_logs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
|
||||
$this->_view();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* View all logs for a given moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _view()
|
||||
{
|
||||
///----------------------------------------
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
$botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) );
|
||||
$botty = str_replace( "!", "!", $botty );
|
||||
|
||||
///----------------------------------------
|
||||
// No bid or search string?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] AND !$this->request['bid'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['slog_nostring'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// mid?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] )
|
||||
{
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&bid=" . $this->request['bid'] . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'spider_logs',
|
||||
'where' => "bot='{$botty}'",
|
||||
'order' => 'entry_date DESC',
|
||||
'limit' => array( $start, 20 ) ) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&do=view&search_string=" . urlencode($this->request['search_string']);
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'spider_logs',
|
||||
'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'",
|
||||
'order' => 'entry_date DESC',
|
||||
'limit' => array( $start, 20 ) ) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
)
|
||||
);
|
||||
|
||||
///----------------------------------------
|
||||
// Get db results
|
||||
//-----------------------------------------
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$extra = "";
|
||||
|
||||
if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false )
|
||||
{
|
||||
$extra = $this->lang->words['slog_lofi'];
|
||||
|
||||
$query_string_html = $extra . ' ' . $row['query_string'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_string_html = "<a href='" . $this->settings['board_url'] . "/index." . $this->settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . "</a>";
|
||||
}
|
||||
|
||||
$row['_bot_name'] = $this->bot_map[ mb_strtolower($row['bot']) ];
|
||||
$row['_query_string'] = $query_string_html;
|
||||
$row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->spiderlogsView( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by a moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
{
|
||||
if ( $this->request['bid'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 );
|
||||
}
|
||||
|
||||
$botty = urldecode($this->request['bid']);
|
||||
$botty = str_replace( "!", "!", $botty );
|
||||
|
||||
$this->DB->delete( 'spider_logs', "bot='{$botty}'" );
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']);
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
{
|
||||
$spiders = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// All bots
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date',
|
||||
'from' => 'spider_logs',
|
||||
'group' => 'bot',
|
||||
'order' => 'entry_date DESC',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_bot_name'] = $this->bot_map[ mb_strtolower($r['bot']) ];
|
||||
$r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' );
|
||||
$r['_bot_url'] = urlencode($r['bot']);
|
||||
|
||||
$spiders[] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders );
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Search Engine Spider 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_spiderlogs extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
|
||||
/**
|
||||
* Spider map
|
||||
*
|
||||
* @access private
|
||||
* @var array Spider keys to values
|
||||
*/
|
||||
private $bot_map = array();
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load bat names from the useragents cache */
|
||||
foreach( $this->cache->getCache( 'useragents' ) as $agent )
|
||||
{
|
||||
if( $agent['uagent_type'] == 'search' )
|
||||
{
|
||||
$this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name'];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=spiderlogs';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=spiderlogs';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=spiderlogs', $this->lang->words['slog_spider_logs'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
|
||||
$this->_view();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* View all logs for a given moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _view()
|
||||
{
|
||||
///----------------------------------------
|
||||
// Basic init
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
|
||||
|
||||
$botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) );
|
||||
$botty = str_replace( "!", "!", $botty );
|
||||
|
||||
///----------------------------------------
|
||||
// No bid or search string?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] AND !$this->request['bid'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['slog_nostring'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// mid?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->request['search_string'] )
|
||||
{
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&bid=" . $this->request['bid'] . "&do=view";
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'spider_logs',
|
||||
'where' => "bot='{$botty}'",
|
||||
'order' => 'entry_date DESC',
|
||||
'limit' => array( $start, 20 ) ) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) );
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) );
|
||||
|
||||
$row_count = $row['count'];
|
||||
|
||||
$query = "&{$this->form_code}&do=view&search_string=" . urlencode($this->request['search_string']);
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'spider_logs',
|
||||
'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'",
|
||||
'order' => 'entry_date DESC',
|
||||
'limit' => array( $start, 20 ) ) );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count,
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . $query,
|
||||
)
|
||||
);
|
||||
|
||||
///----------------------------------------
|
||||
// Get db results
|
||||
//-----------------------------------------
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$extra = "";
|
||||
|
||||
if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false )
|
||||
{
|
||||
$extra = $this->lang->words['slog_lofi'];
|
||||
|
||||
$query_string_html = $extra . ' ' . $row['query_string'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_string_html = "<a href='" . $this->settings['board_url'] . "/index." . $this->settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . "</a>";
|
||||
}
|
||||
|
||||
$row['_bot_name'] = $this->bot_map[ mb_strtolower($row['bot']) ];
|
||||
$row['_query_string'] = $query_string_html;
|
||||
$row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' );
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
///----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->spiderlogsView( $rows, $links );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by a moderator
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _remove()
|
||||
{
|
||||
if ( $this->request['bid'] == "" )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 );
|
||||
}
|
||||
|
||||
$botty = urldecode($this->request['bid']);
|
||||
$botty = str_replace( "!", "!", $botty );
|
||||
|
||||
$this->DB->delete( 'spider_logs', "bot='{$botty}'" );
|
||||
|
||||
$this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']);
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List the current logs with links to view per-admin
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
private function _listCurrent()
|
||||
{
|
||||
$spiders = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// All bots
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date',
|
||||
'from' => 'spider_logs',
|
||||
'group' => 'bot',
|
||||
'order' => 'entry_date DESC',
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_bot_name'] = $this->bot_map[ mb_strtolower($r['bot']) ];
|
||||
$r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' );
|
||||
$r['_bot_url'] = urlencode($r['bot']);
|
||||
|
||||
$spiders[] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* SQL error logs
|
||||
* Last Updated: $LastChangedDate: 2010-06-16 02:25:19 +0100 (Wed, 16 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6539 $
|
||||
*/
|
||||
|
||||
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_sqlerror extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate('cp_skin_adminlogs');
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=logs&section=sqlerror';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=logs§ion=sqlerror';
|
||||
|
||||
//-----------------------------------------
|
||||
// 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=sqlerror', $this->lang->words['mlog_sqlerrors'] );
|
||||
|
||||
///----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
|
||||
$this->_view();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' );
|
||||
$this->_remove();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' );
|
||||
$this->_listCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* View an SQL log
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _view()
|
||||
{
|
||||
/* INIT */
|
||||
$file = trim( $this->request['file'] );
|
||||
|
||||
/* Check file name */
|
||||
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! file_exists( IPS_CACHE_PATH . 'cache/' . $file ) )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fetch size */
|
||||
$size = @filesize( IPS_CACHE_PATH . 'cache/' . $file );
|
||||
|
||||
/* Fetch content */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Get some tail! */
|
||||
$content = $classFileManagement->tailFile( IPS_CACHE_PATH . 'cache/' . $file, 300 );
|
||||
|
||||
/* Can't believe I typed that last comment */
|
||||
$this->registry->output->html .= $this->html->sqlLogsView( $file, $size, $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove logs by an admin
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
/* INIT */
|
||||
$file = trim( $this->request['file'] );
|
||||
|
||||
/* Check file name */
|
||||
if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! file_exists( IPS_CACHE_PATH . 'cache/' . $file ) )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['sqllog_nofile'];
|
||||
$this->_listCurrent();
|
||||
return;
|
||||
}
|
||||
|
||||
@unlink( IPS_CACHE_PATH . 'cache/' . $file );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['sqllog_removed'];
|
||||
$this->_listCurrent();
|
||||
}
|
||||
|
||||
/**
|
||||
* List the current SQL logs
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function _listCurrent()
|
||||
{
|
||||
$rows = array();
|
||||
|
||||
/* Got a latest? */
|
||||
if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
{
|
||||
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
|
||||
|
||||
if ( $unix )
|
||||
{
|
||||
$mtime = gmdate( 'd-j-Y', $unix );
|
||||
$now = gmdate( 'd-j-Y', time() );
|
||||
|
||||
if ( $mtime == $now )
|
||||
{
|
||||
$contents = file_get_contents( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
|
||||
|
||||
/* Display a message */
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['sqllog_latest'], $this->registry->class_localization->getDate( $unix, 'LONG' ), $contents );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
|
||||
{
|
||||
if ( $file->isDot() OR ! $file->isFile() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
|
||||
{
|
||||
$rows[] = array( 'name' => $file->getFilename(),
|
||||
'mtime' => $file->getMTime(),
|
||||
'size' => $file->getSize() );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->sqllogsWrapper( $rows );
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Warn logs
|
||||
* Last Updated: $LastChangedDate: 2009-12-07 09:26:30 -0500 (Mon, 07 Dec 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-05-19 21:06:53 -0400 (Wed, 19 May 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5526 $
|
||||
* @version $Rev: 6326 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -335,7 +337,7 @@ class admin_core_logs_warnlogs extends ipsCommand
|
||||
$row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' );
|
||||
$row['_type'] = ( $row['wlog_type'] == 'pos' ) ? '<span style="color:green;font-weight:bold">-</span>' : '<span style="color:red;font-weight:bold">+</span>';
|
||||
$row['_type'] = ( $row['wlog_type'] == 'custom' ) ? '<span style="color:grey;font-weight:bold">C</span>' : $row['_type'];
|
||||
$row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "<a title='{$this->lang->words['wlog_showmessage']}' href='#' onclick='return acp.openWindow(\"{$this->settings['base_url']}&{$this->form_code}&do=viewcontact&id={$row['wlog_id']}\",400,400,\"{$this->lang->words['wlog_log']}\"); return false;'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/tick.png' border='0' alt='{$this->lang->words['wlog_contacted']}'></a>" : ' ';
|
||||
$row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "<a title='{$this->lang->words['wlog_showmessage']}' href='#' onclick='return acp.openWindow(\"{$this->settings['base_url']}&{$this->form_code}&do=viewcontact&id={$row['wlog_id']}\",400,400,\"{$this->lang->words['wlog_log']}\"); return false;'><img src='{$this->settings['skin_acp_url']}/_newimages/icons/tick.png' alt='{$this->lang->words['wlog_contacted']}'></a>" : ' ';
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
@@ -358,7 +360,7 @@ class admin_core_logs_warnlogs extends ipsCommand
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$_members[] = $r['wlog_mid'];
|
||||
$_store[ $r['wlog_mid'] ] = $r;
|
||||
$members[ $r['wlog_mid'] ] = $r;
|
||||
}
|
||||
|
||||
if ( !empty( $_members ) )
|
||||
@@ -371,7 +373,7 @@ class admin_core_logs_warnlogs extends ipsCommand
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$members[] = array_merge( $r, $_store[ $r['member_id'] ] );
|
||||
$members[ $r['member_id'] ] = array_merge( $r, $members[ $r['member_id'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -91,4 +91,17 @@
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>SQL Error Logs</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>sqlerrorlogs_view</key>
|
||||
<string>Can view SQL error logs?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>sqlerrorlogs_delete</key>
|
||||
<string>Can delete SQL error logs?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -1,20 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Dashboard
|
||||
* Last Updated: $Date: 2009-12-01 17:42:17 -0500 (Tue, 01 Dec 2009) $
|
||||
* Last Updated: $Date: 2010-10-27 05:50:09 -0400 (Wed, 27 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 5th January 2005
|
||||
* @version $Revision: 5501 $
|
||||
*
|
||||
* @version $Revision: 7049 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -28,31 +28,27 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
@@ -89,54 +85,11 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IPS_NEWS_URL' , '' );
|
||||
define( 'IPS_BULLETINS_URL' , '' );
|
||||
define( 'IPS_VERSION_CHECK_URL' , '' );
|
||||
|
||||
$content = array();
|
||||
$thiscontent = "";
|
||||
$latest_version = array();
|
||||
$reg_end = "";
|
||||
$sm_install = 0;
|
||||
$lock_file = 0;
|
||||
$converter = 0;
|
||||
$fulltext_a = 0;
|
||||
$unfinished_upgrade = 0;
|
||||
$urls = array( 'news' => IPS_NEWS_URL,
|
||||
'keiths_bits' => IPS_BULLETINS_URL,
|
||||
'version_check' => IPS_VERSION_CHECK_URL,
|
||||
'blogs' => '' );
|
||||
|
||||
if ( @file_exists( IPS_ROOT_PATH . 'install/index.php' ) )
|
||||
{
|
||||
$sm_install = 1;
|
||||
}
|
||||
|
||||
if ( @file_exists( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
|
||||
{
|
||||
$lock_file = 1;
|
||||
}
|
||||
|
||||
if ( @is_dir( IPS_ROOT_PATH . 'applications_addon/ips/convert/' ) and !@file_exists( DOC_IPS_ROOT_PATH . 'cache/converter_lock.php' ) )
|
||||
{
|
||||
$converter = 1;
|
||||
}
|
||||
|
||||
if( $this->DB->checkFulltextSupport() )
|
||||
{
|
||||
if( ! $this->DB->getFulltextStatus( 'posts' ) )
|
||||
{
|
||||
$fulltext_a = 1;
|
||||
}
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );
|
||||
$versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
|
||||
|
||||
if( $versions['current'][0] != $versions['latest'][0] )
|
||||
{
|
||||
$unfinished_upgrade = 1;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get MySQL & PHP Version
|
||||
@@ -185,8 +138,6 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
// Licensed?
|
||||
//-----------------------------------------
|
||||
|
||||
$urls['keiths_bits'] = IPS_BULLETINS_URL . '?v=' . ipsRegistry::$vn_full;
|
||||
|
||||
//-----------------------------------------
|
||||
// Notepad
|
||||
//-----------------------------------------
|
||||
@@ -199,7 +150,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
|
||||
$text = $this->lang->words['cp_acpnotes'];
|
||||
|
||||
if ( !$this->cache->getCache('adminnotes') OR !$this->cache->getCache('adminnotes') )
|
||||
if ( !$this->cache->getCache('adminnotes') )
|
||||
{
|
||||
$this->cache->setCache( 'adminnotes', $text, array( 'donow' => 1, 'array' => 0 ) );
|
||||
}
|
||||
@@ -273,55 +224,6 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
|
||||
$content['acp_online'] = $this->html->acp_onlineadmin_wrapper( $acponline );
|
||||
|
||||
//-----------------------------------------
|
||||
// Stats
|
||||
//-----------------------------------------
|
||||
|
||||
$reg = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as reg' ,
|
||||
'from' => array( 'validating' => 'v' ),
|
||||
'where' => 'v.lost_pass <> 1 AND m.member_group_id=' . $this->settings['auth_group'],
|
||||
'add_join' => array( array(
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=v.member_id',
|
||||
'type' => 'left'
|
||||
) ) ) );
|
||||
|
||||
if( $this->settings['ipb_bruteforce_attempts'] )
|
||||
{
|
||||
$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',
|
||||
'from' => 'members',
|
||||
//'where' => IPSBWOptions::sql( 'bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has' ) ) );
|
||||
'where' => "members_bitoptions = '1'" ) );
|
||||
|
||||
$content['stats'] = $this->html->acp_stats_wrapper( array( 'topics' => intval($this->caches['stats']['total_topics']),
|
||||
'replies' => intval($this->caches['stats']['total_replies']),
|
||||
'topics_mod' => intval($pending['topics']),
|
||||
'posts_mod' => intval($pending['posts']),
|
||||
'members' => intval($this->caches['stats']['mem_count']),
|
||||
'validate' => intval( $reg['reg'] ),
|
||||
'spammer' => array( intval( $spammers['count'] ), intval( $spammers['joined'] ) ),
|
||||
'locked' => intval( $lock['mems'] ),
|
||||
'coppa' => intval( $coppa['coppa'] ),
|
||||
'sql_driver' => strtoupper(SQL_DRIVER),
|
||||
'sql_version' => $this->DB->true_version,
|
||||
'php_version' => phpversion(),
|
||||
'sessions' => intval($online['sessions']),
|
||||
'php_sapi' => @php_sapi_name(),
|
||||
'ipb_version' => ipsRegistry::$version,
|
||||
'ipb_id' => ipsRegistry::$vn_full ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Members awaiting admin validation?
|
||||
//-----------------------------------------
|
||||
@@ -379,8 +281,8 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
// Forum and group dropdowns
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/forums/class_forums.php' );
|
||||
$this->registry->setClass( 'class_forums', new class_forums($this->registry) );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad($this->registry) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
$forums = $this->registry->getClass('class_forums')->forumsForumJump( 1 );
|
||||
@@ -401,43 +303,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
// Piece it together
|
||||
//-----------------------------------------
|
||||
|
||||
$urls['version_check'] = IPS_VERSION_CHECK_URL . '?' . base64_encode( ipsRegistry::$vn_full.'|^|'.$this->settings['board_url'] );
|
||||
$this->registry->output->html .= $this->html->mainTemplate( $content, $forums, $groups_html, $urls );
|
||||
|
||||
//-----------------------------------------
|
||||
// FURL cache OOD?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( file_exists( 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' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
|
||||
|
||||
if ( $_mtime > $mtime )
|
||||
{
|
||||
$_html = $this->html->warning_box( $this->lang->words['furlcache_outofdate'], "<a href='" . $this->settings['base_url'] . "app=core&module=applications&section=applications&do=seoRebuild'>{$this->lang->words['rebuild_furl_cache']}</a>" ) . "<br />";
|
||||
$this->registry->output->html = str_replace( '<!--in_dev_check-->', $_html . '<!--in_dev_check-->', $this->registry->output->html );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Minify on but /cache/tmp not writeable?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( isset( $this->settings['_use_minify'] ) AND $this->settings['_use_minify'] )
|
||||
{
|
||||
$_html = $this->html->warning_box( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] ) . "<br />";
|
||||
$this->registry->output->html = str_replace( '<!--in_dev_check-->', $_html . '<!--in_dev_check-->', $this->registry->output->html );
|
||||
}
|
||||
$this->registry->output->html .= $this->html->mainTemplate( $content, $forums, $groups_html, $urls, $this->getNotificationPanelEntries() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Left log all on?
|
||||
@@ -449,11 +315,6 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$this->registry->output->html = str_replace( '<!--in_dev_check-->', $_html . '<!--in_dev_check-->', $this->registry->output->html );
|
||||
}
|
||||
|
||||
if ( count( $tasksContent ) )
|
||||
{
|
||||
$_html .= $this->html->warning_box( $this->lang->words['cp_taskssneedup'], implode( $tasksContent, "<br />" ) . "<br /><a href='" . $this->settings['base_url'] . "app=core&module=system&section=taskmanager&do=tasksImportAllApps'>{$this->lang->words['cp_clickhere']}</a> {$this->lang->words['cp_clickhere_info']}.");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// IN DEV stuff...
|
||||
//-----------------------------------------
|
||||
@@ -484,7 +345,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$_mtime = $this->registry->getClass( 'class_localization')->getDate( $lastMtime , 'JOINED' );
|
||||
$_dbtime = $this->registry->getClass( 'class_localization')->getDate( $lastDBtime, 'JOINED' );
|
||||
|
||||
$content[] = "<strong>" . $app['app_title'] . " {$this->lang->words['cp_settingsupdated']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
$content[] = "<strong>" . $data['app_title'] . " {$this->lang->words['cp_settingsupdated']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
}
|
||||
|
||||
/* Modules */
|
||||
@@ -496,7 +357,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$_mtime = $this->registry->getClass( 'class_localization')->getDate( $lastMtime , 'JOINED' );
|
||||
$_dbtime = $this->registry->getClass( 'class_localization')->getDate( $lastDBtime, 'JOINED' );
|
||||
|
||||
$modContent[] = "<strong>" . $app['app_title'] . " {$this->lang->words['cp_modulessneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
$modContent[] = "<strong>" . $data['app_title'] . " {$this->lang->words['cp_modulessneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
}
|
||||
|
||||
/* Tasks */
|
||||
@@ -508,7 +369,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$_mtime = $this->registry->getClass( 'class_localization')->getDate( $lastMtime , 'JOINED' );
|
||||
$_dbtime = $this->registry->getClass( 'class_localization')->getDate( $lastDBtime, 'JOINED' );
|
||||
|
||||
$tasksContent[] = "<strong>" . $app['app_title'] . " {$this->lang->words['cp_taskssneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
$tasksContent[] = "<strong>" . $data['app_title'] . " {$this->lang->words['cp_taskssneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
}
|
||||
|
||||
/* Help Files */
|
||||
@@ -520,7 +381,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$_mtime = $this->registry->getClass( 'class_localization')->getDate( $lastMtime , 'JOINED' );
|
||||
$_dbtime = $this->registry->getClass( 'class_localization')->getDate( $lastDBtime, 'JOINED' );
|
||||
|
||||
$helpContent[] = "<strong>" . $app['app_title'] . " {$this->lang->words['cp_helpneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
$helpContent[] = "<strong>" . $data['app_title'] . " {$this->lang->words['cp_helpneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
}
|
||||
|
||||
/* BBCode Files */
|
||||
@@ -532,7 +393,7 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$_mtime = $this->registry->getClass( 'class_localization')->getDate( $lastMtime , 'JOINED' );
|
||||
$_dbtime = $this->registry->getClass( 'class_localization')->getDate( $lastDBtime, 'JOINED' );
|
||||
|
||||
$bbContent[] = "<strong>" . $app['app_title'] . " {$this->lang->words['cp_bbcodeneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
$bbContent[] = "<strong>" . $data['app_title'] . " {$this->lang->words['cp_bbcodeneedup']}.</strong><br />-- {$this->lang->words['cp_lastimportrun']}: {$_dbtime}<br />-- {$this->lang->words['cp_lastxmlexport']}: {$_mtime}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,92 +436,18 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INSTALLER PRESENT?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $sm_install == 1 )
|
||||
{
|
||||
if ( $lock_file != 1 )
|
||||
{
|
||||
$this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY );
|
||||
$installer = $this->html->warning_box( $this->lang->words['cp_unlockedinstaller'], $this->html->warning_unlocked_installer() ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--warninginstaller-->', $installer, $this->registry->output->html );
|
||||
}
|
||||
else
|
||||
{
|
||||
$installer = $this->html->warning_box( $this->lang->words['cp_installerpresent'], $this->html->warning_installer() ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--warninginstaller-->', $installer, $this->registry->output->html );
|
||||
}
|
||||
}
|
||||
else if( $converter )
|
||||
{
|
||||
$text = $this->lang->words['cp_unlocked_converter'];
|
||||
$installer = $this->html->warning_box( $text, $this->html->warning_converter($converter) ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--warningconverter-->', $installer, $this->registry->output->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// UNFINISHED UPGRADE?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $unfinished_upgrade == 1 )
|
||||
{
|
||||
$this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] );
|
||||
|
||||
$upgrade = $this->html->warning_box( $this->lang->words['cp_unfinishedupgrade'], $this->html->warning_upgrade() ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--warningupgrade-->', $upgrade, $this->registry->output->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INSUFFICIENT PHP VERSION?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( PHP_VERSION < '5.1.0' )
|
||||
{
|
||||
$version = $this->html->warning_box( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ),
|
||||
$this->html->acp_php_version_warning() ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--phpversioncheck-->', $version, $this->registry->output->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// BOARD OFFLINE?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['board_offline'] )
|
||||
{
|
||||
$offline = $this->html->warning_box( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />» <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--boardoffline-->', $offline, $this->registry->output->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// No fulltext
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] )
|
||||
{
|
||||
$ftext = $this->html->warning_box( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />» <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" ) . "<br />";
|
||||
|
||||
$this->registry->output->html = str_replace( '<!--fulltext-->', $ftext, $this->registry->output->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Last 5 log in attempts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( $this->registry->getClass('class_permissions')->checkPermission( 'acplogin_log' ) )
|
||||
if( $this->registry->getClass('class_permissions')->checkPermission( 'acplogin_log', 'core', 'system' ) )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'admin_login_logs',
|
||||
'where' => 'admin_time > 0', // This just helps mysql use the index properly, which is useful for sorting
|
||||
'order' => 'admin_time DESC',
|
||||
'limit' => array( 0, 5 )
|
||||
) );
|
||||
@@ -685,4 +472,56 @@ class admin_core_mycp_dashboard extends ipsCommand
|
||||
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a list of nag panel entries
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getNotificationPanelEntries()
|
||||
{
|
||||
/* INIT */
|
||||
$entries = array();
|
||||
|
||||
/* Look for notification classes */
|
||||
foreach( ipsRegistry::$applications as $r )
|
||||
{
|
||||
if ( ! IPSLib::appIsInstalled( $r['app_directory'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Notification Class */
|
||||
$_file = IPSLib::getAppDir( $r['app_directory'] ) . '/extensions/dashboardNotifications.php';
|
||||
|
||||
/* Look for the file */
|
||||
if( file_exists( $_file ) )
|
||||
{
|
||||
/* Get the file */
|
||||
$_class = IPSLib::loadLibrary( $_file, 'dashboardNotifications__' . $r['app_directory'], $r['app_directory'] );
|
||||
|
||||
/* Look for the class */
|
||||
if( class_exists( $_class ) )
|
||||
{
|
||||
/* Create the object */
|
||||
$notifyObj = new $_class;
|
||||
|
||||
/* Look for the method */
|
||||
if( method_exists( $notifyObj, 'get' ) )
|
||||
{
|
||||
/* Get the entries */
|
||||
$_entries = $notifyObj->get();
|
||||
|
||||
if( is_array( $_entries ) && count( $_entries ) )
|
||||
{
|
||||
$entries = array_merge( $entries, $_entries );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Return entries */
|
||||
return $entries;
|
||||
}
|
||||
}
|
||||
Loaded 100 of 2563 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user