Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -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,17 +2,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.0
|
||||
* Custom Profile Fields
|
||||
* Last Updated: $Date: 2010-09-27 18:18:35 -0400 (Mon, 27 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-09-01 11:30:42 -0400 (Thu, 01 Sep 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
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6917 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9440 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -158,10 +158,16 @@ class customProfileFields
|
||||
*/
|
||||
protected $_addedFields = array();
|
||||
|
||||
/* Ability to pull fields from groups */
|
||||
protected $fromGroups = array();
|
||||
|
||||
/* Ability to exlude fields from groups */
|
||||
protected $notGroups = array();
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -172,7 +178,27 @@ class customProfileFields
|
||||
/* User Setup */
|
||||
$this->member_id = ipsRegistry::member()->getProperty( 'member_id' );
|
||||
$this->admin = intval( ipsRegistry::member()->getProperty( 'g_access_cp' ) );
|
||||
$this->supmod = intval( ipsRegistry::member()->getProperty( 'g_is_supmod' ) );
|
||||
$this->supmod = intval( ipsRegistry::member()->getProperty( 'g_is_supmod' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set only to show from x groups
|
||||
*
|
||||
* @param mixed string or array
|
||||
*/
|
||||
public function setFromGroups( $in )
|
||||
{
|
||||
$this->fromGroups = ( is_array( $in ) ) ? $in : array( $in );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set only to show from x groups
|
||||
*
|
||||
* @param mixed string or array
|
||||
*/
|
||||
public function setNotGroups( $in )
|
||||
{
|
||||
$this->notGroups = ( is_array( $in ) ) ? $in : array( $in );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +206,7 @@ class customProfileFields
|
||||
*
|
||||
* @param string $type Set to view for displaying the field normally or edit for displaying in a form
|
||||
* @param bool $mlist Whether this is the memberlist or not
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function initData( $type='view', $mlist=0 )
|
||||
{
|
||||
@@ -230,11 +256,40 @@ class customProfileFields
|
||||
|
||||
if( $mlist )
|
||||
{
|
||||
$this->in_fields[ $id ] = ( isset(ipsRegistry::$request[ 'field_' . $id ]) AND ipsRegistry::$request[ 'field_' . $id ] ) ? ipsRegistry::$request[ 'field_' . $id ] : '';
|
||||
$this->in_fields[ $id ] = '';
|
||||
|
||||
if( !empty(ipsRegistry::$request[ 'field_' . $id ]) )
|
||||
{
|
||||
if( is_string(ipsRegistry::$request[ 'field_' . $id ]) )
|
||||
{
|
||||
$this->in_fields[ $id ] = urldecode(ipsRegistry::$request[ 'field_' . $id ]);
|
||||
}
|
||||
else if( is_array(ipsRegistry::$request[ 'field_' . $id ]) )
|
||||
{
|
||||
foreach( ipsRegistry::$request[ 'field_' . $id ] as $k => $v )
|
||||
{
|
||||
$this->in_fields[ $id ][ $k ] = urldecode($v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->in_fields[ $id ] = isset( $this->member_data['field_'.$id] ) ? $this->member_data['field_' . $id] : ( isset(ipsRegistry::$request[ 'field_' . $id ]) ? ipsRegistry::$request[ 'field_' . $id ] : '' );
|
||||
$_val = '';
|
||||
|
||||
if( is_string(ipsRegistry::$request[ 'field_' . $id ]) )
|
||||
{
|
||||
$_val = urldecode(ipsRegistry::$request[ 'field_' . $id ]);
|
||||
}
|
||||
else if( is_array(ipsRegistry::$request[ 'field_' . $id ]) )
|
||||
{
|
||||
foreach( ipsRegistry::$request[ 'field_' . $id ] as $k => $v )
|
||||
{
|
||||
$_val[ $k ] = urldecode($v);
|
||||
}
|
||||
}
|
||||
|
||||
$this->in_fields[ $id ] = isset( $this->member_data['field_'.$id] ) ? $this->member_data['field_' . $id] : $_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,9 +326,12 @@ class customProfileFields
|
||||
|
||||
/* Kernel profile field class */
|
||||
$_NOW = IPSDebug::getMemoryDebugFlag();
|
||||
require_once( IPS_KERNEL_PATH . 'classCustomFields.php' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classCustomFields.php', 'classCustomFields' );
|
||||
|
||||
IPSDebug::setMemoryDebugFlag( "Get CustomFields Kernel Class", $_NOW );
|
||||
$this->cfields_obj = new classCustomFields( $this->cache_data, $type );
|
||||
|
||||
$this->cfields_obj = new $classToLoad( $this->cache_data, $type );
|
||||
$this->cfields = $this->cfields_obj->cfields;
|
||||
|
||||
$this->init = 1;
|
||||
@@ -283,7 +341,7 @@ class customProfileFields
|
||||
* Parses fields for saving into the database, results are stored in $this->out_fields
|
||||
*
|
||||
* @param array $field_data Array that contains the fields to parse, usually $this->request
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function parseToSave( $field_data, $mode='normal' )
|
||||
{
|
||||
@@ -350,7 +408,7 @@ class customProfileFields
|
||||
/* Make sure error message texts are loaded */
|
||||
ipsRegistry::getClass( 'class_localization' )->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
if( array_key_exists( 'field_' . $id, $this->error_messages ) )
|
||||
if( isset( $this->error_messages[ 'field_' . $id ] ) )
|
||||
{
|
||||
$this->error_messages['field_' . $id] .= ', ' . ipsRegistry::getClass( 'class_localization' )->words['profile_field_error__blacklist'];
|
||||
}
|
||||
@@ -369,7 +427,7 @@ class customProfileFields
|
||||
*
|
||||
* @param bool $check_topic_format Whether to apply topic formatting
|
||||
* @param string $location Location being called from
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function parseToView( $check_topic_format=0, $location='profile' )
|
||||
{
|
||||
@@ -377,11 +435,11 @@ class customProfileFields
|
||||
foreach( $this->cfields as $id => $field )
|
||||
{
|
||||
/* Can we view this field? */
|
||||
if( ! $this->_checkFieldAuth( $field ) )
|
||||
if ( ! $this->_checkFieldAuth( $field ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Topic Format */
|
||||
if( $check_topic_format )
|
||||
{
|
||||
@@ -474,7 +532,7 @@ class customProfileFields
|
||||
* Parses fields for editing, results are stored in $this->out_fields
|
||||
*
|
||||
* @param string [$mode] register or normal, normal is default
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function parseToEdit( $mode='normal' )
|
||||
{
|
||||
@@ -515,10 +573,32 @@ class customProfileFields
|
||||
}
|
||||
}
|
||||
|
||||
/* Whitelist */
|
||||
if ( count( $this->fromGroups ) )
|
||||
{
|
||||
if ( in_array( $field->raw_data['pf_group_key'], $this->fromGroups ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Blacklist */
|
||||
if ( count( $this->notGroups ) )
|
||||
{
|
||||
if ( in_array( $field->raw_data['pf_group_key'], $this->notGroups ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Member Edit? */
|
||||
if( $this->type == 'edit' && ! $field->raw_data['pf_member_edit'] )
|
||||
{
|
||||
if ( $mode != 'register' AND ! $this->admin AND !$this->supmod )
|
||||
if ( $mode != 'register' AND $mode != 'mlist' AND ! $this->admin AND !$this->supmod )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user