Version 3.3.4

This commit is contained in:
Neo committed 2025-12-19 00:35:52 -08:00
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 -&gt; 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 -&gt; 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( '&nbsp;', '&#160;' ), '', $_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( '&nbsp;', '&#160;' ), '', $_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 ) );
}
}