1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 04:32:01 +02:00

Forum styling changes/fixes.

This commit is contained in:
Cameron 2015-05-07 20:55:12 -07:00
parent 51b121610f
commit 06d9075c9d
5 changed files with 54 additions and 19 deletions

View File

@ -2948,7 +2948,7 @@ class e_parser
* @param @array - user data from e107_user.
* @return <img> 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 = "<img class='img-rounded img-responsive user-avatar e-tip' title=\"".$title."\" src='".$img."' alt='' style='width:".$width."px; height:".$height."px' />";
$text = "<img class='".$shape." img-responsive user-avatar e-tip' title=\"".$title."\" src='".$img."' alt='' style='width:".$width."px; height:".$height."px' />";
// return $img;
return $text;

View File

@ -263,6 +263,9 @@ class e_ranks
$img_title = ($this->ranks['data'][$rank]['name'] ? " alt='{$data['name']}' title='{$data['name']}'" : ' alt = ""');
$data['pic'] = "<img {$img_title} src='".$this->_getImage($this->ranks['data'][$rank])."'{$img_title} />";
}
$data['value'] = $rank;
$this->userRanks[$userId] = $data;
return $data;

View File

@ -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}
#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 }

View File

@ -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 "<span class='label label-info'>".$rankInfo['name']."</span>";
@ -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 = '<div class="btn-group ">
$text = '<div class="btn-group btn-block ">
<a class="btn btn-default btn-sm btn-small" href="'.e_BASE.'user.php?id.'.$this->postInfo['post_user'].'">'.$username.'</a>
<button class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
<a class="btn btn-default btn-sm col-sm-10 btn-small" href="'.e_BASE.'user.php?id.'.$this->postInfo['post_user'].'">'.$username.'</a>
<button class="btn btn-default btn-sm col-sm-2 btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu left">

View File

@ -330,10 +330,14 @@ $FORUM_VIEWTOPIC_TEMPLATE['start'] = "
$FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
<li id='post-{POSTID}'>
<div class='hidden-xs row row-fluid btn-navbar navbar-btn'>
<div class='col-xs-12'><hr /></div>
<div class=' col-xs-2 span2 left text-left'>{NEWFLAG}<small>
{LEVEL=badge} {LEVEL=pic}
</small> {ANON_IP}</div>
<div class='col-xs-12'><hr /></div>
<div class='col-xs-2 span2 left text-left'>
<div class='row'>
<div class='col-xs-12 col-md-12 forum-user-combo'>{USERCOMBO}<br />{CUSTOMTITLE}</div>
</div>
{NEWFLAG} {ANON_IP}</div>
<div class='col-xs-4 text-muted span4 text-muted muted'><small>{THREADDATESTAMP=relative}</small></div>
<div class='col-xs-5 text-muted span5 text-muted muted right text-right'><small>{LASTEDIT}{LASTEDITBY=link}</small></div>
<div class='col-xs-3 col-sm-1 span1 right text-right'>{POSTOPTIONS}</div>
@ -342,14 +346,21 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
<div class='row row-fluid' >
<div class='visible-xs col-xs-12'><hr /></div>
<div class=' col-xs-12 col-md-2 span2 left'>
<div class='row'><div class='col-xs-3 col-md-12 left'>{AVATAR}</div>
<div class='col-xs-6 col-md-12'>{USERCOMBO}<br />{CUSTOMTITLE}</div>
<div class='visible-xs col-xs-3'><div class='clearfix'>{POSTOPTIONS}</div><div class='pull-right '><br /><small class='text-muted'>{THREADDATESTAMP=relative}</small></div></div>
<div class='col-xs-12 col-md-2 span2 left'>
<div class='row'>
<div class='col-xs-3 col-md-12 text-center'>{AVATAR: shape=rounded}</div>
<div class='col-xs-6 visible-xs'>{USERCOMBO}<br />{CUSTOMTITLE}</div>
<div class='col-xs-6 col-md-12 hidden-xs'>
<small>
{LEVEL=badge} {LEVEL=glyph}
</small>
</div>
<div class='visible-xs col-xs-3'><div class='clearfix'>{POSTOPTIONS}</div><div class='pull-right '><br /><small class='text-muted'>{THREADDATESTAMP=relative}</small></div></div>
</div>
</div>
<div class='visible-xs col-xs-12'><hr /></div>
<div class='col-xs-12 col-md-9 span9 '>
<div class='col-xs-12 col-md-9 span9 forum-thread-text '>
{POLL}
{THREAD_TEXT}
{ATTACHMENTS}