diff --git a/e107_files/shortcode/user_extended.sc b/e107_files/shortcode/user_extended.sc index 6db637642..f692be461 100644 --- a/e107_files/shortcode/user_extended.sc +++ b/e107_files/shortcode/user_extended.sc @@ -1,16 +1,14 @@ -//USAGE: {EXTENDED=.[text|value|icon].} +//USAGE: {EXTENDED=.[text|value|icon|text_value].} //EXAMPLE: {EXTENDED=user_gender.value.5} will show the value of the extended field user_gender for user #5 include(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php"); $parms = explode(".", $parm); -global $currentUser, $sql, $tp, $loop_uid, $e107, $imode; +global $currentUser, $sql, $tp, $loop_uid, $e107, $imode, $sc_style; if(isset($loop_uid) && intval($loop_uid) == 0) { return ""; } -$ueStruct = getcachedvars("user_extended_struct"); -if(!$ueStruct) -{ - require_once(e_HANDLER."user_extended_class.php"); - $ueStruct = e107_user_extended::user_extended_getStruct(); - cachevars("user_extended_struct", $ueStruct); -} +$key = $parms[0].".".$parms[1]; +$sc_style['USER_EXTENDED']['pre'] = (isset($sc_style['USER_EXTENDED'][$key]['pre']) ? $sc_style['USER_EXTENDED'][$key]['pre'] : ""); +$sc_style['USER_EXTENDED']['post'] = (isset($sc_style['USER_EXTENDED'][$key]['post']) ? $sc_style['USER_EXTENDED'][$key]['post'] : ""); +include_once(e_HANDLER."user_extended_class.php"); +$ueStruct = e107_user_extended::user_extended_getStruct(); $uid = intval($parms[2]); if($uid == 0) @@ -45,6 +43,20 @@ if ( return FALSE; } +if($parms[1] == 'text_value') +{ + $_value = $tp->parseTemplate("{USER_EXTENDED={$parms[0]}.value}"); + if($_value) + { + $__pre = (isset($sc_style['USER_EXTENDED'][$key]['pre']) ? $sc_style['USER_EXTENDED'][$key]['pre'] : ""); + $__post = (isset($sc_style['USER_EXTENDED'][$key]['post']) ? $sc_style['USER_EXTENDED'][$key]['post'] : ""); + $_text = $tp->parseTemplate("{USER_EXTENDED={$parms[0]}.text}"); + $_mid = (isset($sc_style['USER_EXTENDED'][$key]['mid']) ? $sc_style['USER_EXTENDED'][$key]['mid'] : ""); + return $__pre.$_text.$_mid.$_value.$__post; + } + return false; +} + if ($parms[1] == 'text') { $text_val = $ueStruct["user_".$parms[0]]['user_extended_struct_text']; diff --git a/e107_plugins/forum/templates/forum_viewtopic_template.php b/e107_plugins/forum/templates/forum_viewtopic_template.php index 758e5ae63..e6b8f810d 100644 --- a/e107_plugins/forum/templates/forum_viewtopic_template.php +++ b/e107_plugins/forum/templates/forum_viewtopic_template.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_viewtopic_template.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:35:19 $ +| $Revision: 1.2 $ +| $Date: 2006-12-16 14:13:28 $ | $Author: mcfly_e107 $ +----------------------------------------------------------------------------+ */ @@ -30,7 +30,8 @@ $sc_style['LEVEL']['post'] = ""; $sc_style['ANON_IP']['pre'] = "
"; $sc_style['ANON_IP']['post'] = "
"; -$location_tpl = (array_key_exists('user_location', $currentUser) ? "{USER_EXTENDED=location.text}: {USER_EXTENDED=location.value}" : ""); +$sc_style['USER_EXTENDED']['location.text_value']['mid'] = ": "; +$sc_style['USER_EXTENDED']['location.text_value']['post'] = "
"; $FORUMSTART = "
@@ -118,7 +119,7 @@ $FORUMTHREADSTYLE = " {LEVEL=pic} {LEVEL=userid} {JOINED} - {$location_tpl}
+ {USER_EXTENDED=location.text_value} {POSTS}
@@ -204,7 +205,7 @@ $FORUMREPLYSTYLE = " {LEVEL=pic} {LEVEL=userid} {JOINED} - {$location_tpl}
+ {USER_EXTENDED=location.text_value} {POSTS}
diff --git a/e107_themes/e107v4a/forum_template.php b/e107_themes/e107v4a/forum_template.php index dc97024ba..a63a44db7 100644 --- a/e107_themes/e107v4a/forum_template.php +++ b/e107_themes/e107v4a/forum_template.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_themes/e107v4a/forum_template.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:35:47 $ +| $Revision: 1.2 $ +| $Date: 2006-12-16 14:13:28 $ | $Author: mcfly_e107 $ +----------------------------------------------------------------------------+ */ @@ -21,7 +21,9 @@ if (!defined('e107_INIT')) { exit; } $sc_style['ANON_IP']['pre'] = "
"; $sc_style['ANON_IP']['post'] = ""; -$location_tpl = (array_key_exists('user_location', $currentUser) ? "{USER_EXTENDED=location.text}: {USER_EXTENDED=location.value}" : ""); + +$sc_style['USER_EXTENDED']['location.text_value']['mid'] = ": "; +$sc_style['USER_EXTENDED']['location.text_value']['post'] = "
"; $FORUMSTART = " @@ -70,7 +72,7 @@ $FORUMTHREADSTYLE = " - + @@ -102,7 +104,7 @@ $FORUMREPLYSTYLE = " - +
\n{AVATAR}\n
\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{$location_tpl}
\n{POSTS}\n
\n
\n{AVATAR}\n
\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{USER_EXTENDED=location.text_value}\n{POSTS}\n
\n
{POLL}\n{POST}\n{SIGNATURE}\n
\n{AVATAR}\n\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{$location_tpl}
\n{POSTS}\n
\n
\n{AVATAR}\n\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{USER_EXTENDED=location.text_value}\n{POSTS}\n\n \n{POST}\n{SIGNATURE}\n