Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,408 +1,309 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile View
|
||||
* Last Updated: $Date: 2009-05-18 22:05:12 -0400 (Mon, 18 May 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4668 $
|
||||
*
|
||||
*/
|
||||
|
||||
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'] )
|
||||
{
|
||||
case 'view':
|
||||
default:
|
||||
$this->_viewComments();
|
||||
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()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$comment_id = intval( $this->request['comment_id'] );
|
||||
//-----------------------------------------
|
||||
// Try it. You might like it.
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/comments.php' );
|
||||
$comment_lib = new profileCommentsLib( $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()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$comment_id = intval( $this->request['comment_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Try it. You might like it.
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/comments.php' );
|
||||
$comment_lib = new profileCommentsLib( $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§ion=comments&module=profile&member_id=' . $member_id . '&do=list&_saved=1&___msg=pp_comments_updated&md5check=' . $this->member->form_hash );
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the content for the comments tab
|
||||
*
|
||||
* @access private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
private function _viewComments()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$content = '';
|
||||
$comment_perpage = 10;
|
||||
$pages = '';
|
||||
$start = intval( $this->request['st'] );
|
||||
$sql_extra = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
die( '' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Not my tab? So no moderation...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ( $member_id != $this->memberData['member_id'] ) AND ( ! $this->memberData['g_is_supmod'] ) )
|
||||
{
|
||||
$sql_extra = ' AND comment_approved=1';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
die( '' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// How many comments must a man write down
|
||||
// before he is considered a spammer?
|
||||
//-----------------------------------------
|
||||
|
||||
$comment_count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count_comment',
|
||||
'from' => 'profile_comments',
|
||||
'where' => 'comment_for_member_id=' . $member_id . $sql_extra
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pages
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => intval( $comment_count['count_comment'] ),
|
||||
'itemsPerPage' => $comment_perpage,
|
||||
'currentStartValue' => $start,
|
||||
'baseUrl' => $this->settings['base_url'] . 'app=members&section=comments&module=profile&member_id=' . $member_id . '&do=view&md5check=' . $this->member->form_hash,
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Regenerate comments...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'pc.*',
|
||||
'from' => array( 'profile_comments' => 'pc' ),
|
||||
'where' => 'pc.comment_for_member_id='.$member_id . $sql_extra,
|
||||
'order' => 'pc.comment_date DESC',
|
||||
'limit' => array( $start, $comment_perpage ),
|
||||
'add_join' => array(
|
||||
0 => array(
|
||||
'select' => 'm.members_display_name, m.login_anonymous',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=pc.comment_by_member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
1 => array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch($o) )
|
||||
{
|
||||
$row['comment_content'] = IPSText::wordwrap( $row['comment_content'], '19', ' ' );
|
||||
|
||||
$row = IPSMember::buildDisplayData( $row, 0 );
|
||||
|
||||
if( !$row['members_display_name_short'] )
|
||||
{
|
||||
$row = array_merge( $row, IPSMember::setUpGuest() );
|
||||
}
|
||||
|
||||
$comments[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ok.. show the settings
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->showIframeComments( $member, $comments, $pages );
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->settings['board_name'] );
|
||||
$this->registry->getClass('output')->popUpWindow( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the new comment
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _doAddComment()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$comment = $this->request['comment_text'];
|
||||
|
||||
/* Add Comment */
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/comments.php' );
|
||||
$comment_lib = new profileCommentsLib( $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 );
|
||||
}
|
||||
}
|
||||
<?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§ion=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,18 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Define the default profile section
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
* 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.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4948 $
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,107 +1,109 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile View
|
||||
* Last Updated: $Date: 2009-03-04 07:36:56 -0500 (Wed, 04 Mar 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4135 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_dname extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dname_profiles_off', 10233 );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_off', 10234 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_no_id', 10235 );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['dname_title'] );
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['dname_title'], '' );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Profile View
|
||||
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: danc $
|
||||
* @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: 6502 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_dname extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dname_profiles_off', 10233, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_off', 10234, null, null, 403 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'dnames_no_id', 10235, null, null, 404 );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('output')->setTitle( $this->lang->words['dname_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->getClass('output')->addNavigation( $this->lang->words['dname_title'], '' );
|
||||
$this->registry->getClass('output')->addContent( $html );
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,247 +1,249 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Ignore a user
|
||||
* Last Updated: $Date: 2009-04-07 08:23:29 -0400 (Tue, 07 Apr 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4414 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_ignore extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
if( $result['error'] )
|
||||
{
|
||||
$this->registry->output->showError( $result['error'], 10266 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $result['message'], $this->settings['base_url'] . 'showuser=' . $this->request['memberID'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore a member's topics
|
||||
*
|
||||
* @access public
|
||||
* @param integer Member ID to ignore
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function ignoreMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we ignore them?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $member['_canBeIgnored'] !== TRUE )
|
||||
{
|
||||
return array( 0 => $this->lang->words['ignoreuser_cannot'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( $ignoreMe['ignore_' . $type ] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_already'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 1 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'ignored_users', array(
|
||||
'ignore_owner_id' => $this->memberData['member_id'],
|
||||
'ignore_ignore_id' => $member['member_id'],
|
||||
'ignore_' . $antiType => 0,
|
||||
'ignore_' . $type => 1,
|
||||
)
|
||||
);
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop ignoring the user's topics
|
||||
*
|
||||
* @access public
|
||||
* @param integer Member ID to stop ignoring
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function stopIgnoringMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( !$ignoreMe['ignore_' . $antiType ] )
|
||||
{
|
||||
$this->DB->delete( 'ignored_users', 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 0 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['noignoreuser_success'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Ignore a user
|
||||
* 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 $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_ignore extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $this->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $this->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
if( $result['error'] )
|
||||
{
|
||||
$this->registry->output->showError( $result['error'], 10266 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $result['message'], $this->settings['base_url'] . 'showuser=' . $this->request['memberID'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore a member's topics
|
||||
*
|
||||
* @access public
|
||||
* @param integer Member ID to ignore
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function ignoreMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we ignore them?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $member['_canBeIgnored'] !== TRUE )
|
||||
{
|
||||
return array( 0 => $this->lang->words['ignoreuser_cannot'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( $ignoreMe['ignore_' . $type ] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['ignoreuser_already'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 1 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->insert( 'ignored_users', array(
|
||||
'ignore_owner_id' => $this->memberData['member_id'],
|
||||
'ignore_ignore_id' => $member['member_id'],
|
||||
'ignore_' . $antiType => 0,
|
||||
'ignore_' . $type => 1,
|
||||
)
|
||||
);
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['ignoreuser_success'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop ignoring the user's topics
|
||||
*
|
||||
* @access public
|
||||
* @param integer Member ID to stop ignoring
|
||||
* @param string Column to update
|
||||
* @return array Array of info
|
||||
*/
|
||||
public function stopIgnoringMember( $ignoreId, $type='topics' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_usercp' ), 'core' );
|
||||
|
||||
$ignoreId = intval( $ignoreId );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$antiType = $type == 'topics' ? 'messages' : 'topics';
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$ignoreId )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['securehash_not_secure'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $ignoreId, 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already ignoring?
|
||||
//-----------------------------------------
|
||||
|
||||
$ignoreMe = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'ignored_users',
|
||||
'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id']
|
||||
) );
|
||||
|
||||
if ( $ignoreMe['ignore_id'] )
|
||||
{
|
||||
if( !$ignoreMe['ignore_' . $antiType ] )
|
||||
{
|
||||
$this->DB->delete( 'ignored_users', 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->DB->update( 'ignored_users', array( 'ignore_' . $type => 0 ), 'ignore_id=' . $ignoreMe['ignore_id'] );
|
||||
}
|
||||
|
||||
/* Rebuild cache */
|
||||
IPSMember::rebuildIgnoredUsersCache( $this->memberData );
|
||||
|
||||
return array( 'message' => $this->lang->words['noignoreuser_success'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return array( 'error' => $this->lang->words['noignoreuser_noid'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> 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,77 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile View
|
||||
* Last Updated: $Date: 2009-03-04 07:36:56 -0500 (Wed, 04 Mar 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 4135 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_photo extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'photos_profiles_off', 10242 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'photos_no_id', 10243 );
|
||||
}
|
||||
|
||||
$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'] );
|
||||
$this->registry->getClass('output')->popUpWindow( $html );
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <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) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: danc $
|
||||
* @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: 6502 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_photo extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen/redirects]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'photos_profiles_off', 10242, null, null, 403 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'photos_no_id', 10243, null, null, 404 );
|
||||
}
|
||||
|
||||
$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 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Allow user to change their status
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4239 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_status extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Security check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['k'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20314 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10269 );
|
||||
}
|
||||
|
||||
$newStatus = trim( IPSText::getTextClass('bbcode')->stripBadWords( $this->request['new_status'] ) );
|
||||
|
||||
IPSMember::save( $id, array( 'extendedProfile' => array( 'pp_status' => $newStatus, 'pp_status_update' => time() ) ) );
|
||||
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
@@ -1,86 +1,389 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Allow user to change their status
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_status extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Security check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['k'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20314 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_mem_info'] OR $this->memberData['gbw_no_status_update'] )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268 );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10269 );
|
||||
}
|
||||
|
||||
$newStatus = trim( IPSText::getTextClass('bbcode')->stripBadWords( $this->request['new_status'] ) );
|
||||
|
||||
IPSMember::save( $id, array( 'extendedProfile' => array( 'pp_status' => $newStatus, 'pp_status_update' => time() ) ) );
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Allow user to change their status
|
||||
* Last Updated: $Date: 2010-06-10 06:36:42 -0400 (Thu, 10 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: danc $
|
||||
* @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: 6502 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_profile_status extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->request['do'] = ( $this->request['do'] ) ? $this->request['do'] : 'list';
|
||||
|
||||
//-----------------------------------------
|
||||
// Security check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['do'] != 'list' AND ( $this->request['k'] != $this->member->form_hash ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'no_permission', 20314, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load status class */
|
||||
if ( ! $this->registry->isClassLoaded( 'memberStatus' ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' );
|
||||
$this->registry->setClass( 'memberStatus', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
/* WHAT R WE DOING? */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'list':
|
||||
$this->_list();
|
||||
break;
|
||||
case 'new':
|
||||
$this->_new();
|
||||
break;
|
||||
case 'reply':
|
||||
$this->_reply();
|
||||
break;
|
||||
case 'deleteStatus':
|
||||
$this->_deleteStatus();
|
||||
break;
|
||||
case 'deleteReply':
|
||||
$this->_deleteReply();
|
||||
break;
|
||||
case 'lockStatus':
|
||||
$this->_lockStatus();
|
||||
break;
|
||||
case 'unlockStatus':
|
||||
$this->_unlockStatus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _lockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canLockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->lockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_locked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a status
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _unlockStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canUnlockStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->unlockStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_unlocked'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _list()
|
||||
{
|
||||
/* INIT */
|
||||
$filters = array( 'limit' => 15 );
|
||||
|
||||
/* Add to the filters */
|
||||
if ( $this->request['member_id'] )
|
||||
{
|
||||
$filters['member_id'] = intval( $this->request['member_id'] );
|
||||
}
|
||||
else if ( $this->request['status_id'] )
|
||||
{
|
||||
$filters['status_id'] = intval( $this->request['status_id'] );
|
||||
}
|
||||
else if ( $this->request['type'] == 'friends' )
|
||||
{
|
||||
$filters['friends_only'] = 1;
|
||||
}
|
||||
|
||||
/* Fetch last 20 */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Fetch */
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, $filters );
|
||||
|
||||
/* Fetch actions */
|
||||
$actions = $this->registry->getClass('memberStatus')->fetchActions( $this->memberData, array( 'limit' => 30, 'not_theirs' => 1, 'custom' => 0 ) );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->statusUpdatesPage( $statuses, $actions );
|
||||
|
||||
$this->registry->output->addContent( $content );
|
||||
$this->registry->output->setTitle( $this->lang->words['status_updates_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
|
||||
$this->registry->output->addNavigation( $this->lang->words['status_updates_title'], '' );
|
||||
$this->registry->output->sendOutput();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status reply
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _deleteReply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$reply_id = intval( $this->request['reply_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $reply_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10276, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
$this->registry->getClass('memberStatus')->setReplyData( $reply_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10277, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteReply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_deleted'], $this->settings['base_url'] . 'app=members&module=profile&section=status&status_id=' . $status_id, 'false', 'members_status_all' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a status
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _deleteStatus()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10278, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canDeleteStatus() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10279, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->deleteStatus();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_deleted'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_deleted'], $this->settings['base_url'] . 'showuser=' . $this->memberData['member_id'], $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply statussesses
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _reply()
|
||||
{
|
||||
/* INIT */
|
||||
$status_id = intval( $this->request['status_id'] );
|
||||
$comment = trim( $this->request['comment-' . $status_id ] );
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Quick check? */
|
||||
if ( ! $status_id OR ! $comment )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10280, null, null, 404 );
|
||||
}
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( $comment );
|
||||
|
||||
/* Set Data */
|
||||
$this->registry->getClass('memberStatus')->setStatusData( $status_id );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canReply() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10281, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->reply();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_reply_done'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new statussesses
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _new()
|
||||
{
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
$su_Twitter = intval( $this->request['su_Twitter'] );
|
||||
$su_Facebook = intval( $this->request['su_Facebook'] );
|
||||
|
||||
/* Set Author */
|
||||
$this->registry->getClass('memberStatus')->setAuthor( $this->memberData );
|
||||
|
||||
/* Set Content */
|
||||
$this->registry->getClass('memberStatus')->setContent( trim( $this->request['content'] ) );
|
||||
|
||||
/* Can we reply? */
|
||||
if ( ! $this->registry->getClass('memberStatus')->canCreate() )
|
||||
{
|
||||
$this->registry->output->showError( 'status_off', 10268, null, null, 403 );
|
||||
}
|
||||
|
||||
/* Set post outs */
|
||||
$this->registry->getClass('memberStatus')->setExternalUpdates( array( 'twitter' => $su_Twitter, 'facebook' => $su_Facebook ) );
|
||||
|
||||
/* Update */
|
||||
$this->registry->getClass('memberStatus')->create();
|
||||
|
||||
/* Got a return URL? */
|
||||
if ( $this->request['rurl'] )
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . base64_decode( $this->request['rurl'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->redirectScreen( $this->lang->words['status_was_changed'], $this->settings['base_url'] . 'showuser=' . $id, $this->memberData['members_seo_name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user