Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/user_profile/user_profile_tp.php
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | |||||
* @param string $var_name | * @param string $var_name | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
function recallUserProfileVar($var_name) | function recallUserProfileVar($var_name) | ||||
{ | { | ||||
static $cache = null; | static $cache = null; | ||||
if (!isset($cache)) { | if (!isset($cache)) { | ||||
/** @var kDBItem $user */ | |||||
$user = $this->Application->recallObject( $this->getUserPrefixSpecial() ); | $user = $this->Application->recallObject( $this->getUserPrefixSpecial() ); | ||||
/* @var $user kDBItem */ | |||||
$sql = 'SELECT VariableValue, VariableName | $sql = 'SELECT VariableValue, VariableName | ||||
FROM ' . TABLE_PREFIX . 'UserPersistentSessionData | FROM ' . TABLE_PREFIX . 'UserPersistentSessionData | ||||
WHERE (PortalUserId = ' . $user->GetID() . ')'; | WHERE (PortalUserId = ' . $user->GetID() . ')'; | ||||
$cache = $this->Conn->GetCol($sql, 'VariableName'); | $cache = $this->Conn->GetCol($sql, 'VariableName'); | ||||
} | } | ||||
if (array_key_exists($var_name, $cache)) { | if (array_key_exists($var_name, $cache)) { | ||||
Show All 20 Lines | |||||
* @param Array $params | * @param Array $params | ||||
* @return int | * @return int | ||||
*/ | */ | ||||
function ProfileFieldCount($params) | function ProfileFieldCount($params) | ||||
{ | { | ||||
static $field_count = null; | static $field_count = null; | ||||
if (!isset($field_count)) { | if (!isset($field_count)) { | ||||
/** @var kDBItem $user */ | |||||
$user = $this->Application->recallObject( $this->getUserPrefixSpecial() ); | $user = $this->Application->recallObject( $this->getUserPrefixSpecial() ); | ||||
/* @var $user kDBItem */ | |||||
$display_to_public = $user->GetDBField('DisplayToPublic'); | $display_to_public = $user->GetDBField('DisplayToPublic'); | ||||
$field_count = $display_to_public ? substr_count($display_to_public, '|') - 1 : 0; | $field_count = $display_to_public ? substr_count($display_to_public, '|') - 1 : 0; | ||||
} | } | ||||
return $field_count; | return $field_count; | ||||
} | } | ||||
Show All 29 Lines |