Index: trunk/core/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r8615 -r8620 --- trunk/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8615) +++ trunk/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8620) @@ -4,27 +4,20 @@ function Field($params) { + $profile_mapping = $this->getProfileMapping(); $field = $this->SelectParam($params, 'name,field'); - if (isset($params['user_value']) && $params['user_value']) { - $profile_mapping = Array ( - 'pp_firstname' => 'FirstName', - 'pp_lastname' => 'LastName', - 'pp_dob' => 'dob', - 'pp_email' => 'Email', - 'pp_phone' => 'Phone', - 'pp_street' => 'Street', - 'pp_city' => 'City', - 'pp_state' => 'State', - 'pp_zip' => 'Zip', - 'pp_country' => 'Country', - ); - + if (isset($params['profile_field']) && $params['profile_field']) { $params['name'] = $profile_mapping[$field]; - $value = $this->Application->ProcessParsedTag('u.current', 'Field', $params); + $value = $this->Application->ProcessParsedTag('u.profile', 'Field', $params); } else { - $value = $this->Application->RecallPersistentVar($field); + $profile_user_id = $this->Application->GetVar('user_id'); + if (!$profile_user_id) { + // if none user_id given use current user id + $profile_user_id = $this->Application->RecallVar('user_id'); + } + $value = $this->recallUserProfileVar($profile_user_id, $field); } if (isset($params['checked']) && $params['checked']) { @@ -34,6 +27,50 @@ return $value; } + + /** + * Allows to get persistent var from other user + * + * @param int $user_id + * @param string $var_name + * @return mixed + */ + function recallUserProfileVar($user_id, $var_name) + { + static $cached_vars = null; + + if (!isset($cached_vars)) { + $sql = 'SELECT VariableValue, VariableName + FROM '.TABLE_PREFIX.'PersistantSessionData + WHERE (PortalUserId = '.$user_id.') AND (LENGTH(VariableValue) < 10)'; + $cached_vars = $this->Conn->GetCol($sql, 'VariableName'); + } + + return isset($cached_vars[$var_name]) ? $cached_vars[$var_name] : false; + } + + /** + * Returns mapping between persistent var name and user profile field + * + * @return Array + */ + function getProfileMapping() + { + $profile_mapping = Array ( + 'pp_firstname' => 'FirstName', + 'pp_lastname' => 'LastName', + 'pp_dob' => 'dob', + 'pp_email' => 'Email', + 'pp_phone' => 'Phone', + 'pp_street' => 'Street', + 'pp_city' => 'City', + 'pp_state' => 'State', + 'pp_zip' => 'Zip', + 'pp_country' => 'Country', + ); + + return $profile_mapping; + } } ?> \ No newline at end of file Index: trunk/kernel/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r8615 -r8620 --- trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8615) +++ trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8620) @@ -4,27 +4,20 @@ function Field($params) { + $profile_mapping = $this->getProfileMapping(); $field = $this->SelectParam($params, 'name,field'); - if (isset($params['user_value']) && $params['user_value']) { - $profile_mapping = Array ( - 'pp_firstname' => 'FirstName', - 'pp_lastname' => 'LastName', - 'pp_dob' => 'dob', - 'pp_email' => 'Email', - 'pp_phone' => 'Phone', - 'pp_street' => 'Street', - 'pp_city' => 'City', - 'pp_state' => 'State', - 'pp_zip' => 'Zip', - 'pp_country' => 'Country', - ); - + if (isset($params['profile_field']) && $params['profile_field']) { $params['name'] = $profile_mapping[$field]; - $value = $this->Application->ProcessParsedTag('u.current', 'Field', $params); + $value = $this->Application->ProcessParsedTag('u.profile', 'Field', $params); } else { - $value = $this->Application->RecallPersistentVar($field); + $profile_user_id = $this->Application->GetVar('user_id'); + if (!$profile_user_id) { + // if none user_id given use current user id + $profile_user_id = $this->Application->RecallVar('user_id'); + } + $value = $this->recallUserProfileVar($profile_user_id, $field); } if (isset($params['checked']) && $params['checked']) { @@ -34,6 +27,50 @@ return $value; } + + /** + * Allows to get persistent var from other user + * + * @param int $user_id + * @param string $var_name + * @return mixed + */ + function recallUserProfileVar($user_id, $var_name) + { + static $cached_vars = null; + + if (!isset($cached_vars)) { + $sql = 'SELECT VariableValue, VariableName + FROM '.TABLE_PREFIX.'PersistantSessionData + WHERE (PortalUserId = '.$user_id.') AND (LENGTH(VariableValue) < 10)'; + $cached_vars = $this->Conn->GetCol($sql, 'VariableName'); + } + + return isset($cached_vars[$var_name]) ? $cached_vars[$var_name] : false; + } + + /** + * Returns mapping between persistent var name and user profile field + * + * @return Array + */ + function getProfileMapping() + { + $profile_mapping = Array ( + 'pp_firstname' => 'FirstName', + 'pp_lastname' => 'LastName', + 'pp_dob' => 'dob', + 'pp_email' => 'Email', + 'pp_phone' => 'Phone', + 'pp_street' => 'Street', + 'pp_city' => 'City', + 'pp_state' => 'State', + 'pp_zip' => 'Zip', + 'pp_country' => 'Country', + ); + + return $profile_mapping; + } } ?> \ No newline at end of file Index: trunk/themes/default2007/platform/elements/header.tpl =================================================================== diff -u -N -r8514 -r8620 --- trunk/themes/default2007/platform/elements/header.tpl (.../header.tpl) (revision 8514) +++ trunk/themes/default2007/platform/elements/header.tpl (.../header.tpl) (revision 8620) @@ -1,10 +1,9 @@ + +
- img/inportal_logo.gif" width="203" height="54" alt="" />
+ ">img/inportal_logo.gif" width="203" height="54" alt="" />
- + + +
@@ -17,11 +16,11 @@ - + img/languages_separator.gif" width="1" height="22" alt="" /> -
  : @@ -32,11 +31,11 @@ - -
- -
\ No newline at end of file Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r8428 -r8620 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8428) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8620) @@ -1102,13 +1102,30 @@ * * @param kEvent $event */ - function getPassedId(&$event) + function getPassedID(&$event) { - if ($event->Special == 'ord') { - $order =& $this->Application->recallObject('ord'); - return $order->GetDBField('PortalUserId'); + switch ($event->Special) { + case 'ord': + $order =& $this->Application->recallObject('ord'); + /* @var $order OrdersItem */ + + $id = $order->GetDBField('PortalUserId'); + break; + + case 'profile': + $id = $this->Application->GetVar('user_id'); + if (!$id) { + // if none user_id given use current user id + $id = $this->Application->RecallVar('user_id'); + } + break; + + default: + $id = parent::getPassedID($event); + break; } - return parent::getPassedID($event); + + return $id; } /** Index: trunk/themes/default2007/platform/my_account/my_favorites.tpl =================================================================== diff -u -N -r8599 -r8620 --- trunk/themes/default2007/platform/my_account/my_favorites.tpl (.../my_favorites.tpl) (revision 8599) +++ trunk/themes/default2007/platform/my_account/my_favorites.tpl (.../my_favorites.tpl) (revision 8620) @@ -19,11 +19,11 @@ + + - - - + Index: trunk/themes/default2007/index.tpl =================================================================== diff -u -N -r8521 -r8620 --- trunk/themes/default2007/index.tpl (.../index.tpl) (revision 8521) +++ trunk/themes/default2007/index.tpl (.../index.tpl) (revision 8620) @@ -9,7 +9,19 @@ - Index Page + + + + + + + In-portal is a revolutionary web site management system that allows you to automate and + facilitate management of large portal and community web sites. Regardless of whether you + are running a directory site or a content news portal, a community site or an online mall, + In-portal will enhance your web site management experience with innovative. + + + \ No newline at end of file Index: trunk/themes/default2007/platform/designs/preferences.tpl =================================================================== diff -u -N -r8615 -r8620 --- trunk/themes/default2007/platform/designs/preferences.tpl (.../preferences.tpl) (revision 8615) +++ trunk/themes/default2007/platform/designs/preferences.tpl (.../preferences.tpl) (revision 8620) @@ -1,7 +1,7 @@ - + ]" name="user_profile[]" value=""/> ]" onchange="update_checkbox(this, document.getElementById('user_profile[]'));"/> Index: trunk/themes/default2007/platform/my_account/my_account.tpl =================================================================== diff -u -N -r8599 -r8620 --- trunk/themes/default2007/platform/my_account/my_account.tpl (.../my_account.tpl) (revision 8599) +++ trunk/themes/default2007/platform/my_account/my_account.tpl (.../my_account.tpl) (revision 8620) @@ -14,7 +14,7 @@ - + my account big