From 583a11dca85d608797d3b81a81fa1595923ee381 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 14 Mar 2016 18:32:51 -0700 Subject: [PATCH] Issue #1423 - User Profile template upgrade tweaks. --- .../shortcodes/batch/user_shortcodes.php | 11 +- e107_core/templates/user_template.php | 295 ++++++++++-------- e107_handlers/e_parse_class.php | 2 +- e107_web/css/e107.css | 39 +++ 4 files changed, 209 insertions(+), 138 deletions(-) diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index b6a5105a2..500dec768 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -421,7 +421,8 @@ class user_shortcodes extends e_shortcode function sc_user_loginname($parm='') { - if(ADMIN && getperms("4")) { + if(ADMIN && getperms("4")) + { return $this->var['user_loginname']; } } @@ -618,11 +619,9 @@ class user_shortcodes extends e_shortcode function sc_user_picture($parm) { - $tp = e107::getParser(); - $parm['id'] = 'user-profile-avatar'; - return $tp->toAvatar($this->var, $parm); - + return e107::getParser()->toAvatar($this->var, $parm); +/* return $tp->parseTemplate("{USER_AVATAR=".$this->var['user_sess']."}",true); @@ -634,7 +633,7 @@ class user_shortcodes extends e_shortcode else { return LAN_USER_42; - } + }*/ } /* sc_USER_AVATAR - see single/user_avatar.php */ diff --git a/e107_core/templates/user_template.php b/e107_core/templates/user_template.php index bcbdb506c..daa6a426c 100644 --- a/e107_core/templates/user_template.php +++ b/e107_core/templates/user_template.php @@ -25,6 +25,11 @@ global $user_shortcodes, $pref, $user; //Set this to TRUE if you would like any extended user field that is empty to NOT be shown on the profile page define("HIDE_EMPTY_FIELDS", FALSE); + + + +/// --------------------- Start of Legacy Code --------------------------------------- // + $EXTENDED_CATEGORY_START = "{EXTENDED_NAME}"; $EXTENDED_CATEGORY_TABLE = " @@ -216,136 +221,8 @@ $USER_EMBED_USERPROFILE_TEMPLATE = " "; - -// Convert Templates from v1.x to v2.x Standards. -/** TODO EXPERIMENTAL */ -if(e_DEBUG == true) - { -e107::css('inline', " -.panel-profile .user-avatar { - max-width: 150px; - margin-top: -90px; - margin-bottom: 15px; - border: 5px solid #fff; - border-radius: 100%; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - margin-left:auto; - margin-right:auto; -} -.panel-profile .panel-heading h5.user-id { - color:#ffffff; -} -.panel-profile .panel-body span.padding-left { - display:block; -} -.panel-profile .panel-body p { - clear: both; - float: none; - display: block; -} -.panel-profile .profile-header { - max-width:300px; - margin-left: auto; - margin-right: auto; -} -.panel-profile .profile-header h4 { - padding-bottom: 30px; -} -.panel-profile .panel-body p.row { - border-top: 1px solid rgba(170,170,170,0.35); - padding-top: 10px; -} -"); - -$USER_EMBED_USERPROFILE_TEMPLATE = ' -

- {USER_ADDON_LABEL} - {USER_ADDON_TEXT} -

-'; -$EXTENDED_CATEGORY_TABLE = ' -

- {EXTENDED_NAME} - {EXTENDED_VALUE} -

-'; -$sc_style['USER_COMMENTPOSTS']['pre'] = ''.LAN_USER_68.''; - -$sc_style['USER_COMMENTPER']['pre'] = ' ( '; -$sc_style['USER_COMMENTPER']['post'] = '% )'; - - $USER_FULL_TEMPLATE = ' - {SETIMAGE: w=600} -

-
-
-
-
'.LAN_USER_58.' {USER_ID}
-
-
- {SETIMAGE: w=200} - {USER_PICTURE: shape=circle&link=1} -
-

{USER_NAME}

-

{USER_SIGNATURE}

-

{USER_RATING}

-

{USER_SENDPM}

-
-
-
-

'.LAN_USER_63.' {USER_REALNAME}

-

'.LAN_USER_02.' {USER_LOGINNAME}

-

'.LAN_USER_60.' {USER_EMAIL}

-

'.LAN_USER_54.' {USER_LEVEL}

-

'.LAN_USER_65.' {USER_LASTVISIT}
{USER_LASTVISIT_LAPSE}

-

'.LAN_USER_59.' {USER_JOIN}
{USER_DAYSREGGED}

-

'.LAN_USER_66.' {USER_VISITS}

- {USER_ADDONS} -

{USER_COMMENTPOSTS} {USER_COMMENTPER}

- {USER_EXTENDED_ALL} -

-
-
- {USER_UPDATE_LINK} -
-
-
    - -
  • - -
  • - -
-
-
-
- {PROFILE_COMMENTS} - {PROFILE_COMMENT_FORM} -
-
-
-'; - } - - - - -$USER_TEMPLATE['view'] = $USER_FULL_TEMPLATE; -$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_START; -$USER_TEMPLATE['extended']['item'] = $EXTENDED_CATEGORY_TABLE ; -$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_END; -$USER_TEMPLATE['addon'] = $USER_EMBED_USERPROFILE_TEMPLATE; - -$USER_TEMPLATE['list']['start'] = $USER_SHORT_TEMPLATE_START; -$USER_TEMPLATE['list']['item'] = $USER_SHORT_TEMPLATE; -$USER_TEMPLATE['list']['end'] = $USER_SHORT_TEMPLATE_END; - -// Convert Shortcode Wrappers from v1.x to v2.x standards. - +// Convert Shortcode Wrappers from v1.x to v2.x standards. +$USER_TEMPLATE['view'] = $USER_FULL_TEMPLATE; $USER_WRAPPER['view']['USER_COMMENTS_LINK'] = $sc_style['USER_COMMENTS_LINK']['pre']."{---}".$sc_style['USER_COMMENTS_LINK']['post']; $USER_WRAPPER['view']['USER_SIGNATURE'] = $sc_style['USER_SIGNATURE']['pre']."{---}".$sc_style['USER_SIGNATURE']['post']; $USER_WRAPPER['view']['USER_UPDATE_LINK'] = $sc_style['USER_UPDATE_LINK']['pre']."{---}".$sc_style['USER_UPDATE_LINK']['post']; @@ -356,4 +233,160 @@ $USER_WRAPPER['view']['USER_LOGINNAME'] = $sc_style['USER_LOGINNAME']['pre']."{ $USER_WRAPPER['view']['USER_COMMENTPOSTS'] = $sc_style['USER_COMMENTPOSTS']['pre']."{---}"; $USER_WRAPPER['view']['USER_COMMENTPER'] = $sc_style['USER_COMMENTPER']['pre']."{---}".$sc_style['USER_COMMENTPER']['post']; -?> + +$USER_TEMPLATE['addon'] = $USER_EMBED_USERPROFILE_TEMPLATE; +$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_START; +$USER_TEMPLATE['extended']['item'] = $EXTENDED_CATEGORY_TABLE ; +$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_END; +$USER_TEMPLATE['list']['start'] = $USER_SHORT_TEMPLATE_START; +$USER_TEMPLATE['list']['item'] = $USER_SHORT_TEMPLATE; +$USER_TEMPLATE['list']['end'] = $USER_SHORT_TEMPLATE_END; + + +// ------------ End of Legacy Code ------------------------------- // + +// v2.x Standards. +if(deftrue('BOOTSTRAP')) +{ + + $USER_TEMPLATE = array(); // reset the legacy template above. + $USER_WRAPPER = array(); // reset all the legacy wrappers above. + + + $USER_TEMPLATE['addon'] = ' +

+ {USER_ADDON_LABEL} + {USER_ADDON_TEXT} +

+ '; + + $USER_TEMPLATE['extended']['start'] = ''; + $USER_TEMPLATE['extended']['end'] = ''; + + $USER_TEMPLATE['extended']['item'] = ' +

+ {EXTENDED_NAME} + {EXTENDED_VALUE} +

+ '; + + + $USER_TEMPLATE['list']['start'] = " +

+
".LAN_USER_56." {TOTAL_USERS} +
+
+ {USER_FORM_START} +
+ ".LAN_SHOW.": {USER_FORM_RECORDS} ".LAN_USER_57." {USER_FORM_ORDER} + {USER_FORM_SUBMIT} +
+ {USER_FORM_END} +
+
+
+ + + + + + + + + + + {SETIMAGE: w=40} + "; + + + $USER_TEMPLATE['list']['item'] = " + + + + + + + "; + + $USER_TEMPLATE['list']['end'] = " + +
 ".LAN_USER_58."".LAN_USER_60."".LAN_USER_59."
{USER_PICTURE}{USER_ID}: {USER_NAME_LINK}{USER_EMAIL}{USER_JOIN}
+
+ "; + + + // View shortcode wrappers. + $USER_WRAPPER['view']['USER_COMMENTPOSTS'] = ''.LAN_USER_68.'{---}'; + $USER_WRAPPER['view']['USER_COMMENTPER'] = ' ( {---}% )'; + $USER_WRAPPER['view']['USER_SIGNATURE'] = '
{---}
'; + $USER_WRAPPER['view']['USER_RATING'] = '
{---}
'; + $USER_WRAPPER['view']['USER_SENDPM'] = '
{---}
'; + + $USER_TEMPLATE['view'] = ' + {SETIMAGE: w=600} +
+
+
+
+
'.LAN_USER_58.' {USER_ID}
+
+
+ {SETIMAGE: w=200} + {USER_PICTURE: shape=circle&link=1} +
+

{USER_NAME}

+ {USER_SIGNATURE} + {USER_RATING} + {USER_SENDPM} +
+
+
+

'.LAN_USER_63.'{USER_REALNAME}

+

'.LAN_USER_02.'{USER_LOGINNAME}

+

'.LAN_USER_60.'{USER_EMAIL}

+

'.LAN_USER_54.'{USER_LEVEL}

+

'.LAN_USER_65.'{USER_LASTVISIT}
{USER_LASTVISIT_LAPSE}

+

'.LAN_USER_59.'{USER_JOIN}
{USER_DAYSREGGED}

+

'.LAN_USER_66.'{USER_VISITS}

+ {USER_ADDONS} +

{USER_COMMENTPOSTS} {USER_COMMENTPER}

+ {USER_EXTENDED_ALL} +

+
+
+ {USER_UPDATE_LINK} +
+
+
    + +
  • + +
  • + +
+
+
+
+ {PROFILE_COMMENTS} + {PROFILE_COMMENT_FORM} +
+
+
+ '; +} + + + + + + + + + + + +?> \ No newline at end of file diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 4900ef9ff..7f5b626ba 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -3542,7 +3542,7 @@ class e_parser $id = (!empty($options['id'])) ? "id='".$options['id']."' " : ""; $text = $linkStart; - $text .= ""; + $text .= "\"".$title."\""; $text .= $linkEnd; // return $img; return $text; diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css index 374e4f546..b1b292161 100644 --- a/e107_web/css/e107.css +++ b/e107_web/css/e107.css @@ -144,6 +144,45 @@ div.bbcode { margin: 15px 0px; clear: both; } /* layout control via bbcodes */ .e-email:before { content: attr(data-user); } .e-email:after { content: attr(data-dom) } +/* User Profile css */ +.panel-profile .user-avatar { + max-width: 150px; + margin-top: -90px; + margin-bottom: 15px; + border: 5px solid #fff; + border-radius: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + margin-left:auto; + margin-right:auto; +} +.panel-profile .panel-heading h5.user-id { + color:#ffffff; +} +.panel-profile .panel-body span.padding-left { + display:block; +} +.panel-profile .panel-body p { + clear: both; + float: none; + display: block; +} +.panel-profile .profile-header { + max-width:300px; + margin-left: auto; + margin-right: auto; +} +.panel-profile .profile-header h4 { + padding-bottom: 30px; +} +.panel-profile .panel-body p.row { + border-top: 1px solid rgba(170,170,170,0.35); + padding-top: 10px; +} + + + + + /* default comments layout */