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
* 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 );
}
}