Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,83 +1,109 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX hCard
* Last Updated: $Date: 2009-09-30 06:58:35 -0400 (Wed, 30 Sep 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5180 $
*
*/
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
*
* @access public
* @param object Registry reference
* @return 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'] );
$this->returnHtml( $this->registry->getClass('output')->getTemplate('profile')->showCard( $member ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile AJAX hCard
* Last Updated: $Date: 2010-09-08 12:09:02 -0400 (Wed, 08 Sep 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6840 $
*
*/
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
*
* @access public
* @param object Registry reference
* @return 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( $this->memberData['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,232 +1,234 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Comment Handler
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_comments extends ipsAjaxCommand
{
/**
* Comments library
*
* @access private
* @var object
*/
private $comments;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
require_once( IPSLib::getAppDir( 'members' ) . '/sources/comments.php' );
$this->comments = new profileCommentsLib( $this->registry );
switch( $this->request[ 'do' ] )
{
case 'view':
default:
$this->returnHtml( $this->comments->buildComments( IPSMember::load( intval( $this->request['member_id'] ) ) ) );
break;
case 'add':
$this->_addComment();
break;
case 'delete':
$this->_deleteComment();
break;
case 'approve':
$this->_approveComment();
break;
case 'reload':
$this->_reloadComment();
break;
}
}
/**
* Approve a comment on member's profile
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
private function _approveComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Delete
//-----------------------------------------
$result = $this->comments->approveComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
}
}
/**
* Reload comments
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-15
*/
private function _reloadComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
//-----------------------------------------
// 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' );
}
//-----------------------------------------
// Regenerate comments...
//-----------------------------------------
$this->returnHtml( $this->comments->buildComments( $member ) );
}
/**
* Deletes a comment on member's profile
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
private function _deleteComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Delete
//-----------------------------------------
$result = $this->comments->deleteComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
}
}
/**
* Saves a comment on member's profile
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
private function _addComment()
{
/* INIT */
$member_id = intval( $this->request['member_id'] );
$result = $this->comments->addCommentToDB( $member_id, IPSText::parseCleanValue( $_POST['comment'] ) );
/* Check for error */
if( $result AND $result != 'pp_comment_added_mod' )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ), $new_id, $return_msg ) );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile AJAX Comment Handler
* Last Updated: $Date: 2010-09-07 14:10:16 -0400 (Tue, 07 Sep 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6834 $
*
*/
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_comments extends ipsAjaxCommand
{
/**
* Comments library
*
* @access protected
* @var object
*/
protected $comments;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
$this->comments = new $classToLoad( $this->registry );
switch( $this->request[ 'do' ] )
{
case 'view':
default:
$this->returnHtml( $this->comments->buildComments( IPSMember::load( intval( $this->request['member_id'] ) ) ) );
break;
case 'add':
$this->_addComment();
break;
case 'delete':
$this->_deleteComment();
break;
case 'approve':
$this->_approveComment();
break;
case 'reload':
$this->_reloadComment();
break;
}
}
/**
* Approve a comment on member's profile
*
* @access protected
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
protected function _approveComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Delete
//-----------------------------------------
$result = $this->comments->approveComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
}
}
/**
* Reload comments
*
* @access protected
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-15
*/
protected function _reloadComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
//-----------------------------------------
// 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' );
}
//-----------------------------------------
// Regenerate comments...
//-----------------------------------------
$this->returnHtml( $this->comments->buildComments( $member ) );
}
/**
* Deletes a comment on member's profile
*
* @access protected
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
protected function _deleteComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Delete
//-----------------------------------------
$result = $this->comments->deleteComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
}
}
/**
* Saves a comment on member's profile
*
* @access protected
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-02
*/
protected function _addComment()
{
/* INIT */
$member_id = intval( $this->request['member_id'] );
$result = $this->comments->addCommentToDB( $member_id, IPSText::parseCleanValue( $_POST['comment'] ) );
/* Check for error */
if( $result AND $result != 'pp_comment_added_mod' )
{
$this->returnString( $result );
}
else
{
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ), 0, '' ) );
}
}
}
@@ -1,18 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Profile display name history
* Last Updated: $Date: 2010-04-15 15:46:26 -0400 (Thu, 15 Apr 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
* @version $Revision: 6133 $
*
*/
@@ -1,51 +1,53 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Member AJAX DST switcher
* Last Updated: $Date: 2009-09-29 17:59:02 -0400 (Tue, 29 Sep 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5178 $
*
*/
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
*
* @access public
* @param object Registry reference
* @return 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.1.4
* Member AJAX DST switcher
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5713 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_dst extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return 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,202 +1,204 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Comment Handler
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_friends extends ipsAjaxCommand
{
/**
* Friends library
*
* @access private
* @var object
*/
private $friends;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return 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 */
require_once( IPSLib::getAppDir( 'members' ) . '/sources/friends.php' );
$this->friends = new profileFriendsLib( $registry );
switch( $this->request['do'] )
{
case 'add':
$this->_addFriend();
break;
case 'remove':
$this->_removeFriend();
break;
case 'view':
$this->_iframeList();
break;
}
}
/**
* Loads the content for the friends tab
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-15
*/
private function _iframeList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$content = '';
$friends = array();
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnString( $this->lang->words['nofriendid'] );
}
//-----------------------------------------
// Grab the friends
//-----------------------------------------
$this->DB->build( array( 'select' => 'f.*',
'from' => array( 'profile_friends' => 'f' ),
'where' => 'f.friends_member_id=' . $member_id . ' AND f.friends_approved=1',
'order' => 'm.members_display_name ASC',
'add_join' => array(
1 => array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=f.friends_friend_id',
'type' => 'left' ),
2 => array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=f.friends_friend_id',
'type' => 'left' )
)
) );
$outer = $this->DB->execute();
//-----------------------------------------
// Get and store...
//-----------------------------------------
while( $row = $this->DB->fetch($outer) )
{
$row['members_display_name_short'] = IPSText::truncate( $row['members_display_name'], 13 );
$friends[] = IPSMember::buildDisplayData( $row, 0 );
}
//-----------------------------------------
// Ok.. show the friends
//-----------------------------------------
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe( $member, $friends );
$this->returnHtml( $content );
}
/**
* Add a friend
*
* @access private
* @return void
*/
private 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
*
* @access private
* @return void
*/
private 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.1.4
* Profile AJAX Comment Handler
* Last Updated: $Date: 2010-07-14 17:57:17 -0400 (Wed, 14 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6651 $
*
*/
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
*
* @access private
* @var object
*/
private $friends;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return 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;
case 'view':
$this->_iframeList();
break;
}
}
/**
* Loads the content for the friends tab
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-15
*/
private function _iframeList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$content = '';
$friends = array();
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnString( $this->lang->words['nofriendid'] );
}
//-----------------------------------------
// Grab the friends
//-----------------------------------------
$this->DB->build( array( 'select' => 'f.*',
'from' => array( 'profile_friends' => 'f' ),
'where' => 'f.friends_member_id=' . $member_id . ' AND f.friends_approved=1',
'order' => 'm.members_display_name ASC',
'add_join' => array(
1 => array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=f.friends_friend_id',
'type' => 'left' ),
2 => array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=f.friends_friend_id',
'type' => 'left' )
)
) );
$outer = $this->DB->execute();
//-----------------------------------------
// Get and store...
//-----------------------------------------
while( $row = $this->DB->fetch($outer) )
{
$row['members_display_name_short'] = IPSText::truncate( $row['members_display_name'], 13 );
$friends[] = IPSMember::buildDisplayData( $row, 0 );
}
//-----------------------------------------
// Ok.. show the friends
//-----------------------------------------
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe( $member, $friends );
$this->returnHtml( $content );
}
/**
* Add a friend
*
* @access private
* @return void
*/
private 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
*
* @access private
* @return void
*/
private 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,64 +1,63 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Ignore User
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_ignore extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Get ignore user quick call file */
require_once( IPSLib::getAppDir( 'members' ) . '/modules_public/profile/ignore.php' );
$library = new public_members_profile_ignore( $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.1.4
* Profile AJAX Ignore User
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 7007 $
*/
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 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 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&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.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,113 +1,115 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Tab Loader
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_load extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( ipsRegistry::$request['member_id'] );
$tab = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( ipsRegistry::$request['tab'] ) ) ), 0, 20 );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$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( !file_exists( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.conf.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.conf.php' );
//-----------------------------------------
// Active?
//-----------------------------------------
if ( ! $CONFIG['plugin_enabled'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Load main class...
//-----------------------------------------
if( !file_exists( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.php' );
$_func_name = 'profile_' . $tab;
$plugin = new $_func_name( $this->registry );
$html = $plugin->return_html_block( $member );
//-----------------------------------------
// Return it...
//-----------------------------------------
$this->returnHtml( $html );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile AJAX Tab Loader
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 7007 $
*/
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 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( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );
//-----------------------------------------
// Active?
//-----------------------------------------
if ( ! $CONFIG['plugin_enabled'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Load main class...
//-----------------------------------------
if( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
$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,149 +1,163 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Tab Loader
* Last Updated: $Date: 2009-09-22 17:31:43 -0400 (Tue, 22 Sep 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5141 $
*
*/
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
*
* @access public
* @param object Registry reference
* @return 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->returnJsonArray( $return );
//$this->returnString( $member['pp_rating_value'] . ',' . $member['pp_rating_hits'] . ',' . $member['pp_rating_real'] . ',' . $type );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile AJAX Tab Loader
* Last Updated: $Date: 2010-07-14 23:29:48 -0400 (Wed, 14 Jul 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6655 $
*
*/
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
*
* @access public
* @param object Registry reference
* @return 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
*
* @access protected
* @param array Data to return
* @param array Member data
* @return void
*/
protected function outputResult( $return, $member )
{
$this->returnJsonArray( $return );
}
}
@@ -1,153 +1,155 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Profile AJAX Tab Loader
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
* @deprecated We no longer have AJAX setting changes in profile
*
*/
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_settings extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval($this->request['member_id']);
$member = array();
$command = trim( $this->request['cmd'] );
$value = $this->convertAndMakeSafe( $this->request['value'], 0 );
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
$return_string = '';
$pp_b_day = intval( $this->request['pp_b_day'] );
$pp_b_month = intval( $this->request['pp_b_month'] );
$pp_b_year = intval( $this->request['pp_b_year'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5_check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member_id OR ! $this->memberData['member_id'] )
{
$this->returnString( 'error' );
}
if ( ! $this->memberData['g_edit_profile'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
if ( ! $member['member_id'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Not the same member?
//-----------------------------------------
if ( !$this->memberData['g_is_supmod'] AND $member_id != $this->memberData['member_id'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Alright.. what are we doing?
//-----------------------------------------
switch( $command )
{
case 'birthdate':
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ) );
if( $pp_b_month OR $pp_b_day OR $pp_b_year )
{
if ( ! $pp_b_month or ! $pp_b_day )
{
$return_string = 'dateerror';
}
}
if ( ( $pp_b_month AND $pp_b_day AND $pp_b_year ) AND ! @checkdate( $pp_b_month, $pp_b_day, $pp_b_year ) )
{
$return_string = 'dateerror';
}
if( $return_string != 'dateerror' )
{
IPSMember::save( $member_id, array( 'core' => array( 'bday_month' => intval( $pp_b_month ), 'bday_day' => intval( $pp_b_day ), 'bday_year' => intval( $pp_b_year ) ) ) );
$_pp_b_month = '';
if( $pp_b_month > 0 AND $pp_b_month < 13 )
{
$_pp_b_month = $this->lang->words['M_' . $pp_b_month ];
}
$date_vars = array();
# Adding this to support birthdays that don't specify all 3 params
if( $_pp_b_month )
{
$date_vars[] = $_pp_b_month;
}
if( $pp_b_day )
{
$date_vars[] = $pp_b_day;
}
if( $pp_b_year )
{
$date_vars[] = $pp_b_year;
}
$return_string = ( count($date_vars) ) ? implode( '-', $date_vars ) : $this->lang->words['m_bday_unknown'];
}
}
$this->returnString( $return_string );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile AJAX Tab Loader
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5713 $
* @deprecated We no longer have AJAX setting changes in profile
*
*/
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_settings extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval($this->request['member_id']);
$member = array();
$command = trim( $this->request['cmd'] );
$value = $this->convertAndMakeSafe( $this->request['value'], 0 );
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
$return_string = '';
$pp_b_day = intval( $this->request['pp_b_day'] );
$pp_b_month = intval( $this->request['pp_b_month'] );
$pp_b_year = intval( $this->request['pp_b_year'] );
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5_check != $this->member->form_hash )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member_id OR ! $this->memberData['member_id'] )
{
$this->returnString( 'error' );
}
if ( ! $this->memberData['g_edit_profile'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
if ( ! $member['member_id'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Not the same member?
//-----------------------------------------
if ( !$this->memberData['g_is_supmod'] AND $member_id != $this->memberData['member_id'] )
{
$this->returnString( 'error' );
}
//-----------------------------------------
// Alright.. what are we doing?
//-----------------------------------------
switch( $command )
{
case 'birthdate':
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ) );
if( $pp_b_month OR $pp_b_day OR $pp_b_year )
{
if ( ! $pp_b_month or ! $pp_b_day )
{
$return_string = 'dateerror';
}
}
if ( ( $pp_b_month AND $pp_b_day AND $pp_b_year ) AND ! @checkdate( $pp_b_month, $pp_b_day, $pp_b_year ) )
{
$return_string = 'dateerror';
}
if( $return_string != 'dateerror' )
{
IPSMember::save( $member_id, array( 'core' => array( 'bday_month' => intval( $pp_b_month ), 'bday_day' => intval( $pp_b_day ), 'bday_year' => intval( $pp_b_year ) ) ) );
$_pp_b_month = '';
if( $pp_b_month > 0 AND $pp_b_month < 13 )
{
$_pp_b_month = $this->lang->words['M_' . $pp_b_month ];
}
$date_vars = array();
# Adding this to support birthdays that don't specify all 3 params
if( $_pp_b_month )
{
$date_vars[] = $_pp_b_month;
}
if( $pp_b_day )
{
$date_vars[] = $pp_b_day;
}
if( $pp_b_year )
{
$date_vars[] = $pp_b_year;
}
$return_string = ( count($date_vars) ) ? implode( '-', $date_vars ) : $this->lang->words['m_bday_unknown'];
}
}
$this->returnString( $return_string );
}
}
@@ -1,18 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Allow user to change their status
* Last Updated: $Date: 2010-10-04 21:50:24 -0400 (Mon, 04 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
* @version $Revision: 6942 $
*
*/
@@ -45,26 +48,309 @@ class public_members_ajax_status extends ipsAjaxCommand
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
//-----------------------------------------
// Can we access?
//-----------------------------------------
if ( !$this->memberData['g_mem_info'] OR $this->memberData['gbw_no_status_update'] )
/* 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;
}
}
/**
* Add a reply statussesses
*
* @access protected
* @return void
*/
protected function _showAll()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
$st = intval( $this->request['st'] );
/* 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('profile')->statusReplies( $this->registry->getClass('memberStatus')->fetchAllReplies() ) ) ) );
}
/**
* Lock a status
*
* @access protected
* @return void
*/
protected function _lockStatus()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
/* Quick check? */
if ( ! $status_id )
{
$this->returnJsonError( $this->lang->words['status_off'] );
}
if( !$id )
{
/* 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'] );
}
$newStatus = trim( IPSText::getTextClass('bbcode')->stripBadWords( IPSText::parseCleanValue( $_POST['new_status'] ) ) );
/* Update */
$this->registry->getClass('memberStatus')->lockStatus();
IPSMember::save( $id, array( 'extendedProfile' => array( 'pp_status' => $newStatus, 'pp_status_update' => time() ) ) );
/* Success? */
$this->returnJsonArray( array( 'status' => 'success' ) );
}
/**
* Lock a status
*
* @access protected
* @return void
*/
protected function _unlockStatus()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
/* Quick check? */
if ( ! $status_id )
{
$this->returnJsonError( $this->lang->words['status_off'] );
}
$this->returnJsonArray( array( 'status' => 'success', 'new_status' => $newStatus ) );
/* 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
*
* @access protected
* @return 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
*
* @access protected
* @return 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
*
* @access protected
* @return void
*/
protected function _reply()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
$comment = $this->convertAndMakeSafe( $_POST['content'] );
$id = intval( $this->request['id'] );
/* 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('profile')->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
*
* @access protected
* @return 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'] );
/* 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'] ) ) );
/* Set post outs */
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
/* Can we reply? */
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
{
$this->returnJsonError( $this->lang->words['status_off'] );
}
/* Update */
$newStatus = $this->registry->getClass('memberStatus')->create();
/* Now grab the reply and return it */
$new = $this->registry->getClass('output')->getTemplate('profile')->statusUpdates( $this->registry->getClass('memberStatus')->fetch( $this->memberData['member_id'], array( 'member_id' => $this->memberData['member_id'], 'sort_dir' => 'desc', 'limit' => 1 ) ), $smallSpace );
$this->returnJsonArray( array( 'status' => 'success', 'html' => $this->cleanOutput( $new ) ) );
exit;
}
@@ -1,76 +1,74 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Retrieve member warn log
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Members
* @link http://www.iinvisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 4948 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_ajax_warn extends ipsAjaxCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
if ( ! $this->settings['warn_on'] )
{
$this->returnJsonError( $this->lang->words['ajax_no_warn'] );
}
switch( $this->request['do'] )
{
case 'view':
$this->_viewWarnLogs();
break;
}
}
/**
* Retieve warn logs and return them
*
* @access private
* @return void
*/
private function _viewWarnLogs()
{
require_once( IPSLib::getAppDir('members') . '/modules_public/warn/warn.php' );
$warn = new public_members_warn_warn( $this->registry );
$warn->makeRegistryShortcuts( $this->registry );
$warn->loadData();
$warnHTML = $warn->viewLog();
if ( !$warnHTML )
{
$this->returnJsonError( $this->lang->words['ajax_bad_html'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('mod')->warnLogsAjaxWrapper( $warnHTML ) );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Retrieve member warn log
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 7007 $
*/
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_warn extends ipsAjaxCommand
{
/**
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
if ( ! $this->settings['warn_on'] )
{
$this->returnJsonError( $this->lang->words['ajax_no_warn'] );
}
switch( $this->request['do'] )
{
case 'view':
$this->_viewWarnLogs();
break;
}
}
/**
* Retieve warn logs and return them
*
* @return void
*/
private function _viewWarnLogs()
{
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('members') . '/modules_public/warn/warn.php', 'public_members_warn_warn' );
$warn = new $classToLoad();
$warn->makeRegistryShortcuts( $this->registry );
$warn->loadData();
$warnHTML = $warn->viewLog();
if ( !$warnHTML )
{
$this->returnJsonError( $this->lang->words['ajax_bad_html'] );
}
else
{
$this->returnHtml( $this->registry->getClass('output')->getTemplate('mod')->warnLogsAjaxWrapper( $warnHTML ) );
}
}
}