Index: trunk/core/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r8620 -r8634 --- trunk/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8620) +++ trunk/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8634) @@ -12,12 +12,7 @@ $value = $this->Application->ProcessParsedTag('u.profile', 'Field', $params); } else { - $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); + $value = $this->recallUserProfileVar($field); } if (isset($params['checked']) && $params['checked']) { @@ -29,17 +24,37 @@ } /** + * Returns user_id to view profile from (same as u:getPassedID) + * + * @return int + */ + function getProfileUserID() + { + $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'); + } + + return $profile_user_id; + } + + /** * Allows to get persistent var from other user * * @param int $user_id * @param string $var_name * @return mixed */ - function recallUserProfileVar($user_id, $var_name) + function recallUserProfileVar($var_name, $user_id = null) { static $cached_vars = null; if (!isset($cached_vars)) { + if (!isset($user_id)) { + $user_id = $this->getProfileUserID(); + } + $sql = 'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'PersistantSessionData WHERE (PortalUserId = '.$user_id.') AND (LENGTH(VariableValue) < 10)'; @@ -71,6 +86,42 @@ return $profile_mapping; } + + /** + * Returns visible field count in user profile + * + * @param Array $params + * @return int + */ + function ProfileFieldCount($params) + { + static $field_count = null; + + if (!isset($field_count)) { + $profile_mapping = $this->getProfileMapping(); + $field_count = 0; + foreach ($profile_mapping as $var_name => $field_name) { + if ($this->recallUserProfileVar($var_name) == 1) { + $field_count++; + } + } + } + + return $field_count; + } + + /** + * Allows to detect that not all fields were shown + * + * @param Array $params + * @return bool + */ + function NotLastField($params) + { + $counter = (int)$this->Application->GetVar($params['counter']); + + return $counter < $this->ProfileFieldCount(); + } } ?> \ No newline at end of file Index: trunk/kernel/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r8620 -r8634 --- trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8620) +++ trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8634) @@ -12,12 +12,7 @@ $value = $this->Application->ProcessParsedTag('u.profile', 'Field', $params); } else { - $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); + $value = $this->recallUserProfileVar($field); } if (isset($params['checked']) && $params['checked']) { @@ -29,17 +24,37 @@ } /** + * Returns user_id to view profile from (same as u:getPassedID) + * + * @return int + */ + function getProfileUserID() + { + $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'); + } + + return $profile_user_id; + } + + /** * Allows to get persistent var from other user * * @param int $user_id * @param string $var_name * @return mixed */ - function recallUserProfileVar($user_id, $var_name) + function recallUserProfileVar($var_name, $user_id = null) { static $cached_vars = null; if (!isset($cached_vars)) { + if (!isset($user_id)) { + $user_id = $this->getProfileUserID(); + } + $sql = 'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'PersistantSessionData WHERE (PortalUserId = '.$user_id.') AND (LENGTH(VariableValue) < 10)'; @@ -71,6 +86,42 @@ return $profile_mapping; } + + /** + * Returns visible field count in user profile + * + * @param Array $params + * @return int + */ + function ProfileFieldCount($params) + { + static $field_count = null; + + if (!isset($field_count)) { + $profile_mapping = $this->getProfileMapping(); + $field_count = 0; + foreach ($profile_mapping as $var_name => $field_name) { + if ($this->recallUserProfileVar($var_name) == 1) { + $field_count++; + } + } + } + + return $field_count; + } + + /** + * Allows to detect that not all fields were shown + * + * @param Array $params + * @return bool + */ + function NotLastField($params) + { + $counter = (int)$this->Application->GetVar($params['counter']); + + return $counter < $this->ProfileFieldCount(); + } } ?> \ No newline at end of file Index: trunk/themes/default2007/platform/my_account/public_profile.tpl =================================================================== diff -u -N --- trunk/themes/default2007/platform/my_account/public_profile.tpl (revision 0) +++ trunk/themes/default2007/platform/my_account/public_profile.tpl (revision 8634) @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
img/s.gif" width="3" height="1" alt=""/>
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" /> +
+   + +
+ + send message + + +

+ +
+
+ + +
+ + \ No newline at end of file Index: trunk/themes/default2007/platform/my_account/my_preferences.tpl =================================================================== diff -u -N -r8615 -r8634 --- trunk/themes/default2007/platform/my_account/my_preferences.tpl (.../my_preferences.tpl) (revision 8615) +++ trunk/themes/default2007/platform/my_account/my_preferences.tpl (.../my_preferences.tpl) (revision 8634) @@ -73,9 +73,12 @@   - +
"/> + + "> +

Index: trunk/themes/default2007/platform/designs/preferences.tpl =================================================================== diff -u -N -r8620 -r8634 --- trunk/themes/default2007/platform/designs/preferences.tpl (.../preferences.tpl) (revision 8620) +++ trunk/themes/default2007/platform/designs/preferences.tpl (.../preferences.tpl) (revision 8634) @@ -14,4 +14,22 @@ + + + + + + + + + + + + + +
img/s.gif" width="3" height="1" alt=""/>
+ + +
+
\ No newline at end of file Index: trunk/core/units/users/users_tag_processor.php =================================================================== diff -u -N -r8369 -r8634 --- trunk/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 8369) +++ trunk/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 8634) @@ -82,7 +82,7 @@ $passed_key = $this->Application->GetVar('user_key'); $user_object = &$this->Application->recallObject('u.forgot'); - + // used for error reporting only -> rewrite code + theme (by Alex) $user_current_object = &$this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too @@ -176,16 +176,16 @@ $object =& $this->getObject($params); return $object->GetID() != -1 ? $object->GetDBField('Login') : 'root'; } - + function CookieUsername($params) { $submit_value = $this->Application->GetVar($params['submit_field']); if ($submit_value !== false) { return $submit_value; } - + $username = $this->Application->GetVar('save_username'); // from cookie - + if ($username == 'super-root') { $username = 'root'; } @@ -205,9 +205,21 @@ return $perm_helper->TagPermissionCheck($params, 'u_HasPermission'); } - - } + /** + * Returns link to post author public profile + * + * @param Array $params + * @return string + */ + function ProfileLink($params) + { + $object =& $this->getObject($params); + $params['user_id'] = $object->GetID(); + return $this->Application->ProcessParsedTag('m', 'Link', $params); + } + } + ?> \ No newline at end of file