From 06d9075c9d810a41a55c349e3059061a3aacb877 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 7 May 2015 20:55:12 -0700 Subject: [PATCH] Forum styling changes/fixes. --- e107_handlers/e_parse_class.php | 5 ++-- e107_handlers/e_ranks_class.php | 3 ++ e107_plugins/forum/forum.css | 12 ++++++-- .../shortcodes/batch/view_shortcodes.php | 24 +++++++++++---- .../templates/forum_viewtopic_template.php | 29 +++++++++++++------ 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 60892dc9d..9674a10ba 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2948,7 +2948,7 @@ class e_parser * @param @array - user data from e107_user. * @return tag of avatar. */ - public function toAvatar($userData=null) + public function toAvatar($userData=null, $options=array()) { $tp = e107::getParser(); $width = $tp->thumbWidth; @@ -2995,8 +2995,9 @@ class e_parser } $title = (ADMIN) ? $image : $tp->toAttribute($userData['user_name']); + $shape = (vartrue($options['shape'])) ? "img-".$options['shape'] : "img-rounded"; - $text = ""; + $text = ""; // return $img; return $text; diff --git a/e107_handlers/e_ranks_class.php b/e107_handlers/e_ranks_class.php index 4fc6340b9..f3131847c 100644 --- a/e107_handlers/e_ranks_class.php +++ b/e107_handlers/e_ranks_class.php @@ -263,6 +263,9 @@ class e_ranks $img_title = ($this->ranks['data'][$rank]['name'] ? " alt='{$data['name']}' title='{$data['name']}'" : ' alt = ""'); $data['pic'] = ""; } + + $data['value'] = $rank; + $this->userRanks[$userId] = $data; return $data; diff --git a/e107_plugins/forum/forum.css b/e107_plugins/forum/forum.css index d13364902..a02168257 100644 --- a/e107_plugins/forum/forum.css +++ b/e107_plugins/forum/forum.css @@ -1,3 +1,11 @@ -.forum-viewforum-pagination { margin:0px } +.forum-viewforum-pagination { margin:0 } -#poll.tab-pane .form-group { margin-left: 0px; margin-right:0px} \ No newline at end of file +#poll.tab-pane .form-group { margin-left: 0; margin-right:0} + +#forum-viewtopic li img.user-avatar { margin-bottom:10px; display:inline-block } + +.forum-attachment-file { margin-top:15px; } + +#forum-viewtopic li ul.thumbnails { margin-top:15px} + +.forum-user-combo { padding-bottom:5px } \ No newline at end of file diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index e7f5caaa2..59271d659 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -180,9 +180,9 @@ class plugin_forum_view_shortcodes extends e_shortcode } } - function sc_avatar() + function sc_avatar($opts) { - return e107::getParser()->toAvatar($this->postInfo); + return e107::getParser()->toAvatar($this->postInfo,$opts); // return $tp->parseTemplate("{USER_AVATAR=".$this->postInfo['user_image']."}", true); } @@ -353,7 +353,9 @@ class plugin_forum_view_shortcodes extends e_shortcode $rankInfo = e107::getRank()->getRanks($this->postInfo['post_user']); // FIXME - level handler!!! - + + // print_a($rankInfo); + if($parm == 'badge') { return "".$rankInfo['name'].""; @@ -378,6 +380,16 @@ class plugin_forum_view_shortcodes extends e_shortcode return ''; break; + case 'glyph': + $text = ""; + $tp = e107::getParser(); + for($i=0; $i< $rankInfo['value']; $i++) + { + $text .= $tp->toGlyph('fa-star'); + } + return $text; + break; + default: return varset($rankInfo[$parm], ''); break; @@ -441,10 +453,10 @@ class plugin_forum_view_shortcodes extends e_shortcode $ue = $tp->parseTemplate("{USER_EXTENDED=location.text_value}",true); $username = (empty($this->postInfo['user_name'])) ? LAN_ANONYMOUS : $this->postInfo['user_name']; - $text = '
+ $text = '
- '.$username.' -