Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* @file attach.php Provides ajax methods to switch uploader type
|
||||
*
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-05-25 10:30:28 -0400 (Wed, 25 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8887 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_attach
|
||||
* @brief Provides ajax methods for the attach functions
|
||||
*/
|
||||
class public_core_ajax_attach extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Guest? */
|
||||
if ( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError('no_permission');
|
||||
}
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'setPref':
|
||||
$this->_setPref();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets uploader preference
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _setPref()
|
||||
{
|
||||
/* Init */
|
||||
$uploader = ( $this->request['pref'] == 'flash' ) ? 'flash' : 'default';
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_uploader' => $uploader ) ) );
|
||||
|
||||
/* Fetch data */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Update captcha image
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 2.3
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,8 @@ class public_core_ajax_captcha extends ipsAjaxCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -48,8 +47,7 @@ class public_core_ajax_captcha extends ipsAjaxCommand
|
||||
/**
|
||||
* Refresh the captcha image
|
||||
*
|
||||
* @access public
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function refresh()
|
||||
{
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-09-21 05:45:37 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6767 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9521 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -27,7 +27,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -35,7 +35,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
$fromApp = trim( $this->request['fromApp'] );
|
||||
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
|
||||
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
|
||||
|
||||
/* What to do? */
|
||||
@@ -65,7 +65,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Moderate
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _moderate()
|
||||
{
|
||||
@@ -91,7 +91,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Reply
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _fetchReply()
|
||||
{
|
||||
@@ -105,12 +105,18 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
{
|
||||
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
|
||||
|
||||
$this->returnString( $html );
|
||||
$this->editor->setContent( $html, 'topics', true );
|
||||
|
||||
$this->returnHtml( $this->editor->getContent() );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
@@ -122,7 +128,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
@@ -151,7 +157,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Shows the edit box
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showEdit()
|
||||
{
|
||||
@@ -183,7 +189,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Saves the post
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveEdit()
|
||||
{
|
||||
@@ -214,7 +220,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
/**
|
||||
* Add a comment via the magic and mystery of ajax
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _add()
|
||||
{
|
||||
@@ -226,8 +232,16 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
{
|
||||
try
|
||||
{
|
||||
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newCommentId ) );
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
if( $newComment['comment_approved'] )
|
||||
{
|
||||
return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newComment['comment_id'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'comment_requires_approval' );
|
||||
}
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
@@ -236,7 +250,7 @@ class public_core_ajax_comments extends ipsAjaxCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'no_permission');
|
||||
$this->returnJsonError( 'no_permission' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default ajax section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'ajax' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'login';
|
||||
$DEFAULT_SECTION = 'login';
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2011-09-26 10:20:55 -0400 (Mon, 26 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9547 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_editor extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$autoSaveKey = trim( $this->request['autoSaveKey'] );
|
||||
|
||||
if ( ! $autoSaveKey )
|
||||
{
|
||||
trigger_error( "Missing data in " . __FILE__ . ' ' . __LINE__ );
|
||||
}
|
||||
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$this->editor = new $classToLoad();
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'autoSave':
|
||||
$this->_autoSave( $autoSaveKey );
|
||||
break;
|
||||
case 'switch':
|
||||
$this->_switch();
|
||||
break;
|
||||
case 'showSettings':
|
||||
$this->_showSettings();
|
||||
break;
|
||||
case 'getEmoticons':
|
||||
$this->_getEmoticons();
|
||||
break;
|
||||
case 'saveSettings':
|
||||
$this->_saveSettings();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
protected function _getEmoticons()
|
||||
{
|
||||
return $this->returnJsonArray( $this->editor->fetchEmoticons( 250 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show settings box
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showSettings()
|
||||
{
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('editors')->editorSettings() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveSettings()
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'nopermission' );
|
||||
}
|
||||
|
||||
$clearSavedContent = intval( $this->request['clearSavedContent'] );
|
||||
$bw_cke_contextmenu = intval( $this->request['bw_cke_contextmenu'] );
|
||||
|
||||
if ( $clearSavedContent )
|
||||
{
|
||||
$this->DB->delete( 'core_editor_autosave', 'eas_member_id=' . $this->memberData['member_id'] );
|
||||
}
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'bw_cke_contextmenu' => $bw_cke_contextmenu ) ) );
|
||||
$member = IPSMember::load( $this->memberData['member_id'] );
|
||||
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between bbcode and rte on the fly, man
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _switch()
|
||||
{
|
||||
$content = $_POST['content'];
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content received: ' . $content ) );
|
||||
|
||||
if ( $content )
|
||||
{
|
||||
$content = $this->editor->switchContent( $content, intval( $_POST['isRte'] ) );
|
||||
}
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Content after conversion: ' . $content ) );
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnString( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more dialogue
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _autoSave( $autoSaveKey )
|
||||
{
|
||||
if ( $_POST['content'] && $autoSaveKey )
|
||||
{
|
||||
$this->editor->autoSave( $_POST['content'], $autoSaveKey );
|
||||
}
|
||||
|
||||
/* return if no errors occurred */
|
||||
return $this->returnJsonArray( array( 'status' => 'ok' ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2010-01-25 11:58:04 -0500 (Mon, 25 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5747 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ class public_core_ajax_facebook extends ipsAjaxCommand
|
||||
/**
|
||||
* Login handler object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
@@ -38,7 +37,6 @@ class public_core_ajax_facebook extends ipsAjaxCommand
|
||||
/**
|
||||
* Flag : Logged in
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $logged_in = false;
|
||||
@@ -46,9 +44,8 @@ class public_core_ajax_facebook extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -68,10 +65,9 @@ class public_core_ajax_facebook extends ipsAjaxCommand
|
||||
/**
|
||||
* Main AJAX log in routine
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
private function _getUserByFbId()
|
||||
protected function _getUserByFbId()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX Find Names functions
|
||||
* Last Updated: $Date: 2010-04-14 19:25:27 -0400 (Wed, 14 Apr 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6118 $
|
||||
* @version $Revision: 8644 $
|
||||
* @see admin_core_ajax_findnames
|
||||
*
|
||||
*/
|
||||
@@ -31,9 +31,8 @@ class public_core_ajax_findnames extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -48,10 +47,9 @@ class public_core_ajax_findnames extends ipsAjaxCommand
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @access private
|
||||
* @return void Outputs to screen
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
private function _getMemberNames()
|
||||
protected function _getMemberNames()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -97,10 +95,10 @@ class public_core_ajax_findnames extends ipsAjaxCommand
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSLib::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')',
|
||||
'img' => $photo['pp_thumb_photo'],
|
||||
'img' => $photo['pp_mini_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height']
|
||||
);
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,19 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6767 $
|
||||
*
|
||||
* @file like.php Provides ajax methods for the central like/follow class
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -22,20 +17,25 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_like
|
||||
* @brief Provides ajax methods for the central like/follow class
|
||||
*/
|
||||
class public_core_ajax_like extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$app = trim( $this->request['f_app'] );
|
||||
$area = trim( $this->request['f_area'] );
|
||||
$relid = intval( $this->request['f_relid'] );
|
||||
$app = trim( $this->request['f_app'] );
|
||||
$area = trim( $this->request['f_area'] );
|
||||
$relid = intval( $this->request['f_relid'] );
|
||||
|
||||
if ( ! $app OR ! $area OR empty( $relid ) )
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class public_core_ajax_like extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
$this->_like = classes_like::bootstrap( $app, $area );
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_like' ), 'core' );
|
||||
@@ -53,42 +53,38 @@ class public_core_ajax_like extends ipsAjaxCommand
|
||||
{
|
||||
case 'setDialogue':
|
||||
$this->_setDialogue( $app, $area, $relid );
|
||||
break;
|
||||
break;
|
||||
case 'save':
|
||||
$this->_save( $app, $area, $relid );
|
||||
break;
|
||||
$this->_save( $relid );
|
||||
break;
|
||||
case 'unset':
|
||||
$this->_unset( $app, $area, $relid );
|
||||
break;
|
||||
$this->_unset( $relid );
|
||||
break;
|
||||
case 'more':
|
||||
$this->_more( $app, $area, $relid );
|
||||
break;
|
||||
$this->_more( $relid );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show more dialogue
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return void
|
||||
* @param integer $relid Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _more( $app, $area, $relid )
|
||||
protected function _more( $relid )
|
||||
{
|
||||
/* Fetch data */
|
||||
return $this->returnHtml( $this->_like->render( 'more', $relid ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Do unset
|
||||
* Do unset like
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return void
|
||||
* @param integer $relid Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _unset( $app, $area, $relid )
|
||||
protected function _unset( $relid )
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
@@ -103,14 +99,12 @@ class public_core_ajax_like extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
/**
|
||||
* Save form
|
||||
* Save like
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return void
|
||||
* @param integer $relid Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _save( $app, $area, $relid )
|
||||
protected function _save( $relid )
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
@@ -125,16 +119,17 @@ class public_core_ajax_like extends ipsAjaxCommand
|
||||
$this->_like->add( $relid, $this->memberData['member_id'], array( 'like_notify_do' => $like_notify, 'like_notify_freq' => $like_freq ), $like_anon );
|
||||
|
||||
/* Fetch data */
|
||||
return $this->returnHtml( $this->_like->render( 'summary', $relid ) );
|
||||
return $this->returnHtml( $this->_like->render( 'summary', $relid ) );
|
||||
/* This used to force response as UTF-8, but that caused this bug: @link http://community.invisionpower.com/tracker/issue-32255-character-conversion-bug-with-follow-this-x */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show set form
|
||||
*
|
||||
* @param string App
|
||||
* @param string Area
|
||||
* @param int Relationship ID
|
||||
* @return void
|
||||
* @param string $app Application
|
||||
* @param string $area Area
|
||||
* @param integer $relid Relationship ID
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _setDialogue( $app, $area, $relid )
|
||||
{
|
||||
@@ -147,5 +142,4 @@ class public_core_ajax_like extends ipsAjaxCommand
|
||||
|
||||
return $this->returnHtml( $this->registry->getClass('output')->getTemplate('global_other')->likeSetDialogue( $app, $area, $relid, $data ) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX login
|
||||
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6995 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -43,7 +43,7 @@ class public_core_ajax_login extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -88,9 +88,9 @@ class public_core_ajax_login extends ipsAjaxCommand
|
||||
/**
|
||||
* Authenticate a user, returns a JSON array
|
||||
*
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
private function _authenticateUser()
|
||||
protected function _authenticateUser()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -117,9 +117,9 @@ class public_core_ajax_login extends ipsAjaxCommand
|
||||
/**
|
||||
* Main AJAX log in routine
|
||||
*
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
private function _doLogIn()
|
||||
protected function _doLogIn()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Use central method
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Handles ajax functions for IP.Board Text Editor
|
||||
* Author: Matt "Matt Mecham" Mecham
|
||||
* Last Updated: $LastChangedDate: 2011-08-18 17:50:15 -0400 (Thu, 18 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9399 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_media extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Route action
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'loadtab':
|
||||
$this->_showTab();
|
||||
break;
|
||||
|
||||
case 'show':
|
||||
default:
|
||||
$this->_showPane();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a tab
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showTab()
|
||||
{
|
||||
$app = trim($this->request['tabapp']);
|
||||
$plugin = trim($this->request['tabplugin']);
|
||||
$output = '';
|
||||
$string = $this->convertAndMakeSafe( $this->request['search'], TRUE );
|
||||
|
||||
if( $app AND is_file( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_plugin = new $classToLoad( $this->registry );
|
||||
$output = $_plugin->showTab( $string );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = $this->registry->output->getTemplate('editors')->sharedMediaDefault();
|
||||
}
|
||||
|
||||
return $this->returnHtml( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the panel to select your media
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showPane()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Loop through apps and collect tabs
|
||||
//-----------------------------------------
|
||||
|
||||
$_plugins = array();
|
||||
$_tabs = array();
|
||||
|
||||
foreach( ipsRegistry::$applications as $application )
|
||||
{
|
||||
if( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) as $file )
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( '/^plugin_(.+?)\.php$/', $file->getFileName(), $matches ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $application['app_directory'] . '_' . $matches[1], $application['app_directory'] );
|
||||
$_plugins[ $application['app_directory'] ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() )
|
||||
{
|
||||
$_tabs[] = array( 'app' => $application['app_directory'], 'plugin' => $matches[1], 'title' => $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('editors')->sharedMedia( $_tabs ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* @file modcp.php Moderator control panel AJAX retrieve tab
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_modcp
|
||||
* @brief Moderator control panel
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_modcp extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load basic things
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Which road are we going to take?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'index':
|
||||
$this->_getTab();
|
||||
break;
|
||||
|
||||
case 'getmembers':
|
||||
$this->_getMembers();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns possible matches for the string input
|
||||
*
|
||||
* @return @e void Outputs to screen
|
||||
*/
|
||||
protected function _getMembers()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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.member_id, m.members_seo_name',
|
||||
'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() )
|
||||
{
|
||||
$url = $this->registry->output->buildSEOUrl( "app=core&module=modcp&section=editmember&mid={$r['member_id']}", 'public' );
|
||||
$photo = IPSMember::buildProfilePhoto( $r );
|
||||
$group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
|
||||
|
||||
$return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'],
|
||||
'showas'=> $r['members_display_name'],
|
||||
'img' => $photo['pp_thumb_photo'],
|
||||
'img_w' => $photo['pp_mini_width'],
|
||||
'img_h' => $photo['pp_mini_height'],
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve modcp tab based
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _getTab()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$app = trim($this->request['fromapp']);
|
||||
$plugin = trim($this->request['tab']);
|
||||
$moderator = $this->registry->class_forums->getModerator();
|
||||
$_output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get plugin output
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
|
||||
$_thisPlugin = new $classToLoad( $this->registry );
|
||||
|
||||
$_output = $_thisPlugin->executePlugin( $moderator );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
if( $_output )
|
||||
{
|
||||
$this->returnJsonArray( array( 'html' => $_output ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['plugin_not_found'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @file navigation.php navigation AJAX retrieve (Matt Mecham)
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-04-27 19:56:50 -0400 (Wed, 27 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8514 $
|
||||
*/
|
||||
|
||||
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 public_core_ajax_navigation
|
||||
* @brief Navigation builder
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_navigation extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Set up */
|
||||
$inapp = trim( $this->request['inapp'] );
|
||||
$do = ( ! empty( $this->request['do'] ) ) ? $this->request['do'] : 'all';
|
||||
|
||||
/* Load navigation stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build' );
|
||||
$navigation = new $classToLoad( $inapp );
|
||||
|
||||
/* Show warning if offline */
|
||||
if ( $this->settings['board_offline'] AND !$this->memberData['g_access_offline'] )
|
||||
{
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='offline_msg'" ) );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'global';
|
||||
|
||||
$row['conf_value'] = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $row['conf_value'] ) );
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->quickNavigationOffline( $row['conf_value'] ) );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
if ( $do == 'all' )
|
||||
{
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->quickNavigationWrapper( $navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $navigation->getApp() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->quickNavigationPanel( $navigation->loadNavigationData(), $navigation->getApp() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Notification AJAX methods
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-09-21 09:23:48 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 9524 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_core_ajax_notifications extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -56,9 +55,8 @@ class public_core_ajax_notifications extends ipsAjaxCommand
|
||||
/**
|
||||
* Retrieve next notification for user
|
||||
*
|
||||
* @access protected
|
||||
* @param string Database order (asc/desc)
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function getMoreNotifications( $dir='DESC' )
|
||||
{
|
||||
@@ -139,8 +137,7 @@ class public_core_ajax_notifications extends ipsAjaxCommand
|
||||
/**
|
||||
* Retrieve user's last x notifications
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
protected function getMyNotifications()
|
||||
{
|
||||
@@ -148,7 +145,7 @@ class public_core_ajax_notifications extends ipsAjaxCommand
|
||||
// We logged in?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->memberData['member_id'] )
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['notifylogin_error'] );
|
||||
}
|
||||
@@ -161,20 +158,18 @@ class public_core_ajax_notifications extends ipsAjaxCommand
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
$notifyLibrary->setMember( $this->memberData );
|
||||
|
||||
$_data = $notifyLibrary->fetchUnreadNotifications( 10, 'notify_sent', 'DESC', false );
|
||||
$_data = $notifyLibrary->fetchLatestNotifications( 10 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Now mark them all read
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] );
|
||||
|
||||
$notifyLibrary->rebuildUnreadCount();
|
||||
$notifyLibrary->markNotificationsAsReadByMemberId( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return results
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) );
|
||||
$this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) ) );
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Registration AJAX routines
|
||||
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Who knows...
|
||||
* @version $Revision: 6995 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,7 +29,7 @@ class public_core_ajax_register extends ipsAjaxCommand
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -50,7 +50,7 @@ class public_core_ajax_register extends ipsAjaxCommand
|
||||
/**
|
||||
* Check the email address
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function checkEmail()
|
||||
{
|
||||
@@ -136,7 +136,7 @@ class public_core_ajax_register extends ipsAjaxCommand
|
||||
/**
|
||||
* Check the name or display name
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function checkDisplayName( $field='members_display_name' )
|
||||
{
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Reports AJAX options
|
||||
* Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6995 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -28,7 +28,7 @@ class public_core_ajax_reports extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -51,9 +51,9 @@ class public_core_ajax_reports extends ipsAjaxCommand
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _changeStatus()
|
||||
protected function _changeStatus()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get status's and flags
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2010-10-14 17:24:55 -0400 (Thu, 14 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6982 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -28,7 +28,7 @@ class public_core_ajax_reputation extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -36,19 +36,97 @@ class public_core_ajax_reputation extends ipsAjaxCommand
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add_rating':
|
||||
$this->doRating();
|
||||
$this->_doRating();
|
||||
break;
|
||||
|
||||
case 'more':
|
||||
$this->_more();
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$this->_viewRep();
|
||||
break;
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays reputation popup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _viewRep()
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
if ( !$this->memberData['gbw_view_reps'] )
|
||||
{
|
||||
$this->returnJsonError('no_permission');
|
||||
}
|
||||
|
||||
$repApp = $this->request['repApp'];
|
||||
$repType = $this->request['repType'];
|
||||
$repId = intval($this->request['repId']);
|
||||
|
||||
/* Get data */
|
||||
$reps = array();
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'member_id, rep_rating',
|
||||
'from' => 'reputation_index',
|
||||
'where' => "app='{$repApp}' AND type='{$repType}' AND type_id='{$repId}'",
|
||||
'order' => 'rep_date',
|
||||
) );
|
||||
$q = $this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch( $q ) )
|
||||
{
|
||||
$reps[ $r['member_id'] ] = $r;
|
||||
$members[ $r['member_id'] ] = $r['member_id'];
|
||||
}
|
||||
|
||||
if( count($members) AND count($reps) )
|
||||
{
|
||||
$_members = IPSMember::load( $members );
|
||||
|
||||
foreach( $reps as $memId => $repData )
|
||||
{
|
||||
$reps[ $memId ]['member'] = $_members[ $memId ];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate('global_other')->reputationPopup( $reps ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doRating()
|
||||
protected function _more()
|
||||
{
|
||||
$app = trim( $this->request['f_app'] );
|
||||
$type = trim( $this->request['f_type'] );
|
||||
$id = intval( $this->request['f_id'] );
|
||||
|
||||
/* Get the rep library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
|
||||
$repCache = new $classToLoad();
|
||||
|
||||
/* Fetch members who have wanted to favorite this item */
|
||||
$data = $repCache->getDataByRelationshipId( array( 'app' => $app, 'type' => $type, 'id' => $id, 'rating' => 1 ) );
|
||||
|
||||
return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->repMoreDialogue( $data, $id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _doRating()
|
||||
{
|
||||
/* INIT */
|
||||
$app = $this->request['app_rate'];
|
||||
@@ -67,12 +145,21 @@ class public_core_ajax_reputation extends ipsAjaxCommand
|
||||
$repCache = new $classToLoad();
|
||||
|
||||
/* Add the rating */
|
||||
if( $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) === false )
|
||||
if ( $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) !== false )
|
||||
{
|
||||
$this->returnString( $repCache->error_message );
|
||||
$formatted = $repCache->getLikeFormatted( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
$current = $repCache->getCurrentMemberRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type, 'memberId' => $this->memberData['member_id'] ) );
|
||||
$rating = $repCache->getCurrentRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'ok', 'rating' => $rating, 'likeData' => $formatted, 'canRepUp' => IPSMember::canRepUp( $current, $this->memberData ), 'canRepDown' => IPSMember::canRepDown( $current, $this->memberData ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $repCache->error_message )
|
||||
{
|
||||
$this->returnJsonError( $repCache->error_message );
|
||||
}
|
||||
|
||||
$this->returnString( 'done' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @file search.php AJAX configure VNC filters
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-25 10:30:28 -0400 (Wed, 25 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8887 $
|
||||
*/
|
||||
|
||||
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 public_core_ajax_search
|
||||
* @brief Search VNC configurator
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_search extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get forums class
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 1;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_search' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'showForumsVncFilter':
|
||||
$this->showForm();
|
||||
break;
|
||||
|
||||
case 'saveForumsVncFilter':
|
||||
$this->saveForm();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the form to configure VNC forum filters
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function saveForm()
|
||||
{
|
||||
$vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' );
|
||||
|
||||
/* Filter forums for VNC */
|
||||
if( !empty($this->request['saveVncFilters']) )
|
||||
{
|
||||
$this->request['saveVncFilters'] = rtrim( $this->request['saveVncFilters'], ',' );
|
||||
|
||||
if( $this->request['saveVncFilters'] == 'all' )
|
||||
{
|
||||
unset($vncPrefs['forums']['vnc_forum_filter']);
|
||||
}
|
||||
else if( strpos( $this->request['saveVncFilters'], ',' ) !== false )
|
||||
{
|
||||
$vncPrefs['forums']['vnc_forum_filter'] = explode( ',', $this->request['saveVncFilters'] );
|
||||
}
|
||||
else if( !empty($this->request['saveVncFilters']) )
|
||||
{
|
||||
$vncPrefs['forums']['vnc_forum_filter'] = array( $this->request['saveVncFilters'] );
|
||||
}
|
||||
}
|
||||
|
||||
IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) );
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => true ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form to configure VNC forum filters
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function showForm()
|
||||
{
|
||||
$_data = $this->_getData();
|
||||
$vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' );
|
||||
$fFP = $vncPrefs == null ? null : ( empty($vncPrefs['forums']['vnc_forum_filter']) ? null : $vncPrefs['forums']['vnc_forum_filter'] );
|
||||
|
||||
$this->returnHtml( $this->registry->output->getTemplate('search')->forumsVncFilters( $_data, $fFP ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches forum jump data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getData()
|
||||
{
|
||||
$depth_guide = 0;
|
||||
$links = array();
|
||||
|
||||
if( is_array($this->registry->class_forums->forum_cache['root'] ) AND count($this->registry->class_forums->forum_cache['root'] ) )
|
||||
{
|
||||
foreach($this->registry->class_forums->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['sub_can_post'] or ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND count($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) ) )
|
||||
{
|
||||
$forum_data['redirect_on'] = isset( $forum_data['redirect_on'] ) ? $forum_data['redirect_on'] : 0;
|
||||
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'important' => true, 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] );
|
||||
|
||||
if ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ]) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
$depth_guide++;
|
||||
|
||||
foreach($this->registry->class_forums->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] );
|
||||
|
||||
$links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide );
|
||||
}
|
||||
|
||||
$depth_guide--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal helper function for forumsForumJump
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $links
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
private function _getDataRecursively( $root_id, $links=array(), $depth_guide=0 )
|
||||
{
|
||||
if ( isset( $this->registry->class_forums->forum_cache[ $root_id ] ) AND is_array($this->registry->class_forums->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
$depth_guide++;
|
||||
|
||||
foreach($this->registry->class_forums->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] );
|
||||
|
||||
$links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* AJAX Sharelinks
|
||||
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-08 03:56:43 -0400 (Thu, 08 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 6997 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9465 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -28,7 +28,7 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -56,16 +56,16 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
/**
|
||||
* Displays a form of facebook stuff. It's really that exciting.
|
||||
*
|
||||
* @return void [Outputs HTML to browser AJAX call]
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
private function _facebookForm()
|
||||
protected function _facebookForm()
|
||||
{
|
||||
/* Ensure we have a twitter account and that */
|
||||
if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] )
|
||||
{
|
||||
/* Connect to the Facebook */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
|
||||
$connect = new facebook_connect( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $this->registry );
|
||||
|
||||
try
|
||||
{
|
||||
@@ -80,22 +80,23 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
|
||||
$this->returnHtml( 'x' );
|
||||
/* Oh go on then */
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( array() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Go go Facebook go
|
||||
*
|
||||
* @return void [Outputs HTML to browser AJAX call]
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
private function _facebookGo()
|
||||
protected function _facebookGo()
|
||||
{
|
||||
/* INIT */
|
||||
$comment = trim( urldecode( $_POST['comment'] ) );
|
||||
$url = trim( urldecode( $_POST['url'] ) );
|
||||
$title = trim( urldecode( $_POST['title'] ) );
|
||||
$comment = ( $comment == $this->lang->words['fb_share_default'] ) ? '' : $comment;
|
||||
|
||||
/* Ensure title is correctly de-html-ized */
|
||||
$title = IPSText::UNhtmlspecialchars( $title );
|
||||
@@ -104,8 +105,8 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] )
|
||||
{
|
||||
/* Connect to the Facebook */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' );
|
||||
$connect = new facebook_connect( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' );
|
||||
$connect = new $classToLoad( $this->registry );
|
||||
|
||||
try
|
||||
{
|
||||
@@ -144,9 +145,9 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
/**
|
||||
* Go go twitter go
|
||||
*
|
||||
* @return void [Outputs HTML to browser AJAX call]
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
private function _twitterGo()
|
||||
protected function _twitterGo()
|
||||
{
|
||||
/* INIT */
|
||||
$tweet = trim( urldecode( $_POST['tweet'] ) );
|
||||
@@ -160,8 +161,8 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] )
|
||||
{
|
||||
/* Connect to the twitter */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
|
||||
$connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
|
||||
$user = $connect->fetchUserData();
|
||||
|
||||
if ( $user['id'] )
|
||||
@@ -200,16 +201,16 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
/**
|
||||
* Displays a form of twitter stuff. It's really that exciting.
|
||||
*
|
||||
* @return void [Outputs HTML to browser AJAX call]
|
||||
* @return @e void [Outputs HTML to browser AJAX call]
|
||||
*/
|
||||
private function _twitterForm()
|
||||
protected function _twitterForm()
|
||||
{
|
||||
/* Ensure we have a twitter account and that */
|
||||
if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] )
|
||||
{
|
||||
/* Connect to the twitter */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' );
|
||||
$connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' );
|
||||
$connect = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] );
|
||||
$user = $connect->fetchUserData();
|
||||
|
||||
if ( $user['id'] )
|
||||
@@ -218,13 +219,13 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
|
||||
$this->returnHtml( '.' );
|
||||
/* Bog off */
|
||||
$this->returnHtml( 'x' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */
|
||||
/* Bog off */
|
||||
$this->returnHtml( 'x' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_skingen extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinGenerator.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinGenerator( $registry );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
/* Init */
|
||||
$storedClasses = json_decode( $_POST['storedClasses'], true );
|
||||
$storedSettings = json_decode( $_POST['storedSettings'], true );
|
||||
$css = $_POST['css'];
|
||||
|
||||
/* Build it, ship it, wiggle your hips a bit */
|
||||
try
|
||||
{
|
||||
/* Apologies for the previous comment */
|
||||
$this->skinFunctions->resetMemberAndSwitchSkin( $this->memberData['member_id'] );
|
||||
|
||||
$this->skinFunctions->save( array( 'css' => $css, 'storedSettings' => $storedSettings, 'storedClasses' => $storedClasses ), $this->memberData['member_id'] );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
return $this->returnJsonArray( array('status' => 'error', 'msg' => $e->getMessage() ) );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
return $this->returnJsonArray( array('status' => 'ok' ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Like Ajax
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_tags extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'find':
|
||||
$this->_find();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find tags
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _find()
|
||||
{
|
||||
/* init */
|
||||
$app = $this->request['meta_app'];
|
||||
$area = $this->request['meta_area'];
|
||||
$parentId = intval( $this->request['meta_parent_id'] );
|
||||
$metaId = intval( $this->request['meta_id'] );
|
||||
$find = trim( $this->request['find'] );
|
||||
$tags = array();
|
||||
$sort = array();
|
||||
|
||||
/* Checks */
|
||||
if ( empty( $app ) OR empty( $area ) )
|
||||
{
|
||||
return $this->returnJsonArray( array() );
|
||||
}
|
||||
|
||||
/* Init tags */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$tagClass = classes_tags_bootstrap::run( $app, $area );
|
||||
|
||||
/* Get tags by whut */
|
||||
if ( ! empty( $metaId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByMetaId( $metaId, $find );
|
||||
}
|
||||
else if ( ! empty( $parentId ) )
|
||||
{
|
||||
$tags = $tagClass->getRawTagsByParentId( $parentId, $find );
|
||||
}
|
||||
|
||||
/* format */
|
||||
if ( is_array( $tags ) && count( $tags ) )
|
||||
{
|
||||
foreach( $tags as $id => $t )
|
||||
{
|
||||
$sort[ strlen( $t['tag_text'] ) . '.' . md5( $t['tag_text'] ) ] = $t['tag_text'];
|
||||
}
|
||||
}
|
||||
|
||||
ksort( $sort );
|
||||
|
||||
return $this->returnJsonArray( array_values( $sort ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* @file templates.php Retrieve a template bit
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since Friday 19th May 2006 17:33
|
||||
* $LastChangedDate: 2011-05-03 04:53:04 -0400 (Tue, 03 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8588 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_templates
|
||||
* @brief Retrieve a template bit
|
||||
*
|
||||
*/
|
||||
class public_core_ajax_templates extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fetch template bit
|
||||
//-----------------------------------------
|
||||
|
||||
$templateBit = trim($this->request['template_bit']);
|
||||
$group = trim($this->request['template_group']);
|
||||
$_lang = trim($this->request['lang_module']);
|
||||
$_app = trim($this->request['lang_app']);
|
||||
|
||||
if( !$templateBit OR !$group )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['missing_template_bit'] );
|
||||
}
|
||||
|
||||
$templateBit = 'ajax__' . $templateBit;
|
||||
|
||||
if( !is_object( $this->registry->output->getTemplate( $group ) ) OR !method_exists( $this->registry->output->getTemplate( $group ), $templateBit ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['missing_template_bit'] );
|
||||
}
|
||||
|
||||
if( $_lang && $_app )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_' . $_lang ), $_app );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate( $group )->$templateBit() ), true );
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction : AJAX UserCP functions
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_core_ajax_usercp extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -47,10 +46,9 @@ class public_core_ajax_usercp extends ipsAjaxCommand
|
||||
/**
|
||||
* Checks a display name
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
* @return @e void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
private function displayNameCheck()
|
||||
protected function displayNameCheck()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.0
|
||||
* Vkontakte auth : AJAX
|
||||
*
|
||||
* @author $Author: giv $
|
||||
* @copyright (c) 2010 IBResource, LTD.
|
||||
* @license http://www.ibresource.ru/products/ipboard/
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @since 1st June 2010
|
||||
* @link http://www.ibresource.ru
|
||||
* @version $Rev: 6242 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_vkontakte extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Login handler object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
|
||||
/**
|
||||
* Flag : Logged in
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $logged_in = false;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'getUserByVkId':
|
||||
$return = $this->_getUserByVkId();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->returnHtml( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Main AJAX log in routine
|
||||
*
|
||||
* @access private
|
||||
* @return void [Outputs JSON to browser AJAX call]
|
||||
*/
|
||||
private function _getUserByVkId()
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' );
|
||||
$vk = new Vkontakte_Request_Validator( $this->settings['vk_api_id'], $this->settings['vk_secret'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$vkUid = is_numeric( $vk->mid ) ? $vk->mid : -1;
|
||||
$member = array( 'member_id' => 0 );
|
||||
|
||||
if ( $vkUid )
|
||||
{
|
||||
$_mid = $this->DB->buildAndFetch( array( 'select' => 'member_id',
|
||||
'from' => 'members',
|
||||
'where' => 'vk_uid=' . $vkUid ) );
|
||||
|
||||
if ( $_mid['member_id'] )
|
||||
{
|
||||
$member = IPSMember::load( $_mid['member_id'], 'all' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Create validating account for the member */
|
||||
$key = md5( uniqid( microtime() ) );
|
||||
$member['key'] = $key;
|
||||
|
||||
if ( $vkUid == $this->request['id'] )
|
||||
{
|
||||
|
||||
$this->DB->delete( 'vkontakte_connect', 'v_id = ' . $vkUid );
|
||||
|
||||
$name = IPSMember::getFunction()->cleanAndCheckName( $this->request['name'], array(), 'name' );
|
||||
|
||||
$photo = '';
|
||||
|
||||
if ( IPSText::xssCheckUrl( $this->request['photo'] ) && preg_match('~^http://.+?\.vkontakte\.ru/u' . $vkUid. '~is', $this->request['photo']))
|
||||
{
|
||||
$photo = $this->request['photo'];
|
||||
}
|
||||
|
||||
$this->DB->insert( 'vkontakte_connect', array( 'v_key' => $key,
|
||||
'v_user' => $name['username'],
|
||||
'v_data' => $photo,
|
||||
'v_id' => $vkUid ) );
|
||||
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $member );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Retrieve member warn log
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_ajax_warn extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* System disabled? */
|
||||
if ( !$this->settings['warn_on'] )
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
$this->returnJsonError( $this->lang->words['ajax_no_warn'] );
|
||||
}
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->_viewWarnLogs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retieve warn logs and return them
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _viewWarnLogs()
|
||||
{
|
||||
/* Get library and load */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_public/modcp/editmember.php', 'public_core_modcp_editmember' );
|
||||
$warn = new $classToLoad();
|
||||
$warn->makeRegistryShortcuts( $this->registry );
|
||||
$warn->loadData();
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_modcp' ), 'core' );
|
||||
|
||||
$warnHTML = $warn->viewLog( true );
|
||||
|
||||
if ( $warnHTML )
|
||||
{
|
||||
$this->returnHtml( $warnHTML );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
$this->returnJsonError( $this->lang->words['ajax_bad_html'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Attachment Poster
|
||||
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-07 14:34:13 -0400 (Wed, 07 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6997 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9462 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -42,7 +42,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -86,7 +86,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
/**
|
||||
* View Post Attachment
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function showPostAttachment()
|
||||
{
|
||||
@@ -103,7 +103,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
/**
|
||||
* Remove an upload
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentUploadRemove()
|
||||
{
|
||||
@@ -137,7 +137,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
/**
|
||||
* Perform the actual upload
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentUploadProcess()
|
||||
{
|
||||
@@ -173,8 +173,8 @@ class public_core_attach_attach extends ipsCommand
|
||||
* @param string $msg
|
||||
* @param bool $is_error
|
||||
* @param integer $insert_id
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentUploadShow( $msg="ready", $is_error=0, $insert_id=0 )
|
||||
{
|
||||
/* INIT JSON */
|
||||
@@ -278,7 +278,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
$JSON['attach_stats'] = $this->class_attach->attach_stats;
|
||||
|
||||
/* Formatting nonsense for special char sets */
|
||||
array_walk_recursive( $JSON, create_function( '&$value, $key', '$value = IPSText::convertCharsets($value, "' . IPS_DOC_CHAR_SET . '", "UTF-8");' ) );
|
||||
array_walk_recursive( $JSON, array( 'IPSText', 'arrayWalkCallbackConvert' ) );
|
||||
$result = json_encode( $JSON );
|
||||
$result = IPSText::convertCharsets( $result, "UTF-8", IPS_DOC_CHAR_SET );
|
||||
|
||||
@@ -294,7 +294,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
* @param string $msg
|
||||
* @param bool $is_error
|
||||
* @param integer $insert_id
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachiFrame( $msg="ready", $is_error=0, $insert_id=0 )
|
||||
{
|
||||
@@ -309,7 +309,7 @@ class public_core_attach_attach extends ipsCommand
|
||||
/**
|
||||
* Perform the actual upload
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachUploadiFrame()
|
||||
{
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default attachments section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'attach' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'attach';
|
||||
$DEFAULT_SECTION = 'attach';
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6997 $
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,7 +29,7 @@ class public_core_global_captcha extends ipsCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -53,16 +53,13 @@ class public_core_global_captcha extends ipsCommand
|
||||
* Show the captcha image
|
||||
* Shows the captcha image. Good god, that was a waste of time
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function showImage()
|
||||
{
|
||||
/* INIT */
|
||||
$captcha_unique_id = trim( $this->request['captcha_unique_id'] );
|
||||
|
||||
/* GD installed? */
|
||||
$this->class_captcha->show_error_gd_img = TRUE;
|
||||
|
||||
/* Show Image... */
|
||||
$this->class_captcha->showImage( $captcha_unique_id );
|
||||
}
|
||||
@@ -71,7 +68,7 @@ class public_core_global_captcha extends ipsCommand
|
||||
* Show the captcha image
|
||||
* Refreshes the captcha image.
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function refreshImage()
|
||||
{
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-09-07 21:50:25 -0400 (Wed, 07 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6767 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9464 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,17 +27,21 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$fromApp = trim( $this->request['fromApp'] );
|
||||
|
||||
if( !$fromApp )
|
||||
{
|
||||
$this->registry->output->showError( 'noappcomments', 100135.8 );
|
||||
}
|
||||
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
|
||||
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
|
||||
|
||||
/* What to do? */
|
||||
@@ -73,8 +77,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Redirects]
|
||||
* @return @e void [Redirects]
|
||||
*/
|
||||
protected function _findLastComment()
|
||||
{
|
||||
@@ -87,8 +90,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Redirects]
|
||||
* @return @e void [Redirects]
|
||||
*/
|
||||
protected function _findComment()
|
||||
{
|
||||
@@ -102,8 +104,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Moderate
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _moderate()
|
||||
{
|
||||
@@ -129,8 +130,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Reply
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _fetchReply()
|
||||
{
|
||||
@@ -153,16 +153,14 @@ class public_core_global_comments extends ipsCommand
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->returnString( 'Error ' . $error->getMessage() );
|
||||
$this->returnString( $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
@@ -198,8 +196,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Shows the edit box
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showEdit()
|
||||
{
|
||||
@@ -213,12 +210,12 @@ class public_core_global_comments extends ipsCommand
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
array( 'parent_id' => 'id',
|
||||
'parent_owner_id' => 'member_id',
|
||||
'parent_parent_id' => 'img_album_id',
|
||||
'parent_title' => 'caption',
|
||||
'parent_seo_title' => 'caption_seo',
|
||||
'parent_date' => 'idate' );
|
||||
array( 'parent_id' => 'id',
|
||||
'parent_owner_id' => 'member_id',
|
||||
'parent_parent_id' => 'img_album_id',
|
||||
'parent_title' => 'caption',
|
||||
'parent_seo_title' => 'caption_seo',
|
||||
'parent_date' => 'idate' );
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
@@ -229,10 +226,10 @@ class public_core_global_comments extends ipsCommand
|
||||
$parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' );
|
||||
|
||||
/* Output */
|
||||
$this->registry->getClass('output')->setTitle( $this->title );
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['edit_comment'] . ' ' . $parent['parent_title'] );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] );
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . ' ' . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] );
|
||||
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
@@ -242,11 +239,10 @@ class public_core_global_comments extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Saves the post
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveEdit()
|
||||
{
|
||||
@@ -283,8 +279,7 @@ class public_core_global_comments extends ipsCommand
|
||||
/**
|
||||
* Add a comment via the magic and mystery of NORMAL POSTING FOOL
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _add()
|
||||
{
|
||||
@@ -297,15 +292,25 @@ class public_core_global_comments extends ipsCommand
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 );
|
||||
}
|
||||
|
||||
|
||||
/* If we are a guest, verify captcha */
|
||||
if( !$this->memberData['member_id'] AND $this->settings['guest_captcha'] )
|
||||
{
|
||||
if ( !$this->registry->getClass('class_captcha')->validate() )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_captcha', '1-global-comments-_add-3', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the comment */
|
||||
if ( $post AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
$newComment = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
/* Redirect to find latest */
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
$this->_comments->redirectToComment( 'last', $parentId, $newComment['comment_approved'] ? false : true );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default global section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'global' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'login';
|
||||
$DEFAULT_SECTION = 'login';
|
||||
@@ -1,322 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Image Ajax
|
||||
* Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6767 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_comments extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* From App */
|
||||
$fromApp = trim( $this->request['fromApp'] );
|
||||
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );
|
||||
$this->_comments = classes_comments_bootstrap::controller( $fromApp );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->_add();
|
||||
break;
|
||||
case 'delete':
|
||||
$this->_delete();
|
||||
break;
|
||||
case 'showEdit':
|
||||
$this->_showEdit();
|
||||
break;
|
||||
case 'saveEdit':
|
||||
$this->_saveEdit();
|
||||
break;
|
||||
case 'fetchReply':
|
||||
$this->_fetchReply();
|
||||
break;
|
||||
case 'moderate':
|
||||
$this->_moderate();
|
||||
break;
|
||||
case 'findLastComment':
|
||||
$this->_findLastComment();
|
||||
break;
|
||||
case 'findComment':
|
||||
$this->_findComment();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Redirects]
|
||||
*/
|
||||
protected function _findLastComment()
|
||||
{
|
||||
/* Init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find last page of comments
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Redirects]
|
||||
*/
|
||||
protected function _findComment()
|
||||
{
|
||||
/* Init */
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$comment_id = intval( $this->request['comment_id'] );
|
||||
|
||||
$this->_comments->redirectToComment( $comment_id, $parentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* Moderate
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function _moderate()
|
||||
{
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$commentIds = ( is_array( $_POST['commentIds'] ) ) ? IPSLib::cleanIntArray( $_POST['commentIds'] ) : array();
|
||||
$modact = trim( $this->request['modact'] );
|
||||
|
||||
if ( count( $commentIds ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->_comments->moderate( $modact, $parentId, $commentIds, $this->memberData );
|
||||
|
||||
$this->returnJsonArray( array( 'msg' => 'ok' ) );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( 'Error ' . $error->getMessage() . ' line: ' . $error->getFile() . '.' . $error->getLine() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reply
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
protected function _fetchReply()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['comment_id'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $commentId OR ! $parentId )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
{
|
||||
$html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData );
|
||||
|
||||
$this->returnString( $html );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->returnString( 'Error ' . $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a comment
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['comment_id'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* Perm check (looks nice) */
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_delete-0', null, null, 403 );
|
||||
}
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $commentId OR ! $parentId )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$this->_comments->delete( $parentId, $commentId, $this->memberData );
|
||||
|
||||
/* Redirect to find latest */
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the edit box
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
protected function _showEdit()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['comment_id'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $commentId OR ! $parentId )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
array( 'parent_id' => 'id',
|
||||
'parent_owner_id' => 'member_id',
|
||||
'parent_parent_id' => 'img_album_id',
|
||||
'parent_title' => 'caption',
|
||||
'parent_seo_title' => 'caption_seo',
|
||||
'parent_date' => 'idate' );
|
||||
|
||||
# Get Edit form
|
||||
try
|
||||
{
|
||||
$html = $this->_comments->displayEditForm( $parentId, $commentId, $this->memberData );
|
||||
|
||||
/* Get nav */
|
||||
$parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' );
|
||||
|
||||
/* Output */
|
||||
$this->registry->getClass('output')->setTitle( $this->title );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] );
|
||||
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_showEdit-0', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the post
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
protected function _saveEdit()
|
||||
{
|
||||
/* INIT */
|
||||
$commentId = intval( $this->request['comment_id'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
$post = IPSText::parseCleanValue( $_POST['Post'] );
|
||||
|
||||
/* Perm check (looks nice) */
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_saveEdit-0', null, null, 403 );
|
||||
}
|
||||
|
||||
/* Quick error checko */
|
||||
if ( ! $parentId OR ! $commentId )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-1', null, null, 403 );
|
||||
}
|
||||
|
||||
/* Edit */
|
||||
try
|
||||
{
|
||||
$this->_comments->edit( $parentId, $commentId, $_POST['Post'], $this->memberData );
|
||||
|
||||
$this->_comments->redirectToComment( $commentId, $parentId );
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-2', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment via the magic and mystery of NORMAL POSTING FOOL
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function _add()
|
||||
{
|
||||
/* init */
|
||||
$post = IPSText::parseCleanValue( $_POST['Post'] );
|
||||
$parentId = intval( $this->request['parentId'] );
|
||||
|
||||
/* Perm check (looks nice) */
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 );
|
||||
}
|
||||
|
||||
if ( $post AND $parentId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newCommentId = $this->_comments->add( $parentId, $_POST['Post'] );
|
||||
|
||||
/* Redirect to find latest */
|
||||
$this->_comments->redirectToComment( 'last', $parentId );
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-1', null, null, 403 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', '1-global-comments-_add-2', null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* @file like.php Provides ajax methods for the central like/follow class
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-08-06 01:51:01 +0100 (Sat, 06 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9373 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_ajax_like
|
||||
* @brief Provides ajax methods for the central like/follow class
|
||||
*/
|
||||
class public_core_global_like extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Init some data */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_like' ), 'core' );
|
||||
|
||||
/* What to do? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'unsubscribe':
|
||||
$html = $this->_unsubscribe();
|
||||
break;
|
||||
case 'doUnsubscribe':
|
||||
$html = $this->_doUnsubscribe();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->addContent( $html );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the unsubscribe
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _doUnsubscribe()
|
||||
{
|
||||
$like_rel_id = trim( $this->request['like_rel_id'] );
|
||||
$like_area = trim( $this->request['like_area'] );
|
||||
$like_app = trim( $this->request['like_app'] );
|
||||
$like_id = trim( $this->request['like_id'] );
|
||||
|
||||
/* Member? */
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-d-1' );
|
||||
}
|
||||
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-d-2' );
|
||||
}
|
||||
|
||||
/* Think we're safe... */
|
||||
$this->_like = classes_like::bootstrap( $like_app, $like_area );
|
||||
|
||||
/* Get data */
|
||||
$data = $this->_like->getDataByRelationshipId( $like_rel_id, false );
|
||||
|
||||
if ( $data[ $this->memberData['member_id'] ]['like_member_id'] != $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-d-3' );
|
||||
}
|
||||
|
||||
/* Remove it */
|
||||
$this->_like->remove( $like_rel_id, $this->memberData['member_id'] );
|
||||
|
||||
/* Boing it */
|
||||
$this->registry->getClass('output')->redirectScreen( $this->lang->words['pg_unlike_done'], $this->registry->getClass('output')->buildUrl( 'app=core&module=search&do=followed', 'public' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show unsubscribe dialogue
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _unsubscribe()
|
||||
{
|
||||
/* Fetch data */
|
||||
$key = trim( IPSText::base64_decode_urlSafe( $this->request['key'] ) );
|
||||
|
||||
list( $app, $area, $relId, $likeMemberId, $memberId, $email ) = explode( ';', $key );
|
||||
|
||||
/* Member? */
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-1' );
|
||||
}
|
||||
|
||||
if ( ! $app || ! $area || ! $relId )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-1' );
|
||||
}
|
||||
|
||||
if ( ( $memberId != $likeMemberId ) || ( $memberId != $this->memberData['member_id'] ) )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-2' );
|
||||
}
|
||||
|
||||
if ( $email != $this->memberData['email'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 'pcgl-3' );
|
||||
}
|
||||
|
||||
/* Think we're safe... */
|
||||
$this->_like = classes_like::bootstrap( $app, $area );
|
||||
|
||||
/* Get data */
|
||||
$data = $this->_like->getDataByRelationshipId( $relId, false );
|
||||
|
||||
if ( ! is_array( $data[ $this->memberData['member_id'] ] ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['pg_no_longer_following'], 'pcgl-4' );
|
||||
}
|
||||
|
||||
/* Get meta */
|
||||
$meta = $this->_like->getMeta( $relId );
|
||||
|
||||
/* Display box, then */
|
||||
$this->registry->output->setTitle( $this->lang->words['pg_unfollow_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['pg_unfollow_title'], '' );
|
||||
|
||||
return $this->registry->output->getTemplate('global_other')->followUnsubscribe( $data, $meta );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Login handler abstraction
|
||||
* Last Updated: $Date: 2010-10-07 18:12:54 -0400 (Thu, 07 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-16 17:49:58 -0400 (Fri, 16 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6954 $
|
||||
* @version $Revision: 9505 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Login handler object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $han_login;
|
||||
@@ -38,16 +37,14 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Facebook connect class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
private $_facebook;
|
||||
protected $_facebook;
|
||||
|
||||
/**
|
||||
* Initiate login handler
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function initHanLogin()
|
||||
{
|
||||
@@ -59,9 +56,8 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -117,7 +113,7 @@ class public_core_global_login extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->redirectScreen( $return[0], $return[1], 'false' );
|
||||
$this->registry->getClass('output')->redirectScreen( $return[0], $return[1] );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -133,7 +129,7 @@ class public_core_global_login extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->redirectScreen( $return[1], $return[2], 'false' );
|
||||
$this->registry->getClass('output')->redirectScreen( $return[1], $return[2] );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -163,7 +159,6 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Attempt to automatically log a user in
|
||||
*
|
||||
* @access public
|
||||
* @return array [0=Words to display,1=URL to send to]
|
||||
*/
|
||||
public function autoLogin()
|
||||
@@ -198,7 +193,7 @@ class public_core_global_login extends ipsCommand
|
||||
$method = 'show';
|
||||
}
|
||||
|
||||
if( $this->memberData[ 'member_id' ] )
|
||||
if( $this->memberData['member_id'] )
|
||||
{
|
||||
/* Member Sync */
|
||||
IPSLib::runMemberSync( 'onLogin', $this->memberData );
|
||||
@@ -233,7 +228,6 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Delete a user's cookies
|
||||
*
|
||||
* @access public
|
||||
* @param boolean Check the key
|
||||
* @return mixed Output error page if key checking fails, else boolean true
|
||||
*/
|
||||
@@ -288,7 +282,6 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Show the login form
|
||||
*
|
||||
* @access public
|
||||
* @param string Message to show on login form
|
||||
* @return string Login form HTML
|
||||
*/
|
||||
@@ -340,10 +333,13 @@ class public_core_global_login extends ipsCommand
|
||||
switch ($serviceClick)
|
||||
{
|
||||
case 'facebook':
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?reg=1" );
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?_reg=1" );
|
||||
break;
|
||||
case 'twitter':
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?reg=1" );
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?_reg=1" );
|
||||
break;
|
||||
case 'vkontakte':
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/vkontakte/index.php?reg=1" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -380,7 +376,15 @@ class public_core_global_login extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$http_referrer = my_getenv('HTTP_REFERER');
|
||||
/* @link http://community.invisionpower.com/tracker/issue-32302-login-redirect-when-activating */
|
||||
if( strpos( my_getenv('HTTP_REFERER'), $this->settings['board_url'] ) === 0 )
|
||||
{
|
||||
$http_referrer = my_getenv('HTTP_REFERER');
|
||||
}
|
||||
else
|
||||
{
|
||||
$http_referrer = '';
|
||||
}
|
||||
}
|
||||
|
||||
$facebookOpts = array();
|
||||
@@ -429,14 +433,16 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Verify login form submission and log user in
|
||||
*
|
||||
* @access public
|
||||
* @return mixed array [0=Words to show, 1=URL to send to, 2=error array]
|
||||
*/
|
||||
public function doLogin()
|
||||
{
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 );
|
||||
if( !defined('IGNORE_AUTH_KEY') OR !IGNORE_AUTH_KEY )
|
||||
{
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
return $this->han_login->verifyLogin();
|
||||
@@ -445,7 +451,6 @@ class public_core_global_login extends ipsCommand
|
||||
/**
|
||||
* Log a user out
|
||||
*
|
||||
* @access public
|
||||
* @param integer Flag to check md5 key
|
||||
* @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to]
|
||||
*/
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Recover Lost Password
|
||||
* Last Updated: $Date: 2010-09-06 12:10:04 -0400 (Mon, 06 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-07-22 20:10:44 -0400 (Fri, 22 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6832 $
|
||||
* @version $Rev: 9306 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,8 @@ class public_core_global_lostpass extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -73,8 +72,7 @@ class public_core_global_lostpass extends ipsCommand
|
||||
/**
|
||||
* Validates a lost password request
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function lostPasswordValidate()
|
||||
{
|
||||
@@ -149,7 +147,7 @@ class public_core_global_lostpass extends ipsCommand
|
||||
// Generate a new random password
|
||||
//-----------------------------------------
|
||||
|
||||
$new_pass = IPSLib::makePassword();
|
||||
$new_pass = IPSMember::makePassword();
|
||||
|
||||
//-----------------------------------------
|
||||
// Generate a new salt
|
||||
@@ -184,13 +182,16 @@ class public_core_global_lostpass extends ipsCommand
|
||||
$this->han_login->init();
|
||||
$this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member );
|
||||
|
||||
if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 );
|
||||
}
|
||||
//if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
|
||||
//{
|
||||
// $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 );
|
||||
//}
|
||||
|
||||
IPSMember::save( $member['member_id'], array( 'members' => $save_array ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send out the email...
|
||||
//-----------------------------------------
|
||||
@@ -199,9 +200,9 @@ class public_core_global_lostpass extends ipsCommand
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'NAME' => $member['members_display_name'],
|
||||
'THE_LINK' => $this->settings['base_url'] . 'app=core&module=usercp&tab=core&area=password',
|
||||
'THE_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=usercp&tab=core&area=password', 'publicNoSession' ),
|
||||
'PASSWORD' => $new_pass,
|
||||
'LOGIN' => $this->settings['base_url'] . 'app=core&module=global§ion=login',
|
||||
'LOGIN' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login', 'publicNoSession' ),
|
||||
'USERNAME' => $member['name'],
|
||||
'EMAIL' => $member['email'],
|
||||
'ID' => $member['member_id'],
|
||||
@@ -265,24 +266,27 @@ class public_core_global_lostpass extends ipsCommand
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$this->han_login = new $classToLoad( $this->registry );
|
||||
$this->han_login->init();
|
||||
$this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member );
|
||||
$this->han_login->changePass( $member['email'], $new_pass, $pass_a, $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// We'll ignore any remote errors
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
|
||||
/*if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
// Pass not changed remotely
|
||||
}
|
||||
}*/
|
||||
|
||||
/* Update the member */
|
||||
IPSMember::save( $member['member_id'], array( 'members' => $save_array ) );
|
||||
|
||||
/* Password has been changed! */
|
||||
IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a );
|
||||
|
||||
/* Remove "dead" validation */
|
||||
$this->DB->delete( 'validating', "vid='{$validate['vid']}' OR (member_id={$member['member_id']} AND lost_pass=1)" );
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=global§ion=login&do=autologin&frompass=1' );
|
||||
$this->registry->output->silentRedirect( $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,8 +294,7 @@ class public_core_global_lostpass extends ipsCommand
|
||||
/**
|
||||
* Completes the lost password request form
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function lostPasswordEnd()
|
||||
{
|
||||
@@ -345,14 +348,13 @@ class public_core_global_lostpass extends ipsCommand
|
||||
$this->registry->output->showError( 'lostpass_no_mid', 2014 );
|
||||
}
|
||||
|
||||
$validate_key = md5( IPSLib::makePassword() . uniqid( mt_rand(), TRUE ) );
|
||||
$validate_key = md5( IPSMember::makePassword() . uniqid( mt_rand(), TRUE ) );
|
||||
|
||||
/* Get rid of old entries for this member */
|
||||
$this->DB->delete( 'validating', "member_id={$member['member_id']} AND lost_pass=1" );
|
||||
|
||||
/* Update the DB for this member. */
|
||||
$db_str = array(
|
||||
'vid' => $validate_key,
|
||||
$db_str = array('vid' => $validate_key,
|
||||
'member_id' => $member['member_id'],
|
||||
'temp_group' => $member['member_group_id'],
|
||||
'entry_date' => time(),
|
||||
@@ -374,8 +376,8 @@ class public_core_global_lostpass extends ipsCommand
|
||||
|
||||
IPSText::getTextClass('email')->buildMessage( array(
|
||||
'NAME' => $member['members_display_name'],
|
||||
'THE_LINK' => $this->settings['base_url']."app=core&module=global§ion=lostpass&do=sendform&uid=".$member['member_id']."&aid=".$validate_key,
|
||||
'MAN_LINK' => $this->settings['base_url']."app=core&module=global§ion=lostpass&do=sendform",
|
||||
'THE_LINK' => $this->registry->getClass('output')->buildUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession' ),
|
||||
'MAN_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession' ),
|
||||
'EMAIL' => $member['email'],
|
||||
'ID' => $member['member_id'],
|
||||
'CODE' => $validate_key,
|
||||
@@ -396,9 +398,8 @@ class public_core_global_lostpass extends ipsCommand
|
||||
/**
|
||||
* Displays the lost password form
|
||||
*
|
||||
* @access public
|
||||
* @param string $errors
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function lostPasswordForm( $errors="" )
|
||||
{
|
||||
@@ -432,9 +433,8 @@ class public_core_global_lostpass extends ipsCommand
|
||||
/**
|
||||
* Shows the form for validating a lost password request
|
||||
*
|
||||
* @access public
|
||||
* @param string $msg
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function lostPasswordValidateForm( $msg='' )
|
||||
{
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_core_global_navigation extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Set up */
|
||||
$inapp = trim( $this->request['inapp'] );
|
||||
|
||||
/* Load navigation stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build' );
|
||||
$navigation = new $classToLoad( $inapp );
|
||||
|
||||
/* Return */
|
||||
$html = $this->registry->output->getTemplate( 'global_other' )->quickNavigationWrapper( $navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $inapp );
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['navigation_title'] );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->getClass('output')->sendOutput();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Reputation
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-10-14 10:30:53 -0400 (Fri, 14 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9620 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,9 +28,8 @@ class public_core_global_reputation extends ipsCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -46,8 +45,7 @@ class public_core_global_reputation extends ipsCommand
|
||||
/**
|
||||
* Adds a rating to the index
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doRating()
|
||||
{
|
||||
@@ -60,13 +58,13 @@ class public_core_global_reputation extends ipsCommand
|
||||
/* Check */
|
||||
if( ! $app || ! $type || ! $type_id || ! $rating )
|
||||
{
|
||||
$this->registry->output->showError( 'reputation_missing_data', 10126 );
|
||||
$this->registry->output->showError( 'reputation_missing_data', 10126, false, false, 403 );
|
||||
}
|
||||
|
||||
/* Check the secure key. Needed here to prevent direct URLs from increasing reps */
|
||||
if ( $this->request['secure_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'reputation_missing_data', 10126 );
|
||||
$this->registry->output->showError( 'reputation_missing_data', 10126, false, false, 403 );
|
||||
}
|
||||
|
||||
/* Get the rep library */
|
||||
@@ -76,14 +74,14 @@ class public_core_global_reputation extends ipsCommand
|
||||
/* Add the rating */
|
||||
if( ! $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) )
|
||||
{
|
||||
$this->registry->output->showError( $repCache->error_message, 10127 );
|
||||
$this->registry->output->showError( $repCache->error_message, 10127, false, false, 403 );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Redirect to */
|
||||
$return_url = '';
|
||||
|
||||
if( isset( $this->request['post_return'] ) && $this->request['post_return'] )
|
||||
if( !empty( $this->request['post_return'] ) )
|
||||
{
|
||||
$return_url = $this->settings['base_url'] . 'app=forums&module=forums§ion=findpost&pid=' . intval( $this->request['post_return'] );
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* RSS output functionality
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Friday 18th March 2005
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -30,13 +30,13 @@ class public_core_global_rss extends ipsCommand
|
||||
*
|
||||
* @var string XML document content
|
||||
*/
|
||||
private $to_print = '';
|
||||
protected $to_print = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -78,7 +78,7 @@ class public_core_global_rss extends ipsCommand
|
||||
{
|
||||
if( IPSLib::appIsInstalled( IPSText::alphanumericalClean( $this->request['type'] ) ) )
|
||||
{
|
||||
if( file_exists( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
|
||||
if( is_file( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) )
|
||||
{
|
||||
$type = IPSText::alphanumericalClean( $this->request['type'] );
|
||||
}
|
||||
@@ -91,8 +91,8 @@ class public_core_global_rss extends ipsCommand
|
||||
|
||||
if( IPSLib::appIsInstalled($type) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php', 'rss_output_'.$type, $type );
|
||||
$rss_library = new $classToLoad( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php', 'rss_output_'.$type, $type );
|
||||
$rss_library = new $classToLoad( $this->registry );
|
||||
|
||||
$this->to_print = $rss_library->returnRSSDocument();
|
||||
$expires = $rss_library->grabExpiryDate();
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Captcha
|
||||
* Last Updated: $Date: 2010-01-15 15:18:44 +0000 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-06-02 18:58:10 -0400 (Thu, 02 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 8954 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,10 +29,22 @@ class public_core_global_share extends ipsCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Disabled? */
|
||||
if ( ! $this->settings['sl_enable'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.1, false, null, 403 );
|
||||
}
|
||||
|
||||
/* Disable for bots */
|
||||
if( $this->member->is_not_human )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 100234.2, false, null, 403 );
|
||||
}
|
||||
|
||||
$url = IPSText::base64_decode_urlSafe( $this->request['url'] );
|
||||
$title = IPSText::base64_decode_urlSafe( $this->request['title'] );
|
||||
$key = trim( $this->request['key'] );
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default help section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'help' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'help';
|
||||
$DEFAULT_SECTION = 'help';
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Help File System
|
||||
* Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6997 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -35,7 +35,7 @@ class public_core_help_help extends ipsCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -62,7 +62,7 @@ class public_core_help_help extends ipsCommand
|
||||
/**
|
||||
* Show help topics
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowTitles()
|
||||
{
|
||||
@@ -71,7 +71,7 @@ class public_core_help_help extends ipsCommand
|
||||
|
||||
|
||||
/* Query the help topics */
|
||||
$this->DB->build( array( 'select' => 'id, title, description', 'from' => 'faq', 'order' => 'position ASC' ) );
|
||||
$this->DB->build( array( 'select' => 'id, title, description, app', 'from' => 'faq', 'order' => 'position ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through topics */
|
||||
@@ -79,6 +79,11 @@ class public_core_help_help extends ipsCommand
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
if( !IPSLib::appIsInstalled( $row['app'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( isset( $seen[ $row['title'] ] ) )
|
||||
{
|
||||
continue;
|
||||
@@ -93,7 +98,7 @@ class public_core_help_help extends ipsCommand
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->output .= $this->registry->output->getTemplate( 'help' )->helpShowTopics(
|
||||
$this->output .= $this->registry->output->getTemplate('help')->helpShowTopics(
|
||||
$this->lang->words['page_title'],
|
||||
$this->lang->words['help_txt'],
|
||||
$this->lang->words['choose_file'],
|
||||
@@ -108,7 +113,7 @@ class public_core_help_help extends ipsCommand
|
||||
/**
|
||||
* Displays a help file
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function helpShowSection()
|
||||
{
|
||||
@@ -128,18 +133,17 @@ class public_core_help_help extends ipsCommand
|
||||
{
|
||||
$this->registry->output->showError( 'help_no_id', 10128 );
|
||||
}
|
||||
|
||||
/* Load the Parser */
|
||||
IPSText::getTextClass( 'bbcode' )->bypass_badwords = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'help';
|
||||
|
||||
$topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] );
|
||||
|
||||
|
||||
/* Parse out board URL */
|
||||
$topic['text'] = str_replace( '{board_url}', $this->settings['base_url'], $topic['text'] );
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'global';
|
||||
|
||||
$topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] );
|
||||
|
||||
if ( $this->request['hl'] )
|
||||
{
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @file defaultSection.php Define the default section for the 'modcp' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'modcp';
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* @file modcp.php Moderator control panel
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-04-20 04:18:03 -0400 (Wed, 20 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8400 $
|
||||
*/
|
||||
|
||||
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 public_core_modcp_modcp
|
||||
* @brief Moderator control panel
|
||||
*
|
||||
*/
|
||||
class public_core_modcp_modcp extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load basic things
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
|
||||
|
||||
$this->registry->output->setTitle( $this->lang->words['modcp_page_title'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Which road are we going to take?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'index':
|
||||
$this->_indexPage();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['modcp_navbar'], "app=core&module=modcp" );
|
||||
$this->registry->getClass('output')->addContent( $this->output );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the mod CP portal
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _indexPage()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getAppClass('forums');
|
||||
$this->request['tab'] = empty($this->request['tab']) ? 'index' : trim($this->request['tab']);
|
||||
$this->request['fromapp'] = empty($this->request['fromapp']) ? 'index' : trim($this->request['fromapp']);
|
||||
|
||||
$_plugins = array();
|
||||
$_tabs = array();
|
||||
$_activeNav = array( 'primary' => 'index', 'secondary' => 'index' );
|
||||
$_output = '';
|
||||
$moderator = $this->registry->class_forums->getModerator();
|
||||
$tab = $this->request['tab'];
|
||||
$app = $this->request['fromapp'];
|
||||
|
||||
/**
|
||||
* Loop through all apps and get plugins
|
||||
*
|
||||
* @note When updating this code below remember to update also the core in public_core_reports_reports
|
||||
*/
|
||||
foreach( IPSLib::getEnabledApplications() as $appDir => $appData )
|
||||
{
|
||||
if( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) as $file )
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// We load each plugin so it can determine
|
||||
// if it should show based on permissions
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $appDir . '_' . $matches[1], $appDir );
|
||||
$_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Hacky solution - we want forum plugins to
|
||||
// come first as they're the most used
|
||||
//-----------------------------------------
|
||||
|
||||
if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) )
|
||||
{
|
||||
array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] );
|
||||
}
|
||||
|
||||
/* Sort active tab */
|
||||
if ( $appDir == $app && $tab == $matches[1] )
|
||||
{
|
||||
$_activeNav = array( 'primary' => $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab(), 'secondary' => $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we can't view any tabs, show an error
|
||||
//-----------------------------------------
|
||||
|
||||
if( !count($_tabs) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['modcp_no_access'], 10194.12, false, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass the necessary template variables into the plugin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->getTemplate('modcp')->templateVars['tabs'] = $_tabs;
|
||||
$this->registry->output->getTemplate('modcp')->templateVars['activeNav'] = $_activeNav;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get appropriate content to show
|
||||
//-----------------------------------------
|
||||
|
||||
if( $tab AND $app AND isset($_plugins[ $app ][ $tab ]) )
|
||||
{
|
||||
$_output = $_plugins[ $app ][ $tab ]->executePlugin( $moderator );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_output = $this->registry->output->getTemplate('modcp')->memberLookup();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->output .= $this->registry->output->getTemplate('modcp')->portalPage( $_output, $_tabs, $_activeNav );
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default reports section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'reports' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'reports';
|
||||
$DEFAULT_SECTION = 'reports';
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,21 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Reports content central management
|
||||
* Last Updated: $LastChangedDate: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @file reports.php Reports content central management
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6925 $
|
||||
*
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9550 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,14 +18,18 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_core_reports_reports
|
||||
* @brief Reports content central management
|
||||
*/
|
||||
class public_core_reports_reports extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Execute selected method
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -49,22 +47,8 @@ class public_core_reports_reports extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Check permissions...
|
||||
//-----------------------------------------
|
||||
|
||||
$showReportCenter = false;
|
||||
|
||||
$this->member_group_ids = array( $this->memberData['member_group_id'] );
|
||||
$this->member_group_ids = array_diff( array_merge( $this->member_group_ids, explode( ',', $this->memberData['mgroup_others'] ) ), array('') );
|
||||
$report_center = array_diff( explode( ',', $this->settings['report_mod_group_access'] ), array('') );
|
||||
|
||||
foreach( $report_center as $groupId )
|
||||
{
|
||||
if( in_array( $groupId, $this->member_group_ids ) )
|
||||
{
|
||||
$showReportCenter = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( ($this->request['do'] AND $this->request['do'] != 'report') AND !$showReportCenter )
|
||||
if( $this->request['do'] AND $this->request['do'] != 'report' AND !IPSMember::isInGroup( $this->memberData, explode( ',', IPSText::cleanPermString( $this->settings['report_mod_group_access'] ) ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'no_reports_permission', 2018, true, null, 403 );
|
||||
}
|
||||
@@ -80,31 +64,87 @@ class public_core_reports_reports extends ipsCommand
|
||||
default:
|
||||
case 'report':
|
||||
$this->_initReportForm();
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'showMessage':
|
||||
$this->_viewReportedMessage();
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'index':
|
||||
$this->_displayReportCenter();
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'process':
|
||||
$this->_processReports();
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'findfirst':
|
||||
$this->findFirstReport();
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'show_report':
|
||||
$this->_displayReport();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if( $this->request['do'] AND $this->request['do'] != 'report' )
|
||||
{
|
||||
/* Init some data */
|
||||
$_tabs = array();
|
||||
$_activeNav = array( 'primary' => 'reported_content', 'secondary' => 'reports' );
|
||||
$moderator = $this->registry->class_forums->getModerator();
|
||||
|
||||
case 'save_comment':
|
||||
$this->_saveComment();
|
||||
break;
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ), 'core' );
|
||||
|
||||
/**
|
||||
* Loop through all apps and get plugins
|
||||
*
|
||||
* @note When updating this code below remember to update also the core in public_core_modcp_modcp
|
||||
*/
|
||||
foreach( IPSLib::getEnabledApplications() as $appDir => $appData )
|
||||
{
|
||||
if( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) as $file )
|
||||
{
|
||||
if( ! $file->isDot() && $file->isFile() )
|
||||
{
|
||||
if( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// We load each plugin so it can determine
|
||||
// if it should show based on permissions
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $appDir . '_' . $matches[1], $appDir );
|
||||
$_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry );
|
||||
|
||||
if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Hacky solution - we want forum plugins to
|
||||
// come first as they're the most used
|
||||
//-----------------------------------------
|
||||
|
||||
if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) )
|
||||
{
|
||||
array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
$this->output = $this->registry->output->getTemplate('modcp')->portalPage( $this->output, $_tabs, $_activeNav );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -118,10 +158,9 @@ class public_core_reports_reports extends ipsCommand
|
||||
/**
|
||||
* View a reported private message as it shows in the messenger
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _viewReportedMessage()
|
||||
public function _viewReportedMessage()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we have permission?
|
||||
@@ -129,7 +168,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$this->registry->getClass('reportLibrary')->buildQueryPermissions();
|
||||
|
||||
if( !in_array( $this->memberData['member_group_id'], explode( ',', $this->registry->getClass('reportLibrary')->plugins['messages']->_extra['plugi_messages_add'] ) ) )
|
||||
if( !IPSMember::isInGroup( $this->memberData, explode( ',', $this->registry->getClass('reportLibrary')->plugins['messages']->_extra['plugi_messages_add'] ) ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission_addreport', 20115, null, null, 403 );
|
||||
}
|
||||
@@ -207,10 +246,9 @@ class public_core_reports_reports extends ipsCommand
|
||||
/**
|
||||
* Main function for displaying reports in a list
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _displayReportCenter()
|
||||
public function _displayReportCenter()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check for rss key and if none make one
|
||||
@@ -230,48 +268,94 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$COM_PERM = $this->registry->getClass('reportLibrary')->buildQueryPermissions();
|
||||
|
||||
$reports = array();
|
||||
$reports = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// By default we will only show active reports.
|
||||
// If there are no active reports, show all instead.
|
||||
// Alternatively, user can click a show all link we need to honor.
|
||||
//-----------------------------------------
|
||||
|
||||
$_where = $COM_PERM . ' AND stat.is_active=1';
|
||||
|
||||
if( $this->request['showall'] )
|
||||
{
|
||||
$_where = $COM_PERM;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show me the money! err.. Reports!
|
||||
//-----------------------------------------
|
||||
|
||||
$total = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as reports',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $COM_PERM,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
)
|
||||
'select' => 'COUNT(*) as reports',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $_where,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'rc_status' => 'stat' ),
|
||||
'where' => 'stat.status=rep.status'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
if( !$total['reports'] AND !$this->request['showall'] )
|
||||
{
|
||||
$this->request['showall'] = 1;
|
||||
|
||||
$_where = $COM_PERM;
|
||||
$total = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as reports',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $_where,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'rc_status' => 'stat' ),
|
||||
'where' => 'stat.status=rep.status'
|
||||
)
|
||||
) );
|
||||
|
||||
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
$this->DB->buildFromCache( 'reports_index', array( 'WHERE' => $COM_PERM, 'START' => intval($this->request['st']), 'LIMIT' => 10 ), 'report_sql_queries' );
|
||||
$this->DB->buildFromCache( 'reports_index', array( 'WHERE' => $_where, 'START' => intval($this->request['st']), 'LIMIT' => 10 ), 'report_sql_queries' );
|
||||
$res = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch($res) )
|
||||
{
|
||||
$row['_isRead'] = $this->registry->classItemMarking->isRead( array( 'forumID' => 0, 'itemID' => $row['id'], 'itemLastUpdate' => $row['date_updated'] ), 'core' );
|
||||
$sec_data = $this->registry->getClass('reportLibrary')->plugins[$row['my_class']]->giveSectionLinkTitle( $row );
|
||||
$sec_data['url'] = $this->registry->getClass('reportLibrary')->processUrl( $sec_data['url'], $sec_data['seo_title'], $sec_data['seo_template'] );
|
||||
$row['points'] = isset( $row['points'] ) ? $row['points'] : $this->settings['_tmpPoints'][ $row['id'] ];
|
||||
$row['section'] = $sec_data;
|
||||
$row['status_icon'] = $this->_buildStatusIcon( $row );
|
||||
$row['status_icon'] = $this->registry->getClass('reportLibrary')->buildStatusIcon( $row );
|
||||
|
||||
$reports[ $row['id'] ] = $row;
|
||||
|
||||
$members_to_load[] = $row['updated_by'];
|
||||
}
|
||||
|
||||
$members = IPSMember::load( $members_to_load );
|
||||
|
||||
foreach( $reports as $id => $data )
|
||||
{
|
||||
$reports[ $id ]['member'] = IPSMember::buildDisplayData( $members[ $data['updated_by'] ] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Statuses
|
||||
// Manually build status array without severities
|
||||
//-----------------------------------------
|
||||
|
||||
$stats = array();
|
||||
$_tmp = $this->registry->getClass('reportLibrary')->flag_cache;
|
||||
|
||||
// Manually build array get just the statuses, not severities
|
||||
|
||||
foreach( $_tmp as $sid => $sta )
|
||||
{
|
||||
if( is_array( $sta ) && count( $sta ) )
|
||||
@@ -292,23 +376,29 @@ class public_core_reports_reports extends ipsCommand
|
||||
// Display Page Navigation
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['reports'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $this->request['st'],
|
||||
'baseUrl' => 'app=core&module=reports&do=index'
|
||||
$_url = 'app=core&module=reports&do=index';
|
||||
|
||||
if( $this->request['showall'] )
|
||||
{
|
||||
$_url .= '&showall=1';
|
||||
}
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['reports'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $this->request['st'],
|
||||
'baseUrl' => $_url
|
||||
)
|
||||
);
|
||||
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('reports')->reportsIndex( $reports, $this->registry->getClass('reportLibrary')->buildStatuses(), $pages, $this->_getStats( 1 ), $stats );
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('reports')->reportsIndex( $reports, $this->registry->getClass('reportLibrary')->buildStatuses(), $pages, $stats );
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic functions for processing actions on 'Report Index' page (Drop Down)
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _processReports()
|
||||
public function _processReports()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check form key
|
||||
@@ -339,11 +429,11 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
if( $total_pruned )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_prune_message_done'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] );
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_prune_message_done'], $this->settings['base_url'] . "app=core&module=reports&do=index" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_prune_message_none'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] );
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_prune_message_none'], $this->settings['base_url'] . "app=core&module=reports&do=index" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +461,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
$this->_deleteReports( $ids, true );
|
||||
$this->registry->getClass('reportLibrary')->updateCacheTime();
|
||||
|
||||
$this->registry->output->redirectScreen( $this->lang->words['redirect_delete_report'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] );
|
||||
$this->registry->output->redirectScreen( $this->lang->words['redirect_delete_report'], $this->settings['base_url'] . "app=core&module=reports&do=index" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -389,7 +479,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$this->registry->getClass('reportLibrary')->updateCacheTime();
|
||||
|
||||
$this->registry->output->redirectScreen( $this->lang->words['redirect_mark_status'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] );
|
||||
$this->registry->output->redirectScreen( $this->lang->words['redirect_mark_status'], $this->settings['base_url'] . "app=core&module=reports&do=index" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -411,8 +501,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
/**
|
||||
* Finds first post reported using topic-id
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function findFirstReport()
|
||||
{
|
||||
@@ -439,10 +528,9 @@ class public_core_reports_reports extends ipsCommand
|
||||
/**
|
||||
* Main function for making reports and uses the custom plugins
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _initReportForm()
|
||||
public function _initReportForm()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make sure we have an rcom
|
||||
@@ -459,7 +547,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
// Request plugin info from database
|
||||
//-----------------------------------------
|
||||
|
||||
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'rc_classes', 'where' => "my_class='{$rcom}' AND onoff=1" ) );
|
||||
$row = $this->caches['report_plugins'][ $rcom ];
|
||||
|
||||
if( !$row['com_id'] )
|
||||
{
|
||||
@@ -471,7 +559,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
// Can this group report this type of page?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $row['my_class'] == '' || count( array_diff($this->member_group_ids, explode(',', $row['group_can_report'])) ) >= count( $this->member_group_ids ) )
|
||||
if( !$row['my_class'] OR !IPSMember::isInGroup( $this->memberData, explode( ',', IPSText::cleanPermString( $row['group_can_report'] ) ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_cant_report', 10136, null, null, 403 );
|
||||
}
|
||||
@@ -544,7 +632,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Send out notfications...
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $row['my_class'] ]->getNotificationList( IPSText::cleanPermString( $row['mod_group_perm'] ), $report_data ), $report_data );
|
||||
$notify->sendNotifications();
|
||||
|
||||
@@ -558,21 +646,18 @@ class public_core_reports_reports extends ipsCommand
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles ajax/non-ajax window for reports and comments linked from reports
|
||||
* Displays a report
|
||||
*
|
||||
* @access private
|
||||
* @return boolean
|
||||
* @return @e void
|
||||
*/
|
||||
private function _displayReport()
|
||||
public function _displayReport()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Lets make sure this report exists...
|
||||
//-----------------------------------------
|
||||
|
||||
$rid = intval($this->request['rid']);
|
||||
$options = array(
|
||||
'rid' => $rid
|
||||
);
|
||||
$options = array( 'rid' => $rid );
|
||||
$reports = array();
|
||||
$comments = array();
|
||||
|
||||
@@ -592,7 +677,7 @@ class public_core_reports_reports extends ipsCommand
|
||||
$this->registry->output->addNavigation( $this->lang->words['main_title'], 'app=core&module=reports&do=index' );
|
||||
$this->registry->output->addNavigation( $report_index['title'], '' );
|
||||
|
||||
if( $this->DB->getTotalRows() == 0 )
|
||||
if ( !$report_index['id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_no_rid', 10138 );
|
||||
}
|
||||
@@ -636,15 +721,10 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$options['title'] = $row['title'];
|
||||
$options['status_id'] = $row['status'];
|
||||
|
||||
if( !$options['image'] && $row['img_preview'] )
|
||||
{
|
||||
$options['image'] = $this->registry->getClass('reportLibrary')->processUrl( $row['img_preview'], $row['seoname'], $row['seotemplate'] );
|
||||
}
|
||||
|
||||
|
||||
if( !$options['status_icon'] )
|
||||
{
|
||||
$options['status_icon'] = $this->_buildStatusIcon( $row );
|
||||
$options['status_icon'] = $this->registry->getClass('reportLibrary')->buildStatusIcon( $row );
|
||||
$options['status_text'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['title'];
|
||||
}
|
||||
|
||||
@@ -656,7 +736,6 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$row['title'] = $row['_title'];
|
||||
$row['report'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['report'] );
|
||||
$row['report'] = IPSText::getTextClass( 'bbcode' )->memberViewImages( $row['report'] );
|
||||
|
||||
$reports[] = $row;
|
||||
}
|
||||
@@ -688,57 +767,19 @@ class public_core_reports_reports extends ipsCommand
|
||||
//-----------------------------------------
|
||||
// Get comments
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = array( 0 => 0 );
|
||||
|
||||
$this->DB->build( array( 'select' => 'id',
|
||||
'from' => 'rc_comments',
|
||||
'where' => 'rid=' . $rid,
|
||||
'group' => 'id' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$ids[ $row['id'] ] = $row['id'];
|
||||
}
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'comm.*',
|
||||
'from' => array( 'rc_comments' => 'comm' ),
|
||||
'where' => 'comm.id IN (' . implode( ',', $ids ) . ')',
|
||||
'order' => 'comm.comment_date ASC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'mem.*',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=comm.comment_by',
|
||||
),
|
||||
array(
|
||||
'select' => 'grop.*,grop.g_is_supmod as iscop',
|
||||
'from' => array( 'groups' => 'grop' ),
|
||||
'where' => 'grop.g_id=mem.member_group_id',
|
||||
),
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=mem.member_id',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while($row = $this->DB->fetch($outer))
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/
|
||||
$this->_comments = classes_comments_bootstrap::controller( 'core-reports' );
|
||||
|
||||
$comments = array( 'html' => $this->_comments->fetchFormatted( $report_index, array( 'offset' => intval( $this->request['st'] ) ) ),
|
||||
'count' => $this->_comments->count( $report_index ),
|
||||
);
|
||||
|
||||
$row['author'] = IPSMember::buildDisplayData( $row['member_id'] );
|
||||
$row['comment'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment'] );
|
||||
$row['comment'] = IPSText::getTextClass( 'bbcode' )->memberViewImages( $row['comment'] );
|
||||
|
||||
$comments[ $row['id'] ] = $row;
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Mark as read
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->classItemMarking->markRead( array( 'forumID' => 0, 'itemID' => $rid ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// And output
|
||||
@@ -746,93 +787,35 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('reports')->viewReport( $options, $reports, $comments );
|
||||
}
|
||||
|
||||
/**
|
||||
* Recieves comment, submits to database, and redirects user
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _saveComment()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make sure we have a report id...
|
||||
//-----------------------------------------
|
||||
|
||||
$rid = intval($this->request['rid']);
|
||||
|
||||
if( $rid < 1 )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_no_comment', 10139 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Lets make sure we even have this report
|
||||
//-----------------------------------------
|
||||
|
||||
$report = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . $rid ) );
|
||||
|
||||
if( $report['id'] )
|
||||
{
|
||||
$postContent = IPSText::getTextClass( 'editor' )->processRawPost( $_POST['comment'] );
|
||||
|
||||
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';
|
||||
|
||||
$postContent = IPSText::getTextClass( 'bbcode' )->preDbParse( $postContent );
|
||||
|
||||
if( !trim( IPSText::br2nl($postContent) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_no_comment_text', 10188 );
|
||||
}
|
||||
|
||||
$build_comment = array(
|
||||
'rid' => $rid,
|
||||
'comment' => $postContent,
|
||||
'comment_by' => $this->memberData['member_id'],
|
||||
'comment_date' => time()
|
||||
);
|
||||
|
||||
$this->DB->insert( 'rc_comments', $build_comment );
|
||||
$this->DB->update( 'rc_reports_index', array( 'num_comments' => $report['num_comments'] + 1, 'date_updated' => time(), 'updated_by' => $this->memberData['member_id'] ), "id=" . $report['id'] );
|
||||
}
|
||||
|
||||
$this->registry->output->redirectScreen( $this->lang->words['report_comment_saved'], $this->settings['base_url'] . "app=core&module=reports&rid={$report['id']}&do=show_report" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Responsible for pruning reports. Uses the delete reports function to finish
|
||||
*
|
||||
* @access private
|
||||
* @param integer seconds used for pruning reports
|
||||
* @return void
|
||||
* @param integer $stamp Seconds used for pruning reports
|
||||
* @return @e void
|
||||
*/
|
||||
private function _pruneReports( $stamp )
|
||||
public function _pruneReports( $stamp )
|
||||
{
|
||||
$ids = array();
|
||||
$ids = array();
|
||||
|
||||
//--------------------------------------------------
|
||||
// Let's grab a list of reports and check stuff...
|
||||
//--------------------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'rep.id',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND stat.is_complete=1 And rep.date_updated<' . $stamp,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'rc_status' => 'stat' ),
|
||||
'where' => 'stat.status=rep.status'
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->build( array('select' => 'rep.id',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND stat.is_complete=1 And rep.date_updated<' . $stamp,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'rc_status' => 'stat' ),
|
||||
'where' => 'stat.status=rep.status'
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
@@ -855,12 +838,11 @@ class public_core_reports_reports extends ipsCommand
|
||||
/**
|
||||
* Responsible for deleting reports
|
||||
*
|
||||
* @access private
|
||||
* @param string Report IDS (#,#,#,...)
|
||||
* @param boolean Security check?
|
||||
* @return boolean
|
||||
* @param string $rids Report IDS (#,#,#,...)
|
||||
* @param boolean $toCheck Security check?
|
||||
* @return @e boolean TRUE if all is fine otherwise FALSE
|
||||
*/
|
||||
private function _deleteReports( $rids='', $toCheck=false )
|
||||
public function _deleteReports( $rids='', $toCheck=false )
|
||||
{
|
||||
if( $this->memberData['g_access_cp'] != 1 )
|
||||
{
|
||||
@@ -882,21 +864,14 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
if( $toCheck == true )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => 'rep.id, rep.status',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND rep.id IN(' . $rids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$res = $this->DB->execute();
|
||||
$num = $this->DB->getTotalRows();
|
||||
$num = $this->DB->buildAndFetch( array( 'select' => 'count(rep.id) as total',
|
||||
'from' => array( 'rc_reports_index' => 'rep' ),
|
||||
'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND rep.id IN(' . $rids . ')',
|
||||
'add_join' => array( array('from' => array( 'rc_classes' => 'rcl' ),
|
||||
'where' => 'rcl.com_id=rep.rc_class' ) )
|
||||
) );
|
||||
|
||||
if( count( explode( ',' , $rids ) ) != $this->DB->getTotalRows() )
|
||||
if( count( explode( ',' , $rids ) ) != intval($num['total']) )
|
||||
{
|
||||
$this->registry->output->showError( 'reports_like_whoa', 20111, true );
|
||||
}
|
||||
@@ -918,194 +893,4 @@ class public_core_reports_reports extends ipsCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct status icon / flag to display for a report row
|
||||
*
|
||||
* @access private
|
||||
* @param array Report Row
|
||||
* @return string
|
||||
*/
|
||||
private function _buildStatusIcon( $row )
|
||||
{
|
||||
$this->registry->getClass('reportLibrary')->buildStatuses( true );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pick the right flag.. or else!
|
||||
//-----------------------------------------
|
||||
|
||||
$row['img'] = str_replace( '<#IMG_DIR#>', $this->registry->output->skin['set_image_dir'], $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['img'] );
|
||||
$row['width'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['width'];
|
||||
$row['height'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['height'];
|
||||
$row['is_png'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['is_png'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Image? PNG? Using 'Is-Evil' machine?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $row['img'] != '' )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('reports')->statusIcon( $row['img'], $row['width'], $row['height'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ' ';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the "who's viewing" strip
|
||||
*
|
||||
* @access private
|
||||
* @param integer Section ID
|
||||
* @return string
|
||||
*/
|
||||
private function _getStats( $id=1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$ar_time = time();
|
||||
$cached = array();
|
||||
$guests = array();
|
||||
$active = array( 'guests' => 0, 'anon' => 0, 'members' => 0, 'names' => array() );
|
||||
$rows = array( $ar_time => array( 'login_type' => substr($this->memberData['login_anonymous'],0, 1),
|
||||
'running_time' => $ar_time,
|
||||
'id' => $this->member->session_id,
|
||||
'seo_name' => $this->memberData['members_seo_name'],
|
||||
'member_id' => $this->memberData['member_id'],
|
||||
'member_name' => $this->memberData['members_display_name'],
|
||||
'member_group' => $this->memberData['member_group_id'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Process users active in this forum
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->settings['no_au_topic'] != 1)
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the users
|
||||
//-----------------------------------------
|
||||
|
||||
$cut_off = ($this->settings['au_cutoff'] != "") ? $this->settings['au_cutoff'] * 60 : 900;
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'sessions',
|
||||
'where' => "current_appcomponent='core' AND current_module='reports' AND running_time > " . $cut_off,
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// FETCH...
|
||||
//-----------------------------------------
|
||||
|
||||
while ($r = $this->DB->fetch() )
|
||||
{
|
||||
$rows[ $r['running_time'].'.'.$r['id'] ] = $r;
|
||||
}
|
||||
|
||||
krsort( $rows );
|
||||
|
||||
//-----------------------------------------
|
||||
// PRINT...
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $rows as $result )
|
||||
{
|
||||
$result['member_name'] = IPSLib::makeNameFormatted( $result['member_name'], $result['member_group'] );
|
||||
|
||||
$last_date = $this->registry->class_localization->getTime( $result['running_time'] );
|
||||
|
||||
if ( $result['member_id'] == 0 OR ! $result['member_name'] )
|
||||
{
|
||||
if ( in_array( $result['id'], $guests ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Bot?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $result['uagent_type'] == 'search' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Seen bot of this type yet?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $cached[ $result['member_name'] ] )
|
||||
{
|
||||
if ( $this->settings['spider_anon'] )
|
||||
{
|
||||
if ( $this->memberData['g_access_cp'] )
|
||||
{
|
||||
$active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'seo' => $result['seo_name'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'seo' => $result['seo_name'] );
|
||||
}
|
||||
|
||||
$cached[ $result['member_name'] ] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['guests']++;
|
||||
$guests[] = $result['id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['guests']++;
|
||||
$guests[] = $result['id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty( $cached[ $result['member_id'] ] ) )
|
||||
{
|
||||
$cached[ $result['member_id'] ] = 1;
|
||||
|
||||
$p_start = "";
|
||||
$p_end = "";
|
||||
$p_title = sprintf( $this->lang->words['au_reading'], $last_date );
|
||||
|
||||
if ( strstr( $result['current_module'], 'post' ) and $result['member_id'] != $this->memberData['member_id'] )
|
||||
{
|
||||
$p_start = "<span class='activeuserposting'>";
|
||||
$p_end = "</span>";
|
||||
$p_title = sprintf( $this->lang->words['au_posting'], $last_date );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['disable_anonymous'] AND $result['login_type'] )
|
||||
{
|
||||
if ( $this->memberData['g_access_cp'] and ($this->settings['disable_admin_anon'] != 1) )
|
||||
{
|
||||
$active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'] . '*', 'p_start' => $p_start, 'p_title' => $p_title, 'p_end' => $p_end, 'seo' => $result['seo_name'] );
|
||||
$active['anon']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['anon']++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['members']++;
|
||||
$active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'p_start' => $p_start, 'p_title' => $p_title, 'p_end' => $p_end, 'seo' => $result['seo_name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$active['active_users_title'] = sprintf( $this->lang->words['active_users_title'] , ($active['members'] + $active['guests'] + $active['anon'] ) );
|
||||
//$active['active_users_detail'] = sprintf( $this->lang->words['active_users_detail'] , $active['guests'],$active['anon'] );
|
||||
$active['active_users_members'] = sprintf( $this->lang->words['active_users_members'], $active['members'] );
|
||||
|
||||
return $active;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default section section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'search' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'search';
|
||||
$DEFAULT_SECTION = 'search';
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Global Search
|
||||
* Last Updated: $Date: 2010-11-17 03:11:07 -0500 (Wed, 17 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-09-21 16:54:20 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7200 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9532 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,43 +29,43 @@ class public_core_search_search extends ipsCommand
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $output = '';
|
||||
protected $output = '';
|
||||
|
||||
/**
|
||||
* Page Title
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $title = '';
|
||||
protected $title = '';
|
||||
|
||||
/**
|
||||
* Object to handle searches
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $search_plugin = '';
|
||||
protected $search_plugin = '';
|
||||
|
||||
/**
|
||||
* Topics array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_topicArray = array();
|
||||
private $_removedTerms = array();
|
||||
protected $_topicArray = array();
|
||||
protected $_removedTerms = array();
|
||||
|
||||
/**
|
||||
* Search controller
|
||||
*
|
||||
* @var obj
|
||||
*/
|
||||
private $searchController;
|
||||
private $_session;
|
||||
protected $searchController;
|
||||
protected $_session;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -76,6 +76,12 @@ class public_core_search_search extends ipsCommand
|
||||
/* Reset engine type */
|
||||
$this->settings['search_method'] = ( $this->settings['search_method'] == 'traditional' ) ? 'sql' : $this->settings['search_method'];
|
||||
|
||||
/* Force SQL for view new content? */
|
||||
if ( ! empty( $this->settings['force_sql_vnc'] ) && $this->request['do'] == 'viewNewContent' )
|
||||
{
|
||||
$this->settings['search_method'] = 'sql';
|
||||
}
|
||||
|
||||
/* Special consideration for contextual search */
|
||||
if ( isset( $this->request['search_app'] ) AND strstr( $this->request['search_app'], ':' ) )
|
||||
{
|
||||
@@ -104,7 +110,7 @@ class public_core_search_search extends ipsCommand
|
||||
/* Sanitzie */
|
||||
if ( ! is_string( $this->request['search_app'] ) )
|
||||
{
|
||||
$this->request['search_app'] = '';
|
||||
$this->request['search_app'] = 'forums';
|
||||
}
|
||||
|
||||
try
|
||||
@@ -128,10 +134,16 @@ class public_core_search_search extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
/* Log type */
|
||||
IPSDebug::addMessage( "Search type: " . $this->settings['search_method'] );
|
||||
|
||||
/* Set up some defaults */
|
||||
IPSSearchRegistry::set('opt.noPostPreview', false );
|
||||
IPSSearchRegistry::set('in.start', intval( $this->request['st'] ) );
|
||||
IPSSearchRegistry::set('opt.search_per_page', intval( $this->settings['search_per_page'] ) ? intval( $this->settings['search_per_page'] ) : 25 );
|
||||
|
||||
$this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365;
|
||||
|
||||
/* Contextuals */
|
||||
if ( isset( $this->request['cType'] ) )
|
||||
{
|
||||
@@ -142,16 +154,14 @@ class public_core_search_search extends ipsCommand
|
||||
/* What to do */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'active':
|
||||
$this->activeContent();
|
||||
break;
|
||||
|
||||
case 'user_activity':
|
||||
$this->viewUserContent();
|
||||
break;
|
||||
|
||||
case 'new_posts':
|
||||
$this->viewNewPosts();
|
||||
case 'viewNewContent':
|
||||
case 'active':
|
||||
$this->viewNewContent();
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
@@ -159,6 +169,14 @@ class public_core_search_search extends ipsCommand
|
||||
$this->searchResults();
|
||||
break;
|
||||
|
||||
case 'followed':
|
||||
$this->viewFollowedContent();
|
||||
break;
|
||||
|
||||
case 'manageFollowed':
|
||||
$this->updateFollowedContent();
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'search_form':
|
||||
$this->searchAdvancedForm();
|
||||
@@ -174,11 +192,245 @@ class public_core_search_search extends ipsCommand
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Moderate your list of liked content
|
||||
*
|
||||
* @author bfarber
|
||||
* @return string HTML to display
|
||||
*/
|
||||
public function updateFollowedContent()
|
||||
{
|
||||
IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the likes we selected
|
||||
//-----------------------------------------
|
||||
|
||||
$_likes = array();
|
||||
|
||||
if( is_array($this->request['likes']) AND count($this->request['likes']) )
|
||||
{
|
||||
foreach( $this->request['likes'] as $_like )
|
||||
{
|
||||
$_thisLike = explode( '-', $_like );
|
||||
$_likes[] = array(
|
||||
'app' => $_thisLike[0],
|
||||
'area' => $_thisLike[1],
|
||||
'id' => $_thisLike[2],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Got any?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !count($_likes) OR !is_array($_likes) )
|
||||
{
|
||||
return $this->viewFollowedContent( $this->lang->words['no_likes_for_del'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get like helper class
|
||||
//-----------------------------------------
|
||||
|
||||
$bootstraps = array();
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop over and moderate
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $_likes as $_like )
|
||||
{
|
||||
$_bootstrap = classes_like::bootstrap( $_like['app'], $_like['area'] );
|
||||
$_likeKey = classes_like_registry::getKey( $_like['id'], $this->memberData['member_id'] );
|
||||
$_frequencies = $_bootstrap->allowedFrequencies();
|
||||
|
||||
//-----------------------------------------
|
||||
// What action to take?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['modaction'] )
|
||||
{
|
||||
case 'delete':
|
||||
$_bootstrap->remove( $_like['id'], $this->memberData['member_id'] );
|
||||
break;
|
||||
|
||||
case 'change-donotify':
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
break;
|
||||
|
||||
case 'change-donotnotify':
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 0 ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
break;
|
||||
|
||||
case 'change-immediate':
|
||||
if( in_array( 'immediate', $_frequencies ) )
|
||||
{
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change-offline':
|
||||
if( in_array( 'offline', $_frequencies ) )
|
||||
{
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'offline' ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change-daily':
|
||||
if( in_array( 'daily', $_frequencies ) )
|
||||
{
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'daily' ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change-weekly':
|
||||
if( in_array( 'weekly', $_frequencies ) )
|
||||
{
|
||||
$this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'weekly' ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change-anon':
|
||||
$this->DB->update( 'core_like', array( 'like_is_anon' => 1 ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
break;
|
||||
|
||||
case 'change-noanon':
|
||||
$this->DB->update( 'core_like', array( 'like_is_anon' => 0 ), "like_id='" . addslashes($_likeKey) . "'" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=search&do=followed&search_app={$this->request['search_app']}&contentType={$this->request['contentType']}&confirm=1" );
|
||||
}
|
||||
|
||||
/**
|
||||
* View content you are following
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @param string $error Error message
|
||||
* @return @e void
|
||||
*/
|
||||
public function viewFollowedContent( $error='' )
|
||||
{
|
||||
IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] );
|
||||
IPSSearchRegistry::set( 'opt.searchType', 'titles' );
|
||||
IPSSearchRegistry::set( 'opt.noPostPreview', true );
|
||||
|
||||
$results = array();
|
||||
$formatted = array();
|
||||
$count = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Determine content type
|
||||
//-----------------------------------------
|
||||
|
||||
$contentTypes = IPSSearchRegistry::get('config.followContentTypes');
|
||||
|
||||
//-----------------------------------------
|
||||
// Verify likes are available
|
||||
//-----------------------------------------
|
||||
|
||||
if( count( IPSLib::getEnabledApplications('like') ) AND count( $contentTypes ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// What content type?
|
||||
//-----------------------------------------
|
||||
|
||||
$_type = '';
|
||||
|
||||
if( $this->request['contentType'] AND in_array( $this->request['contentType'], $contentTypes ) )
|
||||
{
|
||||
$_type = $this->request['contentType'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$_type = $contentTypes[0];
|
||||
}
|
||||
|
||||
$this->request['contentType'] = $_type;
|
||||
|
||||
IPSSearchRegistry::set( 'in.followContentType', $this->request['contentType'] );
|
||||
|
||||
/* Fetch like class */
|
||||
try
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
$this->_like = classes_like::bootstrap( IPSSearchRegistry::get('in.search_app'), $_type );
|
||||
}
|
||||
catch ( Exception $e)
|
||||
{
|
||||
/* Fail safe... */
|
||||
$this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' );
|
||||
$this->title = $this->lang->words['followed_ct_title'];
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( array(), '', 0, $error, $contentTypes );
|
||||
}
|
||||
|
||||
/* Get a count of likes */
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er',
|
||||
'from' => 'core_like',
|
||||
'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ) );
|
||||
$count = $count['er'];
|
||||
|
||||
/* Do we have some custom join and sort data? */
|
||||
if ( method_exists( $this->_like, 'getSearchJoinAndSortBy' ) )
|
||||
{
|
||||
$custom = $this->_like->getSearchJoinAndSortBy();
|
||||
|
||||
$this->DB->build( array( 'select' => 'l.*',
|
||||
'from' => array('core_like' => 'l'),
|
||||
'where' => 'l.like_member_id=' . $this->memberData['member_id'] . " AND l.like_visible=1 AND l.like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND l.like_area='" . $_type . "'",
|
||||
'add_join' => array( array( 'from' => $custom['from'],
|
||||
'where' => $custom['where'] ) ),
|
||||
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
|
||||
'order' => $custom['order'] . ' DESC' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'core_like',
|
||||
'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'",
|
||||
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
|
||||
'order' => 'like_added DESC' ) );
|
||||
}
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$results[] = $r['like_rel_id'];
|
||||
|
||||
$formatted[ $r['like_id'] ] = $r;
|
||||
}
|
||||
|
||||
/* Process */
|
||||
$results = $this->searchController->fetchFollowedContentOutput( $results, $formatted );
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => "app=core&module=search&do=followed&search_app=" . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$count = 0;
|
||||
$results = array();
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' );
|
||||
$this->title = $this->lang->words['followed_ct_title'];
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( $results, $pages, $count, $error, $contentTypes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the advanced search form
|
||||
*
|
||||
* @param string Message
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function searchAdvancedForm( $msg='', $removed_search_terms=array() )
|
||||
{
|
||||
@@ -188,17 +440,18 @@ class public_core_search_search extends ipsCommand
|
||||
/* Get any application specific filters */
|
||||
$appHtml = $this->searchController->getHtml();
|
||||
$isBoolean = $this->searchController->isBoolean();
|
||||
$canTag = ( $this->settings['tags_enabled'] && IPSSearchRegistry::get( 'config.can_searchTags' ) ) ? true : false;
|
||||
|
||||
/* Output */
|
||||
$this->title = $this->lang->words['search_form'];
|
||||
$this->registry->output->addNavigation( $this->lang->words['search_form'], '' );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean, $canTag );
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a search request
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function searchResults()
|
||||
{
|
||||
@@ -228,10 +481,11 @@ class public_core_search_search extends ipsCommand
|
||||
IPSSearchRegistry::set('in.search_app' , $this->request['search_app'] );
|
||||
IPSSearchRegistry::set('in.raw_search_term' , trim( $this->request['search_term'] ) );
|
||||
IPSSearchRegistry::set('in.clean_search_term', $search_term );
|
||||
IPSSearchRegistry::set('in.raw_search_tags' , str_replace( '&', '&', trim( IPSText::parseCleanValue( urldecode( $_REQUEST['search_tags'] ) ) ) ) );
|
||||
IPSSearchRegistry::set('in.search_higlight' , str_replace( '.', '', $this->request['search_term'] ) );
|
||||
IPSSearchRegistry::set('in.search_date_end' , ( $this->request['search_date_start'] && $this->request['search_date_end'] ) ? $this->request['search_date_end'] : 'now' );
|
||||
IPSSearchRegistry::set('in.search_date_start', ( $this->request['search_date_start'] ) ? $this->request['search_date_start'] : '' );
|
||||
IPSSearchRegistry::set('in.search_author' , ( isset( $this->request['search_author'] ) && $this->request['search_author'] ) ? $this->request['search_author'] : '' );
|
||||
IPSSearchRegistry::set('in.search_author' , !empty( $this->request['search_author'] ) ? $this->request['search_author'] : '' );
|
||||
|
||||
/* Set sort filters */
|
||||
$this->_setSortFilters();
|
||||
@@ -242,8 +496,7 @@ class public_core_search_search extends ipsCommand
|
||||
IPSSearchRegistry::set('set.resultsAsForum' , false );
|
||||
|
||||
/* Are we option to show titles only / search in titles only */
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', ( isset( $this->request['content_title_only'] ) && $this->request['content_title_only'] ) ? true : false );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , ( ( $this->request['show_as_titles'] AND $this->settings['enable_show_as_titles'] ) OR ( IPSSearchRegistry::get('opt.searchTitleOnly') ) ) ? true : false );
|
||||
IPSSearchRegistry::set('opt.searchType', ( !empty( $this->request['search_content'] ) AND in_array( $this->request['search_content'], array( 'both', 'titles', 'content' ) ) ) ? $this->request['search_content'] : 'both' );
|
||||
|
||||
/* Time check */
|
||||
if ( IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start')) ) > time() )
|
||||
@@ -264,17 +517,22 @@ class public_core_search_search extends ipsCommand
|
||||
}
|
||||
|
||||
/**
|
||||
* Ok this is an upper limit.
|
||||
* If you needed to change this, you could do so via conf_global.php by adding:
|
||||
* $INFO['max_search_word'] = #####;
|
||||
* Lower limit
|
||||
*/
|
||||
if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') )
|
||||
if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') && ! IPSSearchRegistry::get('in.raw_search_tags') )
|
||||
{
|
||||
$_words = explode( ' ', IPSSearchRegistry::get('in.raw_search_term') );
|
||||
$_ok = true;
|
||||
|
||||
$_words = explode( ' ', preg_replace( "#\"(.*?)\"#", '', $search_term ) );
|
||||
$_ok = $search_term ? true : false;
|
||||
|
||||
foreach( $_words as $_word )
|
||||
{
|
||||
$_word = preg_replace( '#^\+(.+?)$#', "\\1", $_word );
|
||||
|
||||
if( !$_word )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( strlen( $_word ) < $this->settings['min_search_word'] )
|
||||
{
|
||||
$_ok = false;
|
||||
@@ -287,8 +545,13 @@ class public_core_search_search extends ipsCommand
|
||||
$this->searchAdvancedForm( sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] ), $removedTerms );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ok this is an upper limit.
|
||||
* If you needed to change this, you could do so via conf_global.php by adding:
|
||||
* $INFO['max_search_word'] = #####;
|
||||
*/
|
||||
if ( $this->settings['max_search_word'] && strlen( IPSSearchRegistry::get('in.raw_search_term') ) > $this->settings['max_search_word'] )
|
||||
{
|
||||
$this->searchAdvancedForm( sprintf( $this->lang->words['search_term_long'], $this->settings['max_search_word'] ) );
|
||||
@@ -327,10 +590,15 @@ class public_core_search_search extends ipsCommand
|
||||
}
|
||||
|
||||
/* Clean search term for results view */
|
||||
$_search_term = trim( preg_replace( "#(^|\s)(\+|\-|\||\~)#", " ", $search_term ) );
|
||||
$_search_term = trim( preg_replace( '#(^|\s)(\+|\-|\||\~)#', " ", $search_term ) );
|
||||
|
||||
/* Can we do this? */
|
||||
if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) )
|
||||
/* Got tag search only but app doesn't support tags */
|
||||
if ( IPSSearchRegistry::get('in.raw_search_tags') && ! IPSSearchRegistry::get( 'config.can_searchTags' ) && ! IPSSearchRegistry::get('in.raw_search_term') )
|
||||
{
|
||||
$count = 0;
|
||||
$results = array();
|
||||
}
|
||||
else if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) )
|
||||
{
|
||||
/* Perform the search */
|
||||
$this->searchController->search();
|
||||
@@ -346,21 +614,40 @@ class public_core_search_search extends ipsCommand
|
||||
|
||||
/* Fetch sort details */
|
||||
$sortDropDown = $this->searchController->fetchSortDropDown();
|
||||
|
||||
/* Set default sort option */
|
||||
$_a = IPSSearchRegistry::get('in.search_app');
|
||||
$_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : '';
|
||||
|
||||
if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) )
|
||||
{
|
||||
$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown );
|
||||
}
|
||||
else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) )
|
||||
{
|
||||
$this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown );
|
||||
}
|
||||
|
||||
/* Fetch sort details */
|
||||
$sortIn = $this->searchController->fetchSortIn();
|
||||
|
||||
/* Build pagination */
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '' ) );
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue'=> IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '' ) );
|
||||
|
||||
/* Showing */
|
||||
$showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') );
|
||||
|
||||
/* Parse result set */
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 );
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 );
|
||||
|
||||
/* Check for sortIn */
|
||||
if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] )
|
||||
{
|
||||
$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -370,7 +657,7 @@ class public_core_search_search extends ipsCommand
|
||||
|
||||
/* Output */
|
||||
$this->title = $this->lang->words['search_results'];
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit') );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), IPSSearchRegistry::get('in.raw_search_tags') );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,7 +688,7 @@ class public_core_search_search extends ipsCommand
|
||||
|
||||
if ( isset( $this->_session['_session_data']['search_app_filters'] ) )
|
||||
{
|
||||
$this->request['search_app_filters'] = $this->_session['_session_data']['search_app_filters'];
|
||||
$this->request['search_app_filters'] = is_array( $this->request['search_app_filters'] ) ? array_merge( $this->_session['_session_data']['search_app_filters'], $this->request['search_app_filters'] ) : $this->_session['_session_data']['search_app_filters'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +744,7 @@ class public_core_search_search extends ipsCommand
|
||||
/**
|
||||
* Set the search order and key
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _setSortFilters()
|
||||
{
|
||||
@@ -494,76 +781,41 @@ class public_core_search_search extends ipsCommand
|
||||
$dir = $this->request['search_sort_order'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Numeric? */
|
||||
if ( is_numeric( $dir ) )
|
||||
{
|
||||
$dir = ( $dir == 0 ) ? 'desc' : 'asc';
|
||||
}
|
||||
else
|
||||
{
|
||||
$dir = 'desc';
|
||||
}
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , trim( $key ) );
|
||||
IPSSearchRegistry::set('in.search_sort_order', ( $dir != 'desc' ) ? 'asc' : 'desc' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the active topics screen
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function activeContent()
|
||||
{
|
||||
IPSSearchRegistry::set('in.search_app', $this->request['search_app'] );
|
||||
IPSSearchRegistry::set('in.period' , ( empty( $this->request['period'] ) ) ? 'today' : $this->request['period'] );
|
||||
|
||||
/* Can we do this? */
|
||||
if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) )
|
||||
{
|
||||
/* Perform the search */
|
||||
$this->searchController->viewActiveContent();
|
||||
|
||||
/* Get count */
|
||||
$count = $this->searchController->getResultCount();
|
||||
|
||||
/* Get results which will be array of IDs */
|
||||
$results = $this->searchController->getResultSet();
|
||||
|
||||
/* Get templates to use */
|
||||
$template = $this->searchController->fetchTemplates();
|
||||
|
||||
/* Fetch sort details */
|
||||
$sortIn = $this->searchController->fetchSortIn();
|
||||
|
||||
/* Parse result set */
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 );
|
||||
|
||||
/* Build pagination */
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => 'app=core&module=search&do=active&period=' . IPSSearchRegistry::get('in.period') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$count = 0;
|
||||
$results = array();
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->title = $this->lang->words['active_posts_title'];
|
||||
$this->registry->output->addNavigation( $this->lang->words['active_posts_title'], '' );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->activePostsView( $results, $links, $count, $sortIn );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays latest user content
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function viewUserContent()
|
||||
{
|
||||
/* INIT */
|
||||
$id = $this->request['mid'] ? intval( trim( $this->request['mid'] ) ) : $this->memberData['member_id'];
|
||||
$member = IPSMember::load( $id, 'core' );
|
||||
|
||||
/* Save query if we are viewing our own content */
|
||||
if( $this->memberData['member_id'] AND $id == $this->memberData['member_id'] )
|
||||
{
|
||||
$member = $this->memberData;
|
||||
}
|
||||
else
|
||||
{
|
||||
$member = IPSMember::load( $id, 'core' );
|
||||
}
|
||||
|
||||
$beginStamp = 0;
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
@@ -571,11 +823,16 @@ class public_core_search_search extends ipsCommand
|
||||
$this->registry->output->showError( 'search_invalid_id', 10147, null, null, 403 );
|
||||
}
|
||||
|
||||
$this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : 'all';
|
||||
|
||||
IPSSearchRegistry::set('in.search_app', $this->request['search_app'] );
|
||||
IPSSearchRegistry::set('in.userMode' , ( $this->request['userMode'] ) ? $this->request['userMode'] : 'all' );
|
||||
IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] );
|
||||
|
||||
/* Set sort filters */
|
||||
$this->_setSortFilters();
|
||||
|
||||
/* Can we do this? */
|
||||
if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) )
|
||||
if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) )
|
||||
{
|
||||
/* Perform the search */
|
||||
$this->searchController->viewUserContent( $member );
|
||||
@@ -589,17 +846,38 @@ class public_core_search_search extends ipsCommand
|
||||
/* Get templates to use */
|
||||
$template = $this->searchController->fetchTemplates();
|
||||
|
||||
/* Fetch sort details */
|
||||
$sortDropDown = $this->searchController->fetchSortDropDown();
|
||||
|
||||
/* Set default sort option */
|
||||
$_a = IPSSearchRegistry::get('in.search_app');
|
||||
$_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : '';
|
||||
|
||||
if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) )
|
||||
{
|
||||
$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown );
|
||||
}
|
||||
else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) )
|
||||
{
|
||||
$this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown );
|
||||
}
|
||||
|
||||
/* Fetch sort details */
|
||||
$sortIn = $this->searchController->fetchSortIn();
|
||||
|
||||
/* Reset for template */
|
||||
$this->_resetRequestParameters();
|
||||
|
||||
/* Parse result set */
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 );
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 );
|
||||
|
||||
/* Build pagination */
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] ) );
|
||||
'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] .
|
||||
'&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][sortKey]=' .
|
||||
$this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['sortKey'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][sortDir]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['sortDir'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -609,21 +887,67 @@ class public_core_search_search extends ipsCommand
|
||||
|
||||
$this->title = sprintf( $this->lang->words['s_participation_title'], $member['members_display_name'] );
|
||||
$this->registry->output->addNavigation( $this->title, '' );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn, $sortDropDown );
|
||||
}
|
||||
|
||||
/**
|
||||
* View new posts since your last visit
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function viewNewPosts()
|
||||
public function viewNewContent()
|
||||
{
|
||||
IPSSearchRegistry::set('in.search_app', $this->request['search_app'] );
|
||||
|
||||
/* Can we do this? */
|
||||
if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) )
|
||||
/* Fetch member cache to see if we have a value set */
|
||||
$vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' );
|
||||
|
||||
/* Guests */
|
||||
if ( ! $this->memberData['member_id'] AND ( !$this->request['period'] OR $this->request['period'] == 'unread' ) )
|
||||
{
|
||||
$this->request['period'] = 'today';
|
||||
}
|
||||
|
||||
/* In period */
|
||||
if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['period'] ) )
|
||||
{
|
||||
$vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] = ( ! empty( $this->request['period'] ) ) ? $this->request['period'] : $this->settings['default_vnc_method'];
|
||||
}
|
||||
|
||||
/* Follow filter enabled */
|
||||
if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['followedItemsOnly'] ) )
|
||||
{
|
||||
$vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] = ( ! empty( $this->request['followedItemsOnly'] ) ) ? 1 : 0;
|
||||
}
|
||||
|
||||
/* Filtering VNC by forum? */
|
||||
IPSSearchRegistry::set('forums.vncForumFilters', $vncPrefs['forums']['vnc_forum_filter'] );
|
||||
|
||||
/* Set period up */
|
||||
IPSSearchRegistry::set('in.period' , $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] );
|
||||
IPSSearchRegistry::set('in.vncFollowFilterOn', $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] );
|
||||
|
||||
$this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : '';
|
||||
IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] );
|
||||
|
||||
/* Update member cache */
|
||||
if ( isset( $this->request['period'] ) )
|
||||
{
|
||||
IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) );
|
||||
}
|
||||
|
||||
IPSDebug::addMessage( var_export( $vncPrefs, true ) );
|
||||
IPSDebug::addMessage( 'Using: ' . IPSSearchRegistry::get('in.period') );
|
||||
|
||||
/* Can we do this? */
|
||||
if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) || IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) )
|
||||
{
|
||||
/* Can't do a specific unread search, so */
|
||||
if ( IPSSearchRegistry::get('in.period') == 'unread' && ! IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vncWithUnreadContent' ) )
|
||||
{
|
||||
IPSSearchRegistry::set( 'in.period', 'lastvisit' );
|
||||
}
|
||||
|
||||
/* Perform the search */
|
||||
$this->searchController->viewNewContent();
|
||||
|
||||
@@ -642,14 +966,26 @@ class public_core_search_search extends ipsCommand
|
||||
/* Fetch sort details */
|
||||
$sortIn = $this->searchController->fetchSortIn();
|
||||
|
||||
/* Reset for template */
|
||||
$this->_resetRequestParameters();
|
||||
|
||||
if( IPSSearchRegistry::get('in.start') > 0 AND !count($results) )
|
||||
{
|
||||
$new_url = 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'];
|
||||
$new_url .= '&st=' . ( IPSSearchRegistry::get('in.start') - IPSSearchRegistry::get('opt.search_per_page') ) . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey'];
|
||||
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $new_url );
|
||||
}
|
||||
|
||||
/* Parse result set */
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 );
|
||||
$results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 );
|
||||
|
||||
/* Build pagination */
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
'baseUrl' => 'app=core&module=search&do=new_posts&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid= ' . $this->request['_sid'] ) );
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'),
|
||||
'currentStartValue' => IPSSearchRegistry::get('in.start'),
|
||||
//'method' => 'nextPrevious',
|
||||
'baseUrl' => 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey'] ) );
|
||||
|
||||
/* Showing */
|
||||
$showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') );
|
||||
@@ -660,10 +996,19 @@ class public_core_search_search extends ipsCommand
|
||||
$results = array();
|
||||
}
|
||||
|
||||
/* Add Debug message */
|
||||
IPSDebug::addMessage( "View New Content Matches: " . $count );
|
||||
|
||||
/* Check for sortIn */
|
||||
if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] )
|
||||
{
|
||||
$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0];
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->title = $this->lang->words['new_posts_title'];
|
||||
$this->registry->output->addNavigation( $this->lang->words['new_posts_title'], '' );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->newPostsView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') );
|
||||
$this->output .= $this->registry->output->getTemplate( 'search' )->newContentView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') );
|
||||
}
|
||||
|
||||
|
||||
@@ -679,27 +1024,31 @@ class public_core_search_search extends ipsCommand
|
||||
$url_string .= '&sid=' . $this->request['_sid'];
|
||||
|
||||
/* Add author name */
|
||||
if( isset( $this->request['search_author'] ) AND $this->request['search_author'] )
|
||||
if( !empty( $this->request['search_author'] ) )
|
||||
{
|
||||
$url_string .= "&search_author=" . urlencode($this->request['search_author']);
|
||||
}
|
||||
|
||||
/* Add titles only */
|
||||
if( isset( $this->request['show_as_titles'] ) AND $this->request['show_as_titles'] )
|
||||
{
|
||||
$url_string .= "&show_as_titles={$this->request['show_as_titles']}";
|
||||
}
|
||||
|
||||
|
||||
/* Search Range */
|
||||
if( isset( $this->request['search_date_start'] ) AND $this->request['search_date_start'] )
|
||||
if( !empty( $this->request['search_date_start'] ) )
|
||||
{
|
||||
$url_string .= "&search_date_start={$this->request['search_date_start']}";
|
||||
}
|
||||
|
||||
if( isset( $this->request['search_date_end'] ) AND $this->request['search_date_end'] )
|
||||
if( !empty( $this->request['search_date_end'] ) )
|
||||
{
|
||||
$url_string .= "&search_date_end={$this->request['search_date_end']}";
|
||||
}
|
||||
|
||||
if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey'] ) )
|
||||
{
|
||||
$url_string .= "&search_app_filters[{$this->request['search_app']}][sortKey]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey'];
|
||||
}
|
||||
|
||||
if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir'] ) )
|
||||
{
|
||||
$url_string .= "&search_app_filters[{$this->request['search_app']}][sortDir]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir'];
|
||||
}
|
||||
|
||||
/* Contextual Type */
|
||||
if ( IPSSearchRegistry::get('contextual.type') )
|
||||
@@ -708,9 +1057,14 @@ class public_core_search_search extends ipsCommand
|
||||
}
|
||||
|
||||
/* Content Only */
|
||||
if( isset( $this->request['content_title_only'] ) && $this->request['content_title_only'] )
|
||||
if( !empty( $this->request['search_content'] ) )
|
||||
{
|
||||
$url_string .= "&content_title_only=1";
|
||||
$url_string .= "&search_content=" . $this->request['search_content'];
|
||||
}
|
||||
|
||||
if ( IPSSearchRegistry::get('in.raw_search_tags') )
|
||||
{
|
||||
$url_string .= "&search_tags=" . urlencode( IPSSearchRegistry::get('in.raw_search_tags') );
|
||||
}
|
||||
|
||||
/* Types */
|
||||
@@ -724,6 +1078,30 @@ class public_core_search_search extends ipsCommand
|
||||
$url_string .= "&type_2={$this->request['type_2']}&type_id_2={$this->request['type_id_2']}";
|
||||
}
|
||||
|
||||
if( isset($this->request['search_app_filters']) AND $this->request['search_app_filters'] )
|
||||
{
|
||||
foreach( $this->request['search_app_filters'] as $app => $filters )
|
||||
{
|
||||
if( $app == $this->request['search_app'] AND count($filters) )
|
||||
{
|
||||
foreach( $filters as $_filterKey => $_filterValue )
|
||||
{
|
||||
if( is_array($_filterValue) )
|
||||
{
|
||||
foreach( $_filterValue as $_filterValueKey => $_filterValueValue )
|
||||
{
|
||||
$url_string .= "&search_app_filters[{$app}][{$_filterKey}][{$_filterValueKey}]={$_filterValueValue}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_string .= "&search_app_filters[{$app}][{$_filterKey}]={$_filterValue}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix up the search term a bit */
|
||||
$_search_term = str_replace( '&', '&', $this->request['search_term'] );
|
||||
$_search_term = str_replace( '"', '"', $_search_term );
|
||||
@@ -739,7 +1117,7 @@ class public_core_search_search extends ipsCommand
|
||||
/**
|
||||
* Checks to see if the logged in user is allowed to use the search system
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _canSearch()
|
||||
{
|
||||
@@ -772,5 +1150,17 @@ class public_core_search_search extends ipsCommand
|
||||
$this->registry->output->showError( 'no_permission_to_search', 10146, null, null, 403 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets params for template
|
||||
*/
|
||||
protected function _resetRequestParameters()
|
||||
{
|
||||
$this->request['period'] = IPSSearchRegistry::get('in.period');
|
||||
$this->request['search_app'] = IPSSearchRegistry::get('in.search_app');
|
||||
$this->request['vncFollowFilterOn'] = IPSSearchRegistry::get('in.vncFollowFilterOn');
|
||||
$this->request['followedItemsOnly'] = IPSSearchRegistry::get('in.vncFollowFilterOn');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Task Manager
|
||||
* Last Updated: $Date: 2010-07-12 18:26:09 -0400 (Mon, 12 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6635 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,9 +28,8 @@ class public_core_task_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -38,8 +37,8 @@ class public_core_task_manualResolver extends ipsCommand
|
||||
// Require and run
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );
|
||||
$functions = new $classToLoad( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );/*noLibHook*/
|
||||
$functions = new $classToLoad( $registry );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check shutdown functions
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* User control panel resolver
|
||||
* Last Updated: $Date: 2010-10-21 14:02:34 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-06-09 18:03:22 -0400 (Thu, 09 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 7011 $
|
||||
* @version $Revision: 9021 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -32,7 +32,6 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Page Title set by sub classes
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_pageTitle;
|
||||
@@ -40,7 +39,6 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Navigation array set by sub classes
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $_nav = array();
|
||||
@@ -48,9 +46,8 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -101,9 +98,9 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
|
||||
IPSLib::loadInterface( 'interface_usercp.php' );
|
||||
|
||||
$EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions';
|
||||
$EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions';
|
||||
|
||||
if ( ! file_exists($EXT_DIR . '/usercpForms.php') )
|
||||
if ( ! is_file($EXT_DIR . '/usercpForms.php') )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'usercp_bad_tab', 10147 );
|
||||
exit();
|
||||
@@ -113,24 +110,25 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
// Cycle through applications and load
|
||||
// usercpForm extensions
|
||||
//-----------------------------------------
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
// Check that the application is installed.
|
||||
if ( !IPSLib::appIsInstalled( $app_dir ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$ext_dir = IPSLib::getAppDir( $app_dir ) . '/extensions';
|
||||
|
||||
// Make sure the extension exists
|
||||
if ( !file_exists( $ext_dir . '/usercpForms.php' ) )
|
||||
if ( !is_file( $ext_dir . '/usercpForms.php' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$__class = IPSLib::loadLibrary( $ext_dir . '/usercpForms.php', 'usercpForms_' . $app_dir, $app_dir );
|
||||
$_usercp_module = new $__class();
|
||||
|
||||
/* Block based on version to prevent old files showing up/causing an error */
|
||||
if( !$_usercp_module->version OR $_usercp_module->version < 32 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$_usercp_module->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
if ( is_callable( array( $_usercp_module, 'init' ) ) )
|
||||
@@ -149,17 +147,21 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
|
||||
if ( is_callable( array( $_usercp_module, 'getLinks' ) ) )
|
||||
{
|
||||
$tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $app_dir );
|
||||
$tabs[ $app_dir ]['_menu'] = $_usercp_module->getLinks();
|
||||
|
||||
if ( ! $tabs[ $app_dir ]['_menu'] )
|
||||
|
||||
/* Got any links? */
|
||||
if ( !is_array($tabs[ $app_dir ]['_menu']) || !count($tabs[ $app_dir ]['_menu']) )
|
||||
{
|
||||
unset( $tabs[ $app_dir ] );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Get title */
|
||||
$tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $app_dir );
|
||||
|
||||
/* Add in 'last' element */
|
||||
$tabs[ $app_dir ]['_menu'][ count( $tabs[ $app_dir ]['_menu'] ) - 1 ]['last'] = 1;
|
||||
|
||||
|
||||
/* This nav? */
|
||||
if ( ! count( $_thisNav ) AND $app_dir == $_TAB )
|
||||
{
|
||||
@@ -276,7 +278,7 @@ class public_core_usercp_manualResolver extends ipsCommand
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->setTitle( ( $this->_pageTitle ) ? $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']} : " . $this->_pageTitle : $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']}" );
|
||||
$this->registry->getClass('output')->setTitle( ( $this->_pageTitle ) ? "{$this->lang->words['pagetitle_bit']} : " . $this->_pageTitle . ' - ' . $this->settings['board_name'] : "{$this->lang->words['pagetitle_bit']} - " . $this->settings['board_name'] );
|
||||
$this->registry->getClass('output')->addContent( $template );
|
||||
|
||||
if ( is_array( $this->_nav ) AND count( $this->_nav ) )
|
||||
|
||||
Reference in new issue
Block a user