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
* Profile AJAX hCard
* Last Updated: $Date: 2010-09-08 12:09:02 -0400 (Wed, 08 Sep 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: matt $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6840 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_ajax_card extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -98,7 +97,7 @@ class public_members_ajax_card extends ipsAjaxCommand
/* Reputation */
if ( $this->settings['reputation_protected_groups'] )
{
if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
if ( in_array( $member['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
{
$this->settings['reputation_show_profile'] = false;
}
@@ -1,234 +0,0 @@
<?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, '' ) );
}
}
}
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile display name history
* Last Updated: $Date: 2010-04-15 15:46:26 -0400 (Thu, 15 Apr 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6133 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_ajax_dname extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Member AJAX DST switcher
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 5713 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_ajax_dst extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile AJAX Comment Handler
* Last Updated: $Date: 2010-07-14 17:57:17 -0400 (Wed, 14 Jul 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6651 $
* @version $Revision: 8644 $
*
*/
@@ -30,17 +30,15 @@ class public_members_ajax_friends extends ipsAjaxCommand
/**
* Friends library
*
* @access private
* @var object
*/
private $friends;
protected $friends;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -62,94 +60,16 @@ class public_members_ajax_friends extends ipsAjaxCommand
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
* @return @e void
*/
private function _addFriend()
protected function _addFriend()
{
/* INIT */
$member_id = intval( $this->request['member_id'] );
@@ -177,10 +97,9 @@ class public_members_ajax_friends extends ipsAjaxCommand
/**
* Removes a friend
*
* @access private
* @return void
* @return @e void
*/
private function _removeFriend()
protected function _removeFriend()
{
/* INIT */
$member_id = intval( $this->request['member_id'] );
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile AJAX Ignore User
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 7007 $
* @version $Revision: 8644 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -29,7 +29,7 @@ class public_members_ajax_ignore extends ipsAjaxCommand
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile AJAX Tab Loader
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 7007 $
* @version $Revision: 8644 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -29,7 +29,7 @@ class public_members_ajax_load extends ipsAjaxCommand
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -75,12 +75,12 @@ class public_members_ajax_load extends ipsAjaxCommand
// Load config
//-----------------------------------------
if( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );/*noLibHook*/
//-----------------------------------------
// Active?
@@ -95,12 +95,12 @@ class public_members_ajax_load extends ipsAjaxCommand
// Load main class...
//-----------------------------------------
if( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
{
$this->returnString( 'error' );
}
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
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 );
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile AJAX Ignored User methods
* Last Updated: $Date: 2010-10-05 21:26:08 -0400 (Tue, 05 Oct 2010) $
* Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 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 Thursday 26th June 2008
* @version $Revision: 6945 $
* @version $Revision: 9487 $
*
*/
@@ -30,7 +30,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Messenger library
*
* @access protected
* @var object
*/
protected $messengerFunctions;
@@ -38,9 +37,8 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -76,15 +74,68 @@ class public_members_ajax_messenger extends ipsAjaxCommand
break;
case 'archiveConversation':
$this->_archiveConversation();
break;
case 'getInboxDropDown':
$this->_getInboxDropDown();
break;
case 'sigCloseMenu':
$this->_sigCloseMenu();
break;
default:
break;
}
}
protected function _sigCloseMenu()
{
$this->lang->loadLanguageFile( array( 'public_topic', 'public_mod' ), 'forums' );
$msgid = intval( $this->request['msgid'] );
/* Fetch post */
$msg = $this->messengerFunctions->fetchMessageDataById( $msgid, true );
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $msg['msg_topic_id'] ) )
{
return $this->returnHtml( $this->registry->output->getTemplate('topic')->ajaxSigCloseMenu( $msg ) );
}
else
{
$this->returnJsonError( 'nopermission' );
}
}
/**
* Shows the last 10 Pms or whatever.
*
* @return string HTML to be returned via ajax
* @since IPB 3.1.0.2011-03-24
*/
protected function _getInboxDropDown()
{
if ( ! $this->messengerFunctions->canUsePMSystem( $this->memberData ) )
{
$this->returnJsonError( 'cannotUsePMSystem' );
}
$this->lang->loadLanguageFile( array( 'public_messaging' ), 'members' );
/* Alright. Fetch the last 10 */
//$this->messengerFunctions->addFolderFilter('myconvo');
$topics = $this->messengerFunctions->getPersonalTopicsList( $this->memberData['member_id'], 'myconvo', array( 'sort' => 'date', 'offsetStart' => 0, 'offsetEnd' => 10 ) );
$topics = ( ! is_array( $topics ) ) ? array() : $topics;
/* reset */
$this->messengerFunctions->resetMembersAlertCounts( $this->memberData );
$this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->inboxList( $topics ) ) ) );
}
/**
* Archives the conversation
*
* @access protected
* @return string HTML to be returned via ajax
* @since IPB 3.1.2.2010-07-07
*/
@@ -157,7 +208,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Sends the PM
*
* @access protected
* @return string HTML to be returned via ajax
* @since IPB 3.0.0.2008-06-25
*/
@@ -176,8 +226,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
$msgContent = $this->convertHtmlEntities( $this->convertUnicode( $_POST['Post'] ) );
$msgTitle = IPSText::parseCleanValue( $this->convertHtmlEntities( $this->convertUnicode( $_POST['subject'] ) ) );
$this->request['Post'] = IPSText::parseCleanValue( $_POST['Post'] );
$_trackMsg = intval( $this->request['trackMsg'] );
$_addToSent = intval( $this->request['addToSent'] );
//-----------------------------------------
// Check viewing permissions, etc
@@ -198,12 +246,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
$this->returnJsonError( 'cannotUsePMSystem' );
}
//-----------------------------------------
// Reset Classes
//-----------------------------------------
IPSText::resetTextClass('editor');
//-----------------------------------------
// Load lang file
//-----------------------------------------
@@ -227,12 +269,7 @@ class public_members_ajax_messenger extends ipsAjaxCommand
try
{
$this->messengerFunctions->sendNewPersonalTopic( $toMemberID, $this->memberData['member_id'], array(), $msgTitle, $msgContent, array( 'origMsgID' => 0,
'fromMsgID' => 0,
'postKey' => md5(microtime()),
'trackMsg' => $_trackMsg,
'addToSentFolder' => $_addToSent,
'hideCCUser' => 0 ) );
$this->messengerFunctions->sendNewPersonalTopic( $toMemberID, $this->memberData['member_id'], array(), $msgTitle, $msgContent );
return $this->returnJsonArray( array( 'status' => 'sent' ) );
}
@@ -267,7 +304,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Shows the quick PM form
*
* @access protected
* @return string HTML to be returned via ajax
* @since IPB 3.0.0.2008-06-25
*/
@@ -326,7 +362,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Returns PM notification
*
* @access protected
* @return string JSON either error or status
* @since IPB 3.0.0.2008-06-25
*/
@@ -397,7 +432,7 @@ class public_members_ajax_messenger extends ipsAjaxCommand
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $msg['mgroup_others'];
$msg['msg_post'] = IPSText::getTextClass('bbcode')->stripAllTags( strip_tags( str_replace( '<br />', "\n", $msg['msg_post'] ) ) );
$msg['msg_post'] = IPSText::getTextClass('bbcode')->wordWrap( $msg['msg_post'], 50, "\n" );
$msg['msg_post'] = wordwrap( $msg['msg_post'], 50, "\n" );
if ( IPSText::mbstrlen( $msg['msg_post'] ) > 300 )
{
@@ -438,7 +473,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Empties a folder
*
* @access protected
* @return string JSON either error or status
* @since IPB 3.0.0.2008-06-25
*/
@@ -529,7 +563,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Renames a folder
*
* @access protected
* @return string JSON either error or status
* @since IPB 3.0.0.2008-06-25
*/
@@ -611,7 +644,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Removes a folder
*
* @access protected
* @return string JSON either error or status
* @since IPB 3.0.0.2008-06-25
*/
@@ -669,11 +701,31 @@ class public_members_ajax_messenger extends ipsAjaxCommand
//-----------------------------------------
// .. and it has no messages
// Change May 9 2011 - JS alert already warns that
// all messages in folder will be deleted, so just empty and delete
// @link http://community.invisionpower.com/tracker/issue-29857-cannot-delete-pm-folder
//-----------------------------------------
if ( $folders[ $folderID ]['count'] > 0 )
//if ( $folders[ $folderID ]['count'] > 0 )
//{
// $this->returnJsonError( 'cannotDeleteHasMessages' );
//}
$messages = $this->messengerFunctions->getPersonalTopicsList( $memberID, $folderID, array( 'offsetStart' => 0, 'offsetEnd' => 100000 ) );
/* Just grab IDs */
$mtids = array_keys( $messages );
try
{
$this->returnJsonError( 'cannotDeleteHasMessages' );
$this->messengerFunctions->deleteTopics( $memberData['member_id'], $mtids );
}
catch( Exception $error )
{
if( $error->getMessage() != 'NO_IDS_TO_DELETE' )
{
$this->returnJsonError( $error->getMessage() );
}
}
//-----------------------------------------
@@ -704,7 +756,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
/**
* Adds a folder
*
* @access protected
* @return string JSON either error or status
* @since IPB 3.0.0.2008-06-25
*/
@@ -0,0 +1,194 @@
<?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');
}
}
}
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile AJAX Tab Loader
* Last Updated: $Date: 2010-07-14 23:29:48 -0400 (Wed, 14 Jul 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6655 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_ajax_rate extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -151,10 +150,9 @@ class public_members_ajax_rate extends ipsAjaxCommand
/**
* Utility method to make hooking into file easier
*
* @access protected
* @param array Data to return
* @param array Member data
* @return void
* @return @e void
*/
protected function outputResult( $return, $member )
{
@@ -1,155 +0,0 @@
<?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 );
}
}
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Allow user to change their status
* Last Updated: $Date: 2010-10-04 21:50:24 -0400 (Mon, 04 Oct 2010) $
* Last Updated: $Date: 2011-07-05 09:10:56 -0400 (Tue, 05 Jul 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6942 $
* @version $Revision: 9154 $
*
*/
@@ -30,9 +30,8 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -84,17 +83,28 @@ class public_members_ajax_status extends ipsAjaxCommand
}
}
/**
* 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
*
* @access protected
* @return void
* @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 )
@@ -112,14 +122,13 @@ class public_members_ajax_status extends ipsAjaxCommand
$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() ) ) ) );
$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
*
* @access protected
* @return void
* @return @e void
*/
protected function _lockStatus()
{
@@ -154,8 +163,7 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Lock a status
*
* @access protected
* @return void
* @return @e void
*/
protected function _unlockStatus()
{
@@ -190,8 +198,7 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Delete a status
*
* @access protected
* @return void
* @return @e void
*/
protected function _deleteStatus()
{
@@ -226,8 +233,7 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Delete a status reply
*
* @access protected
* @return void
* @return @e void
*/
protected function _deleteReply()
{
@@ -264,8 +270,7 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Add a reply statussesses
*
* @access protected
* @return void
* @return @e void
*/
protected function _reply()
{
@@ -273,6 +278,8 @@ class public_members_ajax_status extends ipsAjaxCommand
$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 )
@@ -299,7 +306,7 @@ class public_members_ajax_status extends ipsAjaxCommand
$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 ) ) );
$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();
@@ -310,8 +317,7 @@ class public_members_ajax_status extends ipsAjaxCommand
/**
* Add a new statussesses
*
* @access protected
* @return void
* @return @e void
*/
protected function _new()
{
@@ -322,6 +328,8 @@ class public_members_ajax_status extends ipsAjaxCommand
$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'] ) ) ) )
@@ -335,20 +343,36 @@ class public_members_ajax_status extends ipsAjaxCommand
/* 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? */
/* 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('profile')->statusUpdates( $this->registry->getClass('memberStatus')->fetch( $this->memberData['member_id'], array( 'member_id' => $this->memberData['member_id'], 'sort_dir' => 'desc', 'limit' => 1 ) ), $smallSpace );
$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 ) ) );
@@ -1,74 +0,0 @@
<?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 ) );
}
}
}
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default memberlist section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @file defaultSection.php Define the default section for the 'list' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since 20th February 2002
* @version $Rev: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'view';
$DEFAULT_SECTION = 'view';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Member list
* Last Updated: $Date: 2010-10-06 12:00:52 -0400 (Wed, 06 Oct 2010) $
* Last Updated: $Date: 2011-10-11 21:18:16 -0400 (Tue, 11 Oct 2011) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 6949 $
* @version $Revision: 9599 $
*
*/
@@ -30,7 +30,6 @@ class public_members_list_view extends ipsCommand
/**
* Custom fields object
*
* @access public
* @var object
*/
public $custom_fields;
@@ -38,7 +37,6 @@ class public_members_list_view extends ipsCommand
/**
* Temporary stored output HTML
*
* @access public
* @var string
*/
public $output;
@@ -46,65 +44,57 @@ class public_members_list_view extends ipsCommand
/**
* DB result start point
*
* @access private
* @var integer
*/
private $first = 0;
protected $first = 0;
/**
* Maximum results per page
*
* @access private
* @var integer
*/
private $max_results = 20;
protected $max_results = 20;
/**
* Key to sort on
*
* @access private
* @var string
*/
private $sort_key = 'members_display_name';
protected $sort_key = 'members_display_name';
/**
* Sort order (desc or asc)
*
* @access private
* @var string
*/
private $sort_order = 'asc';
protected $sort_order = 'asc';
/**
* Filter
*
* @access private
* @var string
*/
private $filter = 'ALL';
protected $filter = 'ALL';
/**
* Member titles
*
* @access private
* @var array
*/
private $mem_titles = array();
protected $mem_titles = array();
/**
* Member groups
*
* @access private
* @var array
*/
private $mem_groups = array();
protected $mem_groups = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -130,14 +120,14 @@ class public_members_list_view extends ipsCommand
$see_groups = array();
$the_filter = array( 'ALL' => $this->lang->words['show_all'] );
$the_members = array();
$query = array();
$query = array( "m.members_l_display_name !='' AND m.members_l_display_name " . $this->DB->buildIsNull(false) );
$url = array();
$pp_rating_real = isset($this->request['pp_rating_real']) ? intval( $this->request['pp_rating_real'] ) : 0;
$this->first = isset($this->request['st']) ? intval($this->request['st']) : 0;
$this->max_results = ( isset($this->request['max_results']) AND $this->request['max_results'] ) ? $this->request['max_results'] : '20';
$this->sort_key = ( isset($this->request['sort_key']) AND $this->request['sort_key'] ) ? $this->request['sort_key'] : 'members_display_name';
$this->sort_order = ( isset($this->request['sort_order']) AND $this->request['sort_order'] ) ? $this->request['sort_order'] : 'asc';
$this->filter = ( isset($this->request['filter']) AND $this->request['filter'] ) ? ( $this->request['filter'] == 'ALL' ? 'ALL' : intval( $this->request['filter'] ) ) : 'ALL';
$this->max_results = !empty($this->request['max_results']) ? $this->request['max_results'] : $this->max_results;
$this->sort_key = !empty($this->request['sort_key']) ? $this->request['sort_key'] : 'members_display_name';
$this->sort_order = !empty($this->request['sort_order']) ? $this->request['sort_order'] : 'asc';
$this->filter = !empty($this->request['filter']) ? ( $this->request['filter'] == 'ALL' ? 'ALL' : intval( $this->request['filter'] ) ) : 'ALL';
$this->request['showall'] = isset($this->request['showall']) ? intval( $this->request['showall'] ) : 0;
$this->request['name_box'] = isset($this->request['name_box']) ? $this->request['name_box'] : '';
@@ -197,7 +187,7 @@ class public_members_list_view extends ipsCommand
$the_sort_key = array(
'members_l_display_name' => 'sort_by_name',
'posts' => 'sort_by_posts',
'posts' => 'pcount',
'joined' => 'sort_by_joined',
'members_profile_views' => 'm_dd_views',
);
@@ -226,7 +216,7 @@ class public_members_list_view extends ipsCommand
'sort_key' => $this->sort_key,
'sort_order' => $this->sort_order,
'max_results' => $this->max_results,
'photoonly' => ( isset($this->request['photoonly']) AND $this->request['photoonly'] ) ? 1 : 0,
'photoonly' => !empty($this->request['photoonly']) ? 1 : 0,
);
//-----------------------------------------
@@ -245,7 +235,7 @@ class public_members_list_view extends ipsCommand
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' );
$this->custom_fields = new $classToLoad();
$this->custom_fields->initData( 'edit', 1 );
$this->custom_fields->parseToEdit();
$this->custom_fields->parseToEdit( 'mlist' );
//-----------------------------------------
// Member Groups...
@@ -295,7 +285,7 @@ class public_members_list_view extends ipsCommand
foreach( $mapit as $in => $tbl )
{
$this->request[$in] = ( isset($this->request[ $in ]) AND $this->request[ $in ] ) ? $this->request[ $in ] : '';
$this->request[$in] = !empty($this->request[ $in ]) ? $this->request[ $in ] : '';
$inbit = IPSText::parseCleanValue( trim( urldecode( IPSText::stripslashes( $this->request[ $in ] ) ) ) );
$url[ $in ] = $in . '=' . urlencode($this->request[ $in ]);
@@ -363,8 +353,22 @@ class public_members_list_view extends ipsCommand
{
foreach( $this->custom_fields->out_fields as $id => $data )
{
if ( isset($this->request[ 'field_' . $id ]) AND $this->request[ 'field_' . $id ] )
if ( !empty($this->request[ 'field_' . $id ]) )
{
if( is_array($this->request[ 'field_' . $id ]) )
{
foreach( $this->request[ 'field_' . $id ] as $k => $v )
{
$this->request[ 'field_' . $id ][ $k ] = urldecode($v);
$url[ $in ] = "field_{$id}[{$k}]=" . $v;
}
}
else
{
$url[ $in ] = "field_{$id}=" . $this->request[ 'field_' . $id ];
$this->request[ 'field_' . $id ] = urldecode($this->request[ 'field_' . $id ]);
}
if( $this->custom_fields->cache_data[ $id ]['pf_type'] == 'drop' )
{
$query[] = "p.field_{$id}='" . $this->request[ 'field_' . $id ] . "'";
@@ -383,8 +387,6 @@ class public_members_list_view extends ipsCommand
{
$query[] = $this->custom_fields->cache_data[ $id ]['pf_search_type'] == 'loose' ? "p.field_{$id} LIKE '%" . $this->request[ 'field_' . $id ] . "%'" : "p.field_{$id} = '" . $this->request[ 'field_' . $id ] . "'";
}
$url[ $in ] = "field_{$id}=" . $this->request[ 'field_' . $id ];
}
}
}
@@ -474,7 +476,7 @@ class public_members_list_view extends ipsCommand
$members[$id] = $_members[$id];
}
}
$max = $_max['cnt'];
if( is_array($members) AND count($members) )
@@ -498,9 +500,6 @@ class public_members_list_view extends ipsCommand
}
}
/* Data Hook Location */
IPSLib::doDataHooks( $the_members, 'memberListData' );
/* make sure URL doesn't contain empty params */
$_url = $url;
$url = array();
@@ -1,419 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Contact Member Functions
* Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
* </pre>
*
* @author $Author $
* @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 20th February 2002
* @version $Rev: 6925 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_messaging_contact extends ipsCommand
{
/**
* Temporary HTML output
*
* @access public
* @var string
*/
public $output = "";
/**
* Temporary navigation items
*
* @access public
* @var array
*/
public $nav = array();
/**
* Temporary page title
*
* @access public
* @var string
*/
public $page_title = "";
/**
* Error
*
* @access private
* @var string
*/
private $int_error = "";
/**
* Extra info
*
* @access private
* @var string
*/
private $int_extra = "";
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* What to do? */
switch( $this->request['do'] )
{
case '01':
case '00':
case 'Mail':
$this->mailMember();
break;
case 'report':
if( $this->request['send'] != 1 )
{
$this->reportPostForm();
}
else
{
$this->reportPostSend();
}
break;
default:
$this->registry->output->showError( 'contact_what_action', 1034, null, null, 404 );
break;
}
/* Navigation */
foreach( $this->nav as $nav )
{
$this->registry->output->addNavigation( $nav[0], $nav[1] );
}
/* Output */
$this->registry->output->setTitle( $this->page_title . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addContent( $this->output );
$this->registry->output->sendOutput();
}
/**
* Displays the report post form
*
* @access public
* @return void
* @deprecated Just redirects to report center now
*/
public function reportPostForm()
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=reports&rcom=post&tid={$this->request['t']}&pid={$this->request['p']}&st={$this->request['st']}" );
}
/**
* Sends the reported post
*
* @access public
* @return void
* @deprecated Just redirects to report center now
*/
public function reportPostSend()
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=reports&rcom=post&tid={$this->request['t']}&pid={$this->request['p']}&st={$this->request['st']}" );
}
/**
* Handles the routines called by clicking on the "email" button
*
* @access public
* @return void
*/
public function mailMember()
{
/* Load Language */
$this->registry->class_localization->loadLanguageFile( array( 'public_emails' ), 'core' );
if( empty( $this->memberData['member_id'] ) )
{
ipsRegistry::getClass('output')->showError( 'members_only_mail', 10313, null, null, 403 );
}
/* Check email permission */
if( ! $this->memberData['g_email_friend'] )
{
ipsRegistry::getClass('output')->showError( 'no_member_mail', 10314, null, null, 403 );
}
if( $this->request['do'] == '01' )
{
$this->mailMemberSend();
}
else
{
$this->mailMemberForm();
}
}
/**
* Displays the form for mailing a member
*
* @access public
* @param string Errors
* @param string Extra data
* @return void
*/
public function mailMemberForm( $errors="", $extra="" )
{
/* Check ID */
$id = intval( $this->request['MID'] );
if( ! $id )
{
$this->registry->output->showError( 'mail_member_no_mid', 10315, null, null, 404 );
}
/* Query member information */
$member = IPSMember::load( $id );
/* Make sure we have a valid user */
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'mail_member_no_member', 10316, null, null, 404 );
}
/* Check email privacy */
if( $member['hide_email'] == 1 )
{
$this->registry->output->showError( 'mail_member_private', 10317 );
}
/* Show errors */
if ( $errors != "" )
{
$msg = $this->lang->words[$errors];
if ( $extra != "" )
{
$msg = sprintf( $msg, $extra );
}
$this->output .= $this->registry->output->getTemplate('emails')->errors( $msg );
}
/* Output */
$this->output .= $this->settings['use_mail_form']
? $this->registry->output->getTemplate('emails')->sendMailForm(
array(
'NAME' => $member['members_display_name'],
'TO' => $member['member_id'],
'subject'=> $this->request['subject'],
'content'=> stripslashes( htmlspecialchars( $_POST['message'] ) ),
)
)
: $this->registry->output->getTemplate('emails')->show_address(
array(
'NAME' => $member['members_display_name'],
'ADDRESS' => $member['email'],
)
);
$this->page_title = $this->lang->words['member_address_title'];
$this->nav[] = array( $this->lang->words['member_address_title'], '' );
}
/**
* Sends the email
*
* @access public
* @return void
*/
public function mailMemberSend()
{
//-----------------------------------------
// Check form key first
//-----------------------------------------
if ( $this->request['k'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'no_permission', 20313 );
}
$this->request['to'] = intval( $this->request['to'] );
if( $this->request['to'] == 0 )
{
$this->registry->output->showError( 'mail_member_no_mid', 10318, null, null, 404 );
}
/* Query Member */
$member = IPSMember::load( $this->request['to'] );
/* Check for schtuff */
if( ! $member['member_id'] )
{
$this->registry->output->showError( 'mail_member_no_member', 10319, null, null, 404 );
}
/* Check email privacy */
if( $member['hide_email'] == 1 )
{
$this->registry->output->showError( 'mail_member_private', 10320, true );
}
/* Check for blanks */
$check_array = array (
'message' => 'no_message',
'subject' => 'no_subject'
);
foreach( $check_array as $input => $msg )
{
if( empty( $this->request[$input] ) )
{
$this->request['MID'] = $this->request['to'];
$this->mailMemberForm( $msg );
return;
}
}
/* Check for spam / delays */
$email_check = $this->_allowToMail( $this->memberData['member_id'], $this->memberData['g_email_limit'] );
if( $email_check != TRUE )
{
$this->request['MID'] = $this->request['to'];
$this->mailMemberForm( $this->int_error, $this->int_extra );
return;
}
/**
* No check for injected headers in the message
* @link http://forums.invisionpower.com/index.php?app=tracker&showissue=13098
*/
if( preg_match("/(content-type:|content-transfer-encoding:|content-disposition:)/i", $this->request['message'] ) )
{
$this->registry->output->showError( 'bad_email_message', 5021, true );
}
/* Send the email */
IPSText::getTextClass( 'email' )->getTemplate( 'email_member' );
IPSText::getTextClass( 'email' )->buildMessage( array(
'MESSAGE' => str_replace( "<br>", "\n", str_replace( "\r", "", $this->request['message'] ) ),
'MEMBER_NAME' => $member['members_display_name'],
'FROM_NAME' => $this->memberData['members_display_name']
) );
IPSText::getTextClass( 'email' )->subject = $this->request['subject'];
IPSText::getTextClass( 'email' )->to = $member['email'];
IPSText::getTextClass( 'email' )->from = $this->memberData['email'];
IPSText::getTextClass( 'email' )->sendMail();
/* Store email in the database */
$this->DB->insert( 'email_logs', array(
'email_subject' => $this->request['subject'],
'email_content' => $this->request['message'],
'email_date' => time(),
'from_member_id' => $this->memberData['member_id'],
'from_email_address' => $this->memberData['email'],
'from_ip_address' => $this->member->ip_address,
'to_member_id' => $member['member_id'],
'to_email_address' => $member['email'],
) );
$this->output = $this->registry->output->getTemplate('emails')->sentScreen( $member['members_display_name'] );
$this->page_title = $this->lang->words['email_sent'];
$this->nav[] = array( $this->lang->words['email_sent'], '' );
}
/**
* Check Flood Limit
*
* @access private
* @param integer $member_id
* @param string $email_limit
* @return bool
**/
private function _allowToMail( $member_id, $email_limit )
{
$member_id = intval( $member_id );
if( ! $member_id )
{
$this->int_error = 'gen_error';
return FALSE;
}
list( $limit, $flood ) = explode( ':', $email_limit );
if ( ! $limit and ! $flood )
{
return TRUE;
}
//-----------------------------------------
// Get some stuff from the DB!
// 1) FLOOD?
//-----------------------------------------
if( $flood )
{
$this->DB->build( array(
'select' => '*',
'from' => 'email_logs',
'where' => "from_member_id=$member_id",
'order' => 'email_date DESC',
'limit' => array( 0, 1 ) ) );
$this->DB->execute();
$last_email = $this->DB->fetch();
if( $last_email['email_date'] + ( $flood * 60 ) > time() )
{
$this->int_error = 'exceeded_flood';
$this->int_extra = $flood;
return FALSE;
}
}
if( $limit )
{
$time_range = time() - 86400;
$this->DB->build( array(
'select' => 'count(email_id) as cnt',
'from' => 'email_logs',
'where' => "from_member_id={$member_id} AND email_date > {$time_range}",
) );
$this->DB->execute();
$quota_sent = $this->DB->fetch();
if( $quota_sent['cnt'] + 1 > $limit )
{
$this->int_error = 'exceeded_quota';
$this->int_extra = $limit;
return FALSE;
}
}
return TRUE;
}
}
@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default messaging section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @file defaultSection.php Define the default section for the 'messaging' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since 20th February 2002
* @version $Rev: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'view';
$DEFAULT_SECTION = 'view';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Mark a private message as read
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author Brandon Farber
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Thurs 7th Jan 2010
* @version $Rev: 6596 $
* @version $Rev: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_messaging_markasread extends ipsCommand
/**
* Main execution point
*
* @access public
* @param object ipsRegistry reference
* @return void
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -55,9 +54,8 @@ class public_members_messaging_markasread extends ipsCommand
/**
* All done, return
*
* @access public
* @param int AJAX result
* @return void
* @return @e void
*/
public function endReturn( $_ajax )
{
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Online list
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 12th March 2002
* @version $Revision: 6596 $
* @version $Revision: 8644 $
*
*/
@@ -31,23 +31,20 @@ class public_members_messaging_search extends ipsCommand
/**
* Page title
*
* @access private
* @var string
*/
private $_title;
protected $_title;
/**
* Navigation entries
*
* @access private
* @var array
*/
private $_navigation;
protected $_navigation;
/**
* Messenger library
*
* @access public
* @var object
*/
public $messengerFunctions;
@@ -55,7 +52,6 @@ class public_members_messaging_search extends ipsCommand
/**
* Error string
*
* @access private
* @var string
*/
public $_errorString = '';
@@ -63,9 +59,8 @@ class public_members_messaging_search extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -90,7 +85,7 @@ class public_members_messaging_search extends ipsCommand
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227.1, null, null, 404 );
}
//-----------------------------------------
@@ -141,26 +136,23 @@ class public_members_messaging_search extends ipsCommand
$this->registry->output->sendOutput();
}
/**
* Search. Do it.
*
* @access private
* @param string Any error text
* @return string returns HTML
*/
private function _search( $error='' )
protected function _search( $error='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$start = intval($this->request['st']);
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
$searchIn = '';
$start = intval($this->request['st']);
$p_end = $this->settings['show_max_msg_list'] > 0 ? $this->settings['show_max_msg_list'] : 50;
$searchFor_TAINTED = IPSText::parseCleanValue( urldecode( $_REQUEST['searchFor'] ) );
$searchIn = '';
/* Got an error? */
if ( $error )
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Online list
* Last Updated: $Date: 2010-10-28 08:16:00 -0400 (Thu, 28 Oct 2010) $
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 12th March 2002
* @version $Revision: 7061 $
* @version $Revision: 9483 $
*
*/
@@ -31,7 +31,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Page title
*
* @access protected
* @var string
*/
protected $_title;
@@ -39,7 +38,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Navigation
*
* @access protected
* @var array[ 0 => [ title, url ] ]
*/
protected $_navigation;
@@ -47,7 +45,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Post Key
*
* @access protected
* @var string Md5 key
*/
protected $_postKey;
@@ -55,7 +52,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Flag: Can we upload?
*
* @access protected
* @var int 1 or 0
*/
protected $_canUpload;
@@ -63,7 +59,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Error string
*
* @access protected
* @var string
*/
protected $_errorString = '';
@@ -71,9 +66,8 @@ class public_members_messaging_send extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -106,13 +100,12 @@ class public_members_messaging_send extends ipsCommand
//-----------------------------------------
IPSText::resetTextClass('bbcode');
IPSText::resetTextClass('editor');
//-----------------------------------------
// Load lang file
//-----------------------------------------
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_error", "public_editors" ), 'core' );
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_error" ), 'core' );
//-----------------------------------------
// Post Key
@@ -177,7 +170,7 @@ class public_members_messaging_send extends ipsCommand
//-----------------------------------------
// What to do?
//-----------------------------------------
switch( $this->request['do'] )
{
default:
@@ -227,8 +220,7 @@ class public_members_messaging_send extends ipsCommand
/**
* Deletes a reply
*
* @access protected
* @return void
* @return @e void
*/
protected function _deleteReply()
{
@@ -277,7 +269,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends a reply
*
* @access protected
* @return mixed void, or HTML form
*/
protected function _sendReply()
@@ -293,7 +284,7 @@ class public_members_messaging_send extends ipsCommand
//-----------------------------------------
// Error checking
//-----------------------------------------
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $_POST['msgContent'] ) ) ) < 2 )
{
return $this->_showForm( 'reply', $this->lang->words['err_no_msg'] );
@@ -326,6 +317,7 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
}
@@ -347,7 +339,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends a reply
*
* @access protected
* @return mixed void, or HTML form
*/
protected function _sendEdit()
@@ -397,6 +388,7 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
}
@@ -418,8 +410,7 @@ class public_members_messaging_send extends ipsCommand
/**
* Sends the PM
*
* @access protected
* @return void, or HTML form
* @return @e void, or HTML form
*/
protected function _sendNewPersonalTopic()
{
@@ -452,7 +443,7 @@ class public_members_messaging_send extends ipsCommand
return $this->_showNewTopicForm( $this->lang->words['err_no_title'] );
}
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $_POST['Post'] ) ) ) < 3 )
if ( IPSText::mbstrlen( trim( IPSText::br2nl( $msgContent ) ) ) < 3 )
{
return $this->_showNewTopicForm( $this->lang->words['err_no_msg'] );
}
@@ -511,7 +502,7 @@ class public_members_messaging_send extends ipsCommand
catch( Exception $error )
{
$msg = $error->getMessage();
if ( strstr( $msg, 'BBCODE_' ) )
{
$msg = str_replace( 'BBCODE_', '', $msg );
@@ -522,6 +513,7 @@ class public_members_messaging_send extends ipsCommand
{
$_msgString = $this->lang->words[ 'err_' . $msg ];
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
$_msgString = str_replace( '#DATE#' , $this->messengerFunctions->exceptionData[0], $_msgString );
@@ -533,7 +525,7 @@ class public_members_messaging_send extends ipsCommand
return $this->_showNewTopicForm( $_msgString );
}
//-----------------------------------------
// Swap and serve...
//-----------------------------------------
@@ -554,7 +546,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Show PM form
*
* @access protected
* @param string Type of form (edit / reply)
* @param string Error message
* @return string returns HTML
@@ -598,6 +589,14 @@ class public_members_messaging_send extends ipsCommand
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
}
//-----------------------------------------
// Load editor
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
$_editor = new $classToLoad();
$_editor->setAllowHtml( $this->memberData['g_dohtml'] );
//-----------------------------------------
// Got a message ID?
//-----------------------------------------
@@ -611,45 +610,29 @@ class public_members_messaging_send extends ipsCommand
if ( $type == 'reply' )
{
/* We're quoting a post... */
if ( IPSText::getTextClass( 'editor' )->method == 'rte' )
if ( $_editor->getRteEnabled() )
{
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']<br />{$msgData['msg_post']}".'[/quote]'."<br /><br /><br />";
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']<br />{$msgData['msg_post']}".'[/quote]'."<br />";
}
else
{
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
$msgData['msg_post'] = IPSText::getTextClass('bbcode')->preEditParse( $msgData['msg_post'] );
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']\n{$msgData['msg_post']}".'[/quote]'."\n\n\n";
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']\n{$msgData['msg_post']}".'[/quote]'."\n";
}
}
else if ( $type == 'edit' )
{
if ( IPSText::getTextClass('editor')->method == 'rte' )
{
IPSText::getTextClass('bbcode')->parse_wordwrap = 0;
IPSText::getTextClass('bbcode')->parse_html = 0;
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $msgData['msg_post'] );
/* Reset post key */
$this->_postKey = $msgData['msg_post_key'];
/* Reset post key */
$this->_postKey = $msgData['msg_post_key'];
}
else
{
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $msgData['msg_post'] );
}
$displayData['message'] = $msgData['msg_post'];
}
}
}
@@ -657,23 +640,23 @@ class public_members_messaging_send extends ipsCommand
//-----------------------------------------
// Previewing...
//-----------------------------------------
if ( $preview )
{
/* Grab language for attachment previews */
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_topic" ), 'forums' );
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
$this->settings['max_emos'] = 0;
$msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
$msg = $_editor->process( $_POST['Post-NS'] );
$msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $msg ) );
if ( ! is_object( $this->class_attach ) )
@@ -725,27 +708,10 @@ class public_members_messaging_send extends ipsCommand
if ( $preview )
{
$displayData['message'] = ( $displayData['message'] ) ? $displayData['message'] : $_POST['Post-NS'];
}
//-----------------------------------------
// Is this RTE? If so, convert BBCode
//-----------------------------------------
}
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
{
if ( $preview )
{
$displayData['message'] = stripslashes( $displayData['message'] );
}
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
}
else if ( $displayData['message'] )
{
// Not needed as is handled in above $type == 'edit' block
}
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'msgContent' );
$_editor->setContent( $displayData['message'] );
$displayData['editor'] = $_editor->show( 'msgContent', array( 'height' => 350 ) );
//-----------------------------------------
// More Data...
@@ -792,7 +758,6 @@ class public_members_messaging_send extends ipsCommand
/**
* Show PM form
*
* @access protected
* @param string Error message
* @return string returns HTML
*/
@@ -829,6 +794,14 @@ class public_members_messaging_send extends ipsCommand
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' );
//-----------------------------------------
// Load editor
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
$_editor = new $classToLoad();
$_editor->setAllowHtml( $this->memberData['g_dohtml'] );
//-----------------------------------------
// Preview post?
//-----------------------------------------
@@ -838,10 +811,10 @@ class public_members_messaging_send extends ipsCommand
/* Grab language for attachment previews */
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_topic" ), 'forums' );
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
@@ -854,7 +827,7 @@ class public_members_messaging_send extends ipsCommand
}
else
{
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
$old_msg = $_editor->process( $_POST['Post'] );
}
$old_msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $old_msg ) );
@@ -955,13 +928,13 @@ class public_members_messaging_send extends ipsCommand
$_msg_id = $draftTopic['msg_id'];
$this->_postKey = $draftTopic['msg_post_key'];
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_html = $this->memberData['g_dohtml'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
if ( IPSText::getTextClass('editor')->method == 'rte' )
if ( $_editor->getRteEnabled() )
{
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $draftTopic['msg_post'] );
}
@@ -1004,32 +977,10 @@ class public_members_messaging_send extends ipsCommand
}
}
}
//-----------------------------------------
// Remove side panel
//-----------------------------------------
IPSText::getTextClass('editor')->remove_side_panel = 1;
//-----------------------------------------
// PM returns
//-----------------------------------------
$_editor->setContent( $displayData['message'] );
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
{
if ( count( $errors ) or $preview )
{
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
}
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
}
else if ( $displayData['message'] )
{
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
}
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'Post' );
$displayData['editor'] = $_editor->show( 'Post', array( 'height' => 350 ) );
//-----------------------------------------
// More Data...
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Online list
* Last Updated: $Date: 2010-09-14 05:48:02 -0400 (Tue, 14 Sep 2010) $
* Last Updated: $Date: 2011-07-11 21:16:52 -0400 (Mon, 11 Jul 2011) $
* </pre>
*
* @author $Author: terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 12th March 2002
* @version $Revision: 6865 $
* @version $Revision: 9201 $
*
*/
@@ -31,31 +31,27 @@ class public_members_messaging_view extends ipsCommand
/**
* Page title
*
* @access private
* @var string
*/
private $_title;
protected $_title;
/**
* Navigation
*
* @access private
* @var array[ 0 => [ title, url ] ]
*/
private $_navigation;
protected $_navigation;
/**
* Folder totals
*
* @access private
* @var mixed
*/
private $_totals;
protected $_totals;
/**
* Contains topic participant data
*
* @access public
* @var array
*/
public $_topicParticipants;
@@ -63,7 +59,6 @@ class public_members_messaging_view extends ipsCommand
/**
* Messenger library
*
* @access public
* @var object
*/
public $messengerFunctions;
@@ -71,7 +66,6 @@ class public_members_messaging_view extends ipsCommand
/**
* Error string
*
* @access public
* @var string
*/
public $_errorString = '';
@@ -79,9 +73,8 @@ class public_members_messaging_view extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -94,7 +87,7 @@ class public_members_messaging_view extends ipsCommand
$this->registry->getClass('output')->showError( 'messenger_disabled', 10226, null, null, 403 );
}
if ( $this->memberData['members_disable_pm'] )
if ( $this->memberData['members_disable_pm'] == 2)
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 403 );
}
@@ -108,6 +101,9 @@ class public_members_messaging_view extends ipsCommand
{
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
}
/* Print CSS */
$this->registry->output->addToDocumentHead( 'raw', "<link rel='stylesheet' type='text/css' title='Main' media='print' href='{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_print.css' />" );
//-----------------------------------------
// Language
@@ -133,6 +129,11 @@ class public_members_messaging_view extends ipsCommand
$this->messengerFunctions->addFolderFilter( $this->request['folderFilter'] );
}
/* force disabled messenger into default */
if ( $this->memberData['members_disable_pm'] && $this->request['do'] != 'enableMessenger' )
{
$this->request['do'] = 'inbox';
}
//-----------------------------------------
// What to do?
//-----------------------------------------
@@ -175,6 +176,12 @@ class public_members_messaging_view extends ipsCommand
case 'toggleNotifications':
$html = $this->_toggleNotifications();
break;
case 'enableMessenger':
$this->_enableMessenger();
break;
case 'disableMessenger':
$this->_disableMessenger();
break;
}
//-----------------------------------------
@@ -197,14 +204,56 @@ class public_members_messaging_view extends ipsCommand
$this->registry->output->sendOutput();
}
/**
* Enable messenger
*/
protected function _enableMessenger()
{
$authKey = $this->request['authKey'];
/* Auth key */
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
/* Toggle */
if ( $this->memberData['members_disable_pm'] != 2 )
{
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_disable_pm' => 0 ) ) );
}
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=members&amp;module=messaging' );
}
/**
* Enable messenger
*/
protected function _disableMessenger()
{
$authKey = $this->request['authKey'];
/* Auth key */
if ( $this->request['authKey'] != $this->member->form_hash )
{
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
}
/* Toggle */
if ( $this->memberData['members_disable_pm'] != 2 )
{
IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'members_disable_pm' => 1 ) ) );
}
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=members&amp;module=messaging' );
}
/**
* Block a participant
*
* @access private
* @return mixed void, or HTML
*/
private function _toggleNotifications()
protected function _toggleNotifications()
{
//-----------------------------------------
// INIT
@@ -244,10 +293,9 @@ class public_members_messaging_view extends ipsCommand
/**
* Block a participant
*
* @access private
* @return mixed void, or HTML
*/
private function _blockParticipant()
protected function _blockParticipant()
{
//-----------------------------------------
// INIT
@@ -288,10 +336,9 @@ class public_members_messaging_view extends ipsCommand
/**
* Leave a conversation (non topic starter)
*
* @access private
* @return mixed void, or HTML
*/
private function _unblockParticipant()
protected function _unblockParticipant()
{
//-----------------------------------------
// INIT
@@ -332,10 +379,9 @@ class public_members_messaging_view extends ipsCommand
/**
* Leave a conversation (non topic starter)
*
* @access private
* @return mixed void, or HTML
*/
private function _deleteConversation()
protected function _deleteConversation()
{
//-----------------------------------------
// INIT
@@ -376,10 +422,9 @@ class public_members_messaging_view extends ipsCommand
/**
* Deletes a reply
*
* @access private
* @return mixed void, or HTML
*/
private function _addParticipants()
protected function _addParticipants()
{
//-----------------------------------------
// INIT
@@ -439,6 +484,7 @@ class public_members_messaging_view extends ipsCommand
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
$_msgString = str_replace( '#TONAME#' , implode( ",", $inviteUsers), $_msgString );
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
$_msgString = str_replace( '#LIMIT#' , $this->memberData['g_max_mass_pm'], $_msgString );
}
else
{
@@ -454,7 +500,6 @@ class public_members_messaging_view extends ipsCommand
/**
* Redirects the user to the correct page in a conversation based on the incoming msg ID
*
* @access protected
* @return string returns HTML
*/
protected function _findMessage()
@@ -512,10 +557,9 @@ class public_members_messaging_view extends ipsCommand
/**
* Multi Files Messages
*
* @access private
* @return string returns HTML
*/
private function _multiFile()
protected function _multiFile()
{
//-----------------------------------------
// INIT
@@ -620,7 +664,6 @@ class public_members_messaging_view extends ipsCommand
/**
* Show a message
*
* @access public
* @return string returns HTML
*/
public function showConversation()
@@ -668,7 +711,16 @@ class public_members_messaging_view extends ipsCommand
// Add to the topic data...
//-----------------------------------------
$conversationData['topicData']['_canReply'] = $this->messengerFunctions->canReplyTopic( $this->memberData['member_id'], $conversationData['topicData'], $conversationData['memberData'] );
$conversationData['topicData']['_canReply'] = $this->messengerFunctions->canReplyTopic( $this->memberData['member_id'], $conversationData['topicData'], $conversationData['memberData'] );
//-----------------------------------------
// Check report permissions
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportLibrary.php', 'reportLibrary', 'core' );
$reports = new $classToLoad( $this->registry );
$conversationData['topicData']['_canReport'] = $reports->canReport( 'messages' );
//-----------------------------------------
// Pages
@@ -677,6 +729,7 @@ class public_members_messaging_view extends ipsCommand
$conversationData['topicData']['_pages'] = $this->registry->output->generatePagination( array( 'totalItems' => $conversationData['topicData']['mt_replies'] + 1,
'itemsPerPage' => $end,
'currentStartValue' => $start,
'showNumbers' => false,
'baseUrl' => "app=members&amp;module=messaging&amp;section=view&amp;do=showConversation&amp;topicID=".$topicID."&amp;sort=".$this->request['sort'] ) );
//-----------------------------------------
@@ -704,11 +757,10 @@ class public_members_messaging_view extends ipsCommand
/**
* Show the folder list
*
* @access private
* @param string Any error text
* @return string returns HTML
*/
private function _showFolder( $error='' )
protected function _showFolder( $error='' )
{
//-----------------------------------------
// INIT
@@ -761,6 +813,7 @@ class public_members_messaging_view extends ipsCommand
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $totalMsg,
'itemsPerPage' => $p_end,
'currentStartValue' => $start,
'showNumbers' => false,
'baseUrl' => $_baseURL ) );
//-----------------------------------------
@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default online section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @file defaultSection.php Define the default section for the 'online' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since 20th February 2002
* @version $Rev: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'online';
$DEFAULT_SECTION = 'online';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Online list
* Last Updated: $Date: 2010-10-21 09:25:51 -0400 (Thu, 21 Oct 2010) $
* Last Updated: $Date: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 12th March 2002
* @version $Revision: 7009 $
* @version $Revision: 9373 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -50,7 +50,7 @@ class public_members_online_online extends ipsCommand
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -87,8 +87,8 @@ class public_members_online_online extends ipsCommand
//-----------------------------------------
$this->registry->output->addContent( $this->output );
$this->registry->output->setTitle( $this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation( $this->lang->words['page_title'], '' );
$this->registry->output->setTitle( $this->lang->words['online_page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->output->addNavigation( $this->lang->words['online_page_title'], '' );
$this->registry->output->sendOutput();
}
@@ -96,7 +96,7 @@ class public_members_online_online extends ipsCommand
/**
* Show the online list
*
* @return void [Stores HTML in $this->output]
* @return @e void [Stores HTML in $this->output]
*/
protected function _listAll()
{
@@ -106,6 +106,7 @@ class public_members_online_online extends ipsCommand
$this->first = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0;
$final = array();
$_errors = array();
$modules = array();
$memberIDs = array();
@@ -142,19 +143,16 @@ class public_members_online_online extends ipsCommand
break;
}
if ( $this->settings['spider_anon'] OR ! $this->settings['spider_active'] )
if ( ! $this->settings['spider_active'] AND ! $this->memberData['g_access_cp'] )
{
if ( ! $this->settings['spider_active'] OR ! $this->memberData['g_access_cp'] )
{
$wheres[] = $this->DB->buildRight( 'id', 8 ) . " != '_session'";
}
$wheres[] = $this->DB->buildRight( 'id', 8 ) . " != '_session'";
}
if ( ! $this->settings['disable_anonymous'] AND ! $this->memberData['g_access_cp'] OR $this->settings['disable_admin_anon'] )
if ( ! $this->settings['disable_anonymous'] AND !$this->memberData['g_access_cp'] )
{
$wheres[] = "login_type != 1";
}
//-----------------------------------------
// Grab all the current sessions.
//-----------------------------------------
@@ -186,7 +184,7 @@ class public_members_online_online extends ipsCommand
{
$r['is_bot'] = 1;
}
$r['where_line'] = '';
$r['where_link'] = '';
@@ -211,20 +209,30 @@ class public_members_online_online extends ipsCommand
$memberIDs[] = $r['member_id'];
}
$final[ $r['id'] ] = $r;
//-----------------------------------------
// Don't parse if in an error
//-----------------------------------------
if( $r['in_error'] )
{
$_errors[ $r['id'] ] = $r;
}
else
{
$final[ $r['id'] ] = $r;
}
//-----------------------------------------
// Module?
//-----------------------------------------
$modules[ $r['current_section'] ] = array( 'app' => $r['current_appcomponent'] );
}
$links = $this->registry->output->generatePagination( array( 'totalItems' => $max,
$links = $this->registry->output->generatePagination( array( 'totalItems' => $max,
'itemsPerPage' => $this->perpage,
'currentStartValue' => $this->first,
'baseUrl' => "app=members&amp;section=online&amp;module=online&amp;sort_key={$defaults['sort_key']}&amp;sort_order={$defaults['sort_order']}&amp;show_mem={$defaults['show_mem']}"
'baseUrl' => "app=members&amp;section=online&amp;module=online&amp;sort_key={$defaults['sort_key']}&amp;sort_order={$defaults['sort_order']}&amp;show_mem={$defaults['show_mem']}"
) );
//-----------------------------------------
@@ -241,7 +249,7 @@ class public_members_online_online extends ipsCommand
$filename = IPSLib::getAppDir( $module_array['app'] ) . '/extensions/coreExtensions.php';
if ( file_exists( $filename ) )
if ( is_file( $filename ) )
{
$classToLoad = IPSLib::loadLibrary( $filename, 'publicSessions__' . $module_array['app'], $module_array['app'] );
$loader = new $classToLoad();
@@ -254,7 +262,9 @@ class public_members_online_online extends ipsCommand
}
}
}
$final = array_merge( $final, $_errors );
//-----------------------------------------
// Finally, members...
//-----------------------------------------
@@ -285,9 +295,22 @@ class public_members_online_online extends ipsCommand
}
}
/* Data Hook Location */
IPSLib::doDataHooks( $newFinal, 'onlineUsersListData' );
//-----------------------------------------
// Set defaults
//-----------------------------------------
foreach ( array( 'sort_key', 'sort_order', 'show_mem' ) as $k )
{
if ( !$this->request[ $k ] )
{
$this->request[ $k ] = $defaults[ $k ];
}
}
//-----------------------------------------
// Output
//-----------------------------------------
$this->output .= $this->registry->getClass('output')->getTemplate('online')->showOnlineList( $newFinal, $links, $defaults );
}
}
@@ -1,309 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile View
* Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 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 20th February 2002
* @version $Revision: 6596 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_members_profile_comments extends ipsCommand
{
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
//-----------------------------------------
// Can we access?
//-----------------------------------------
if ( !$this->memberData['g_mem_info'] )
{
$this->registry->output->showError( 'comments_profiles', 10231 );
}
switch( $this->request['do'] )
{
default:
die('');
break;
case 'save':
$this->_saveComment();
break;
case 'delete':
$this->_deleteComment();
break;
case 'approve':
$this->_approveComment();
break;
case 'add_new_comment':
$this->_doAddComment();
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()
{
/* Security Check */
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'usercp_forums_bad_key', 103999, null, null, 403 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// Try it. You might like it.
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
$comment_lib = new $classToLoad( $this->registry );
$result = $comment_lib->approveComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->registry->output->showError( $result, 10232 );
}
else
{
$member = IPSMember::load( $member_id );
$this->registry->output->redirectScreen( $this->lang->words['comment_was_approved'], $this->settings['base_url'] . 'showuser=' . $member_id, $member['members_seo_name'] );
}
}
/**
* 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()
{
//-----------------------------------------
// Check form hash
//-----------------------------------------
$this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check'];
if( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'usercp_forums_bad_key', 1023222 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$comment_id = intval( $this->request['comment_id'] );
//-----------------------------------------
// Try it. You might like it.
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
$comment_lib = new $classToLoad( $this->registry );
$result = $comment_lib->deleteComment( $member_id, $comment_id );
/* Check for error */
if( $result )
{
$this->registry->output->showError( $result, 10232 );
}
else
{
$member = IPSMember::load( $member_id );
$this->registry->output->redirectScreen( $this->lang->words['comment_was_deleted'], $this->settings['base_url'] . 'showuser=' . $member_id, $member['members_seo_name'] );
}
}
/**
* Updates the comments
*
* @access private
* @return void [Prints to screen]
* @since IPB 2.2.0.2006-08-15
*/
private function _saveComment()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$md5check = IPSText::md5Clean( $this->request['md5check'] );
$content = '';
$comment_ids = array();
$final_ids = '';
//-----------------------------------------
// MD5 check
//-----------------------------------------
if ( $md5check != $this->member->form_hash )
{
die( '' );
}
//-----------------------------------------
// My tab?
//-----------------------------------------
if ( $member_id != $this->memberData['member_id'] AND !$this->memberData['g_is_supmod'] )
{
die( '' );
}
//-----------------------------------------
// Load member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $member['member_id'] )
{
die( '' );
}
//-----------------------------------------
// Grab comment_ids
//-----------------------------------------
if ( is_array( $this->request['pp-checked'] ) AND count( $this->request['pp-checked'] ) )
{
foreach( $this->request['pp-checked'] as $key => $value )
{
$key = intval( $key );
if ( $value )
{
$comment_ids[ $key ] = $key;
}
}
}
//-----------------------------------------
// Update the database...
//-----------------------------------------
if ( is_array( $comment_ids ) AND count( $comment_ids ) )
{
$final_ids = implode( ',', $comment_ids );
//-----------------------------------------
// Now update...
//-----------------------------------------
switch( $this->request['pp-moderation'] )
{
case 'approve':
$this->DB->update( 'profile_comments', array( 'comment_approved' => 1 ), 'comment_id IN(' . $final_ids . ')' );
break;
case 'unapprove':
$this->DB->update( 'profile_comments', array( 'comment_approved' => 0 ), 'comment_id IN(' . $final_ids . ')' );
break;
case 'delete':
$this->DB->delete( 'profile_comments', 'comment_id IN(' . $final_ids . ')' );
break;
}
}
//-----------------------------------------
// Bounce...
//-----------------------------------------
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=members&section=comments&module=profile&member_id=' . $member_id . '&do=list&_saved=1&___msg=pp_comments_updated&md5check=' . $this->member->form_hash );
}
/**
* Save the new comment
*
* @access private
* @return void
*/
private function _doAddComment()
{
/* INIT */
$member_id = intval( $this->request['member_id'] );
$comment = $this->request['comment_text'];
$md5check = IPSText::md5Clean( $this->request['auth_key'] );
/* Check member has */
if ( $md5check != $this->member->form_hash )
{
$this->registry->output->showError( $this->lang->words['no_permission'], 10233 );
}
/* Add Comment */
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
$comment_lib = new $classToLoad( $this->registry );
$result = $comment_lib->addCommentToDB( $member_id, $comment );
/* Check for error */
if( $result AND $result != 'pp_comment_added_mod' )
{
$this->registry->output->showError( $result, 10232 );
}
else if ( $result == 'pp_comment_added_mod' )
{
$this->registry->output->redirectScreen( $this->lang->words[ $result ], $this->settings['base_url'] . 'showuser=' . $member_id );
}
else
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'showuser=' . $member_id );
}
}
}
@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default profile section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @file defaultSection.php Define the default section for the 'profile' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since 20th February 2002
* @version $Rev: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'view';
$DEFAULT_SECTION = 'view';
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile View
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: danc $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 6502 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_profile_dname extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -55,7 +54,7 @@ class public_members_profile_dname extends ipsCommand
if ( !$this->memberData['g_mem_info'] )
{
$this->registry->output->showError( 'dname_profiles_off', 10233, null, null, 403 );
$this->registry->output->showError( 'dname_profiles_off', 10233.22, null, null, 403 );
}
if ( ! $this->settings['auth_allow_dnames'] )
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile View
* Last Updated: $Date: 2010-11-16 11:26:43 -0500 (Tue, 16 Nov 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 7195 $
* @version $Revision: 8644 $
*
*/
@@ -30,17 +30,15 @@ class public_members_profile_friends extends ipsCommand
/**
* Friend's library
*
* @access private
* @var object
*/
private $friend_lib;
protected $friend_lib;
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -78,103 +76,23 @@ class public_members_profile_friends extends ipsCommand
case 'moderate':
$this->_moderation();
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->registry->output->showError( $this->lang->words['nofriendid'], 10270, null, null, 404 );
}
//-----------------------------------------
// 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, array( 'avatar' => 0, 'warn' => 0 ) );
}
//-----------------------------------------
// Ok.. show the friends
//-----------------------------------------
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe( $member, $friends, true );
$this->registry->getClass('output')->setTitle( ipsRegistry::$settings['board_name'] );
$this->registry->getClass('output')->addContent( $content );
$this->registry->getClass('output')->sendOutput();
}
/**
* Remove a friend
*
* @access private
* @return void [Prints to screen]
* @return @e void [Prints to screen]
* @since IPB 2.2.0.2006-08-09
*/
private function _removeFriend()
protected function _removeFriend()
{
/* INIT */
$friend_id = intval( $this->request['member_id'] );
$friend_id = intval( $this->request['member_id'] );
/* Check the secure key */
$this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check'];
$this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check'];
if( $this->request['secure_key'] != $this->member->form_hash )
{
@@ -200,11 +118,10 @@ class public_members_profile_friends extends ipsCommand
/**
* Moderate pending friends
*
* @access private
* @return void [Prints to screen]
* @return @e void [Prints to screen]
* @since IPB 2.2.0.2006-08-09
*/
private function _moderation()
protected function _moderation()
{
//-----------------------------------------
// INIT
@@ -218,7 +135,7 @@ class public_members_profile_friends extends ipsCommand
$friends_already = array();
$friends_update = array();
$member = array();
$pp_option = $this->request['pp_option'] == 'delete' ? 'delete' : 'add_reciprocal';//trim( $this->request['pp_option'] );
$pp_option = $this->request['pp_option'] == 'delete' ? 'delete' : 'add';
$message = '';
$subject = '';
$msg = 'pp_friend_approved';
@@ -230,7 +147,6 @@ class public_members_profile_friends extends ipsCommand
if ( $md5check != $this->member->form_hash )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=error&tab=pending' );
exit();
}
//-----------------------------------------
@@ -240,7 +156,6 @@ class public_members_profile_friends extends ipsCommand
if ( ! is_array( $this->request['pp_friend_id'] ) OR ! count( $this->request['pp_friend_id'] ) )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=error&tab=pending' );
exit();
}
//-----------------------------------------
@@ -260,18 +175,15 @@ class public_members_profile_friends extends ipsCommand
if ( ! is_array( $_friend_ids ) OR ! count( $_friend_ids ) )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=error&tab=pending' );
exit();
}
//-----------------------------------------
// Check our friends are OK
//-----------------------------------------
$this->DB->build( array( 'select' => '*',
'from' => 'profile_friends',
'where' => 'friends_friend_id=' . $this->memberData['member_id'] . ' AND friends_approved=0 AND friends_member_id IN (' . implode( ',', $_friend_ids ) . ')' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
@@ -283,29 +195,21 @@ class public_members_profile_friends extends ipsCommand
if ( ! is_array( $friend_ids ) OR ! count( $friend_ids ) )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=error&tab=pending' );
exit();
}
//-----------------------------------------
// Load friends...
//-----------------------------------------
$friends = IPSMember::load( $friend_member_ids );
//-----------------------------------------
// Get member...
//-----------------------------------------
$member = $this->memberData;
$friends = IPSMember::load( $friend_member_ids );
//-----------------------------------------
// Check...
//-----------------------------------------
if ( ! is_array( $friends ) OR ! count( $friends ) OR ! $member['member_id'] )
if ( ! is_array( $friends ) OR ! count( $friends ) OR ! $this->memberData['member_id'] )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=error&tab=pending' );
exit();
}
//-----------------------------------------
@@ -315,15 +219,9 @@ class public_members_profile_friends extends ipsCommand
if ( $pp_option == 'delete' )
{
//-----------------------------------------
// Ok.. delete them in the DB.
// Delete friends records
//-----------------------------------------
//$this->DB->delete( 'profile_friends', 'friends_id IN(' . implode( ',', $friend_ids ) . ')' );
//-----------------------------------------
// And make sure you are no longer their friend
//-----------------------------------------
foreach( $friend_member_ids as $friend_id )
{
$this->friend_lib->removeFriend( $this->memberData['member_id'], $friend_id );
@@ -346,14 +244,14 @@ class public_members_profile_friends extends ipsCommand
foreach( $friend_member_ids as $friend_id )
{
$this->friend_lib->addFriend( $this->memberData['member_id'], $friend_id, true );
$this->friend_lib->addFriend( $friend_id, $this->memberData['member_id'], true );
}
//-----------------------------------------
// Reciprocal mode?
// Catch all (should find any missing friends)
//-----------------------------------------
if ( $pp_option == 'add_reciprocal' )
if ( $pp_option == 'add' )
{
//-----------------------------------------
// Find out who isn't already on your list...
@@ -369,6 +267,7 @@ class public_members_profile_friends extends ipsCommand
{
$friends_already[ $row['friends_member_id'] ] = $row['friends_member_id'];
}
//-----------------------------------------
// Check which aren't already members...
//-----------------------------------------
@@ -389,10 +288,10 @@ class public_members_profile_friends extends ipsCommand
if ( is_array( $friends_update ) AND count( $friends_update ) )
{
foreach( $friends_update as $id => $_id )
foreach( $friends_update as $id )
{
$this->DB->insert( 'profile_friends', array( 'friends_member_id' => $id,
'friends_friend_id' => $member['member_id'],
'friends_friend_id' => $this->memberData['member_id'],
'friends_approved' => 1,
'friends_added' => time() ) );
}
@@ -406,47 +305,35 @@ class public_members_profile_friends extends ipsCommand
foreach( $friends as $friend )
{
//-----------------------------------------
// INIT
// Notifications library
//-----------------------------------------
$message = '';
$subject = '';
//if ( $friend['pp_setting_notify_friend'] )
//{
//-----------------------------------------
// 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_approved" );
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;module=profile&amp;section=friends&amp;do=list' ) );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
IPSText::getTextClass( 'email' )->getTemplate( "new_friend_approved" );
IPSText::getTextClass( 'email' )->buildMessage( array( 'MEMBERS_DISPLAY_NAME' => $friend['members_display_name'],
'FRIEND_NAME' => $this->memberData['members_display_name'],
'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?app=members&amp;module=profile&amp;section=friends&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_approve' );
$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 ){}
$return_msg = '';
//}
IPSText::getTextClass('email')->subject = sprintf(
IPSText::getTextClass('email')->subject,
$this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ),
$this->memberData['members_display_name']
);
$notifyLibrary->setMember( $friend );
$notifyLibrary->setFrom( $this->memberData );
$notifyLibrary->setNotificationKey( 'friend_request_approve' );
$notifyLibrary->setNotificationUrl( $this->registry->output->buildSEOUrl( 'showuser=' . $this->memberData['member_id'], 'public', $this->memberData['members_seo_name'], 'showuser' ) );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
try
{
$notifyLibrary->sendNotification();
}
catch( Exception $e ){}
}
$this->friend_lib->recacheFriends( $friend );
@@ -456,29 +343,29 @@ class public_members_profile_friends extends ipsCommand
// Recache..
//-----------------------------------------
$this->friend_lib->recacheFriends( $member );
$this->friend_lib->recacheFriends( $this->memberData );
//-----------------------------------------
// Return
//-----------------------------------------
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg='.$msg.'&tab=pending' );
$this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=members&section=friends&module=profile&do=list&___msg=' . $msg . '&tab=pending' );
}
/**
* Add a friend
*
* @access private
* @return void [Prints to screen]
* @return @e void [Prints to screen]
* @since IPB 2.2.0.2006-08-09
*/
private function _addFriend()
protected function _addFriend()
{
/* INIT */
$friend_id = intval( $this->request['member_id'] );
$friend_id = intval( $this->request['member_id'] );
$_friend = IPSMember::load( $friend_id, 'core' );
/* Check the secure key */
$this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check'];
$this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check'];
if( $this->request['secure_key'] != $this->member->form_hash )
{
@@ -500,30 +387,24 @@ class public_members_profile_friends extends ipsCommand
}
else
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . 'showuser=' . $friend_id );
$this->registry->output->redirectScreen( $this->lang->words['friend_added_ok'], $this->settings['base_url'] . 'showuser=' . $friend_id, 'showuser', $_friend['members_seo_name'] );
}
}
/**
* List all current friends.
*
* @access private
* @return void [Prints to screen]
* @return @e void [Prints to screen]
* @since IPB 2.2.0.2006-08-08
*/
private function _viewList()
protected function _viewList()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$member_id = intval( $this->memberData['member_id'] );
$friends = array();
$tab = substr( IPSText::alphanumericalClean( $this->request['tab'] ), 0, 20 );
$friends_filter = substr( IPSText::alphanumericalClean( $this->request['friends_filter'] ), 0, 20 );
$_mutual_ids = array( 0 => 0 );
$time_limit = time() - $this->settings['au_cutoff'] * 60;
$per_page = 25;
$start = intval( $this->request['st'] );
@@ -531,10 +412,9 @@ class public_members_profile_friends extends ipsCommand
// Check we're a member
//-----------------------------------------
if ( ! $member_id )
if ( !$this->memberData['member_id'] )
{
$this->lang->loadLanguageFile( array( 'public_error' ), 'core' );
$this->registry->output->showError( $this->lang->words['no_friend_mid'], 10267, null, null, 404 );
$this->registry->output->showError( 'no_friend_mid', 10267, null, null, 404 );
}
//-----------------------------------------
@@ -543,35 +423,20 @@ class public_members_profile_friends extends ipsCommand
if ( $tab == 'pending' )
{
$query = 'f.friends_friend_id=' . $member_id;
$query .= ' AND f.friends_approved=0';
$joinKey = 'f.friends_member_id';
$query = 'f.friends_approved=0 AND f.friends_friend_id=' . $this->memberData['member_id'];
$joinKey = 'f.friends_member_id';
}
else
{
$query = 'f.friends_member_id=' . $member_id;
$query .= ' AND f.friends_approved=1';
$joinKey = 'f.friends_friend_id';
$query = 'f.friends_approved=1 AND f.friends_member_id=' . $this->memberData['member_id'];
$joinKey = 'f.friends_friend_id';
}
//-----------------------------------------
// Filtered?
//-----------------------------------------
if ( $friends_filter == 'online' )
{
$query .= " AND ( ( m.last_visit > {$time_limit} OR m.last_activity > {$time_limit} ) AND m.login_anonymous='0&1' )";
}
else if ( $friends_filter == 'offline' )
{
$query .= " AND ( m.last_activity < {$time_limit} OR ( m.login_anonymous='0&0' OR m.login_anonymous='1&0' ) )";
}
//-----------------------------------------
// Get count...
//-----------------------------------------
$count = $this->DB->buildAndFetch( array(
$count = $this->DB->buildAndFetch( array(
'select' => 'COUNT(*) as count',
'from' => array( 'profile_friends' => 'f' ),
'where' => $query,
@@ -582,44 +447,45 @@ class public_members_profile_friends extends ipsCommand
'type' => 'inner'
) )
) );
//-----------------------------------------
// Pages...
//-----------------------------------------
$pages = $this->registry->output->generatePagination( array(
$pages = $this->registry->output->generatePagination( array(
'totalItems' => intval( $count['count'] ),
'noDropdown' => 1,
'itemsPerPage' => $per_page,
'currentStartValue' => $start,
'baseUrl' => 'app=members&amp;module=profile&amp;section=friends&amp;do=list&amp;tab='.$tab.'&amp;friends_filter=' . $friends_filter,
'baseUrl' => 'app=members&amp;module=profile&amp;section=friends&amp;do=list&amp;tab=' . $tab,
) );
//-----------------------------------------
// Get current friends...
//-----------------------------------------
$this->DB->build( array(
'select' => 'f.*',
'from' => array( 'profile_friends' => 'f' ),
'where' => $query,
'order' => 'm.members_l_display_name ASC',
'limit' => array( $start, $per_page ),
'add_join' => array(
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=' . $joinKey,
'type' => 'left'
),
array(
'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . $joinKey,
'type' => 'left'
)
'select' => 'f.*',
'from' => array( 'profile_friends' => 'f' ),
'where' => $query,
'order' => 'm.members_l_display_name ASC',
'limit' => array( $start, $per_page ),
'add_join' => array(
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=' . $joinKey,
'type' => 'left'
),
array(
'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=' . $joinKey,
'type' => 'left'
)
)
) );
$q = $this->DB->execute();
$q = $this->DB->execute();
//-----------------------------------------
// Get and store...
@@ -627,7 +493,7 @@ class public_members_profile_friends extends ipsCommand
while( $row = $this->DB->fetch( $q ) )
{
$row = IPSMember::buildDisplayData( $row, array( 'avatar' => 0, 'warn' => 0 ) );
$row = IPSMember::buildDisplayData( $row, array( 'warn' => 0 ) );
$friends[] = $row;
}
@@ -636,11 +502,12 @@ class public_members_profile_friends extends ipsCommand
// Show...
//-----------------------------------------
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsList( $friends, $pages );
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsList( $friends, $pages );
$this->registry->output->setTitle( $this->lang->words['m_title_friends'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['m_title_friends'], '' );
$this->registry->getClass('output')->addContent( $content );
$this->registry->getClass('output')->sendOutput( $content );
$this->registry->getClass('output')->sendOutput();
}
}
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Ignore a user
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 5713 $
* @version $Revision: 8644 $
*
*/
@@ -30,9 +30,8 @@ class public_members_profile_ignore extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -69,7 +68,6 @@ class public_members_profile_ignore extends ipsCommand
/**
* Ignore a member's topics
*
* @access public
* @param integer Member ID to ignore
* @param string Column to update
* @return array Array of info
@@ -169,7 +167,6 @@ class public_members_profile_ignore extends ipsCommand
/**
* Stop ignoring the user's topics
*
* @access public
* @param integer Member ID to stop ignoring
* @param string Column to update
* @return array Array of info
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Profile View
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* IP.Board v3.2.3
* Ignore a user
* Last Updated: $Date: 2011-09-08 11:58:29 -0400 (Thu, 08 Sep 2011) $
* </pre>
*
* @author $Author: danc $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 6502 $
* @version $Revision: 9467 $
*
*/
@@ -30,50 +30,132 @@ class public_members_profile_photo extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$info = array();
$id = intval( $this->request['id'] );
//-----------------------------------------
// Get HTML and skin
//-----------------------------------------
/* Load lang file */
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
//-----------------------------------------
// Can we access?
//-----------------------------------------
if ( !$this->memberData['g_mem_info'] )
{
$this->registry->output->showError( 'photos_profiles_off', 10242, null, null, 403 );
}
/* Load library */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
$this->photo = new $classToLoad( $registry );
if( !$id )
switch( $this->request['do'] )
{
$this->registry->output->showError( 'photos_no_id', 10243, null, null, 404 );
case 'save':
$this->_save();
break;
default:
case 'show':
$output = $this->_show();
break;
case 'remove':
$this->_remove();
break;
}
$member = IPSMember::load( $id );
$member = IPSMember::buildDisplayData( $member );
$html = $this->registry->getClass('output')->getTemplate('profile')->showPhoto( $member );
//-----------------------------------------
// Push to print handler
//-----------------------------------------
$this->registry->getClass('output')->setTitle( $this->lang->words['photo_title'] . ' - ' . ipsRegistry::$settings['board_name']);
$this->registry->getClass('output')->popUpWindow( $html );
}
/* Got anything to show? */
if ( $output )
{
$this->registry->output->addContent( $output );
$this->registry->output->setTitle( $this->lang->words['pe_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addNavigation( $this->lang->words['pe_title'], '' );
$this->registry->output->sendOutput();
}
}
/**
* Removes pics
*
* @return @e void [HTML]
*/
protected function _remove()
{
$this->photo->remove( $this->memberData['member_id'] );
/* redirect to show */
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
}
/**
* Saves data
*
* @return @e void [HTML]
*/
protected function _save()
{
$getJson = intval( $this->request['getJson'] );
$photoType = $this->request['photoType'];
$gravatar = $this->request['gravatar'];
if ( $getJson )
{
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$ajax = new $classToLoad();
}
/* Do it */
try
{
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
if ( is_array( $photo ) )
{
if ( $getJson )
{
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
return $ajax->returnJsonArray( $photo, false, 'text/html' );
}
else
{
/* redirect to show */
$this->registry->output->redirectScreen( $this->lang->words['pp_photo_edited'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
}
}
}
catch( Exception $error )
{
$msg = $error->getMessage();
switch ( $msg )
{
default:
if ( $getJson )
{
$msg = ( ! empty( $this->lang->words[ 'pp_' . $msg ] ) ) ? $this->lang->words[ 'pp_' . $msg ] : $this->lang->words[ 'pp_generic_error' ];
$ajax->returnJsonError( $msg, 'text/html' );
exit();
}
else
{
$this->registry->getClass('output')->showError( $this->lang->words[ 'pp_' . $msg ], 1027, null, null, 403 );
}
break;
case 'PROFILE_DISABLED':
if ( $getJson )
{
$ajax->returnJsonError( 'member_profile_disabled', 'text/html' );
exit();
}
else
{
$this->registry->getClass('output')->showError( $this->lang->words['member_profile_disabled'], 1027, null, null, 403 );
}
break;
}
}
}
/**
* Display the photo editor
*
* @return @e void [HTML]
*/
protected function _show()
{
return $this->photo->getEditorHtml( $this->memberData );
}
}
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Allow user to change their status
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
* Last Updated: $Date: 2011-08-25 07:46:38 -0400 (Thu, 25 Aug 2011) $
* </pre>
*
* @author $Author: danc $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 6502 $
* @version $Revision: 9413 $
*
*/
@@ -30,9 +30,8 @@ class public_members_profile_status extends ipsCommand
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -91,9 +90,8 @@ class public_members_profile_status extends ipsCommand
/**
* Lock a status
*
* @access private
*/
private function _lockStatus()
protected function _lockStatus()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
@@ -133,9 +131,8 @@ class public_members_profile_status extends ipsCommand
/**
* Lock a status
*
* @access private
*/
private function _unlockStatus()
protected function _unlockStatus()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
@@ -175,25 +172,27 @@ class public_members_profile_status extends ipsCommand
/**
* Delete a status reply
*
* @access private
*/
private function _list()
protected function _list()
{
/* INIT */
$filters = array( 'limit' => 15 );
$filters = array( 'offset' => intval( $this->request['st'] ), 'limit' => 15, 'getCount' => true );
/* Add to the filters */
if ( $this->request['member_id'] )
{
$filters['member_id'] = intval( $this->request['member_id'] );
$filters['relatedTo'] = intval( $this->request['member_id'] );
$filters['isApproved'] = true;
}
else if ( $this->request['status_id'] )
{
$filters['status_id'] = intval( $this->request['status_id'] );
$filters['type'] = 'all';
}
else if ( $this->request['type'] == 'friends' )
{
$filters['friends_only'] = 1;
$filters['type'] = 'all';
}
/* Fetch last 20 */
@@ -201,11 +200,17 @@ class public_members_profile_status extends ipsCommand
/* Fetch */
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, $filters );
$count = $this->registry->getClass('memberStatus')->getStatusCount();
/* Fetch actions */
$actions = $this->registry->getClass('memberStatus')->fetchActions( $this->memberData, array( 'limit' => 30, 'not_theirs' => 1, 'custom' => 0 ) );
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count,
'itemsPerPage' => 15,
'currentStartValue' => $this->request['st'],
'seoTitle' => true,
'seoTemplate' => 'members_status_all',
'showNumbers' => false,
'baseUrl' => "app=members&amp;module=profile&amp;section=status&amp;type={$this->request['type']}&amp;member_id={$this->request['member_id']}" ) );
$content = $this->registry->getClass('output')->getTemplate('profile')->statusUpdatesPage( $statuses, $actions );
$content = $this->registry->getClass('output')->getTemplate('profile')->statusUpdatesPage( $statuses, $pages );
$this->registry->output->addContent( $content );
$this->registry->output->setTitle( $this->lang->words['status_updates_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
@@ -217,9 +222,8 @@ class public_members_profile_status extends ipsCommand
/**
* Delete a status reply
*
* @access private
*/
private function _deleteReply()
protected function _deleteReply()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
@@ -261,9 +265,8 @@ class public_members_profile_status extends ipsCommand
/**
* Delete a status
*
* @access private
*/
private function _deleteStatus()
protected function _deleteStatus()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
@@ -280,11 +283,14 @@ class public_members_profile_status extends ipsCommand
/* Set Data */
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
/* Can we reply? */
/* Can we delete? */
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
{
$this->registry->output->showError( 'status_off', 10279, null, null, 403 );
}
/* Get info */
$status = $this->registry->getClass('memberStatus')->getStatusData();
/* Update */
$this->registry->getClass('memberStatus')->deleteStatus();
@@ -296,16 +302,17 @@ class public_members_profile_status extends ipsCommand
}
else
{
$this->registry->output->redirectScreen( $this->lang->words['status_deleted'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
$_text = ( $status['status_member_id'] == $status['status_author_id'] ) ? $this->lang->words['status_deleted'] : $this->lang->words['comment_was_deleted'];
$this->registry->output->redirectScreen( $_text, $this->settings['base_url'] . 'showuser=' . $status['status_member_id'] . '&amp;tab=status', $status['members_seo_name'] );
}
}
/**
* Add a reply statussesses
*
* @access private
*/
private function _reply()
protected function _reply()
{
/* INIT */
$status_id = intval( $this->request['status_id'] );
@@ -350,13 +357,13 @@ class public_members_profile_status extends ipsCommand
/**
* Add a new statussesses
*
* @access private
*/
private function _new()
protected function _new()
{
$id = intval( $this->memberData['member_id'] );
$su_Twitter = intval( $this->request['su_Twitter'] );
$su_Facebook = intval( $this->request['su_Facebook'] );
$forMemberId = intval( $this->request['forMemberId'] );
/* Set Author */
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
@@ -370,8 +377,24 @@ class public_members_profile_status extends ipsCommand
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
}
/* Set post outs */
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
/* Update or comment? */
if ( $forMemberId && $forMemberId != $this->memberData['member_id'] )
{
$owner = IPSMember::load( $forMemberId );
if ( ! $owner['pp_setting_count_comments'] )
{
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
}
/* Set owner */
$this->registry->getClass('memberStatus')->setStatusOwner( $owner );
}
else
{
/* Set post outs */
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
}
/* Update */
$this->registry->getClass('memberStatus')->create();
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Profile View
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
* Last Updated: $Date: 2011-08-01 07:12:21 -0400 (Mon, 01 Aug 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 20th February 2002
* @version $Revision: 7007 $
* @version $Revision: 9338 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -50,7 +50,7 @@ class public_members_profile_view extends ipsCommand
* Class entry point
*
* @param object Registry reference
* @return void [Outputs to screen/redirects]
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -81,11 +81,133 @@ class public_members_profile_view extends ipsCommand
$this->registry->output->addNavigation( $this->lang->words['page_title_pp'] . ': ' . $this->member_name, '' );
$this->registry->output->sendOutput();
}
/**
* Get 12 random friends
*
* @param array $member Member data
* @return @e array
*/
protected function _getRandomFriends( $member )
{
# Get random number from member's friend cache... grab 10 random. array_rand( array, no.)
# also fall back on last 10 if no cache
$_member_ids = array();
$friends = array();
if ( $member['pp_setting_count_friends'] > 0 && $this->settings['friends_enabled'] )
{
$member['_cache'] = IPSMember::unpackMemberCache( $member['members_cache'] );
if ( is_array( $member['_cache']['friends'] ) AND count( $member['_cache']['friends'] ) )
{
foreach( $member['_cache']['friends'] as $id => $approved )
{
$id = intval( $id );
if ( $approved AND $id )
{
$_member_ids[] = $id;
}
}
$member['_total_approved_friends'] = count( $_member_ids );
if ( is_array( $_member_ids ) AND $member['_total_approved_friends'] )
{
$_max = $member['_total_approved_friends'] > 12 ? 12 : $member['_total_approved_friends'];
$_rand = array_rand( $_member_ids, $_max );
$_final = array();
# If viewing member is in list, let's show em
if( in_array( $this->memberData['member_id'], $_member_ids ) )
{
$_final[] = $this->memberData['member_id'];
$new_mids = array();
foreach( $_member_ids as $mid )
{
if( $mid == $this->memberData['member_id'] )
{
continue;
}
$new_mids[] = $mid;
}
$_member_ids = $new_mids;
unset( $new_mids );
if( is_array( $_rand ) )
{
if( count( $_rand ) >= 12 )
{
array_pop( $_rand );
}
}
}
if ( is_array( $_rand ) AND count( $_rand ) )
{
foreach( $_rand as $_id )
{
$_final[] = $_member_ids[ $_id ];
}
}
if ( count( $_final ) )
{
$sql_extra = ' AND friends_friend_id IN (' . IPSText::cleanPermString( implode( ',', $_final ) ) . ')';
}
}
}
/* Fetch friends */
$_memberIds = array();
$_members = array();
$_friends = array();
$this->DB->build( array('select' => '*',
'from' => 'profile_friends',
'where' => 'friends_member_id=' . $member['member_id'] . ' AND friends_approved=1' . $sql_extra,
'limit' => array( 0, 12 ),
'order' => 'friends_approved DESC' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$_memberIds[] = $row['friends_friend_id'];
$_friends[] = $row;
}
/* Got members? */
$_members = IPSMember::load( $_memberIds, 'core,extendedProfile' );
foreach( $_friends as $row )
{
if( ! isset( $_members[ $row['friends_friend_id'] ] ) )
{
continue;
}
$row = array_merge( $row, $_members[ $row['friends_friend_id'] ] );
$row['_friends_added'] = ipsRegistry::getClass('class_localization')->getDate( $row['friends_added'], 'SHORT' );
$row = IPSMember::buildProfilePhoto( $row );
$friends[] = $row;
}
}
return $friends;
}
/**
* Modern profile
*
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
protected function _viewModern()
{
@@ -94,12 +216,15 @@ class public_members_profile_view extends ipsCommand
//-----------------------------------------
$member_id = intval( $this->request['id'] ) ? intval( $this->request['id'] ) : intval( $this->request['MID'] );
$member_id = $member_id ? $member_id : $this->memberData['member_id'];
if( !$member_id )
{
$this->registry->output->showError( 'profiles_no_member', 10246.0, null, null, 404 );
}
$tab = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( $this->request['tab'] ) ) ), 0, 20 );
$firsttab = '';
$member = array();
$comments = array();
$comments_html = "";
$friends = array();
$visitors = array();
$comment_perpage = 5;
@@ -118,15 +243,6 @@ class public_members_profile_view extends ipsCommand
$time_adjust = $this->settings['time_adjust'] == "" ? 0 : $this->settings['time_adjust'];
$board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
$seenFiles = array();
//-----------------------------------------
// Check input..
//-----------------------------------------
if ( ! $member_id )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] );
}
/* Removing customization? */
if ( $_rCustom AND ( $member_id == $this->memberData['member_id'] OR $this->memberData['g_is_supmod'] ) AND $this->request['secure_key'] == $this->member->form_hash )
@@ -139,91 +255,91 @@ class public_members_profile_view extends ipsCommand
{
IPSMember::save( $member_id, array( 'core' => array( 'bw_disable_customization' => 1 ) ) );
}
//-----------------------------------------
// Configure tabs
//-----------------------------------------
foreach( ipsRegistry::$applications as $app )
{
/* Skip if disabled */
if( ! $app['app_enabled'] )
{
continue;
}
/* Path to tabs */
$custom_path = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/profileTabs';
if ( is_dir( $custom_path ) )
{
foreach( new DirectoryIterator( $custom_path ) as $f )
{
if ( ! $f->isDot() && ! $f->isDir() )
{
$file = $f->getFileName();
if( $file[0] == '.' )
{
continue;
}
if ( preg_match( "#\.conf\.php$#i", $file ) )
{
$classname = str_replace( ".conf.php", "", $file );
$CONFIG = array();
require( $custom_path . '/' . $file );
//-------------------------------
// Allowed to use?
//-------------------------------
if ( $CONFIG['plugin_enabled'] )
{
$CONFIG['app'] = $app['app_directory'];
$_position = $this->_getTabPosition( $_positions, $CONFIG['plugin_order'] );
$_tabs[ $_position ] = $CONFIG;
$_positions[] = $_position;
}
}
}
}
}
}
ksort( $_tabs );
foreach( $_tabs as $_pos => $data )
{
if( !$firsttab )
{
$firsttab = $data['plugin_key'];
}
$data['_lang'] = isset($this->lang->words[ $data['plugin_lang_bit'] ]) ? $this->lang->words[ $data['plugin_lang_bit'] ] : $data['plugin_name'];
$tabs[ $data['plugin_key'] ] = $data;
}
if ( ! $tab OR ( $tab != 'comments' AND $tab != 'settings' AND ! @file_exists( IPSLib::getAppDir( $tabs[ $tab ]['app'] ) . '/extensions/profileTabs/' . $tab . '.php' ) ) )
{
$tab = $firsttab;
$default_tab = $tabs[ $tab ]['app'] . ':' . $tab;
}
//-----------------------------------------
// Grab all data...
//-----------------------------------------
$member = IPSMember::load( $member_id, 'profile_portal,pfields_content,sessions,groups', 'id' );
$member = IPSMember::load( $member_id, 'profile_portal,pfields_content,sessions,groups', 'id' );
if ( !$member['member_id'] )
if ( ! $member['member_id'] )
{
$this->registry->output->showError( 'profiles_no_member', 10246, null, null, 404 );
}
// Cycle redirect on member profile for ID FURL Fix
//-----------------------------------------
// Configure tabs
//-----------------------------------------
foreach( IPSLib::getEnabledApplications() as $appDir => $app )
{
/* Path to tabs */
$custom_path = IPSLib::getAppDir( $appDir ) . '/extensions/profileTabs';
if ( is_dir( $custom_path ) )
{
foreach( new DirectoryIterator( $custom_path ) as $f )
{
if ( ! $f->isDot() && ! $f->isDir() )
{
$file = $f->getFileName();
if( $file[0] == '.' )
{
continue;
}
if ( preg_match( '#\.conf\.php$#i', $file ) )
{
$classname = str_replace( ".conf.php", "", $file );
$CONFIG = array();
require( $custom_path . '/' . $file );/*noLibHook*/
//-------------------------------
// Allowed to use?
//-------------------------------
if ( $CONFIG['plugin_enabled'] )
{
/* Block friends tab if we have disabled friends or friends feature is shut off */
if( $CONFIG['plugin_key'] == 'friends' AND ( !$member['pp_setting_count_friends'] OR !$this->settings['friends_enabled'] ) )
{
continue;
}
$CONFIG['app'] = $appDir;
$_position = $this->_getTabPosition( $_positions, $CONFIG['plugin_order'] );
$_tabs[ $_position ] = $CONFIG;
$_positions[] = $_position;
}
}
}
}
}
}
ksort( $_tabs );
foreach( $_tabs as $_pos => $data )
{
$data['_lang'] = isset($this->lang->words[ $data['plugin_lang_bit'] ]) ? $this->lang->words[ $data['plugin_lang_bit'] ] : $data['plugin_name'];
$tabs[ $data['plugin_key'] ] = $data;
}
if ( $tab && @is_file( IPSLib::getAppDir( $tabs[ $tab ]['app'] ) . '/extensions/profileTabs/' . $tab . '.php' ) )
{
$default_tab = $tabs[ $tab ]['app'] . ':' . $tab;
}
else
{
$default_tab = 'core:info';
}
$friends = $this->_getRandomFriends( $member );
/* Cycle redirect on member profile for ID FURL Fix */
if ( IPB_USE_ONLY_ID_FURL )
{
$member['members_seo_name'] = $member['member_id'];
@@ -281,7 +397,7 @@ class public_members_profile_view extends ipsCommand
}
$member['_local_time'] = $member['time_offset'] != "" ? gmstrftime( $this->settings['clock_long'], time() + ($member['time_offset']*3600) + ($time_adjust * 60) ) : '';
$member['g_title'] = IPSLib::makeNameFormatted( $member['g_title'], $member['g_id'], $member['prefix'], $member['suffix'] );
$member['g_title'] = IPSMember::makeNameFormatted( $member['g_title'], $member['g_id'], $member['prefix'], $member['suffix'] );
$member['_posts_day'] = 0;
$member['_total_pct'] = 0;
$member['_bday_month'] = $member['bday_month'] ? $this->lang->words['M_' . $member['bday_month'] ] : 0;
@@ -346,17 +462,6 @@ class public_members_profile_view extends ipsCommand
}
}
//-----------------------------------------
// Comments
//-----------------------------------------
if( $member['pp_setting_count_comments'] )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
$comment_lib = new $classToLoad( $this->registry );
$comment_html = $comment_lib->buildComments( $member );
}
//-----------------------------------------
// Visitors
//-----------------------------------------
@@ -365,8 +470,7 @@ class public_members_profile_view extends ipsCommand
{
$_pp_last_visitors = unserialize( $member['pp_last_visitors'] );
$_visitor_info = array();
$_count = 1;
if ( is_array( $_pp_last_visitors ) )
{
krsort( $_pp_last_visitors );
@@ -375,152 +479,27 @@ class public_members_profile_view extends ipsCommand
foreach( $_members as $_id => $_member )
{
$_visitor_info[ $_id ] = IPSMember::buildDisplayData( $_member, array( 'reputation' => 0, 'avatar' => 0, 'warn' => 0 ) );
$_visitor_info[ $_id ] = IPSMember::buildDisplayData( $_member, array( 'reputation' => 0, 'warn' => 0 ) );
}
foreach( $_pp_last_visitors as $_time => $_id )
{
if ( $_count > $member['pp_setting_count_visitors'] )
if ( !$_visitor_info[ $_id ]['members_display_name_short'] )
{
break;
}
$_count++;
if( !$_visitor_info[ $_id ]['members_display_name_short'] )
{
$_visitor_info[ $_id ] = IPSMember::buildDisplayData( IPSMember::setUpGuest(), array( 'reputation' => 0, 'avatar' => 0, 'warn' => 0 ) );
$_visitor_info[ $_id ] = IPSMember::buildDisplayData( IPSMember::setUpGuest(), array( 'reputation' => 0, 'warn' => 0 ) );
}
$_visitor_info[ $_id ]['_visited_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $_time, 'TINY' );
$_visitor_info[ $_id ]['members_display_name_short'] = $_visitor_info[ $_id ]['members_display_name_short'] ? $_visitor_info[ $_id ]['members_display_name_short'] : $this->lang->words['global_guestname'];
$visitors[] = $_visitor_info[ $_id ];
}
}
}
//-----------------------------------------
// Friends
//-----------------------------------------
# Get random number from member's friend cache... grab 10 random. array_rand( array, no.)
# also fall back on last 10 if no cache
if ( $member['pp_setting_count_friends'] > 0 && $this->settings['friends_enabled'] )
{
$member['_cache'] = IPSMember::unpackMemberCache( $member['members_cache'] );
if ( is_array( $member['_cache']['friends'] ) AND count( $member['_cache']['friends'] ) )
{
foreach( $member['_cache']['friends'] as $id => $approved )
{
$id = intval( $id );
if ( $approved AND $id )
{
$_member_ids[] = $id;
}
}
$member['_total_approved_friends'] = count( $_member_ids );
$member['_showing_friend_count'] = $member['_total_approved_friends'] > 50 ? 50 : $member['_total_approved_friends'];
if ( is_array( $_member_ids ) AND $member['_total_approved_friends'] )
{
$_max = $member['_total_approved_friends'] > 50 ? 50 : $member['_total_approved_friends'];
$_rand = array_rand( $_member_ids, $_max );
$_final = array();
# If viewing member is in list, let's show em
if( in_array( $this->memberData[ 'member_id' ], $_member_ids ) )
{
$_final[] = $this->memberData[ 'member_id' ];
$new_mids = array();
foreach( $_member_ids as $mid )
{
if( $mid == $this->memberData[ 'member_id' ] )
{
continue;
}
$new_mids[] = $mid;
}
$_member_ids = $new_mids;
unset( $new_mids );
if( is_array( $_rand ) )
{
if( count( $_rand ) >= 50 )
{
array_pop( $_rand );
}
}
}
if ( is_array( $_rand ) AND count( $_rand ) )
if ( count($visitors) == 5 )
{
foreach( $_rand as $_id )
{
$_final[] = $_member_ids[ $_id ];
}
}
if ( count( $_final ) )
{
$sql_extra = ' AND friends_friend_id IN (' . IPSText::cleanPermString( implode( ',', $_final ) ) . ')';
break;
}
}
}
/* Fetch friends */
$_memberIds = array();
$_members = array();
$_friends = array();
$this->DB->build( array('select' => '*',
'from' => 'profile_friends',
'where' => 'friends_member_id=' . $member_id . ' AND friends_approved=1' . $sql_extra,
'limit' => array( 0, 50 ),
'order' => 'friends_approved DESC' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$_memberIds[] = $row['friends_friend_id'];
$_friends[] = $row;
}
/* Got members? */
$_members = IPSMember::load( $_memberIds, 'core,extendedProfile' );
$member['_total_displayed_friends'] = 0;
foreach( $_friends as $row )
{
if( ! isset( $_members[ $row['friends_friend_id'] ] ) )
{
continue;
}
if ( $row['friends_friend_id'] && isset( $_members[ $row['friends_friend_id'] ] ) )
{
$row = array_merge( $row, $_members[ $row['friends_friend_id'] ] );
}
$row['_friends_added'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['friends_added'], 'SHORT' );
$row = IPSMember::buildProfilePhoto( $row );
$row['members_display_name_short'] = IPSText::truncate( $row['members_display_name'], 13 );
$friends[] = $row;
$member['_total_displayed_friends']++;
}
}
//-----------------------------------------
@@ -541,11 +520,11 @@ class public_members_profile_view extends ipsCommand
$tab_html = '';
if ( $tab != 'comments' AND $tab != 'settings' )
if ( $tab )
{
if( file_exists( IPSLib::getAppDir( $tabs[ $tab ]['app'] ) . '/extensions/profileTabs/' . $tab . '.php' ) )
if( is_file( IPSLib::getAppDir( $tabs[ $tab ]['app'] ) . '/extensions/profileTabs/' . $tab . '.php' ) )
{
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $tabs[ $tab ]['app'] ) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $tabs[ $tab ]['app'] );
$plugin = new $classToLoad( $this->registry );
$tab_html = $plugin->return_html_block( $member );
@@ -560,7 +539,7 @@ class public_members_profile_view extends ipsCommand
if ( $_desc )
{
$this->registry->output->addMetaTag( 'description', $member['members_display_name'] . ': ' . IPSText::getTextClass('bbcode')->stripAllTags( $_desc ) );
$this->registry->output->addMetaTag( 'description', $member['members_display_name'] . ': ' . IPSText::xssMakeJavascriptSafe( IPSText::getTextClass('bbcode')->stripAllTags( $_desc ) ) );
}
/* Reputation */
@@ -599,13 +578,65 @@ class public_members_profile_view extends ipsCommand
}
}
}
//-----------------------------------------
// Format signature
//-----------------------------------------
if( $member['signature'] )
{
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 0;
IPSText::getTextClass('bbcode')->parse_html = $member['g_dohtml'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'signatures';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
$member['signature'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['signature'] );
$member['signature'] = $this->registry->getClass('output')->getTemplate('global')->signature_separator( $member['signature'] );
}
//-----------------------------------------
// Format 'About me'
//-----------------------------------------
if( $member['pp_about_me'] )
{
IPSText::getTextClass( 'bbcode' )->parse_html = $member['g_dohtml'];
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'aboutme';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
$member['pp_about_me'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['pp_about_me'] );
}
/* final data */
if ( $default_tab == 'core:info' )
{
/* 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 */
$status = $this->registry->getClass('memberStatus')->fetchMemberLatest( $member['member_id'] );
}
//-----------------------------------------
// Add to output
//-----------------------------------------
$this->request['member_id'] = intval( $this->request['showuser'] );
$this->member_name = $member['members_display_name'];
$this->output = $this->registry->getClass('output')->getTemplate('profile')->profileModern( $tabs, $member, $comment_html, $friends, $visitors, $default_tab, $tab_html );
$this->output = $this->registry->getClass('output')->getTemplate('profile')->profileModern( $tabs, $member, $visitors, $default_tab, $tab_html, $friends, $status );
}
/**
@@ -668,7 +699,7 @@ class public_members_profile_view extends ipsCommand
{
if ( $_id == $member_id_to_add )
{
$found = 1;
$found = 1;
continue;
}
else
@@ -687,7 +718,7 @@ class public_members_profile_view extends ipsCommand
if ( ! $found )
{
if ( count( $recent_visitors ) > 10 )
if ( count( $recent_visitors ) > 5 )
{
$_tmp = array_pop( $recent_visitors );
}
@@ -1,32 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default warn section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'warn';
@@ -1,10 +0,0 @@
<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,969 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Member warn functions
* Last Updated: $Date: 2010-10-08 10:15:14 -0400 (Fri, 08 Oct 2010) $
* </pre>
*
* @author $Author: mark $
* @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 20th February 2002
* @version $Revision: 6956 $
*
* @todo [Future] Ability to require confirmation of a warning (feature)?
*/
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_warn_warn extends ipsCommand
{
/**
* Temporary stored output HTML
*
* @access public
* @var string
*/
public $output;
/**
* Forum information
*
* @access protected
* @var array Array of forum details
*/
protected $forum = array();
/**
* Topic information
*
* @access protected
* @var array Array of topic details
*/
protected $topic = array();
/**
* Topic ID
*
* @access protected
* @var integer Topic id
*/
protected $topic_id = 0;
/**
* Forum ID
*
* @access protected
* @var integer Forum id
*/
protected $forum_id = 0;
/**
* Moderator information
*
* @access protected
* @var array Array of moderator details
*/
protected $moderator = array();
/**
* Can ban member from warn panel
*
* @access protected
* @var bool Can ban member
*/
protected $canSuspend = 0;
/**
* Can mod queue member from warn panel
*
* @access protected
* @var bool Can mod queue member
*/
protected $canModQueue = 0;
/**
* Can remove posting rights from member from warn panel
*
* @access protected
* @var bool Can remove posting for member
*/
protected $canRemovePostAbility = 0;
/**
* Number of times per day member can be warned
*
* @access protected
* @var integer Number of times per day member can be warned
*/
protected $restrictWarnsPerDay = 0;
/**
* Type of member
*
* @access protected
* @var string mod, supmod, or member
*/
protected $type = 'mod';
/**
* Data for the member being warned
*
* @access protected
* @var array Member being warned
*/
protected $warn_member = array();
/**
* Class entry point
*
* @access public
* @param object Registry reference
* @return void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
$this->loadData();
//-----------------------------------------
// Bouncy, bouncy!
//-----------------------------------------
switch ($this->request['do'])
{
case 'dowarn':
$this->_doWarn();
break;
case 'add_note':
$this->_addNoteform();
break;
case 'save_note':
$this->_saveNote();
break;
case 'view':
$this->viewLog();
break;
case 'form':
default:
$this->_showForm();
break;
}
$this->registry->output->addNavigation( $this->lang->words['w_title'], '' );
$this->registry->output->addContent( $this->output );
if( $this->request['popup'] )
{
$this->registry->getClass('output')->popUpWindow( $this->output );
}
else
{
$this->registry->output->sendOutput();
}
}
/**
* Load all necessary properties
*
* @access public
* @param boolean Return false on error, instead of display
* @return void
*/
public function loadData( $returnOnError=false )
{
//-----------------------------------------
// Set up
//-----------------------------------------
$this->settings[ 'warn_min'] = $this->settings['warn_min'] ? $this->settings['warn_min'] : 0;
$this->settings[ 'warn_max'] = $this->settings['warn_max'] ? $this->settings['warn_max'] : 10;
//-----------------------------------------
// Load modules...
//-----------------------------------------
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
if ( ! $this->settings['warn_on'] )
{
if( $returnOnError )
{
return false;
}
$this->registry->output->showError( 'warn_system_off', 10248 );
}
/* Need app_class_forums to setup moderator stuff */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'applications/forums/app_class_forums.php', 'app_class_forums', 'forums' );
$app_class_forums = new $classToLoad( $this->registry );
//-----------------------------------------
// Make sure we're a moderator...
//-----------------------------------------
$pass = 0;
if( $this->memberData['member_id'] )
{
if( $this->memberData['g_is_supmod'] == 1 )
{
$pass = 1;
$this->canSuspend = $this->settings['warn_gmod_ban'];
$this->canModQueue = $this->settings['warn_gmod_modq'];
$this->canRemovePostAbility = $this->settings['warn_gmod_post'];
$this->restrictWarnsPerDay = intval($this->settings['warn_gmod_day']);
$this->canApprovePosts = 1;
$this->canApproveTopics = 1;
$this->canDeletePosts = 1;
$this->canDeleteTopics = 1;
$this->type = 'supmod';
}
else if( $this->memberData['is_mod'] )
{
$other_mgroups = array();
$_other_mgroups = IPSText::cleanPermString( $this->memberData['mgroup_others'] );
if( $_other_mgroups )
{
$other_mgroups = explode( ",", $_other_mgroups );
}
$other_mgroups[] = $this->memberData['member_group_id'];
$this->DB->build( array(
'select' => '*',
'from' => 'moderators',
'where' => "(member_id='" . $this->memberData['member_id'] . "' OR (is_group=1 AND group_id IN(" . implode( ",", $other_mgroups ) . ")))"
) );
$this->DB->execute();
while ( $this->moderator = $this->DB->fetch() )
{
if ( $this->moderator['allow_warn'] )
{
$pass = 1;
$this->canSuspend = $this->settings['warn_mod_ban'];
$this->canModQueue = $this->settings['warn_mod_modq'];
$this->canRemovePostAbility = $this->settings['warn_mod_post'];
$this->restrictWarnsPerDay = intval($this->settings['warn_mod_day']);
$this->canApprovePosts = $this->moderator['post_q'];
$this->canApproveTopics = $this->moderator['topic_q'];
$this->canDeletePosts = $this->moderator['delete_post'];
$this->canDeleteTopics = $this->moderator['delete_topic'];
$this->type = 'mod';
}
}
}
else if( $this->settings['warn_show_own'] and $this->memberData['member_id'] == $this->request['mid'] )
{
$pass = 1;
$this->canSuspend = 0;
$this->canModQueue = 0;
$this->canRemovePostAbility = 0;
$this->restrictWarnsPerDay = 0;
$this->canApprovePosts = 0;
$this->canApproveTopics = 0;
$this->canDeletePosts = 0;
$this->canDeleteTopics = 0;
$this->type = 'member';
}
}
if ( $pass == 0 )
{
if( $returnOnError )
{
return false;
}
$this->registry->output->showError( 'warn_no_access', 2025, null, null, 403 );
}
//-----------------------------------------
// Ensure we have a valid member
//-----------------------------------------
$mid = intval($this->request['mid']);
if ( $mid < 1 )
{
if( $returnOnError )
{
return false;
}
$this->registry->output->showError( 'warn_no_user', 10249, null, null, 404 );
}
$this->warn_member = IPSMember::load( $mid, 'all' );
if ( ! $this->warn_member['member_id'] )
{
if( $returnOnError )
{
return false;
}
$this->registry->output->showError( 'warn_no_user', 10250, null, null, 404 );
}
$this->registry->output->setTitle( $this->page_title ? $this->page_title : $this->lang->words['w_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
}
/**
* Save a new note
*
* @access protected
* @return void [Outputs to screen/redirects]
*/
protected function _saveNote()
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2026, null, null, 403 );
}
/* Security Check */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 3021, null, null, 403 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$note = trim( $this->request['note'] );
$save = array();
if ( $note )
{
//-----------------------------------------
// Ready to save?
//-----------------------------------------
$save['wlog_notes'] = "<content>{$note}</content>";
$save['wlog_notes'] .= "<mod></mod>";
$save['wlog_notes'] .= "<post></post>";
$save['wlog_notes'] .= "<susp></susp>";
$save['wlog_mid'] = $this->warn_member['member_id'];
$save['wlog_addedby'] = $this->memberData['member_id'];
$save['wlog_type'] = 'note';
$save['wlog_date'] = time();
//-----------------------------------------
// Enter into warn loggy poos (eeew - poo)
//-----------------------------------------
$this->DB->insert( 'warn_logs', $save );
}
//-----------------------------------------
// Done...
//-----------------------------------------
$popup = $this->request['popup'] ? '&amp;popup=1' : '';
$this->registry->output->silentRedirect( $this->settings['base_url']."app=members&amp;module=warn&amp;section=warn&amp;mid={$this->warn_member['member_id']}&amp;do=view" . $popup );
}
/**
* Form to add a new note
*
* @access protected
* @return void [Outputs to screen/redirects]
*/
protected function _addNoteForm()
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2027, null, null, 403 );
}
//-----------------------------------------
// INIT
//-----------------------------------------
$content = '';
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_add_note_form( $this->warn_member['member_id'], $this->warn_member['members_display_name'], $this->warn_member['members_seo_name'] );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->getClass('output')->popUpWindow( $this->output );
}
/**
* View the warn logs
*
* @access public
* @return string HTML output
*/
public function viewLog()
{
$perpage = 50;
$start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
$row = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['member_id']}" ) );
$rows = array();
$links = $this->registry->output->generatePagination( array(
'totalItems' => $row['cnt'],
'itemsPerPage' => $perpage,
'currentStartValue' => $start,
'baseUrl' => "app=members&amp;module=warn&amp;section=warn&amp;do=view&amp;mid={$this->warn_member['member_id']}",
) );
if ( $row['cnt'] > 0 )
{
$this->DB->build( array(
'select' => 'l.*',
'from' => array( 'warn_logs' => 'l' ),
'where' => 'l.wlog_mid=' . $this->warn_member['member_id'],
'order' => 'l.wlog_date DESC ',
'limit' => array( $start, $perpage ),
'add_join' => array(
array(
'select' => 'p.member_id as punisher_id, p.members_display_name as punisher_name, p.members_seo_name, p.member_group_id, p.mgroup_others',
'from' => array( 'members' => 'p' ),
'where' => 'p.member_id=l.wlog_addedby',
'type' => 'left',
)
)
) );
$q =$this->DB->execute();
while ( $r = $this->DB->fetch( $q ) )
{
if ( strstr( $r['wlog_notes'], '<content>' ) )
{
$raw = preg_match( "#<content>(.+?)</content>#is", $r['wlog_notes'], $match );
}
else
{
$_array = unserialize( $r['wlog_notes'] );
if ( is_array( $_array ) AND $_array['content'] )
{
$match[1] = $_array['content'];
}
}
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $r['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $r['mgroup_others'];
$r['content'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $match[1] );
$rows[] = $r;
}
}
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_view_log( $this->warn_member, $rows, $links );
$this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
return $this->output;
}
/**
* Add a new arn entry
*
* @access protected
* @return void [Outputs to screen/redirects]
*/
protected function _doWarn()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$save = array();
$err = 0;
$topicPosts_type = trim( $this->request['topicPosts_type'] );
$topicPosts_topics = intval( $this->request['topicPosts_topics'] );
$topicPosts_replies = intval( $this->request['topicPosts_replies'] );
$topicPosts_lastx = intval( $this->request['topicPosts_lastx'] );
$topicPosts_lastxunits = trim( $this->request['topicPosts_lastxunits'] );
$level_custom = intval( $this->request['level_custom'] );
$ban_indef = intval( $this->request['ban_indef'] );
$member_banned = intval( $this->warn_member['member_banned'] );
$warn_level = intval( $this->warn_member['warn_level']) ;
//--------------------------------------
// Are we allowed to do this?
//--------------------------------------
if ( $this->request['level'] == 'add' or ( $this->request['level'] == 'custom' and $level_custom > $warn_level ) )
{
$this->_checkAccess();
}
//-----------------------------------------
// Load Mod Squad
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
$moderatorLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// Security checks
//-----------------------------------------
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 2028, null, null, 403 );
}
//-----------------------------------------
// Check security fang
//-----------------------------------------
if ( $this->request['key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'warn_bad_key', 3020, null, null, 403 );
}
//-----------------------------------------
// As Celine Dion once squawked, "Show me the reason"
//-----------------------------------------
if ( trim($this->request['reason']) == "" )
{
$this->_showForm( 'we_no_reason' );
return;
}
//-----------------------------------------
// Other checks
//-----------------------------------------
if ( ! $this->settings['warn_past_max'] && $this->request['level'] != 'nochange' )
{
if ( $this->request['level'] == 'custom' )
{
if ( $level_custom > $this->settings['warn_max'] )
{
$err = 1;
}
else if( $level_custom < $this->settings['warn_min'] )
{
$err = 2;
}
}
else if ( $this->request['level'] == 'add' )
{
if ( $warn_level >= $this->settings['warn_max'] )
{
$err = 1;
}
}
else
{
if ( $warn_level <= $this->settings['warn_min'] )
{
$err = 2;
}
}
if ( $err )
{
$this->registry->output->showError( $err == 1 ? 'warn_past_max_high' : 'warn_past_max_low', 10251 );
}
}
//-----------------------------------------
// Plussy - minussy?
//-----------------------------------------
if( $this->request['level'] == 'nochange' )
{
$save['wlog_type'] = 'nochan';
}
else
{
$save['wlog_type'] = ( $this->request['level'] == 'custom' ) ? 'custom' : ( ( $this->request['level'] == 'add' ) ? 'neg' : 'pos' );
}
$save['wlog_date'] = time();
//-----------------------------------------
// Contacting the member?
//-----------------------------------------
$test_content = trim( IPSText::br2nl( $_POST['contact'] ) ) ;
if ( $test_content != "" )
{
if ( trim($this->request['subject']) == "" )
{
$this->_showForm('we_no_subject');
return;
}
unset($test_content);
if ( IPSText::getTextClass('editor')->method == 'rte' )
{
$this->request['contact'] = IPSText::getTextClass('editor')->processRawPost( 'contact' );
}
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn';
$save['wlog_contact'] = $this->request['contactmethod'];
$save['wlog_contact_content'] = "<subject>" . $this->request['subject'] . "</subject><content>" . $this->request['contact'] . "</content>";
$save['wlog_contact_content'] = IPSText::getTextClass( 'bbcode' )->preDbParse( $save['wlog_contact_content'] );
if ( $this->request['contactmethod'] == 'email' )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = 0;
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
$this->request['contact'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( IPSText::getTextClass( 'bbcode' )->preDbParse( $this->request['contact'] ) );
//-----------------------------------------
// Send the email
//-----------------------------------------
IPSText::getTextClass( 'email' )->getTemplate("email_member");
IPSText::getTextClass( 'email' )->buildMessage( array(
'MESSAGE' => IPSText::br2nl( $this->request['contact'] ),
'MEMBER_NAME' => $this->warn_member['members_display_name'],
'FROM_NAME' => $this->memberData['members_display_name']
)
);
IPSText::getTextClass( 'email' )->subject = $this->request['subject'];
IPSText::getTextClass( 'email' )->to = $this->warn_member['email'];
IPSText::getTextClass( 'email' )->from = $this->settings['email_out'];
IPSText::getTextClass( 'email' )->sendMail();
}
else
{
//-----------------------------------------
// Grab PM class
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
$messengerFunctions = new $classToLoad( $this->registry );
try
{
$messengerFunctions->sendNewPersonalTopic( $this->warn_member['member_id'],
$this->memberData['member_id'],
array(),
$this->request['subject'],
IPSText::getTextClass( 'editor' )->method == 'rte' ? nl2br($_POST['contact']) : $_POST['contact'],
array( 'origMsgID' => 0,
'fromMsgID' => 0,
'postKey' => md5(microtime()),
'trackMsg' => 0,
'addToSentFolder' => 0,
'hideCCUser' => 0,
'forcePm' => 1,
)
);
}
catch( Exception $error )
{
$msg = $error->getMessage();
$toMember = IPSMember::load( $this->warn_member['member_id'], 'core' );
if ( strstr( $msg, 'BBCODE_' ) )
{
$msg = str_replace( 'BBCODE_', '', $msg );
$this->registry->output->showError( $msg, 10252 );
}
else if ( isset($this->lang->words[ 'err_' . $msg ]) )
{
$this->lang->words[ 'err_' . $msg ] = $this->lang->words[ 'err_' . $msg ];
$this->lang->words[ 'err_' . $msg ] = str_replace( '#NAMES#' , implode( ",", $messengerFunctions->exceptionData ), $this->lang->words[ 'err_' . $msg ] );
$this->lang->words[ 'err_' . $msg ] = str_replace( '#TONAME#' , $toMember['members_display_name'] , $this->lang->words[ 'err_' . $msg ] );
$this->lang->words[ 'err_' . $msg ] = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words[ 'err_' . $msg ] );
$this->registry->output->showError( 'err_' . $msg, 10253 );
}
else if( $msg != 'CANT_SEND_TO_SELF' )
{
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
$this->registry->output->showError( $_msgString, 10254 );
}
}
}
}
else
{
unset($test_content);
}
//-----------------------------------------
// Right - is we banned or wha?
//-----------------------------------------
$restrict_post = '';
$mod_queue = '';
$susp = '';
$_notes = array();
$_notes['content'] = $this->request['reason'];
$_notes['mod'] = $this->request['mod_value'];
$_notes['post'] = $this->request['post_value'];
$_notes['susp'] = $this->request['susp_value'];
$_notes['ban'] = $ban_indef;
$_notes['topicPosts_type'] = $topicPosts_type;
$_notes['topicPosts_topics'] = $topicPosts_topics;
$_notes['topicPosts_replies'] = $topicPosts_replies;
$_notes['topicPosts_lastx'] = $topicPosts_lastx;
$_notes['topicPosts_lastxunits'] = $topicPosts_lastxunits;
$save['wlog_notes'] = serialize( $_notes );
//-----------------------------------------
// Member Content
//-----------------------------------------
if ( $topicPosts_type == 'unapprove' OR $topicPosts_type == 'approve' )
{
$time = ( $topicPosts_lastxunits == 'd' ) ? ( $topicPosts_lastx * 24 ) : $topicPosts_lastx;
$approve = ( $topicPosts_type == 'approve' ) ? TRUE : FALSE;
if ( ( $topicPosts_topics AND $this->canApproveTopics ) AND ( $topicPosts_replies AND $this->canApprovePosts ) )
{
$moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'all', $time );
}
else if ( $topicPosts_topics AND $this->canApproveTopics )
{
$moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'topics', $time );
}
else if ( $topicPosts_replies AND $this->canApprovePosts )
{
$moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'replies', $time );
}
}
else if ( $topicPosts_type == 'delete')
{
$time = ( $topicPosts_lastxunits == 'd' ) ? ( $topicPosts_lastx * 24 ) : $topicPosts_lastx;
if ( ( $topicPosts_topics AND $this->canDeleteTopics ) AND ( $topicPosts_replies AND $this->canDeletePosts ) )
{
$moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'all', $time );
}
else if ( $topicPosts_topics AND $this->canDeleteTopics )
{
$moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'topics', $time );
}
else if ( $topicPosts_replies AND $this->canDeletePosts )
{
$moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'replies', $time );
}
}
//-----------------------------------------
// Member Suspension
//-----------------------------------------
if ( $this->canModQueue )
{
if ( $this->request['mod_indef'] == 1 )
{
$mod_queue = 1;
}
elseif ( $this->request['mod_value'] > 0 )
{
$mod_queue = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['mod_value']), 'unit' => $this->request['mod_unit'] ) );
}
}
if ( $this->canRemovePostAbility )
{
if ( $this->request['post_indef'] == 1 )
{
$restrict_post = 1;
}
elseif ( $this->request['post_value'] > 0 )
{
$restrict_post = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['post_value']), 'unit' => $this->request['post_unit'] ) );
}
}
if ( $this->canSuspend )
{
if ( $ban_indef )
{
$member_banned = 1;
}
else if ( $this->request['susp_value'] > 0 )
{
$susp = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['susp_value']), 'unit' => $this->request['susp_unit'] ) );
}
/* Were banned but now unticked? */
if ( ! $ban_indef AND $member_banned )
{
$member_banned = 0;
}
}
$save['wlog_mid'] = $this->warn_member['member_id'];
$save['wlog_addedby'] = $this->memberData['member_id'];
//-----------------------------------------
// Enter into warn loggy poos (eeew - poo)
//-----------------------------------------
$this->DB->insert( 'warn_logs', $save );
//-----------------------------------------
// Update member
//-----------------------------------------
if( $this->request['level'] != 'nochange' )
{
if ( $this->request['level'] == 'custom' )
{
$warn_level = $level_custom;
}
else if ( $this->request['level'] == 'add' )
{
$warn_level++;
}
else
{
$warn_level--;
}
if ( $warn_level > $this->settings['warn_max'] )
{
$warn_level = $this->settings['warn_max'];
}
if ( $warn_level < intval($this->settings['warn_min']) )
{
$warn_level = intval($this->settings['warn_min']);
}
}
IPSMember::save( $this->warn_member['member_id'], array( 'core' => array( 'mod_posts' => $mod_queue,
'restrict_post' => $restrict_post,
'temp_ban' => $susp,
'member_banned' => $member_banned,
'warn_level' => $warn_level,
'warn_lastwarn' => time() ) ) );
//-----------------------------------------
// Now what? Show success screen, that's what!!
//-----------------------------------------
$this->lang->words['w_done_te'] = sprintf( $this->lang->words['w_done_te'], $this->warn_member['members_display_name'] );
$tid = intval($this->request['t']);
$topic = array();
if ( $tid > 0 )
{
$topic = $this->DB->buildAndFetch( array(
'select' => 't.tid, t.title, t.title_seo',
'from' => array( 'topics' => 't' ),
'where' => "t.tid={$tid}",
'add_join' => array( array(
'select' => 'f.id, f.name, f.name_seo',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=t.forum_id',
'type' => 'left'
) )
) );
}
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_success( $topic );
}
/**
* Show the add new warn form
*
* @access protected
* @param mixed Empty | Error message language key
* @return void [Outputs to screen/redirects]
*/
protected function _showForm( $errors="" )
{
if ( $this->type == 'member' )
{
$this->registry->output->showError( 'warn_member_notes', 10255, null, null, 403 );
}
$this->warn_member['warn_level'] = intval($this->warn_member['warn_level']);
$this->request['contact'] = $this->request['contact'] ? IPSText::getTextClass( 'bbcode' )->preEditParse( $this->request['contact'] ) : '';
$this->output .= $this->registry->getClass('output')->getTemplate('mod')->warnForm( IPSMember::buildDisplayData( $this->warn_member, '__all__' ),
intval($this->request['t']),
intval($this->request['st']),
$errors ? $this->lang->words[$errors] : '',
$this->canModQueue,
$this->canRemovePostAbility,
$this->canSuspend,
IPSText::getTextClass( 'editor' )->showEditor( $this->request['contact'] ? $this->request['contact'] : '', 'contact' ) );
}
/**
* Checking method access
*
* @access protected
* @return void [Displays error if appropriate]
*/
protected function _checkAccess()
{
//-----------------------------------------
// Protected member? Really? o_O
//-----------------------------------------
if ( strstr( ',' . $this->settings['warn_protected'] . ',', ',' . $this->warn_member['member_group_id'] . ',' ) )
{
$this->registry->output->showError( 'warn_protected_member', 10256, null, null, 403 );
}
//-----------------------------------------
// I've already warned you!!
//-----------------------------------------
if ( $this->restrictWarnsPerDay > 0 )
{
$time_to_check = time() - 86400;
$check = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as warn_times', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['member_id']} AND wlog_date > $time_to_check" ) );
if ( $check['warn_times'] >= $this->restrictWarnsPerDay )
{
$this->registry->output->showError( 'warned_already', 10257, null, null, 403 );
}
}
}
}