Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Friends library
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
* Last Updated: $Date: 2011-09-09 19:44:48 -0400 (Fri, 09 Sep 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Rev: 6882 $
* @version $Rev: 9476 $
*
*/
@@ -30,7 +30,6 @@ class profileFriendsLib
/**
* Registry object
*
* @access protected
* @var object
*/
protected $registry;
@@ -38,7 +37,6 @@ class profileFriendsLib
/**
* Database object
*
* @access protected
* @var object
*/
protected $DB;
@@ -46,7 +44,6 @@ class profileFriendsLib
/**
* Settings object
*
* @access protected
* @var object
*/
protected $settings;
@@ -54,7 +51,6 @@ class profileFriendsLib
/**
* Request object
*
* @access protected
* @var object
*/
protected $request;
@@ -62,15 +58,14 @@ class profileFriendsLib
/**
* Member object
*
* @access protected
* @var object
*/
protected $member;
protected $memberData;
/**
* Is approval pending?
*
* @access public
* @var boolean
*/
public $pendingApproval = false;
@@ -78,9 +73,8 @@ class profileFriendsLib
/**
* Constructor
*
* @access public
* @param object Registry object
* @return void
* @param object $registry Registry object
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
@@ -96,7 +90,6 @@ class profileFriendsLib
/**
* Adds a friend to the account that is logged in or specified
*
* @access public
* @param integer $friend_id The friend being added to the account
* @param integer $from_id The requesting member, defaults to current member
* @param boolean $forceApproval Automatically approve, regardless of setting
@@ -144,7 +137,7 @@ class profileFriendsLib
$friend_check = $this->DB->buildAndFetch( array(
'select' => 'friends_id',
'from' => 'profile_friends',
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend['member_id']}"
'where' => "friends_member_id={$from_id} AND friends_friend_id={$friend_id}"
) );
if( $friend_check['friends_id'] )
@@ -205,7 +198,7 @@ class profileFriendsLib
$notifyLibrary->setMember( $friend );
$notifyLibrary->setFrom( $member );
$notifyLibrary->setNotificationKey( 'friend_request_pending' );
$notifyLibrary->setNotificationKey( 'friend_request' );
$notifyLibrary->setNotificationUrl( "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&amp;section=friends&amp;module=profile&amp;do=list&amp;tab=pending" );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
@@ -219,38 +212,42 @@ class profileFriendsLib
}
else
{
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
IPSText::getTextClass('email')->getTemplate( "new_friend_added", $friend['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
'FRIEND_NAME' => $member['members_display_name'],
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&amp;section=friends&amp;module=profile&amp;do=list"
) );
IPSText::getTextClass('email')->subject = sprintf(
IPSText::getTextClass('email')->subject,
$this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ),
$member['members_display_name']
);
$notifyLibrary->setMember( $friend );
$notifyLibrary->setFrom( $member );
$notifyLibrary->setNotificationKey( 'friend_request' );
$notifyLibrary->setNotificationUrl( $this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ) );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
try
/* Don't notify yourself */
if( $friend['member_id'] != $this->memberData['member_id'] )
{
$notifyLibrary->sendNotification();
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
IPSText::getTextClass('email')->getTemplate( "new_friend_added", $friend['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
'FRIEND_NAME' => $member['members_display_name'],
'LINK' => "{$this->settings['board_url']}/index.{$this->settings['php_ext']}?app=members&amp;section=friends&amp;module=profile&amp;do=list"
) );
IPSText::getTextClass('email')->subject = sprintf(
IPSText::getTextClass('email')->subject,
$this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ),
$member['members_display_name']
);
$notifyLibrary->setMember( $friend );
$notifyLibrary->setFrom( $member );
$notifyLibrary->setNotificationKey( 'friend_request' );
$notifyLibrary->setNotificationUrl( $this->registry->output->buildSEOUrl( 'showuser=' . $member['member_id'], 'public', $member['members_seo_name'], 'showuser' ) );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
try
{
$notifyLibrary->sendNotification();
}
catch( Exception $e ){}
}
catch( Exception $e ){}
$return_msg = 'pp_friend_added';
}
@@ -265,7 +262,6 @@ class profileFriendsLib
/**
* Removes a friend from the logged in account
*
* @access public
* @param integer $friend_id The friend being removed
* @param integer $from_id The requesting member, defaults to current member
* @return string Error Key or blank for success
@@ -316,7 +312,6 @@ class profileFriendsLib
/**
* Recaches member's friends
*
* @access public
* @param array $member Member array to recache
* @return boolean
*/
@@ -350,12 +345,11 @@ class profileFriendsLib
* Check to see if we can add this member
* Just checks flood table right now, but this can be expanded upon
*
* @access private
* @param int Member ID
* @param int Friend ID
* @return boolean
*/
private function _canAddFriend( $member_id, $friend_id )
protected function _canAddFriend( $member_id, $friend_id )
{
/* Clean flood table */
$this->_cleanFloodTable();
@@ -377,12 +371,11 @@ class profileFriendsLib
/**
* Add entry to the flood table
*
* @access private
* @param int Member ID
* @param int Friend ID
* @return boolean
*/
private function _addFloodEntry( $member_id, $friend_id )
protected function _addFloodEntry( $member_id, $friend_id )
{
/* Clean flood table */
$this->_cleanFloodTable();
@@ -396,9 +389,8 @@ class profileFriendsLib
/**
* Clean flood table
*
* @access private
*/
private function _cleanFloodTable()
protected function _cleanFloodTable()
{
$time = time() - ( 60 * 5 );