Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,108 +1,106 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX hCard
|
||||
* 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_members_ajax_card extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile') );
|
||||
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['mid'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
if( !$member_id )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id' );
|
||||
|
||||
if( !$member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_online' ), 'members' );
|
||||
|
||||
$member = IPSMember::buildDisplayData( $member, array( 'customFields' => 1, 'cfSkinGroup' => 'profile', 'spamStatus' => 1 ) );
|
||||
$member = IPSMember::getLocation( $member );
|
||||
|
||||
$board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
|
||||
|
||||
if( $member['posts'] and $board_posts )
|
||||
{
|
||||
$member['_posts_day'] = round( $member['posts'] / ( ( time() - $member['joined']) / 86400 ), 2 );
|
||||
|
||||
# Fix the issue when there is less than one day
|
||||
$member['_posts_day'] = ( $member['_posts_day'] > $member['posts'] ) ? $member['posts'] : $member['_posts_day'];
|
||||
$member['_total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) );
|
||||
}
|
||||
|
||||
$member['_posts_day'] = floatval( $member['_posts_day'] );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* Fetch */
|
||||
$member['_status'] = $this->registry->getClass('memberStatus')->fetch( $this->memberData, array( 'member_id' => $member['member_id'], 'limit' => 1 ) );
|
||||
|
||||
if ( is_array( $member['_status'] ) AND count( $member['_status'] ) )
|
||||
{
|
||||
$member['_status'] = array_pop( $member['_status'] );
|
||||
}
|
||||
|
||||
/* Reputation */
|
||||
if ( $this->settings['reputation_protected_groups'] )
|
||||
{
|
||||
if ( in_array( $member['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
|
||||
{
|
||||
$this->settings['reputation_show_profile'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('profile')->showCard( $member ) );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile AJAX hCard
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_card extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile', 'public_online' ), 'members' );
|
||||
|
||||
/* Got a valid member? */
|
||||
$member_id = intval( $this->request['mid'] );
|
||||
|
||||
if( empty($member_id) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id' );
|
||||
|
||||
if( empty($member['member_id']) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$member = IPSMember::buildDisplayData( $member, array( 'customFields' => 1, 'cfSkinGroup' => 'profile', 'spamStatus' => 1 ) );
|
||||
$member = IPSMember::getLocation( $member );
|
||||
|
||||
$board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
|
||||
|
||||
if( $member['posts'] and $board_posts )
|
||||
{
|
||||
$member['_posts_day'] = round( $member['posts'] / ( ( time() - $member['joined']) / 86400 ), 2 );
|
||||
|
||||
# Fix the issue when there is less than one day
|
||||
$member['_posts_day'] = ( $member['_posts_day'] > $member['posts'] ) ? $member['posts'] : $member['_posts_day'];
|
||||
$member['_total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) );
|
||||
}
|
||||
|
||||
$member['_posts_day'] = floatval( $member['_posts_day'] );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* Fetch */
|
||||
$member['_status'] = $this->registry->getClass('memberStatus')->fetch( $this->memberData, array( 'member_id' => $member['member_id'], 'limit' => 1 ) );
|
||||
|
||||
if ( is_array( $member['_status'] ) AND count( $member['_status'] ) )
|
||||
{
|
||||
$member['_status'] = array_pop( $member['_status'] );
|
||||
}
|
||||
|
||||
/* Reputation */
|
||||
if ( $this->settings['reputation_protected_groups'] )
|
||||
{
|
||||
if ( in_array( $member['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
|
||||
{
|
||||
$this->settings['reputation_show_profile'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('profile')->showCard( $member ) );
|
||||
}
|
||||
}
|
||||
@@ -1,104 +1,104 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile display name history
|
||||
* 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_members_ajax_dname extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dname_profiles_off'] );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_off'] );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_no_id'] );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile display name history
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_dname extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dname_profiles_off'] );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_off'] );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_no_id'] );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member AJAX DST switcher
|
||||
* 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_members_ajax_dst extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnNull();
|
||||
}
|
||||
|
||||
if( $this->memberData['members_auto_dst'] == 1 AND $this->settings['time_dst_auto_correction'] )
|
||||
{
|
||||
$newValue = $this->memberData['dst_in_use'] ? 0 : 1;
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'members' => array( 'dst_in_use' => $newValue ) ) );
|
||||
}
|
||||
|
||||
$this->returnNull();
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Member AJAX DST switcher
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_dst extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnNull();
|
||||
}
|
||||
|
||||
if( $this->memberData['members_auto_dst'] == 1 AND $this->settings['time_dst_auto_correction'] )
|
||||
{
|
||||
$newValue = $this->memberData['dst_in_use'] ? 0 : 1;
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'members' => array( 'dst_in_use' => $newValue ) ) );
|
||||
}
|
||||
|
||||
$this->returnNull();
|
||||
}
|
||||
}
|
||||
@@ -1,123 +1,123 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Comment Handler
|
||||
* 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_members_ajax_friends extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Friends library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $friends;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Friends Enabled */
|
||||
if( ! $this->settings['friends_enabled'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'friends_not_enabled', 10220 );
|
||||
}
|
||||
|
||||
/* Friends Library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/friends.php', 'profileFriendsLib', 'members' );
|
||||
$this->friends = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->_addFriend();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->_removeFriend();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a friend
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _addFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Add friend */
|
||||
$result = $this->friends->addFriend( $member_id );
|
||||
|
||||
/* Add to other user as well, but only if not pending */
|
||||
if( !$this->friends->pendingApproval )
|
||||
{
|
||||
$result2 = $this->friends->addFriend( $this->memberData['member_id'], $member_id, true );
|
||||
}
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a friend
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _removeFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Remove friend */
|
||||
$result = $this->friends->removeFriend( $member_id );
|
||||
|
||||
/* Remove from other user as well */
|
||||
$result2 = $this->friends->removeFriend( $this->memberData['member_id'], $member_id );
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile AJAX Comment Handler
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_friends extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Friends library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $friends;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Friends Enabled */
|
||||
if( ! $this->settings['friends_enabled'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'friends_not_enabled', 10220 );
|
||||
}
|
||||
|
||||
/* Friends Library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/friends.php', 'profileFriendsLib', 'members' );
|
||||
$this->friends = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->_addFriend();
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$this->_removeFriend();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a friend
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _addFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Add friend */
|
||||
$result = $this->friends->addFriend( $member_id );
|
||||
|
||||
/* Add to other user as well, but only if not pending */
|
||||
if( !$this->friends->pendingApproval )
|
||||
{
|
||||
$result2 = $this->friends->addFriend( $this->memberData['member_id'], $member_id, true );
|
||||
}
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a friend
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _removeFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Remove friend */
|
||||
$result = $this->friends->removeFriend( $member_id );
|
||||
|
||||
/* Remove from other user as well */
|
||||
$result2 = $this->friends->removeFriend( $this->memberData['member_id'], $member_id );
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Ignore User
|
||||
* 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_members_ajax_ignore extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Get ignore user quick call file */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'members' ) . '/modules_public/profile/ignore.php', 'public_members_profile_ignore' );
|
||||
$library = new $classToLoad( $registry );
|
||||
$library->makeRegistryShortcuts( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $result );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile AJAX Ignore User
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_ignore extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Get ignore user quick call file */
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'members' ) . '/modules_public/profile/ignore.php', 'public_members_profile_ignore' );
|
||||
$library = new $classToLoad( $registry );
|
||||
$library->makeRegistryShortcuts( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $result );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,115 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Tab Loader
|
||||
* 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_members_ajax_load extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$CONFIG = array();
|
||||
|
||||
$tab = explode( ':', ipsRegistry::$request['tab'] );
|
||||
$app = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( $tab[0] ) ) ), 0, 20 );
|
||||
$tab = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( $tab[1] ) ) ), 0, 20 );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load config
|
||||
//-----------------------------------------
|
||||
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Active?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $CONFIG['plugin_enabled'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load main class...
|
||||
//-----------------------------------------
|
||||
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app );
|
||||
$plugin = new $classToLoad( $this->registry );
|
||||
|
||||
$html = $plugin->return_html_block( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_load extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$CONFIG = array();
|
||||
|
||||
$tab = explode( ':', ipsRegistry::$request['tab'] );
|
||||
$app = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( $tab[0] ) ) ), 0, 20 );
|
||||
$tab = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( $tab[1] ) ) ), 0, 20 );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load config
|
||||
//-----------------------------------------
|
||||
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Active?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $CONFIG['plugin_enabled'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load main class...
|
||||
//-----------------------------------------
|
||||
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app );
|
||||
$plugin = new $classToLoad( $this->registry );
|
||||
|
||||
$html = $plugin->return_html_block( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,194 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* @file photo.php Returns a cropped photo for an ajax request
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since 7th Feb 2011
|
||||
* $LastChangedDate: 2011-09-08 11:58:29 -0400 (Thu, 08 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9467 $
|
||||
*/
|
||||
|
||||
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_members_ajax_photo
|
||||
* @brief Returns a cropped photo for an ajax request
|
||||
*
|
||||
*/
|
||||
class public_members_ajax_photo extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$this->photo = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request[ 'do' ] )
|
||||
{
|
||||
case 'cropPhoto':
|
||||
$this->_cropPhoto();
|
||||
break;
|
||||
case 'show':
|
||||
$this->_show();
|
||||
break;
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
case 'importUrl':
|
||||
$this->_importUrl();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a photo or image from URL
|
||||
*
|
||||
*/
|
||||
protected function _importUrl()
|
||||
{
|
||||
$url = trim( $this->request['url'] );
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
/* Check for valid URL */
|
||||
$photo = $this->photo->save( $this->memberData, 'url', '', $url );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ $msg ] );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
$photoType = $this->request['photoType'];
|
||||
$gravatar = $this->request['gravatar'];
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ 'pp_' . $msg ] );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the photo
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
$this->photo->remove( $this->memberData['member_id'] );
|
||||
|
||||
$return = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$return['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$return['status'] = 'deleted';
|
||||
$return['thumb'] = $return['pp_thumb_photo'];
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the photo editor
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _show()
|
||||
{
|
||||
$this->returnHtml( $this->photo->getEditorHtml( $this->memberData ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Crop the chosen photo
|
||||
*
|
||||
* @return @e void [JSON array]
|
||||
*/
|
||||
protected function _cropPhoto()
|
||||
{
|
||||
$x1 = intval( $this->request['x1'] );
|
||||
$x2 = intval( $this->request['x2'] );
|
||||
$y1 = intval( $this->request['y1'] );
|
||||
$y2 = intval( $this->request['y2'] );
|
||||
$dims = array( 'x1' => $x1, 'y1' => $y1, 'x2' => $x2, 'y2' => $y2 );
|
||||
|
||||
/* Crop and fetch return data */
|
||||
$return = $this->photo->cropPhoto( $this->memberData['member_id'], $dims );
|
||||
$member = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
|
||||
if ( $return['status'] == 'ok' )
|
||||
{
|
||||
$this->returnJsonArray( array_merge( $member, $return ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError('fail');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file photo.php Returns a cropped photo for an ajax request
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 7th Feb 2011
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_members_ajax_photo
|
||||
* @brief Returns a cropped photo for an ajax request
|
||||
*
|
||||
*/
|
||||
class public_members_ajax_photo extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$this->photo = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request[ 'do' ] )
|
||||
{
|
||||
case 'cropPhoto':
|
||||
$this->_cropPhoto();
|
||||
break;
|
||||
case 'show':
|
||||
$this->_show();
|
||||
break;
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
case 'importUrl':
|
||||
$this->_importUrl();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a photo or image from URL
|
||||
*
|
||||
*/
|
||||
protected function _importUrl()
|
||||
{
|
||||
$url = trim( $this->request['url'] );
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
/* Check for valid URL */
|
||||
$photo = $this->photo->save( $this->memberData, 'url', '', $url );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ 'pp_' . $msg ] );
|
||||
break;
|
||||
case 'upload_to_big':
|
||||
$this->returnJsonError( sprintf( $this->lang->words[ 'pp_' . $msg ], $this->memberData['photoMaxKb'] ) );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
$photoType = $this->request['photoType'];
|
||||
$gravatar = $this->request['gravatar'];
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
case 'upload_to_big':
|
||||
$this->returnJsonError( sprintf( $this->lang->words[ 'pp_' . $msg ], $this->memberData['photoMaxKb'] ) );
|
||||
break;
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ 'pp_' . $msg ] );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the photo
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
$this->photo->remove( $this->memberData['member_id'] );
|
||||
|
||||
$return = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$return['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$return['status'] = 'deleted';
|
||||
$return['thumb'] = $return['pp_thumb_photo'];
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the photo editor
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _show()
|
||||
{
|
||||
$this->returnHtml( $this->photo->getEditorHtml( $this->memberData ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Crop the chosen photo
|
||||
*
|
||||
* @return @e void [JSON array]
|
||||
*/
|
||||
protected function _cropPhoto()
|
||||
{
|
||||
$x1 = intval( $this->request['x1'] );
|
||||
$x2 = intval( $this->request['x2'] );
|
||||
$y1 = intval( $this->request['y1'] );
|
||||
$y2 = intval( $this->request['y2'] );
|
||||
$dims = array( 'x1' => $x1, 'y1' => $y1, 'x2' => $x2, 'y2' => $y2 );
|
||||
|
||||
/* Crop and fetch return data */
|
||||
$return = $this->photo->cropPhoto( $this->memberData['member_id'], $dims );
|
||||
$member = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
|
||||
if ( $return['status'] == 'ok' )
|
||||
{
|
||||
$this->returnJsonArray( array_merge( $member, $return ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError('fail');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,161 +1,161 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Tab Loader
|
||||
* 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_members_ajax_rate extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rating_id = intval($this->request['rating']);
|
||||
$rating_id = $rating_id > 5 ? 5 : $rating_id;
|
||||
$rating_id = $rating_id < 0 ? 0 : $rating_id;
|
||||
$member_id = intval($this->request['member_id']);
|
||||
$member = array();
|
||||
$type = 'new';
|
||||
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$error = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->settings['pp_allow_member_rate'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
if ( ! $member_id OR ! $this->memberData['member_id'] OR $member_id == $this->memberData['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5_check != $this->member->form_hash )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm3';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm4';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Have we already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
$rating = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'profile_ratings',
|
||||
'where' => "rating_for_member_id={$member_id} AND rating_by_member_id=" . $this->memberData['member_id'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating['rating_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we allow re-ratings?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating_id != $rating['rating_value'] )
|
||||
{
|
||||
$member['pp_rating_value'] = intval( $member['pp_rating_value'] );
|
||||
$member['pp_rating_value'] = ( $member['pp_rating_value'] + $rating_id ) - $rating['rating_value'];
|
||||
|
||||
$this->DB->update( 'profile_ratings', array( 'rating_value' => $rating_id ), 'rating_id=' . $rating['rating_id'] );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_value' => $member['pp_rating_value'],
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
$type = 'update';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// NEW RATING!
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$member['pp_rating_value'] = intval($member['pp_rating_value']) + $rating_id;
|
||||
$member['pp_rating_hits'] = intval($member['pp_rating_hits']) + 1;
|
||||
|
||||
$this->DB->insert( 'profile_ratings', array( 'rating_for_member_id' => $member_id,
|
||||
'rating_by_member_id' => $this->memberData['member_id'],
|
||||
'rating_value' => $rating_id,
|
||||
'rating_ip_address' => $this->member->ip_address ) );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_hits' => intval($member['pp_rating_hits']),
|
||||
'pp_rating_value' => intval($member['pp_rating_value']),
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
|
||||
}
|
||||
|
||||
$member['pp_rating_real'] = round( $member['pp_rating_value'] / $member['pp_rating_hits'] );
|
||||
|
||||
$return = array(
|
||||
'rating' => $member['pp_rating_value'],
|
||||
'total' => $member['pp_rating_real'],
|
||||
'average' => $member['pp_rating_real'],
|
||||
'rated' => $type
|
||||
);
|
||||
|
||||
$this->outputResult( $return, $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to make hooking into file easier
|
||||
*
|
||||
* @param array Data to return
|
||||
* @param array Member data
|
||||
* @return @e void
|
||||
*/
|
||||
protected function outputResult( $return, $member )
|
||||
{
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_rate extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rating_id = intval($this->request['rating']);
|
||||
$rating_id = $rating_id > 5 ? 5 : $rating_id;
|
||||
$rating_id = $rating_id < 0 ? 0 : $rating_id;
|
||||
$member_id = intval($this->request['member_id']);
|
||||
$member = array();
|
||||
$type = 'new';
|
||||
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$error = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->settings['pp_allow_member_rate'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
if ( ! $member_id OR ! $this->memberData['member_id'] OR $member_id == $this->memberData['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5_check != $this->member->form_hash )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm3';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm4';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Have we already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
$rating = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'profile_ratings',
|
||||
'where' => "rating_for_member_id={$member_id} AND rating_by_member_id=" . $this->memberData['member_id'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating['rating_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we allow re-ratings?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating_id != $rating['rating_value'] )
|
||||
{
|
||||
$member['pp_rating_value'] = intval( $member['pp_rating_value'] );
|
||||
$member['pp_rating_value'] = ( $member['pp_rating_value'] + $rating_id ) - $rating['rating_value'];
|
||||
|
||||
$this->DB->update( 'profile_ratings', array( 'rating_value' => $rating_id ), 'rating_id=' . $rating['rating_id'] );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_value' => $member['pp_rating_value'],
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
$type = 'update';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// NEW RATING!
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$member['pp_rating_value'] = intval($member['pp_rating_value']) + $rating_id;
|
||||
$member['pp_rating_hits'] = intval($member['pp_rating_hits']) + 1;
|
||||
|
||||
$this->DB->insert( 'profile_ratings', array( 'rating_for_member_id' => $member_id,
|
||||
'rating_by_member_id' => $this->memberData['member_id'],
|
||||
'rating_value' => $rating_id,
|
||||
'rating_ip_address' => $this->member->ip_address ) );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_hits' => intval($member['pp_rating_hits']),
|
||||
'pp_rating_value' => intval($member['pp_rating_value']),
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
|
||||
}
|
||||
|
||||
$member['pp_rating_real'] = round( $member['pp_rating_value'] / $member['pp_rating_hits'] );
|
||||
|
||||
$return = array(
|
||||
'rating' => $member['pp_rating_value'],
|
||||
'total' => $member['pp_rating_real'],
|
||||
'average' => $member['pp_rating_real'],
|
||||
'rated' => $type
|
||||
);
|
||||
|
||||
$this->outputResult( $return, $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to make hooking into file easier
|
||||
*
|
||||
* @param array Data to return
|
||||
* @param array Member data
|
||||
* @return @e void
|
||||
*/
|
||||
protected function outputResult( $return, $member )
|
||||
{
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
}
|
||||
@@ -1,381 +1,379 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Allow user to change their status
|
||||
* Last Updated: $Date: 2011-07-05 09:10:56 -0400 (Tue, 05 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @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: 9154 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_members_ajax_status extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* WHAT R WE DOING? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'new':
|
||||
$this->_new();
|
||||
break;
|
||||
case 'reply':
|
||||
$this->_reply();
|
||||
break;
|
||||
case 'showall':
|
||||
$this->_showAll();
|
||||
break;
|
||||
case 'deleteStatus':
|
||||
$this->_deleteStatus();
|
||||
break;
|
||||
case 'deleteReply':
|
||||
$this->_deleteReply();
|
||||
break;
|
||||
case 'lockStatus':
|
||||
$this->_lockStatus();
|
||||
break;
|
||||
case 'unlockStatus':
|
||||
$this->_unlockStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requested skin group
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function getSkinGroup()
|
||||
{
|
||||
return ( !in_array( $this->request['skin_group'], array('boards', 'profile') ) ) ? 'profile' : $this->request['skin_group'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showAll()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$st = intval( $this->request['st'] );
|
||||
|
||||
$skin_group = $this->getSkinGroup();
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* And the number of replies */
|
||||
$statusData = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
/* Fetch */
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'status_replies' => $statusData['status_replies'] + 1, 'html' => $this->cleanOutput( $this->registry->getClass('output')->getTemplate( $skin_group )->statusReplies( $this->registry->getClass('memberStatus')->fetchAllReplies() ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _lockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canLockStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->lockStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _unlockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canUnlockStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->unlockStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _deleteStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _deleteReply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$reply_id = intval( $this->request['reply_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $reply_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
$this->registry->getClass('memberStatus')->setReplyData( $reply_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteReply() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteReply();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _reply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$comment = $this->convertAndMakeSafe( $_POST['content'] );
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
$skin_group = $this->getSkinGroup();
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $comment )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_no_reply'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( $comment );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canReply() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_no_reply'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->reply();
|
||||
|
||||
/* Now grab the reply and return it */
|
||||
$reply = $this->registry->getClass('output')->getTemplate( $skin_group )->statusReplies( $this->registry->getClass('memberStatus')->fetchAllReplies( $status_id, array( 'sort_dir' => 'desc', 'limit' => 1 ) ) );
|
||||
|
||||
/* And the number of replies */
|
||||
$statusData = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'html' => $this->cleanOutput( $reply ), 'status_replies' => $statusData['status_replies'] + 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _new()
|
||||
{
|
||||
IPSDebug::fireBug( 'info', array( 'Status content: ' . $_POST['content'] ) );
|
||||
IPSDebug::fireBug( 'info', array( 'Cleaned status: ' . trim( $this->convertAndMakeSafe( $_POST['content'] ) ) ) );
|
||||
|
||||
/* INIT */
|
||||
$smallSpace = intval( $this->request['smallSpace'] );
|
||||
$su_Twitter = intval( $this->request['su_Twitter'] );
|
||||
$su_Facebook = intval( $this->request['su_Facebook'] );
|
||||
$skin_group = $this->getSkinGroup();
|
||||
$forMemberId = intval( $this->request['forMemberId'] );
|
||||
|
||||
/* Got content? */
|
||||
if( !trim( $this->convertAndMakeSafe( str_replace( array( ' ', ' ' ), '', $_POST['content'] ) ) ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_status_sent'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( trim( $this->convertAndMakeSafe( $_POST['content'] ) ) );
|
||||
|
||||
/* Can we create? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update or comment? */
|
||||
if ( $forMemberId && $forMemberId != $this->memberData['member_id'] )
|
||||
{
|
||||
$owner = IPSMember::load( $forMemberId );
|
||||
|
||||
if ( ! $owner['pp_setting_count_comments'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set owner */
|
||||
$this->registry->getClass('memberStatus')->setStatusOwner( $owner );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set post outs */
|
||||
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$newStatus = $this->registry->getClass('memberStatus')->create();
|
||||
|
||||
/* Now grab the reply and return it */
|
||||
$new = $this->registry->getClass('output')->getTemplate( $skin_group )->statusUpdates( $this->registry->getClass('memberStatus')->fetch( $this->memberData['member_id'], array( 'relatedTo' => $member['member_id'], 'isApproved' => true, 'sort_dir' => 'desc', 'limit' => 1 ) ), $smallSpace );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'html' => $this->cleanOutput( $new ) ) );
|
||||
|
||||
exit;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Allow user to change their status
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_status extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* WHAT R WE DOING? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'new':
|
||||
$this->_new();
|
||||
break;
|
||||
case 'reply':
|
||||
$this->_reply();
|
||||
break;
|
||||
case 'showall':
|
||||
$this->_showAll();
|
||||
break;
|
||||
case 'deleteStatus':
|
||||
$this->_deleteStatus();
|
||||
break;
|
||||
case 'deleteReply':
|
||||
$this->_deleteReply();
|
||||
break;
|
||||
case 'lockStatus':
|
||||
$this->_lockStatus();
|
||||
break;
|
||||
case 'unlockStatus':
|
||||
$this->_unlockStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requested skin group
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function getSkinGroup()
|
||||
{
|
||||
return ( !in_array( $this->request['skin_group'], array('boards', 'profile') ) ) ? 'profile' : $this->request['skin_group'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _showAll()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$st = intval( $this->request['st'] );
|
||||
|
||||
$skin_group = $this->getSkinGroup();
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* And the number of replies */
|
||||
$statusData = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
/* Fetch */
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'status_replies' => $statusData['status_replies'] + 1, 'html' => $this->cleanOutput( $this->registry->getClass('output')->getTemplate( $skin_group )->statusReplies( $this->registry->getClass('memberStatus')->fetchAllReplies() ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _lockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canLockStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->lockStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _unlockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canUnlockStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->unlockStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _deleteStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteStatus();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _deleteReply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$reply_id = intval( $this->request['reply_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $reply_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
$this->registry->getClass('memberStatus')->setReplyData( $reply_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteReply() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteReply();
|
||||
|
||||
/* Success? */
|
||||
$this->returnJsonArray( array( 'status' => 'success' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _reply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$comment = $this->convertAndMakeSafe( $_POST['content'] );
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
$skin_group = $this->getSkinGroup();
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $comment )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_no_reply'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( $comment );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canReply() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_no_reply'] );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->reply();
|
||||
|
||||
/* Now grab the reply and return it */
|
||||
$reply = $this->registry->getClass('output')->getTemplate( $skin_group )->statusReplies( $this->registry->getClass('memberStatus')->fetchAllReplies( $status_id, array( 'sort_dir' => 'desc', 'limit' => 1 ) ) );
|
||||
|
||||
/* And the number of replies */
|
||||
$statusData = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'html' => $this->cleanOutput( $reply ), 'status_replies' => $statusData['status_replies'] + 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new statussesses
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _new()
|
||||
{
|
||||
IPSDebug::fireBug( 'info', array( 'Status content: ' . $_POST['content'] ) );
|
||||
IPSDebug::fireBug( 'info', array( 'Cleaned status: ' . trim( $this->convertAndMakeSafe( $_POST['content'] ) ) ) );
|
||||
|
||||
/* INIT */
|
||||
$smallSpace = intval( $this->request['smallSpace'] );
|
||||
$su_Twitter = intval( $this->request['su_Twitter'] );
|
||||
$su_Facebook = intval( $this->request['su_Facebook'] );
|
||||
$skin_group = $this->getSkinGroup();
|
||||
$forMemberId = intval( $this->request['forMemberId'] );
|
||||
|
||||
/* Got content? */
|
||||
if( !trim( $this->convertAndMakeSafe( str_replace( array( ' ', ' ' ), '', $_POST['content'] ) ) ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_status_sent'] );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( trim( $this->convertAndMakeSafe( $_POST['content'] ) ) );
|
||||
|
||||
/* Can we create? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Update or comment? */
|
||||
if ( $forMemberId && $forMemberId != $this->memberData['member_id'] )
|
||||
{
|
||||
$owner = IPSMember::load( $forMemberId );
|
||||
|
||||
if ( ! $owner['pp_setting_count_comments'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
/* Set owner */
|
||||
$this->registry->getClass('memberStatus')->setStatusOwner( $owner );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set post outs */
|
||||
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$newStatus = $this->registry->getClass('memberStatus')->create();
|
||||
|
||||
/* Now grab the reply and return it */
|
||||
$new = $this->registry->getClass('output')->getTemplate( $skin_group )->statusUpdates( $this->registry->getClass('memberStatus')->fetch( $this->memberData['member_id'], array( 'relatedTo' => $forMemberId, 'isApproved' => true, 'sort_dir' => 'desc', 'limit' => 1 ) ), $smallSpace );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'html' => $this->cleanOutput( $new ) ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* @file warnings.php Warning Log Details Popup AJAX
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: AndyMillne $ (Original: Mark)
|
||||
* @since 9 Nov 2011
|
||||
* $LastChangedDate: 2012-06-19 08:37:02 -0400 (Tue, 19 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10947 $
|
||||
*/
|
||||
|
||||
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_members_ajax_warnings
|
||||
* @brief Warning Log Details Popup AJAX
|
||||
*/
|
||||
class public_members_ajax_warnings extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
switch ( $this->request['do'] )
|
||||
{
|
||||
case 'form':
|
||||
$this->getActionsForForm();
|
||||
break;
|
||||
|
||||
case 'explain_points':
|
||||
$this->explainPoints();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->showLog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: Get actions for warning form
|
||||
*/
|
||||
public function getActionsForForm()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
$manuallySetPoints = TRUE;
|
||||
$setPoints = '';
|
||||
$allowCustomPunishment = $this->settings['warning_custom_noaction'];
|
||||
$setPunishment = $this->lang->words['warnings_verbal_only'];
|
||||
$mq = 0;
|
||||
$mq_unit = 'd';
|
||||
$rpa = 0;
|
||||
$rpa_unit = 'd';
|
||||
$suspend = 0;
|
||||
$suspend_unit = 'd';
|
||||
$banGroup = FALSE;
|
||||
$allowCustomRemovePoints = TRUE;
|
||||
$removePoints = '';
|
||||
$removePointsUnit = 'd';
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch reason
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $id != 0 )
|
||||
{
|
||||
$reason = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}" ) );
|
||||
|
||||
$manuallySetPoints = $reason['wr_points_override'];
|
||||
$setPoints = ( is_numeric($this->request['points']) ) ? intval( $this->request['points'] ) : $reason['wr_points'];
|
||||
|
||||
$removePoints = $reason['wr_remove'];
|
||||
$removePointsUnit = $reason['wr_remove_unit'];
|
||||
$allowCustomRemovePoints = $reason['wr_remove_override'];
|
||||
}
|
||||
elseif ( $this->request['points'] !== '' )
|
||||
{
|
||||
$setPoints = $this->request['points'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load Member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( intval( $this->request['member'] ) );
|
||||
if ( !$member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError("NO_MEMBER");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Are they already being punished?
|
||||
//-----------------------------------------
|
||||
|
||||
$currentPunishments = array();
|
||||
foreach ( array( 'mq' => 'mod_posts', 'rpa' => 'restrict_post', 'suspend' => 'temp_ban' ) as $k => $mk )
|
||||
{
|
||||
if ( $member[ $mk ] )
|
||||
{
|
||||
if ( $member[ $mk ] == 1 )
|
||||
{
|
||||
$currentPunishments[ $k ] = sprintf( $this->lang->words['warnings_already_'.$k.'_perm'], $member['members_display_name'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_processed = IPSMember::processBanEntry( $member[ $mk ] );
|
||||
$currentPunishments[ $k ] = sprintf( $this->lang->words['warnings_already_'.$k.'_time'], $member['members_display_name'], $this->lang->getDate( $_processed['date_end'], 'SHORT' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Okay, so do we have an action here?
|
||||
//-----------------------------------------
|
||||
|
||||
$newPointLevel = floatval( $member['warn_level'] + $setPoints );
|
||||
$action = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_points<={$newPointLevel}", 'order' => 'wa_points DESC', 'limit' => 1 ) );
|
||||
if ( $action )
|
||||
{
|
||||
$setPunishment = array();
|
||||
foreach ( array( 'mq', 'rpa', 'suspend' ) as $k )
|
||||
{
|
||||
if ( $action[ 'wa_' . $k ] )
|
||||
{
|
||||
if ( $action[ 'wa_' . $k ] == -1 )
|
||||
{
|
||||
$text = sprintf( $this->lang->words[ 'warnings_' . $k ], $this->lang->words['warnings_permanently'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = sprintf( $this->lang->words[ 'warnings_' . $k ], sprintf( $this->lang->words['warnings_for'], $action[ 'wa_' . $k ], $this->lang->words[ 'warnings_time_' . $action[ 'wa_' . $k . '_unit' ] ] ) );
|
||||
}
|
||||
|
||||
if ( $currentPunishments[ $k ] )
|
||||
{
|
||||
$text .= " <span class='error'>{$currentPunishments[ $k ]}{$this->lang->words['warnings_already_autochange']}</span>";
|
||||
}
|
||||
|
||||
$setPunishment[] = $text;
|
||||
}
|
||||
}
|
||||
$setPunishment = empty( $setPunishment ) ? $this->lang->words['warnings_verbal_only'] : implode( '<br />', $setPunishment );
|
||||
|
||||
$allowCustomPunishment = $action['wa_override'];
|
||||
|
||||
$mq = $action['wa_mq'];
|
||||
$mq_unit = $action['wa_mq_unit'];
|
||||
$rpa = $action['wa_rpa'];
|
||||
$rpa_unit = $action['wa_rpa_unit'];
|
||||
$suspend = $action['wa_suspend'];
|
||||
$suspend_unit = $action['wa_suspend_unit'];
|
||||
$banGroup = $action['wa_ban_group'];
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array(
|
||||
'id' => $id,
|
||||
'manuallySetPoints' => $this->memberData['g_access_cp'] ? TRUE : $manuallySetPoints,
|
||||
'setPoints' => $setPoints,
|
||||
'allowCustomPunishment' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomPunishment,
|
||||
'setPunishment' => $setPunishment,
|
||||
'allowCustomRemovePoints' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomRemovePoints,
|
||||
'removePoints' => $removePoints,
|
||||
'removePointsUnit' => $removePointsUnit,
|
||||
'mq' => $mq,
|
||||
'mq_unit' => $mq_unit,
|
||||
'rpa' => $rpa,
|
||||
'rpa_unit' => $rpa_unit,
|
||||
'suspend' => $suspend,
|
||||
'suspend_unit' => $suspend_unit,
|
||||
'banGroup' => $banGroup,
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: Explain Points
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function explainPoints()
|
||||
{
|
||||
/* Init vars */
|
||||
$reasons = array();
|
||||
$actions = array();
|
||||
|
||||
/* Load data from DB */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_reasons', 'order' => 'wr_order' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$reasons[ $row['wr_id'] ] = $row;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_actions', 'order' => 'wa_points ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$actions[ $row['wa_id'] ] = $row;
|
||||
}
|
||||
|
||||
$this->returnHtml( $this->registry->output->getTemplate('profile')->explainPoints( $reasons, $actions ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: Show Log Popup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function showLog()
|
||||
{
|
||||
/* Load it */
|
||||
$id = intval( $this->request['id'] );
|
||||
$warning = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_id={$id}" ) );
|
||||
|
||||
if ( !$warning['wl_id'] )
|
||||
{
|
||||
$this->returnJsonError("NO_LOG");
|
||||
}
|
||||
|
||||
/* Can we view it? */
|
||||
$canSeeModNote = FALSE;
|
||||
|
||||
if ( $this->memberData['g_is_supmod'] or $this->memberData['is_mod'] )
|
||||
{
|
||||
$canSeeModNote = TRUE;
|
||||
}
|
||||
elseif ( ! $this->settings['warn_show_own'] OR $this->memberData['member_id'] != $warning['wl_member'] )
|
||||
{
|
||||
$this->returnJsonError("NO_PERMISSION");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse
|
||||
//-----------------------------------------
|
||||
|
||||
/* Reason */
|
||||
if ( $warning['wl_reason'] )
|
||||
{
|
||||
$reason = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => 'wr_id=' . intval( $warning['wl_reason'] ) ) );
|
||||
$warning['wl_reason'] = $reason['wr_name'];
|
||||
}
|
||||
if ( !$warning['wl_reason'] )
|
||||
{
|
||||
$warning['wl_reason'] = $this->lang->words['warnings_reasons_other'];
|
||||
}
|
||||
|
||||
/* Moderator */
|
||||
$warning['wl_moderator'] = IPSMember::load( $warning['wl_moderator'] );
|
||||
|
||||
/* Content */
|
||||
$warning['content'] = "<em>{$this->lang->words['warnings_content_unknown']}</em>";
|
||||
|
||||
if ( $warning['wl_content_app'] and IPSLib::appIsInstalled( $warning['wl_content_app'] ) )
|
||||
{
|
||||
$file = IPSLib::getAppDir( $warning['wl_content_app'] ) . '/extensions/warnings.php';
|
||||
|
||||
if ( is_file( $file ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file, 'warnings_' . $warning['wl_content_app'], $warning['wl_content_app'] );
|
||||
|
||||
if ( class_exists( $classToLoad ) and method_exists( $classToLoad, 'getContentUrl' ) )
|
||||
{
|
||||
$object = new $classToLoad();
|
||||
$content = $object->getContentUrl( $warning );
|
||||
|
||||
if ( !is_null( $content ) )
|
||||
{
|
||||
$warning['content'] = "<a href='{$content['url']}'>{$content['title']}</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Notes */
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'warn';
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $warning['wl_moderator']['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $warning['wl_moderator']['mgroup_others'];
|
||||
|
||||
$warning['wl_note_member'] = IPSText::getTextClass('bbcode')->preDisplayParse( $warning['wl_note_member'] );
|
||||
$warning['wl_note_mods'] = IPSText::getTextClass('bbcode')->preDisplayParse( $warning['wl_note_mods'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Display
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $this->registry->output->getTemplate('global')->warnDetails( $warning, $canSeeModNote ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'list' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'messaging' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,75 +1,75 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Mark a private message as read
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Thurs 7th Jan 2010
|
||||
* @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_members_messaging_markasread extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$_ajax = intval($this->request['ajax']);
|
||||
$topic = intval($this->request['topicID']);
|
||||
|
||||
if( !$topic )
|
||||
{
|
||||
$this->endReturn( $_ajax );
|
||||
}
|
||||
|
||||
$_className = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
|
||||
$_messenger = new $_className( $this->registry );
|
||||
$_messenger->toggleReadStatus( $this->memberData['member_id'], array( $topic ), true );
|
||||
|
||||
$this->endReturn( $_ajax );
|
||||
}
|
||||
|
||||
/**
|
||||
* All done, return
|
||||
*
|
||||
* @param int AJAX result
|
||||
* @return @e void
|
||||
*/
|
||||
public function endReturn( $_ajax )
|
||||
{
|
||||
if( !$_ajax )
|
||||
{
|
||||
$_returnTo = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $this->settings['base_url'];
|
||||
|
||||
$this->registry->output->silentRedirect( $_returnTo );
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'ok';
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Mark a private message as read
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Thurs 7th Jan 2010
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_messaging_markasread extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$_ajax = intval($this->request['ajax']);
|
||||
$topic = intval($this->request['topicID']);
|
||||
|
||||
if( !$topic )
|
||||
{
|
||||
$this->endReturn( $_ajax );
|
||||
}
|
||||
|
||||
$_className = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
|
||||
$_messenger = new $_className( $this->registry );
|
||||
$_messenger->toggleReadStatus( $this->memberData['member_id'], array( $topic ), true );
|
||||
|
||||
$this->endReturn( $_ajax );
|
||||
}
|
||||
|
||||
/**
|
||||
* All done, return
|
||||
*
|
||||
* @param int AJAX result
|
||||
* @return @e void
|
||||
*/
|
||||
public function endReturn( $_ajax )
|
||||
{
|
||||
if( !$_ajax )
|
||||
{
|
||||
$_returnTo = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $this->settings['base_url'];
|
||||
|
||||
$this->registry->output->silentRedirect( $_returnTo );
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'ok';
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -1,212 +1,212 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Online list
|
||||
* 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 12th March 2002
|
||||
* @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_members_messaging_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_title;
|
||||
|
||||
/**
|
||||
* Navigation entries
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_navigation;
|
||||
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $messengerFunctions;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $_errorString = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check viewing permissions, etc
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_use_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228, null, null, 403 );
|
||||
}
|
||||
|
||||
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227.1, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Language
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_messaging' ), 'members' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab class
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messengerFunctions = new $classToLoad( $registry );
|
||||
|
||||
/* Messenger Totals */
|
||||
$totals = $this->messengerFunctions->buildMessageTotals();
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'search':
|
||||
$html = $this->_search();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have any HTML to print, do so...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $totals, $this->_topicParticipants, $this->_errorString ) );
|
||||
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
|
||||
|
||||
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&module=messaging' );
|
||||
|
||||
if ( is_array( $this->_navigation ) AND count( $this->_navigation ) )
|
||||
{
|
||||
foreach( $this->_navigation as $idx => $data )
|
||||
{
|
||||
$this->registry->output->addNavigation( $data[0], $data[1] );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search. Do it.
|
||||
*
|
||||
* @param string Any error text
|
||||
* @return string returns HTML
|
||||
*/
|
||||
protected function _search( $error='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']);
|
||||
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
|
||||
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
|
||||
$searchIn = '';
|
||||
|
||||
/* Got an error? */
|
||||
if ( $error )
|
||||
{
|
||||
$this->_errorString = $error;
|
||||
}
|
||||
|
||||
/* Search for owt? */
|
||||
if( ! $searchFor_TAINTED )
|
||||
{
|
||||
$error = $this->lang->words['search_convo_no_keywords'];
|
||||
}
|
||||
else if( ( $this->settings['min_search_word'] && strlen( $searchFor_TAINTED ) < $this->settings['min_search_word'] ) )
|
||||
{
|
||||
$error = sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] );
|
||||
}
|
||||
/* Do the search */
|
||||
else
|
||||
{
|
||||
$searchResults = $this->messengerFunctions->searchMessages( $this->memberData['member_id'], $searchFor_TAINTED, $start, $p_end, array() );
|
||||
$totalMsg = $searchResults['totalMatches'];
|
||||
$messages = $searchResults['results'];
|
||||
|
||||
/* Got anything? */
|
||||
if ( ! $totalMsg OR ( ! count( $messages ) ) )
|
||||
{
|
||||
$error = $this->lang->words['search_convo_no_results'];
|
||||
}
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Generate Pagination
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $totalMsg,
|
||||
'itemsPerPage' => $p_end,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => "app=members&module=messaging&section=search&do=search&searchFor=" . urlencode( $searchFor_TAINTED ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set title
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_title = $this->lang->words['t_welcome'] . $this->lang->words['search_results_pt'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Set navigation
|
||||
//-----------------------------------------
|
||||
|
||||
//$this->_navigation[] = array( $this->messengerFunctions->_dirData[ $this->messengerFunctions->_currentFolderID ]['real'], $this->settings['base_url']."app=members&module=messaging&section=view&do=showFolder&folderID=".$this->messengerFunctions->_currentFolderID."&sort=".$this->request['sort'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Done...
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('messaging')->showSearchResults( $messages, $pages, $error );
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Online list
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_messaging_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_title;
|
||||
|
||||
/**
|
||||
* Navigation entries
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_navigation;
|
||||
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $messengerFunctions;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $_errorString = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check viewing permissions, etc
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_use_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10228, null, null, 403 );
|
||||
}
|
||||
|
||||
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227.1, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Language
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_messaging' ), 'members' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab class
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messengerFunctions = new $classToLoad( $registry );
|
||||
|
||||
/* Messenger Totals */
|
||||
$totals = $this->messengerFunctions->buildMessageTotals();
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'search':
|
||||
$html = $this->_search();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have any HTML to print, do so...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $totals, $this->_topicParticipants, $this->_errorString ) );
|
||||
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
|
||||
|
||||
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&module=messaging' );
|
||||
|
||||
if ( is_array( $this->_navigation ) AND count( $this->_navigation ) )
|
||||
{
|
||||
foreach( $this->_navigation as $idx => $data )
|
||||
{
|
||||
$this->registry->output->addNavigation( $data[0], $data[1] );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search. Do it.
|
||||
*
|
||||
* @param string Any error text
|
||||
* @return string returns HTML
|
||||
*/
|
||||
protected function _search( $error='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$start = intval($this->request['st']);
|
||||
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
|
||||
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
|
||||
$searchIn = '';
|
||||
|
||||
/* Got an error? */
|
||||
if ( $error )
|
||||
{
|
||||
$this->_errorString = $error;
|
||||
}
|
||||
|
||||
/* Search for owt? */
|
||||
if( ! $searchFor_TAINTED )
|
||||
{
|
||||
$error = $this->lang->words['search_convo_no_keywords'];
|
||||
}
|
||||
else if( ( $this->settings['min_search_word'] && strlen( $searchFor_TAINTED ) < $this->settings['min_search_word'] ) )
|
||||
{
|
||||
$error = sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] );
|
||||
}
|
||||
/* Do the search */
|
||||
else
|
||||
{
|
||||
$searchResults = $this->messengerFunctions->searchMessages( $this->memberData['member_id'], $searchFor_TAINTED, $start, $p_end, array() );
|
||||
$totalMsg = $searchResults['totalMatches'];
|
||||
$messages = $searchResults['results'];
|
||||
|
||||
/* Got anything? */
|
||||
if ( ! $totalMsg OR ( ! count( $messages ) ) )
|
||||
{
|
||||
$error = $this->lang->words['search_convo_no_results'];
|
||||
}
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Generate Pagination
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $totalMsg,
|
||||
'itemsPerPage' => $p_end,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => "app=members&module=messaging&section=search&do=search&searchFor=" . urlencode( $searchFor_TAINTED ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set title
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_title = $this->lang->words['t_welcome'] . ' ' . $this->lang->words['search_results_pt'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Set navigation
|
||||
//-----------------------------------------
|
||||
|
||||
//$this->_navigation[] = array( $this->messengerFunctions->_dirData[ $this->messengerFunctions->_currentFolderID ]['real'], $this->settings['base_url']."app=members&module=messaging&section=view&do=showFolder&folderID=".$this->messengerFunctions->_currentFolderID."&sort=".$this->request['sort'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Done...
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('messaging')->showSearchResults( $messages, $pages, $error );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'online' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,316 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Online list
|
||||
* Last Updated: $Date: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since 12th March 2002
|
||||
* @version $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_members_online_online extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Temporary stored output HTML
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $output;
|
||||
|
||||
/**
|
||||
* DB result start point
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $first = 0;
|
||||
|
||||
/**
|
||||
* DB number of rows to pull
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $perpage = 25;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Are we allowed to see the online list?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->settings['allow_online_list'] )
|
||||
{
|
||||
$this->registry->output->showError( 'onlinelist_disabled', 10230 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init, lang, html
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['st'] = intval( $this->request['st'] >= 0 ? intval($this->request['st']) : 0 );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_online' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'listall':
|
||||
default:
|
||||
$this->_listAll();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have any HTML to print, do so...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->setTitle( $this->lang->words['online_page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
|
||||
$this->registry->output->addNavigation( $this->lang->words['online_page_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the online list
|
||||
*
|
||||
* @return @e void [Stores HTML in $this->output]
|
||||
*/
|
||||
protected function _listAll()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->first = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0;
|
||||
$final = array();
|
||||
$_errors = array();
|
||||
$modules = array();
|
||||
$memberIDs = array();
|
||||
|
||||
if ( !$this->settings['au_cutoff'] )
|
||||
{
|
||||
$this->settings[ 'au_cutoff'] = 15 ;
|
||||
}
|
||||
|
||||
$defaults = array(
|
||||
'show_mem' => ( $this->request['show_mem'] AND in_array( $this->request['show_mem'], array( 'reg', 'guest', 'all' ) ) ) ? $this->request['show_mem'] : 'all',
|
||||
'sort_order' => ( $this->request['sort_order'] AND in_array( $this->request['sort_order'], array( 'desc', 'asc' ) ) ) ? $this->request['sort_order'] : 'asc',
|
||||
'sort_key' => ( $this->request['sort_key'] AND in_array( $this->request['sort_key'], array( 'click', 'name' ) ) ) ? $this->request['sort_key'] : 'click',
|
||||
);
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort the db query
|
||||
//-----------------------------------------
|
||||
|
||||
$cut_off = $this->settings['au_cutoff'] * 60;
|
||||
$t_time = time() - $cut_off;
|
||||
|
||||
$db_order = $defaults['sort_order'] == 'asc' ? 'asc' : 'desc';
|
||||
$db_key = $defaults['sort_key'] == 'click' ? 'running_time' : 'member_name';
|
||||
$wheres = array( 'running_time > ' . $t_time );
|
||||
|
||||
switch ( $defaults['show_mem'] )
|
||||
{
|
||||
case 'reg':
|
||||
$wheres[] = "member_id > 0";
|
||||
$wheres[] = "member_group != " . $this->settings['guest_group'];
|
||||
break;
|
||||
case 'guest':
|
||||
$wheres[] = "member_group = " . $this->settings['guest_group'];
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! $this->settings['spider_active'] AND ! $this->memberData['g_access_cp'] )
|
||||
{
|
||||
$wheres[] = $this->DB->buildRight( 'id', 8 ) . " != '_session'";
|
||||
}
|
||||
|
||||
if ( ! $this->settings['disable_anonymous'] AND !$this->memberData['g_access_cp'] )
|
||||
{
|
||||
$wheres[] = "login_type != 1";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab all the current sessions.
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'sessions',
|
||||
'where' => implode( ' AND ', $wheres ),
|
||||
'calcRows' => TRUE,
|
||||
'order' => $db_key . ' ' . $db_order,
|
||||
'limit' => array( $this->first, $this->perpage ) ) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
$max = $this->DB->fetchCalculatedRows();
|
||||
|
||||
if ( ! $this->DB->getTotalRows($outer) && $this->first > 0 )
|
||||
{
|
||||
// We are request page 2 - but there is no page 2 now...
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."app=members&section=online&module=online&sortkey={$defaults['sort_key']}&show_mem={$defaults['show_mem']}&sort_order={$defaults['sort_order']}" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Put results into array
|
||||
//-----------------------------------------
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
if ( strstr( $r['id'], '_session' ) )
|
||||
{
|
||||
$r['is_bot'] = 1;
|
||||
}
|
||||
|
||||
$r['where_line'] = '';
|
||||
$r['where_link'] = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Sessions aren't updated until shutdown
|
||||
// so reset our session now
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->memberData['member_id'] AND $r['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
$r['current_appcomponent'] = 'members';
|
||||
$r['current_module'] = 'online';
|
||||
$r['current_section'] = 'online';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $r['member_id'] )
|
||||
{
|
||||
$memberIDs[] = $r['member_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Don't parse if in an error
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['in_error'] )
|
||||
{
|
||||
$_errors[ $r['id'] ] = $r;
|
||||
}
|
||||
else
|
||||
{
|
||||
$final[ $r['id'] ] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Module?
|
||||
//-----------------------------------------
|
||||
|
||||
$modules[ $r['current_section'] ] = array( 'app' => $r['current_appcomponent'] );
|
||||
}
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $max,
|
||||
'itemsPerPage' => $this->perpage,
|
||||
'currentStartValue' => $this->first,
|
||||
'baseUrl' => "app=members&section=online&module=online&sort_key={$defaults['sort_key']}&sort_order={$defaults['sort_order']}&show_mem={$defaults['show_mem']}"
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass off entries to modules..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $modules ) )
|
||||
{
|
||||
foreach( $modules as $module_array )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( $module_array['app'] ) )
|
||||
{
|
||||
$module_array['app'] = IPSText::alphanumericalClean($module_array['app']);
|
||||
|
||||
$filename = IPSLib::getAppDir( $module_array['app'] ) . '/extensions/coreExtensions.php';
|
||||
|
||||
if ( is_file( $filename ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $filename, 'publicSessions__' . $module_array['app'], $module_array['app'] );
|
||||
$loader = new $classToLoad();
|
||||
|
||||
if( method_exists( $loader, 'parseOnlineEntries' ) )
|
||||
{
|
||||
$final = $loader->parseOnlineEntries( $final );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$final = array_merge( $final, $_errors );
|
||||
|
||||
//-----------------------------------------
|
||||
// Finally, members...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $memberIDs ) )
|
||||
{
|
||||
$members = IPSMember::load( $memberIDs, 'all' );
|
||||
}
|
||||
|
||||
$newFinal = array();
|
||||
|
||||
if( is_array($final) AND count($final) )
|
||||
{
|
||||
foreach( $final as $id => $data )
|
||||
{
|
||||
if ( $data['member_id'] )
|
||||
{
|
||||
$newFinal[ 'member-' . $data['member_id'] ] = $data;
|
||||
$newFinal[ 'member-' . $data['member_id'] ]['memberData'] = $members[ $data['member_id'] ];
|
||||
$newFinal[ 'member-' . $data['member_id'] ]['_memberData'] = IPSMember::buildProfilePhoto( $members[ $data['member_id'] ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$newFinal[ $data['id'] ] = $data;
|
||||
$newFinal[ $data['id'] ]['memberData'] = array();
|
||||
$newFinal[ $data['id'] ]['_memberData'] = IPSMember::buildProfilePhoto( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set defaults
|
||||
//-----------------------------------------
|
||||
|
||||
foreach ( array( 'sort_key', 'sort_order', 'show_mem' ) as $k )
|
||||
{
|
||||
if ( !$this->request[ $k ] )
|
||||
{
|
||||
$this->request[ $k ] = $defaults[ $k ];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('online')->showOnlineList( $newFinal, $links, $defaults );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Online list
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_online_online extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Temporary stored output HTML
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $output;
|
||||
|
||||
/**
|
||||
* DB result start point
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $first = 0;
|
||||
|
||||
/**
|
||||
* DB number of rows to pull
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $perpage = 25;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Are we allowed to see the online list?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->settings['allow_online_list'] )
|
||||
{
|
||||
$this->registry->output->showError( 'onlinelist_disabled', 10230 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Init, lang, html
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['st'] = intval( $this->request['st'] >= 0 ? intval($this->request['st']) : 0 );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_online' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'listall':
|
||||
default:
|
||||
$this->_listAll();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have any HTML to print, do so...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->output );
|
||||
$this->registry->output->setTitle( $this->lang->words['online_page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
|
||||
$this->registry->output->addNavigation( $this->lang->words['online_page_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the online list
|
||||
*
|
||||
* @return @e void [Stores HTML in $this->output]
|
||||
*/
|
||||
protected function _listAll()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->first = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0;
|
||||
$final = array();
|
||||
$modules = array();
|
||||
$memberIDs = array();
|
||||
|
||||
if ( !$this->settings['au_cutoff'] )
|
||||
{
|
||||
$this->settings[ 'au_cutoff'] = 15 ;
|
||||
}
|
||||
|
||||
$defaults = array(
|
||||
'show_mem' => ( $this->request['show_mem'] AND in_array( $this->request['show_mem'], array( 'reg', 'guest', 'all' ) ) ) ? $this->request['show_mem'] : 'all',
|
||||
'sort_order' => ( $this->request['sort_order'] AND in_array( $this->request['sort_order'], array( 'desc', 'asc' ) ) ) ? $this->request['sort_order'] : 'asc',
|
||||
'sort_key' => ( $this->request['sort_key'] AND in_array( $this->request['sort_key'], array( 'click', 'name' ) ) ) ? $this->request['sort_key'] : 'click',
|
||||
);
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort the db query
|
||||
//-----------------------------------------
|
||||
|
||||
$cut_off = $this->settings['au_cutoff'] * 60;
|
||||
$t_time = time() - $cut_off;
|
||||
|
||||
$db_order = $defaults['sort_order'] == 'asc' ? 'asc' : 'desc';
|
||||
$db_key = $defaults['sort_key'] == 'click' ? 'running_time' : 'member_name';
|
||||
$wheres = array( 'running_time > ' . $t_time );
|
||||
|
||||
switch ( $defaults['show_mem'] )
|
||||
{
|
||||
case 'reg':
|
||||
$wheres[] = "member_id > 0";
|
||||
$wheres[] = "member_group != " . $this->settings['guest_group'];
|
||||
break;
|
||||
case 'guest':
|
||||
$wheres[] = "member_group = " . $this->settings['guest_group'];
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! $this->settings['spider_active'] AND ! $this->memberData['g_access_cp'] )
|
||||
{
|
||||
$wheres[] = $this->DB->buildRight( 'id', 8 ) . " != '_session'";
|
||||
}
|
||||
|
||||
if ( !$this->memberData['g_access_cp'] )
|
||||
{
|
||||
$wheres[] = "login_type != 1";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab all the current sessions.
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'sessions',
|
||||
'where' => implode( ' AND ', $wheres ),
|
||||
'calcRows' => TRUE,
|
||||
'order' => $db_key . ' ' . $db_order,
|
||||
'limit' => array( $this->first, $this->perpage ) ) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
$max = $this->DB->fetchCalculatedRows();
|
||||
|
||||
if ( ! $this->DB->getTotalRows($outer) && $this->first > 0 )
|
||||
{
|
||||
// We are request page 2 - but there is no page 2 now...
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url']."app=members&section=online&module=online&sortkey={$defaults['sort_key']}&show_mem={$defaults['show_mem']}&sort_order={$defaults['sort_order']}" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Put results into array
|
||||
//-----------------------------------------
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
if ( strstr( $r['id'], '_session' ) )
|
||||
{
|
||||
$r['is_bot'] = 1;
|
||||
}
|
||||
|
||||
$r['where_line'] = '';
|
||||
$r['where_link'] = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Sessions aren't updated until shutdown
|
||||
// so reset our session now
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->memberData['member_id'] AND $r['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
$r['current_appcomponent'] = 'members';
|
||||
$r['current_module'] = 'online';
|
||||
$r['current_section'] = 'online';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $r['member_id'] )
|
||||
{
|
||||
$memberIDs[] = $r['member_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Don't parse if in an error
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $r['in_error'] )
|
||||
{
|
||||
$r['current_appcomponent'] = 'core';
|
||||
}
|
||||
|
||||
$final[ $r['id'] ] = $r;
|
||||
|
||||
//-----------------------------------------
|
||||
// Module?
|
||||
//-----------------------------------------
|
||||
|
||||
$modules[ $r['current_section'] ] = array( 'app' => $r['current_appcomponent'] );
|
||||
}
|
||||
|
||||
$links = $this->registry->output->generatePagination( array( 'totalItems' => $max,
|
||||
'itemsPerPage' => $this->perpage,
|
||||
'currentStartValue' => $this->first,
|
||||
'baseUrl' => "app=members&section=online&module=online&sort_key={$defaults['sort_key']}&sort_order={$defaults['sort_order']}&show_mem={$defaults['show_mem']}"
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass off entries to modules..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $modules ) )
|
||||
{
|
||||
foreach( $modules as $module_array )
|
||||
{
|
||||
if( IPSLib::appIsInstalled( $module_array['app'] ) )
|
||||
{
|
||||
$module_array['app'] = IPSText::alphanumericalClean($module_array['app']);
|
||||
|
||||
$filename = IPSLib::getAppDir( $module_array['app'] ) . '/extensions/coreExtensions.php';
|
||||
|
||||
if ( is_file( $filename ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $filename, 'publicSessions__' . $module_array['app'], $module_array['app'] );
|
||||
$loader = new $classToLoad();
|
||||
|
||||
if ( method_exists( $loader, 'parseOnlineEntries' ) )
|
||||
{
|
||||
$final = $loader->parseOnlineEntries( $final );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Finally, members...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $memberIDs ) )
|
||||
{
|
||||
$members = IPSMember::load( $memberIDs, 'all' );
|
||||
}
|
||||
|
||||
$newFinal = array();
|
||||
|
||||
if( is_array($final) AND count($final) )
|
||||
{
|
||||
foreach( $final as $id => $data )
|
||||
{
|
||||
if ( $data['member_id'] )
|
||||
{
|
||||
$newFinal[ 'member-' . $data['member_id'] ] = $data;
|
||||
$newFinal[ 'member-' . $data['member_id'] ]['memberData'] = $members[ $data['member_id'] ];
|
||||
$newFinal[ 'member-' . $data['member_id'] ]['_memberData'] = IPSMember::buildProfilePhoto( $members[ $data['member_id'] ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$newFinal[ $data['id'] ] = $data;
|
||||
$newFinal[ $data['id'] ]['memberData'] = array();
|
||||
$newFinal[ $data['id'] ]['_memberData'] = IPSMember::buildProfilePhoto( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set defaults
|
||||
//-----------------------------------------
|
||||
|
||||
foreach ( array( 'sort_key', 'sort_order', 'show_mem' ) as $k )
|
||||
{
|
||||
if ( !$this->request[ $k ] )
|
||||
{
|
||||
$this->request[ $k ] = $defaults[ $k ];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->output .= $this->registry->getClass('output')->getTemplate('online')->showOnlineList( $newFinal, $links, $defaults );
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'profile' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,108 +1,114 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile View
|
||||
* 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 20th February 2002
|
||||
* @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_members_profile_dname extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dname_profiles_off', 10233.22, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_off', 10234, null, null, 403 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_no_id', 10235, null, null, 404 );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['dname_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['dname_title'], '' );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile View
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_dname extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dname_profiles_off', 10233.22, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_off', 10234, null, null, 403 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_no_id', 10235, null, null, 404 );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
/* Stop Google indexing soft 404s */
|
||||
if ( ! count( $records ) && ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( '404_soft', 10235.1, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['dname_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['dname_title'], '' );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,246 +1,246 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Ignore a user
|
||||
* 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 20th February 2002
|
||||
* @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_members_profile_ignore extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
if( $result['error'] )
|
||||
{
|
||||
$this->registry->output->showError( $result['error'], 10266 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $result['message'], $this->settings['base_url'] . 'showuser=' . $this->request['memberID'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore a member's topics
|
||||
*
|
||||
* @param integer Member ID to ignore
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function ignoreMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we ignore them?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $member['_canBeIgnored'] !== TRUE )
|
||||
{
|
||||
return array( 0 => $this->lang->words['ignoreuser_cannot'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( $ignoreMe['ignore_' . $type ] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_already'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 1 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'ignored_users', array(
|
||||
'ignore_owner_id' => $this->memberData['member_id'],
|
||||
'ignore_ignore_id' => $member['member_id'],
|
||||
'ignore_' . $antiType => 0,
|
||||
'ignore_' . $type => 1,
|
||||
)
|
||||
);
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop ignoring the user's topics
|
||||
*
|
||||
* @param integer Member ID to stop ignoring
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function stopIgnoringMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( !$ignoreMe['ignore_' . $antiType ] )
|
||||
{
|
||||
$this->DB->delete( 'ignored_users', 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 0 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['noignoreuser_success'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Ignore a user
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_ignore extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
if( $result['error'] )
|
||||
{
|
||||
$this->registry->output->showError( $result['error'], 10266 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $result['message'], $this->settings['base_url'] . 'showuser=' . $this->request['memberID'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore a member's topics
|
||||
*
|
||||
* @param integer Member ID to ignore
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function ignoreMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we ignore them?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $member['_canBeIgnored'] !== TRUE )
|
||||
{
|
||||
return array( 0 => $this->lang->words['ignoreuser_cannot'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( $ignoreMe['ignore_' . $type ] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_already'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 1 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'ignored_users', array(
|
||||
'ignore_owner_id' => $this->memberData['member_id'],
|
||||
'ignore_ignore_id' => $member['member_id'],
|
||||
'ignore_' . $antiType => 0,
|
||||
'ignore_' . $type => 1,
|
||||
)
|
||||
);
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop ignoring the user's topics
|
||||
*
|
||||
* @param integer Member ID to stop ignoring
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function stopIgnoringMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( !$ignoreMe['ignore_' . $antiType ] )
|
||||
{
|
||||
$this->DB->delete( 'ignored_users', 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 0 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['noignoreuser_success'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,161 +1,185 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Ignore a user
|
||||
* Last Updated: $Date: 2011-09-08 11:58:29 -0400 (Thu, 08 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 9467 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_members_profile_photo extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load lang file */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$this->photo = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
default:
|
||||
case 'show':
|
||||
$output = $this->_show();
|
||||
break;
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Got anything to show? */
|
||||
if ( $output )
|
||||
{
|
||||
$this->registry->output->addContent( $output );
|
||||
$this->registry->output->setTitle( $this->lang->words['pe_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['pe_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes pics
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
$this->photo->remove( $this->memberData['member_id'] );
|
||||
|
||||
/* redirect to show */
|
||||
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
$getJson = intval( $this->request['getJson'] );
|
||||
$photoType = $this->request['photoType'];
|
||||
$gravatar = $this->request['gravatar'];
|
||||
|
||||
if ( $getJson )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$ajax = new $classToLoad();
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
if ( $getJson )
|
||||
{
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
return $ajax->returnJsonArray( $photo, false, 'text/html' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to show */
|
||||
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
if ( $getJson )
|
||||
{
|
||||
$msg = ( ! empty( $this->lang->words[ 'pp_' . $msg ] ) ) ? $this->lang->words[ 'pp_' . $msg ] : $this->lang->words[ 'pp_generic_error' ];
|
||||
$ajax->returnJsonError( $msg, 'text/html' );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( $this->lang->words[ 'pp_' . $msg ], 1027, null, null, 403 );
|
||||
}
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
if ( $getJson )
|
||||
{
|
||||
$ajax->returnJsonError( 'member_profile_disabled', 'text/html' );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( $this->lang->words['member_profile_disabled'], 1027, null, null, 403 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the photo editor
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _show()
|
||||
{
|
||||
return $this->photo->getEditorHtml( $this->memberData );
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Profile Photo
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_photo extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load lang file */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$this->photo = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
default:
|
||||
case 'show':
|
||||
$output = $this->_show();
|
||||
break;
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Got anything to show? */
|
||||
if ( $output )
|
||||
{
|
||||
$this->registry->output->addContent( $output );
|
||||
$this->registry->output->setTitle( $this->lang->words['pe_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['pe_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes pics
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
$this->photo->remove( $this->memberData['member_id'] );
|
||||
|
||||
/* redirect to show */
|
||||
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
$getJson = intval( $this->request['getJson'] );
|
||||
$photoType = $this->request['photoType'];
|
||||
$gravatar = $this->request['gravatar'];
|
||||
|
||||
if ( $getJson )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
|
||||
$ajax = new $classToLoad();
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
if ( $getJson )
|
||||
{
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
return $ajax->returnJsonArray( $photo, false, 'text/html' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* redirect to show */
|
||||
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
if ( $msg == 'upload_to_big' )
|
||||
{
|
||||
$this->lang->words[ 'pp_' . $msg ] = sprintf( $this->lang->words[ 'pp_' . $msg ], $this->memberData['photoMaxKb'] );
|
||||
}
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
if ( $getJson )
|
||||
{
|
||||
|
||||
|
||||
if ( $this->lang->words[ 'pp_' . $msg ] )
|
||||
{
|
||||
$msg = $this->lang->words[ 'pp_' . $msg ];
|
||||
}
|
||||
elseif ( $this->lang->words[ $msg ] )
|
||||
{
|
||||
$msg = $this->lang->words[ $msg ];
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = $this->lang->words['pp_generic_error'];
|
||||
}
|
||||
|
||||
$ajax->returnJsonError( $msg, 'text/html' );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( $this->lang->words[ 'pp_' . $msg ], 1027, null, null, 403 );
|
||||
}
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
if ( $getJson )
|
||||
{
|
||||
$ajax->returnJsonError( 'member_profile_disabled', 'text/html' );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->showError( $this->lang->words['member_profile_disabled'], 1027, null, null, 403 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the photo editor
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _show()
|
||||
{
|
||||
/* Check we're a member */
|
||||
if ( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['pp_generic_error'], 1027.1, null, null, 403 );
|
||||
}
|
||||
|
||||
return $this->photo->getEditorHtml( $this->memberData );
|
||||
}
|
||||
}
|
||||
@@ -1,412 +1,412 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Allow user to change their status
|
||||
* Last Updated: $Date: 2011-08-25 07:46:38 -0400 (Thu, 25 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @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: 9413 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_members_profile_status extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->request['do'] = ( $this->request['do'] ) ? $this->request['do'] : 'list';
|
||||
|
||||
//-----------------------------------------
|
||||
// Security check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['do'] != 'list' AND ( $this->request['k'] != $this->member->form_hash ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20314, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* WHAT R WE DOING? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->_list();
|
||||
break;
|
||||
case 'new':
|
||||
$this->_new();
|
||||
break;
|
||||
case 'reply':
|
||||
$this->_reply();
|
||||
break;
|
||||
case 'deleteStatus':
|
||||
$this->_deleteStatus();
|
||||
break;
|
||||
case 'deleteReply':
|
||||
$this->_deleteReply();
|
||||
break;
|
||||
case 'lockStatus':
|
||||
$this->_lockStatus();
|
||||
break;
|
||||
case 'unlockStatus':
|
||||
$this->_unlockStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
*/
|
||||
protected function _lockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canLockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->lockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
*/
|
||||
protected function _unlockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canUnlockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->unlockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
*/
|
||||
protected function _list()
|
||||
{
|
||||
/* INIT */
|
||||
$filters = array( 'offset' => intval( $this->request['st'] ), 'limit' => 15, 'getCount' => true );
|
||||
|
||||
/* Add to the filters */
|
||||
if ( $this->request['member_id'] )
|
||||
{
|
||||
$filters['relatedTo'] = intval( $this->request['member_id'] );
|
||||
$filters['isApproved'] = true;
|
||||
}
|
||||
else if ( $this->request['status_id'] )
|
||||
{
|
||||
$filters['status_id'] = intval( $this->request['status_id'] );
|
||||
$filters['type'] = 'all';
|
||||
}
|
||||
else if ( $this->request['type'] == 'friends' )
|
||||
{
|
||||
$filters['friends_only'] = 1;
|
||||
$filters['type'] = 'all';
|
||||
}
|
||||
|
||||
/* Fetch last 20 */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Fetch */
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, $filters );
|
||||
$count = $this->registry->getClass('memberStatus')->getStatusCount();
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => 15,
|
||||
'currentStartValue' => $this->request['st'],
|
||||
'seoTitle' => true,
|
||||
'seoTemplate' => 'members_status_all',
|
||||
'showNumbers' => false,
|
||||
'baseUrl' => "app=members&module=profile&section=status&type={$this->request['type']}&member_id={$this->request['member_id']}" ) );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->statusUpdatesPage( $statuses, $pages );
|
||||
|
||||
$this->registry->output->addContent( $content );
|
||||
$this->registry->output->setTitle( $this->lang->words['status_updates_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['status_updates_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
*/
|
||||
protected function _deleteReply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$reply_id = intval( $this->request['reply_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $reply_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
$this->registry->getClass('memberStatus')->setReplyData( $reply_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteReply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . 'app=members&module=profile&section=status&status_id=' . $status_id, 'false', 'members_status_all' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status
|
||||
*
|
||||
*/
|
||||
protected function _deleteStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10278, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we delete? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10279, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Get info */
|
||||
$status = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_text = ( $status['status_member_id'] == $status['status_author_id'] ) ? $this->lang->words['status_deleted'] : $this->lang->words['comment_was_deleted'];
|
||||
|
||||
$this->registry->output->redirectScreen( $_text, $this->settings['base_url'] . 'showuser=' . $status['status_member_id'] . '&tab=status', $status['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
*/
|
||||
protected function _reply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$comment = trim( $this->request['comment-' . $status_id ] );
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $comment )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10280, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( $comment );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10281, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->reply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new statussesses
|
||||
*
|
||||
*/
|
||||
protected function _new()
|
||||
{
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
$su_Twitter = intval( $this->request['su_Twitter'] );
|
||||
$su_Facebook = intval( $this->request['su_Facebook'] );
|
||||
$forMemberId = intval( $this->request['forMemberId'] );
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( trim( $this->request['content'] ) );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update or comment? */
|
||||
if ( $forMemberId && $forMemberId != $this->memberData['member_id'] )
|
||||
{
|
||||
$owner = IPSMember::load( $forMemberId );
|
||||
|
||||
if ( ! $owner['pp_setting_count_comments'] )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Set owner */
|
||||
$this->registry->getClass('memberStatus')->setStatusOwner( $owner );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set post outs */
|
||||
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->create();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Allow user to change their status
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_status extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->request['do'] = ( $this->request['do'] ) ? $this->request['do'] : 'list';
|
||||
|
||||
//-----------------------------------------
|
||||
// Security check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['do'] != 'list' AND ( $this->request['k'] != $this->member->form_hash ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20314, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* WHAT R WE DOING? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->_list();
|
||||
break;
|
||||
case 'new':
|
||||
$this->_new();
|
||||
break;
|
||||
case 'reply':
|
||||
$this->_reply();
|
||||
break;
|
||||
case 'deleteStatus':
|
||||
$this->_deleteStatus();
|
||||
break;
|
||||
case 'deleteReply':
|
||||
$this->_deleteReply();
|
||||
break;
|
||||
case 'lockStatus':
|
||||
$this->_lockStatus();
|
||||
break;
|
||||
case 'unlockStatus':
|
||||
$this->_unlockStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
*/
|
||||
protected function _lockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canLockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->lockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
*/
|
||||
protected function _unlockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canUnlockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->unlockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
*/
|
||||
protected function _list()
|
||||
{
|
||||
/* INIT */
|
||||
$filters = array( 'offset' => intval( $this->request['st'] ), 'limit' => 15, 'getCount' => true );
|
||||
|
||||
/* Add to the filters */
|
||||
if ( $this->request['member_id'] )
|
||||
{
|
||||
$filters['relatedTo'] = intval( $this->request['member_id'] );
|
||||
$filters['isApproved'] = true;
|
||||
}
|
||||
else if ( $this->request['status_id'] )
|
||||
{
|
||||
$filters['status_id'] = intval( $this->request['status_id'] );
|
||||
$filters['type'] = 'all';
|
||||
}
|
||||
else if ( $this->request['type'] == 'friends' )
|
||||
{
|
||||
$filters['friends_only'] = 1;
|
||||
$filters['type'] = 'all';
|
||||
}
|
||||
|
||||
/* Fetch last 20 */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Fetch */
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, $filters );
|
||||
$count = $this->registry->getClass('memberStatus')->getStatusCount();
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count,
|
||||
'itemsPerPage' => 15,
|
||||
'currentStartValue' => $this->request['st'],
|
||||
'seoTitle' => true,
|
||||
'seoTemplate' => 'members_status_all',
|
||||
'showNumbers' => false,
|
||||
'baseUrl' => "app=members&module=profile&section=status&type={$this->request['type']}&member_id={$this->request['member_id']}" ) );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->statusUpdatesPage( $statuses, $pages );
|
||||
|
||||
$this->registry->output->addContent( $content );
|
||||
$this->registry->output->setTitle( $this->lang->words['status_updates_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['status_updates_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
*/
|
||||
protected function _deleteReply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$reply_id = intval( $this->request['reply_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $reply_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
$this->registry->getClass('memberStatus')->setReplyData( $reply_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteReply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . 'app=members&module=profile&section=status&status_id=' . $status_id, 'false', 'members_status_all' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status
|
||||
*
|
||||
*/
|
||||
protected function _deleteStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10278, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we delete? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10279, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Get info */
|
||||
$status = $this->registry->getClass('memberStatus')->getStatusData();
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_text = ( $status['status_member_id'] == $status['status_author_id'] ) ? $this->lang->words['status_deleted'] : $this->lang->words['comment_was_deleted'];
|
||||
|
||||
$this->registry->output->redirectScreen( $_text, $this->settings['base_url'] . 'showuser=' . $status['status_member_id'] . '&tab=status', $status['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
*/
|
||||
protected function _reply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$comment = trim( $this->request['comment-' . $status_id ] );
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $comment )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10280, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( $comment );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10281, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->reply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new statussesses
|
||||
*
|
||||
*/
|
||||
protected function _new()
|
||||
{
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
$su_Twitter = intval( $this->request['su_Twitter'] );
|
||||
$su_Facebook = intval( $this->request['su_Facebook'] );
|
||||
$forMemberId = intval( $this->request['forMemberId'] );
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( trim( $this->request['content'] ) );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update or comment? */
|
||||
if ( $forMemberId && $forMemberId != $this->memberData['member_id'] )
|
||||
{
|
||||
$owner = IPSMember::load( $forMemberId );
|
||||
|
||||
if ( ! $owner['pp_setting_count_comments'] )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Set owner */
|
||||
$this->registry->getClass('memberStatus')->setStatusOwner( $owner );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set post outs */
|
||||
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->create();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,812 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Warnings Management
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $ (Original: Mark)
|
||||
* @copyright © 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th November 2011
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_warnings extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Can the member warn other users?
|
||||
*
|
||||
* @var $canWarn
|
||||
*/
|
||||
public $canWarn = false;
|
||||
|
||||
/**
|
||||
* List of all the reasons for a warning
|
||||
*
|
||||
* @var $reasons
|
||||
*/
|
||||
public $reasons = array();
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
/* Do we even have warnings enabled? */
|
||||
if ( !$this->settings['warn_on'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10260, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Load the member */
|
||||
$memberId = intval( $this->request['member'] );
|
||||
$this->_member = IPSMember::load( $memberId );
|
||||
if ( !$this->_member['member_id'] )
|
||||
{
|
||||
$this->_member = $this->memberData;
|
||||
}
|
||||
|
||||
/* Is this user protected? */
|
||||
if ( $this->settings['warn_protected'] )
|
||||
{
|
||||
if ( IPSMember::isInGroup( $this->_member, explode( ',', $this->settings['warn_protected'] ) ) )
|
||||
{
|
||||
$this->registry->output->showError( 'warn_protected_member', 10265, null, null, 403 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Can we view? */
|
||||
$pass = FALSE;
|
||||
$this->canWarn = FALSE;
|
||||
$modType = NULL;
|
||||
|
||||
if( $this->memberData['member_id'] )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$pass = TRUE;
|
||||
$this->canWarn = TRUE;
|
||||
$modType = 'warn_gmod_day';
|
||||
}
|
||||
elseif( $this->memberData['is_mod'] )
|
||||
{
|
||||
$other_mgroups = array();
|
||||
$_other_mgroups = IPSText::cleanPermString( $this->memberData['mgroup_others'] );
|
||||
|
||||
if( $_other_mgroups )
|
||||
{
|
||||
$other_mgroups = explode( ",", $_other_mgroups );
|
||||
}
|
||||
|
||||
$other_mgroups[] = $this->memberData['member_group_id'];
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'moderators',
|
||||
'where' => "(member_id='" . $this->memberData['member_id'] . "' OR (is_group=1 AND group_id IN(" . implode( ",", $other_mgroups ) . ")))"
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $this->moderator = $this->DB->fetch() )
|
||||
{
|
||||
if ( $this->moderator['allow_warn'] )
|
||||
{
|
||||
$pass = TRUE;
|
||||
$this->canWarn = TRUE;
|
||||
$modType = 'warn_mod_day';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( ! $pass && $this->memberData['member_id'] == $this->_member['member_id'] )
|
||||
{
|
||||
if ( $this->settings['warn_show_own'] || $this->canWarn || in_array( $this->request['do'], array( 'acknowledge', 'do_acknowledge' ) ) )
|
||||
{
|
||||
$pass = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$pass )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10262, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Are we limited per day? */
|
||||
if ( $this->canWarn and !$this->memberData['g_access_cp'] and $this->settings[ $modType ] != -1 )
|
||||
{
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as dracula', 'from' => 'members_warn_logs', 'where' => "wl_moderator={$this->memberData['member_id']} AND wl_member={$this->_member['member_id']} AND wl_date>" . ( time() - 86400 ) ) );
|
||||
if ( $count['dracula'] >= $this->settings[ $modType ] )
|
||||
{
|
||||
$this->canWarn = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load reasons */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_reasons', 'order' => 'wr_order' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$this->reasons[ $row['wr_id'] ] = $row;
|
||||
}
|
||||
|
||||
/* Output init */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
$this->registry->output->addNavigation( "{$this->lang->words['page_title_pp']}: {$this->_member['members_display_name']}", "showuser={$this->_member['member_id']}", $this->_member['members_seo_name'], 'showuser' );
|
||||
$this->registry->output->addNavigation( $this->lang->words['warnings'], "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" );
|
||||
|
||||
//-----------------------------------------
|
||||
// What are we doing?
|
||||
//-----------------------------------------
|
||||
|
||||
switch ( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->form();
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
$this->save();
|
||||
break;
|
||||
|
||||
case 'acknowledge':
|
||||
$this->acknowledge();
|
||||
break;
|
||||
|
||||
case 'do_acknowledge':
|
||||
$this->doAcknowledge();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->viewWarnings();
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: View Warnings
|
||||
*/
|
||||
public function viewWarnings()
|
||||
{
|
||||
$warnings = array();
|
||||
|
||||
/* Get the count */
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as dracula', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->_member['member_id']}" ) );
|
||||
|
||||
/* Sort out pagination */
|
||||
$st = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0;
|
||||
$pagination = $this->registry->output->generatePagination( array(
|
||||
'totalItems' => $count['dracula'],
|
||||
'itemsPerPage' => 25,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=members&module=profile&section=warnings&member={$this->_member['member_id']}&from_app={$this->request['from_app']}&from_id1={$this->request['from_id1']}&from_id2={$this->request['from_id2']}",
|
||||
'seoTemplate' => '',
|
||||
'seoTitle' => '',
|
||||
) );
|
||||
|
||||
/* Fetch 'em */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'members_warn_logs',
|
||||
'where' => "wl_member={$this->_member['member_id']}",
|
||||
'order' => 'wl_date DESC'
|
||||
) );
|
||||
$e = $this->DB->execute();
|
||||
while ( $row = $this->DB->fetch( $e ) )
|
||||
{
|
||||
$row['wl_moderator'] = IPSMember::load( $row['wl_moderator'] );
|
||||
$warnings[ $row['wl_id'] ] = $row;
|
||||
}
|
||||
|
||||
/* Display */
|
||||
$this->registry->output->addContent( $this->registry->output->getTemplate('profile')->listWarnings( $this->_member, $warnings, $pagination, $this->reasons, $this->canWarn ) );
|
||||
$this->registry->output->setTitle( sprintf( $this->lang->words['warnings_member'], $this->_member['members_display_name'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Form: Warning
|
||||
*/
|
||||
public function form( $errors=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Permission Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->canWarn )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10263, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Work out current punishments
|
||||
//-----------------------------------------
|
||||
|
||||
$currentPunishments = array();
|
||||
foreach ( array( 'mq' => 'mod_posts', 'rpa' => 'restrict_post', 'suspend' => 'temp_ban' ) as $k => $mk )
|
||||
{
|
||||
if ( $this->_member[ $mk ] )
|
||||
{
|
||||
if ( $this->_member[ $mk ] == 1 )
|
||||
{
|
||||
$currentPunishments[ $k ] = sprintf( $this->lang->words['warnings_already_'.$k.'_perm'], $this->_member['members_display_name'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_processed = IPSMember::processBanEntry( $this->_member[ $mk ] );
|
||||
$currentPunishments[ $k ] = sprintf( $this->lang->words['warnings_already_'.$k.'_time'], $this->_member['members_display_name'], $this->lang->getDate( $_processed['date_end'], 'SHORT' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Editor
|
||||
//-----------------------------------------
|
||||
|
||||
$editor = array();
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
|
||||
$editor['member'] = new $classToLoad();
|
||||
if( $this->request['note_member'] )
|
||||
{
|
||||
$editor['member']->setContent( $editor['member']->process( $_POST['note_member'] ) );
|
||||
}
|
||||
$editor['member'] = $editor['member']->show( 'note_member', array( 'autoSaveKey' => "warn-member", 'type' => 'mini', 'minimize' => TRUE ) );
|
||||
|
||||
$editor['mod'] = new $classToLoad();
|
||||
if( $this->request['note_mods'] )
|
||||
{
|
||||
$editor['mod']->setContent( $editor['mod']->process( $_POST['note_mods'] ) );
|
||||
}
|
||||
$editor['mod'] = $editor['mod']->show( 'note_mods', array( 'autoSaveKey' => "warn-mod", 'type' => 'mini', 'minimize' => TRUE ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Display
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->registry->output->getTemplate('profile')->addWarning( $this->_member, $this->reasons, $errors, $editor, $currentPunishments ) );
|
||||
$this->registry->output->setTitle( sprintf( $this->lang->words['warnings_member_add'], $this->_member['members_display_name'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: Issue Warning
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$points = 0;
|
||||
$mq = 0;
|
||||
$mq_unit = 'd';
|
||||
$rpa = 0;
|
||||
$rpa_unit = 'd';
|
||||
$suspend = 0;
|
||||
$suspend_unit = 'd';
|
||||
$banGroup = 0;
|
||||
$removePoints = 0;
|
||||
$removePointsUnit = 'd';
|
||||
|
||||
//-----------------------------------------
|
||||
// Validate
|
||||
//-----------------------------------------
|
||||
|
||||
$errors = array();
|
||||
|
||||
if ( $this->request['reason'] === '' )
|
||||
{
|
||||
/* No reason selected */
|
||||
$errors['reason'] = $this->lang->words['warnings_err_reason'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$reason = intval( $this->request['reason'] );
|
||||
|
||||
/* "Other" reason selected */
|
||||
if ( !$reason )
|
||||
{
|
||||
/* Check we're actually allowed to use it */
|
||||
if ( !$this->memberData['g_access_cp'] and !$this->settings['warnings_enable_other'] )
|
||||
{
|
||||
/* Nope */
|
||||
$errors['reason'] = $this->lang->words['warnings_err_reason'];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we select "Other", we determine the number of points and when they expire */
|
||||
$points = floatval( $this->request['points'] );
|
||||
$removePoints = intval( $this->request['remove'] );
|
||||
$removePointsUnit = $this->request['remove_unit'] == 'h' ? 'h' : 'd';
|
||||
}
|
||||
}
|
||||
/* Defined reason selected */
|
||||
else
|
||||
{
|
||||
$reason = $this->reasons[ $reason ];
|
||||
|
||||
/* Check it's valid */
|
||||
if ( !$reason['wr_id'] )
|
||||
{
|
||||
/* Nope */
|
||||
$errors['reason'] = $this->lang->words['warnings_err_reason'];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Can we override the number of points for this reason? */
|
||||
if ( $this->memberData['g_access_cp'] or $reason['wr_points_override'] )
|
||||
{
|
||||
// Yes, get value from input
|
||||
$points = floatval( $this->request['points'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// No, take whatever the reason has set
|
||||
$points = $reason['wr_points'];
|
||||
}
|
||||
|
||||
/* Can we override when the points expire? */
|
||||
if ( $this->memberData['g_access_cp'] or $reason['wr_remove_override'] )
|
||||
{
|
||||
// Yes, get value from input
|
||||
$removePoints = intval( $this->request['remove'] );
|
||||
$removePointsUnit = $this->request['remove_unit'] == 'h' ? 'h' : 'd';
|
||||
}
|
||||
else
|
||||
{
|
||||
// No, take whatever the reason has set
|
||||
$removePoints = intval( $reason['wr_remove'] );
|
||||
$removePointsUnit = $reason['wr_remove_unit'];
|
||||
}
|
||||
}
|
||||
|
||||
$reason = $reason['wr_id'];
|
||||
}
|
||||
|
||||
/* Now let's get the action */
|
||||
$newPointLevel = floatval( $this->_member['warn_level'] + $points );
|
||||
$action = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_points<={$newPointLevel}", 'order' => 'wa_points DESC', 'limit' => 1 ) );
|
||||
|
||||
if ( $action )
|
||||
{
|
||||
/* We have an action. Can we override it's punishment? */
|
||||
if ( $action['wa_override'] )
|
||||
{
|
||||
// Yes, get values from input
|
||||
$mq = $this->request['mq_perm'] ? -1 : intval( $this->request['mq'] );
|
||||
$mq_unit = $this->request['mq_unit'];
|
||||
$rpa = $this->request['rpa_perm'] ? -1 : intval( $this->request['rpa'] );
|
||||
$rpa_unit = $this->request['rpa_unit'];
|
||||
$suspend = $this->request['suspend_perm'] ? -1 : intval( $this->request['suspend'] );
|
||||
$suspend_unit = $this->request['suspend_unit'];
|
||||
$banGroup = $this->request['ban_group'] ? intval( $this->request['ban_group_id'] ) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No, do whatever the action says
|
||||
$mq = intval( $action['wa_mq'] );
|
||||
$mq_unit = $action['wa_mq_unit'];
|
||||
$rpa = intval( $action['wa_rpa'] );
|
||||
$rpa_unit = $action['wa_rpa_unit'];
|
||||
$suspend = intval( $action['wa_suspend'] );
|
||||
$suspend_unit = $action['wa_suspend_unit'];
|
||||
$banGroup = intval( $action['wa_ban_group'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We don't have an action - are we allowed to give a custom punishment? */
|
||||
if ( $this->memberData['g_access_cp'] or $this->settings['warning_custom_noaction'] )
|
||||
{
|
||||
// Yes, get values from input
|
||||
$mq = $this->request['mq_perm'] ? -1 : intval( $this->request['mq'] );
|
||||
$mq_unit = $this->request['mq_unit'];
|
||||
$rpa = $this->request['rpa_perm'] ? -1 : intval( $this->request['rpa'] );
|
||||
$rpa_unit = $this->request['rpa_unit'];
|
||||
$suspend = $this->request['suspend_perm'] ? -1 : intval( $this->request['suspend'] );
|
||||
$suspend_unit = $this->request['suspend_unit'];
|
||||
$banGroup = $this->request['ban_group'] ? intval( $this->request['ban_group_id'] ) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're not allowed to give a punishment so this is a verbal warning only.
|
||||
// The values we set earlier during init are fine
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty( $errors ) )
|
||||
{
|
||||
return $this->form( $errors );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$editor = new $classToLoad();
|
||||
|
||||
$noteForMember = $editor->process( $_POST['note_member'] );
|
||||
$noteForMods = $editor->process( $_POST['note_mods'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Save Log
|
||||
//-----------------------------------------
|
||||
|
||||
/* If our points are going to expire, woprk out exactly when */
|
||||
$expireDate = 0;
|
||||
if ( $removePoints )
|
||||
{
|
||||
IPSTime::setTimestamp( time() );
|
||||
if ( $removePointsUnit == 'h' )
|
||||
{
|
||||
IPSTime::add_hours( $removePoints );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSTime::add_days( $removePoints );
|
||||
}
|
||||
$expireDate = IPSTime::getTimestamp();
|
||||
}
|
||||
|
||||
/* Log */
|
||||
$warning = array(
|
||||
'wl_member' => $this->_member['member_id'],
|
||||
'wl_moderator' => $this->memberData['member_id'],
|
||||
'wl_date' => time(),
|
||||
'wl_reason' => $reason,
|
||||
'wl_points' => $points,
|
||||
'wl_note_member' => $noteForMember,
|
||||
'wl_note_mods' => $noteForMods,
|
||||
'wl_mq' => $mq,
|
||||
'wl_mq_unit' => $mq_unit,
|
||||
'wl_rpa' => $rpa,
|
||||
'wl_rpa_unit' => $rpa_unit,
|
||||
'wl_suspend' => $suspend,
|
||||
'wl_suspend_unit' => $suspend_unit,
|
||||
'wl_ban_group' => $banGroup,
|
||||
'wl_expire' => $removePoints,
|
||||
'wl_expire_unit' => $removePointsUnit,
|
||||
'wl_acknowledged' => ( $this->settings['warnings_acknowledge'] ? 0 : 1 ),
|
||||
'wl_content_app' => trim( $this->request['from_app'] ),
|
||||
'wl_content_id1' => $this->request['from_id1'],
|
||||
'wl_content_id2' => $this->request['from_id2'],
|
||||
'wl_expire_date' => $expireDate,
|
||||
);
|
||||
|
||||
/* Data Hook Location */
|
||||
$warning['actionData'] = $action;
|
||||
$warning['reasonsData'] = $this->reasons;
|
||||
IPSLib::doDataHooks( $warning, 'memberWarningPre' );
|
||||
unset( $warning['actionData'], $warning['reasonsData'] );
|
||||
|
||||
$this->DB->insert( 'members_warn_logs', $warning );
|
||||
$warning['wl_id'] = $this->DB->getInsertId();
|
||||
|
||||
/* Data Hook Location */
|
||||
$warning['actionData'] = $action;
|
||||
$warning['reasonsData'] = $this->reasons;
|
||||
IPSLib::doDataHooks( $warning, 'memberWarningPost' );
|
||||
unset( $warning['actionData'], $warning['reasonsData'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Actually do it
|
||||
//-----------------------------------------
|
||||
|
||||
$update = array();
|
||||
|
||||
/* Add Points */
|
||||
if ( $points )
|
||||
{
|
||||
$update['warn_level'] = $this->_member['warn_level'] + $points;
|
||||
}
|
||||
|
||||
/* Set Punishments */
|
||||
if ( $mq )
|
||||
{
|
||||
$update['mod_posts'] = ( $mq == -1 ? 1 : IPSMember::processBanEntry( array( 'unit' => $mq_unit, 'timespan' => $mq ) ) );
|
||||
}
|
||||
if ( $rpa )
|
||||
{
|
||||
$update['restrict_post'] = ( $rpa == -1 ? 1 : IPSMember::processBanEntry( array( 'unit' => $rpa_unit, 'timespan' => $rpa ) ) );
|
||||
}
|
||||
if ( $suspend )
|
||||
{
|
||||
if ( $suspend == -1 )
|
||||
{
|
||||
$update['member_banned'] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$update['temp_ban'] = IPSMember::processBanEntry( array( 'unit' => $suspend_unit, 'timespan' => $suspend ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $banGroup > 0 )
|
||||
{
|
||||
$update['member_group_id'] = $banGroup;
|
||||
}
|
||||
|
||||
if ( $this->settings['warnings_acknowledge'] )
|
||||
{
|
||||
$update['unacknowledged_warnings'] = 1;
|
||||
}
|
||||
|
||||
/* Save */
|
||||
if ( !empty( $update ) )
|
||||
{
|
||||
IPSMember::save( $this->_member['member_id'], array( 'core' => $update ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Work out where this warning came from
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $warning['wl_content_app'] and IPSLib::appIsInstalled( $warning['wl_content_app'] ) )
|
||||
{
|
||||
$file = IPSLib::getAppDir( $warning['wl_content_app'] ) . '/extensions/warnings.php';
|
||||
|
||||
if ( is_file( $file ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file, 'warnings_' . $warning['wl_content_app'], $warning['wl_content_app'] );
|
||||
|
||||
if ( class_exists( $classToLoad ) and method_exists( $classToLoad, 'getContentUrl' ) )
|
||||
{
|
||||
$object = new $classToLoad();
|
||||
$content = $object->getContentUrl( $warning );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Send notifications
|
||||
//-----------------------------------------
|
||||
|
||||
/* Init */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
/* Send to member being warned */
|
||||
if ( $this->settings['warnings_acknowledge'] OR $noteForMember )
|
||||
{
|
||||
try
|
||||
{
|
||||
$notifyLibrary->setMember( $this->_member );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'warning' );
|
||||
$notifyLibrary->setNotificationUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" );
|
||||
$notifyLibrary->setNotificationTitle( sprintf( $this->lang->words['warnings_notify'], $this->registry->output->buildUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" ) ) );
|
||||
$notifyLibrary->setNotificationText( sprintf(
|
||||
$this->lang->words['warnings_notify_text'],
|
||||
$this->_member['members_display_name'],
|
||||
$this->memberData['members_display_name'],
|
||||
$reason ? $this->reasons[ $reason ]['wr_name'] : $this->lang->words['warnings_reasons_other'],
|
||||
$noteForMember ? sprintf( $this->lang->words['warnings_notify_member_note'], $noteForMember ) : '',
|
||||
$this->settings['warn_show_own'] ? sprintf( $this->lang->words['warnings_notify_view_link'], $this->registry->output->buildUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" ) ) : ''
|
||||
) );
|
||||
$notifyLibrary->sendNotification();
|
||||
}
|
||||
catch ( Exception $e ) {}
|
||||
}
|
||||
|
||||
/* And all mods that can warn and are super_mods (split this up because of: @link http://community.invisionpower.com/tracker/issue-36960-bad-warn-query/ */
|
||||
$mods = array();
|
||||
$mids = array();
|
||||
$gids = array();
|
||||
$canWarnMids = array();
|
||||
$canWarnGids = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'member_id, allow_warn',
|
||||
'from' => 'moderators',
|
||||
'where' => 'is_group=0' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$mids[ $row['member_id'] ] = $row['member_id'];
|
||||
|
||||
if ( $row['allow_warn'] )
|
||||
{
|
||||
$canWarnMids[] = $row['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'group_id',
|
||||
'from' => 'moderators',
|
||||
'where' => 'is_group=1 AND allow_warn=1' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$gids[] = $row['group_id'];
|
||||
$canWarnGids[] = $row['group_id'];
|
||||
}
|
||||
|
||||
foreach( $this->caches['group_cache'] as $id => $row )
|
||||
{
|
||||
if ( $row['g_is_supmod'] )
|
||||
{
|
||||
$gids[] = $row['g_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Limit this because it could go a bit wrong innit */
|
||||
if ( count( $gids ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'member_id',
|
||||
'from' => 'members',
|
||||
'where' => 'member_group_id IN (' . implode( ',', $gids ) . ')',
|
||||
'limit' => array( 0, 750 ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$mids[ $row['member_id'] ] = $row['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$_mods = IPSMember::load( $mids, 'all' );
|
||||
|
||||
if ( count( $_mods ) )
|
||||
{
|
||||
foreach( $_mods as $id => $row )
|
||||
{
|
||||
if ( $row['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $row['g_is_supmod'] OR ( in_array( $row['member_id'], $canWarnMids ) ) OR ( in_array( $row['member_group_id'], $canWarnGids ) ) )
|
||||
{
|
||||
$mods[ $row['member_id'] ] = $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $mods ) )
|
||||
{
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
$notifyLibrary->setMultipleRecipients( $mods );
|
||||
$notifyLibrary->setFrom( $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( 'warning_mods' );
|
||||
$notifyLibrary->setNotificationUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" );
|
||||
$notifyLibrary->setNotificationTitle( sprintf(
|
||||
$this->lang->words['warnings_notify_mod'],
|
||||
$this->_member['members_display_name'],
|
||||
$this->registry->output->buildUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" ),
|
||||
$this->memberData['members_display_name']
|
||||
) );
|
||||
$notifyLibrary->setNotificationText( sprintf(
|
||||
$this->lang->words['warnings_notify_text_mod'],
|
||||
$this->_member['members_display_name'],
|
||||
$this->memberData['members_display_name'],
|
||||
$this->registry->output->buildUrl( "app=members&module=profile§ion=warnings&member={$this->_member['member_id']}" )
|
||||
) );
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
} catch ( Exception $e ) { }
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Boink
|
||||
//-----------------------------------------
|
||||
|
||||
if ( empty( $content['url'] ) )
|
||||
{
|
||||
$this->registry->getClass('output')->redirectScreen( $this->lang->words['warnings_done'] , $this->settings['base_url'] . 'app=members&module=profile&section=warnings&member=' . $this->_member['member_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('output')->redirectScreen( $this->lang->words['warnings_done'] , $content['url'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Form: Acknowledge
|
||||
*/
|
||||
public function acknowledge()
|
||||
{
|
||||
$id = intval( $this->request['id'] );
|
||||
$warning = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_id={$id}" ) );
|
||||
if ( !$warning['wl_id'] or $warning['wl_member'] != $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10264, null, null, 403 );
|
||||
}
|
||||
|
||||
$warning['wl_moderator'] = IPSMember::load( $warning['wl_moderator'] );
|
||||
$warning['wl_reason'] = $this->reasons[ $warning['wl_reason'] ];
|
||||
|
||||
$warning['content'] = NULL;
|
||||
|
||||
if ( $warning['wl_content_app'] and IPSLib::appIsInstalled( $warning['wl_content_app'] ) )
|
||||
{
|
||||
$file = IPSLib::getAppDir( $warning['wl_content_app'] ) . '/extensions/warnings.php';
|
||||
|
||||
if ( is_file( $file ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $file, 'warnings_' . $warning['wl_content_app'], $warning['wl_content_app'] );
|
||||
|
||||
if ( class_exists( $classToLoad ) and method_exists( $classToLoad, 'getContentUrl' ) )
|
||||
{
|
||||
$object = new $classToLoad();
|
||||
$content = $object->getContentUrl( $warning );
|
||||
|
||||
if ( !is_null( $content ) )
|
||||
{
|
||||
$warning['content'] = "<a href='{$content['url']}'>{$content['title']}</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->addContent( $this->registry->output->getTemplate('profile')->acknowledgeWarning( $warning ) );
|
||||
$this->registry->output->setTitle( $this->lang->words['warnings_acknowledge'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Action: Acknowledge
|
||||
*/
|
||||
public function doAcknowledge()
|
||||
{
|
||||
$id = intval( $this->request['id'] );
|
||||
$warning = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_id={$id}" ) );
|
||||
if ( !$warning['wl_id'] or $warning['wl_member'] != $this->_member['member_id'] or $this->request['secure_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10264, null, null, 403 );
|
||||
}
|
||||
|
||||
$this->DB->update( 'members_warn_logs', array( 'wl_acknowledged' => 1 ), "wl_id={$warning['wl_id']}" );
|
||||
|
||||
$count = array( 'count' => 0 );
|
||||
if ( $this->settings['warnings_acknowledge'] )
|
||||
{
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->_member['member_id']} AND wl_acknowledged=0" ) );
|
||||
}
|
||||
if ( !$count['count'] and $this->memberData['unacknowledged_warnings'] )
|
||||
{
|
||||
IPSMember::save( $this->_member['member_id'], array( 'core' => array( 'unacknowledged_warnings' => 0 ) ) );
|
||||
}
|
||||
|
||||
if ( $this->request['ref'] )
|
||||
{
|
||||
$this->registry->output->silentRedirect( $this->request['ref'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['warnings_acknowledged'], $this->settings['board_url'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Most Liked Content
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright © 2012 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 5th January 2012
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_reputation_most extends ipsCommand
|
||||
{
|
||||
const NUMBER_TO_SHOW = 20;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get supported applications
|
||||
//-----------------------------------------
|
||||
|
||||
$supportedApps = array();
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app )
|
||||
{
|
||||
$file = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/reputation.php';
|
||||
|
||||
if( is_file( $file ) )
|
||||
{
|
||||
require_once( $file );/*maybeLibHook*/
|
||||
|
||||
if( class_exists( 'reputation_' . $app['app_directory'] ) )
|
||||
{
|
||||
$supportedApps[ $app['app_directory'] ] = $app;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get results
|
||||
//-----------------------------------------
|
||||
|
||||
/* What is it we're getting? */
|
||||
$app = ( ! empty($this->request['app_tab']) and isset($supportedApps[ $this->request['app_tab'] ]) ) ? $this->request['app_tab'] : 'forums';
|
||||
|
||||
/* Load our extension class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/reputation.php', 'reputation_' . $app, $app );
|
||||
$reputationClass = new $classToLoad();
|
||||
|
||||
/* Get our query */
|
||||
$_query = $reputationClass->fetch('most');
|
||||
$PRE = trim(ipsRegistry::dbFunctions()->getPrefix());
|
||||
|
||||
/* Got something? */
|
||||
if ( $_query['inner'] )
|
||||
{
|
||||
/* Build inner join */
|
||||
$this->DB->build( $_query['inner'] );
|
||||
$inner = $this->DB->fetchSqlString();
|
||||
$this->DB->flushQuery();
|
||||
|
||||
$this->DB->allow_sub_select = 1;
|
||||
$this->DB->query( 'SELECT * FROM ' . $PRE . "reputation_totals WHERE rt_app_type=MD5( CONCAT( '" . $app . "', ';', '" . $_query['type'] . "' ) ) AND rt_type_id IN (" . $inner . ") GROUP BY rt_key ORDER BY rt_total DESC LIMIT 0," . self::NUMBER_TO_SHOW );
|
||||
$this->DB->execute();
|
||||
|
||||
$typeIds = array();
|
||||
$results = array();
|
||||
$index = array();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$typeIds[ $row['rt_total'] . '.' . $row['rt_type_id'] ] = $row['rt_type_id'];
|
||||
$index[ $row['rt_type_id'] ] = $row['rt_total'] . '.' . $row['rt_type_id'];
|
||||
}
|
||||
|
||||
if ( count( $typeIds ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'r.*',
|
||||
'from' => array( 'reputation_index' => 'r' ),
|
||||
'where' => "r.app='" . $app . "' AND r.type='" . $_query['type'] . "' AND r.type_id IN (" . implode( ',', array_values( $typeIds ) ) . ")",
|
||||
'group' => 'r.app, r.type, r.type_id',
|
||||
'add_join' => $_query['joins'] ) );
|
||||
|
||||
$e = $this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch( $e ) )
|
||||
{
|
||||
$results[ $index[ $row['type_id'] ] ] = $reputationClass->process( $row );
|
||||
}
|
||||
|
||||
krsort( $results );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
/* Process Results */
|
||||
$processedResults = count($results) ? $reputationClass->display( $results ) : '';
|
||||
|
||||
/* Setup page */
|
||||
$langBit = ipsRegistry::$settings['reputation_point_types'] == 'like' ? 'most_rep_likes' : 'most_rep_rep';
|
||||
$this->registry->output->setTitle( $this->lang->words[ $langBit ] );
|
||||
$this->registry->output->addNavigation( $this->lang->words[ $langBit ], NULL );
|
||||
|
||||
/* Display processed results */
|
||||
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('profile')->reputationPage( $langBit, $app, $supportedApps, $processedResults ) );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user