1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 22:27:34 +02:00

Issue #408 Forum now uses font-awesome glyphs when using Bootstrap3 theme. Default Bootstrap template is now responsive for mobile devices etc.

This commit is contained in:
Cameron
2015-03-28 14:10:28 -07:00
parent d3de7a85d4
commit 4514a98016
13 changed files with 158 additions and 76 deletions

View File

@@ -2897,7 +2897,7 @@ class e_parser
$title = (ADMIN) ? $image : $tp->toAttribute($userData['user_name']);
$text = "<img class='img-rounded user-avatar e-tip' title=\"".$title."\" src='".$img."' alt='' style='width:".$width."px; height:".$height."px' />";
$text = "<img class='img-rounded img-responsive user-avatar e-tip' title=\"".$title."\" src='".$img."' alt='' style='width:".$width."px; height:".$height."px' />";
// return $img;
return $text;

View File

@@ -0,0 +1 @@
.forum-viewforum-pagination { margin:0px }

View File

@@ -114,7 +114,7 @@ if(!defined('e_TRACKING_DISABLED'))
}
$fVars->STATLINK = "<a href='".e_PLUGIN."forum/forum_stats.php'>".LAN_FORUM_0017."</a>\n";
$fVars->ICONKEY = "
<table style='width:100%'>\n<tr>
<table class='table table-bordered' style='width:100%'>\n<tr>
<td style='width:2%'>".IMAGE_new_small."</td>
<td style='width:10%'><span class='smallblacktext'>".LAN_FORUM_0039."</span></td>
<td style='width:2%'>".IMAGE_nonew_small."</td>

View File

@@ -114,10 +114,13 @@ $(document).ready(function()
EON;
e107::js('inline',$jscode,'jquery');
e107::css('forum','forum.css');
e107::lan('forum','English_front');
// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php');
if(!defined('IMAGE_new') && !defined('IMAGE_e'))
{
if (file_exists(THEME.'templates/forum/forum_icons_template.php')) // Preferred v2.x location.
{
require_once(THEME.'templates/forum/forum_icons_template.php');
@@ -134,7 +137,7 @@ else
{
require_once(e_PLUGIN.'forum/templates/forum_icons_template.php');
}
}
class e107forum
{

View File

@@ -224,8 +224,15 @@ if(varset($pref['track_online']))
}
if(defset('BOOTSTRAP')==3 && !empty($FORUM_VIEWFORUM_TEMPLATE['iconkey'])) // v2.x
{
$fVars->ICONKEY = $tp->parseTemplate($FORUM_VIEWFORUM_TEMPLATE['iconkey'],true);
}
else // v1.x
{
$fVars->ICONKEY = "
<table class='table' style='width:100%'>
<table class='table table-bordered' style='width:100%'>
<tr>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_new_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_FORUM_0039."</td>
@@ -248,6 +255,10 @@ $fVars->ICONKEY = "
</tr>
</table>";
}
$fVars->SEARCH = "
<form method='get' class='form-inline input-append' action='".e_BASE."search.php'>
<p>
@@ -765,12 +776,11 @@ function fpages($thread_info, $replies)
if(deftrue('BOOTSTRAP'))
{
$text = "<div class='pagination pagination-mini' style='margin:0px'>
<ul>
$text = "<ul class='pagination pagination-sm forum-viewforum-pagination'>
<li>";
$text .= implode("</li><li>",$opts); // ."</div>";
$text .= "</li></ul></div>";
$text .= "</li></ul>";
}
else
{

View File

@@ -200,9 +200,9 @@ $forum->set_crumb(true, '', $tVars); // Set $BREADCRUMB (and BACKLINK)
//$tVars->BACKLINK = $tVars->BREADCRUMB;
//$tVars->FORUM_CRUMB = $crumbs['forum_crumb'];
$tVars->THREADNAME = $tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off');
$tVars->NEXTPREV = "<a class='btn btn-default btn-small' href='" . $e107->url->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>&laquo; " . LAN_FORUM_2001 . "</a>";
$tVars->NEXTPREV = "<a class='btn btn-default btn-sm btn-small' href='" . $e107->url->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>&laquo; " . LAN_FORUM_2001 . "</a>";
$tVars->NEXTPREV .= ' | '; // enabled to make it look better on v1 templates
$tVars->NEXTPREV .= "<a class='btn btn-default btn-small' href='" . $e107->url->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>" . LAN_FORUM_2002 . " &raquo;</a>";
$tVars->NEXTPREV .= "<a class='btn btn-default btn-sm btn-small' href='" . $e107->url->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>" . LAN_FORUM_2002 . " &raquo;</a>";
if ($forum->prefs->get('track') && USER)
{
@@ -210,7 +210,7 @@ if ($forum->prefs->get('track') && USER)
$url = $e107->url->create('forum/thread/view', array('id' => $thread->threadId), 'encode=0'); // encoding could break AJAX call
$tVars->TRACK .= "
<span id='forum-track-trigger-container'>
<a class='btn btn-default btn-small' href='{$url}' id='forum-track-trigger'>{$img}</a>
<a class='btn btn-default btn-sm btn-small' href='{$url}' id='forum-track-trigger'>{$img}</a>
</span>
<script type='text/javascript'>
e107.runOnLoad(function(){

View File

@@ -431,8 +431,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
$text = '<div class="btn-group ">
<a class="btn btn-default btn-small" href="'.e_BASE.'user.php?id.'.$this->postInfo['post_user'].'">'.$username.'</a>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<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">
<span class="caret"></span>
</button>
<ul class="dropdown-menu left">
@@ -475,7 +475,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
// {EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
$text = '<div class="btn-group pull-right">
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<button class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
Options
<span class="caret"></span>
</button>

View File

@@ -225,7 +225,7 @@ $THREADTOPIC_REPLY = "
$FORUMPOST_TEMPLATE['form'] = "
{FORMSTART}
<div class='row row-fluid'>
<div class='row-fluid'>
<div>{BACKLINK}</div>
</div>

View File

@@ -79,20 +79,21 @@ $FORUM_TRACK_END = "<br />TRACK-END";
// New in v2.x - requires a bootstrap theme be loaded.
$FORUM_TEMPLATE['main-start'] = "<div class='row row-fluid'>
{FORUM_BREADCRUMB}
$FORUM_TEMPLATE['main-start'] = "{FORUM_BREADCRUMB}
<div class=''>
<div class='form-group right'>
{SEARCH}
</div>
</div>
<div class='row'>
<div >
<table class='table table-striped table-bordered table-hover'>
<colgroup>
<col style='width:3%' />
<col />
<col />
<col />
<col />
<col style='width:20%' />
<col style='width:20%' />
<col class='hidden-xs' style='width:20%' />
</colgroup>
<tr>
<th colspan='5'>{FORUMTITLE}</th>
@@ -100,7 +101,7 @@ $FORUM_TEMPLATE['main-start'] = "<div class='row row-fluid'>
$FORUM_TEMPLATE['main-parent'] = "<tr>
<th colspan='2'>{PARENTNAME} {PARENTSTATUS}</th>
<th>".LAN_FORUM_0003."</th>
<th class='hidden-xs'>".LAN_FORUM_0003."</th>
<th >".LAN_FORUM_0002."</th>
<th >".LAN_FORUM_0004."</th>
</tr>";
@@ -111,7 +112,7 @@ $FORUM_TEMPLATE['main-forum'] = "<tr>
<td>{FORUMNAME}<br /><small>{FORUMDESCRIPTION}</small>{FORUMSUBFORUMS}</td>
<td >{REPLIESX}</td>
<td >{THREADSX}</td>
<td><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
</tr>";
$FORUM_TEMPLATE['main-end'] = "</table></div>";

View File

@@ -282,51 +282,92 @@ $FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}";
//TODO Find a good place to put a {SEARCH} dropdown.
$FORUM_VIEWFORUM_TEMPLATE['start'] = "";
$FORUM_VIEWFORUM_TEMPLATE['header'] = "<div class='row row-fluid'><div>{BACKLINK}</div> </div>
$FORUM_VIEWFORUM_TEMPLATE['header'] = "<div class=' row-fluid'><div>{BACKLINK}</div> </div>
<div class='row row-fluid'>
<div class='col-md-9 span9 pull-left'><h3>{FORUMTITLE}</h3></div>
<div class='col-md-3 span3 pull-right right' style='padding-top:10px'>{NEWTHREADBUTTONX}</div></div>
<table class='table table-hover table-striped'>
<table class='table table-hover table-striped table-bordered'>
<colgroup>
<col style='width:3%' />
<col />
<col style='width:10%' />
<col style='width:10%' />
<col style='width:20%' />
<col class='hidden-xs' style='width:10%' />
<col class='hidden-xs' style='width:20%' />
</colgroup>
{SUBFORUMS}";
$FORUM_VIEWFORUM_TEMPLATE['item'] = "<tr><td>{ICON}</td><td><div>{THREADNAME}</div><div class='pull-left'><small>by {POSTER} {THREADTIMELAPSE} &nbsp;</small></div><div class='pull-left'> {PAGESX}</div></td><td>{REPLIESX}</td><td>{VIEWSX}</td><td><small>{LASTPOSTUSER} {LASTPOSTDATE} </small><div class='span2 right pull-right'>{ADMINOPTIONS}</div></td></tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUMVIEW['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUMVIEW['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['item'] = "<tr>
<td>{ICON}</td>
<td>
<div class='row'>
<div class='col-xs-12 col-md-9'>
{THREADNAME}
<div><small>by {POSTER} {THREADTIMELAPSE} &nbsp;</small></div>
</div><div class='col-xs-12 col-md-3 text-right'> {PAGESX}</div>
</div>
<div class='row'>
</td>
</div>
<td class='hidden-xs'>{REPLIESX}</td><td>{VIEWSX}</td>
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE} </small><div class='span2 right pull-right'>{ADMINOPTIONS}</div></td>
</tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUM_VIEWFORUM_TEMPLATE['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUM_VIEWFORUM_TEMPLATE['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr><th colspan='2'>".LAN_FORUM_1002."</th><th>".LAN_FORUM_0003."</th><th>".LAN_FORUM_0002."</th><th>".LAN_FORUM_0004."</th></tr>";
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr>
<th colspan='2'>".LAN_FORUM_1002."</th>
<th>".LAN_FORUM_0003."</th>
<th class='hidden-xs'>".LAN_FORUM_0002."</th>
<th class='hidden-xs'>".LAN_FORUM_0004."</th>
</tr>";
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
<td>{SUB_REPLIESX}</td>
<td>{SUB_THREADSX}</td>
<td><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
<td class='hidden-xs'>{SUB_THREADSX}</td>
<td class='hidden-xs'><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
</tr>\n";
$FORUM_VIEWFORUM_TEMPLATE['sub-footer'] = "";
$FORUM_VIEWFORUM_TEMPLATE['divider-important'] = "<tr><th colspan='2'>".LAN_FORUM_1006."</th><th>".LAN_FORUM_0003."</th><th>".LAN_FORUM_1005."</th><th>".LAN_FORUM_0004."</th></tr>";
$FORUM_VIEWFORUM_TEMPLATE['divider-normal'] = "<tr><th colspan='2'>".LAN_FORUM_1007."</th><th>".LAN_FORUM_0003."</th><th>".LAN_FORUM_1005."</th><th>".LAN_FORUM_0004."</th></tr>";
$FORUM_VIEWFORUM_TEMPLATE['divider-important'] = "<tr><th colspan='2'>".LAN_FORUM_1006."</th><th>".LAN_FORUM_0003."</th><th class='hidden-xs'>".LAN_FORUM_1005."</th><th class='hidden-xs'>".LAN_FORUM_0004."</th></tr>";
$FORUM_VIEWFORUM_TEMPLATE['divider-normal'] = "<tr><th colspan='2'>".LAN_FORUM_1007."</th><th >".LAN_FORUM_0003."</th><th class='hidden-xs'>".LAN_FORUM_1005."</th><th class='hidden-xs'>".LAN_FORUM_0004."</th></tr>";
$FORUM_VIEWFORUM_TEMPLATE['footer'] = "</table>
<div class='row-fluid'>
{ICONKEY}
<div class='span5 pull-left left' style='padding-top:10px'>{THREADPAGES}</div><div class='span3 pull-right right' style='padding-top:10px'>{NEWTHREADBUTTONX}</div>
<div class='row row-fluid'>
<div class='col-md-5 span5 pull-left left' style='padding-top:10px'>{THREADPAGES}</div><div class='col-md-3 span3 pull-right right' style='padding-top:10px'>{NEWTHREADBUTTONX}</div>
</div>
<div class='panel panel-default' style='margin-top:50px'>
<div class='panel-body'>
{ICONKEY}
</div>
</div>
";
$FORUM_VIEWFORUM_TEMPLATE['end'] = "<!--- END --> \n";
// define {ICONKEY}
$FORUM_VIEWFORUM_TEMPLATE['iconkey'] = "
<div class='row' >
<div class='col-sm-3 col-xs-6'>".IMAGE_new_small." ".LAN_FORUM_0039."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_nonew_small." ".LAN_FORUM_0040."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_sticky_small." ".LAN_FORUM_1011."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_announce_small." ".LAN_FORUM_1013."</div>
</div>
<div class='row' >
<div class='col-sm-3 col-xs-6'>".IMAGE_new_popular_small." ".LAN_FORUM_0039." ".LAN_FORUM_1010."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_nonew_popular_small." ".LAN_FORUM_0040." ".LAN_FORUM_1010."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_stickyclosed_small." ".LAN_FORUM_1012."</div>
<div class='col-sm-3 col-xs-6'>".IMAGE_closed_small." ".LAN_FORUM_1014."</div>
</div>
";

View File

@@ -312,7 +312,7 @@ $FORUM_CRUMB['forum']['value'] = "<a class='forumlink' href='{FORUM_HREF}'>{FORU
$FORUM_VIEWTOPIC_TEMPLATE['start'] = "
<div class='row row-fluid'>
<div class='row-fluid'>
<div>{BACKLINK}</div>
</div>
@@ -329,23 +329,27 @@ $FORUM_VIEWTOPIC_TEMPLATE['start'] = "
$FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
<li id='post-{POSTID}'>
<div class='row row-fluid btn-navbar navbar-btn'>
<div class='col-md-2 span2 center'>{NEWFLAG}<small>
<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-md-4 text-muted span4 muted'><small>{THREADDATESTAMP=relative}</small></div>
<div class='col-md-5 text-muted span5 muted right text-right'><small>{LASTEDIT}{LASTEDITBY=link}</small></div>
<div class='col-md-1 span1 right text-right'>{POSTOPTIONS}</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>
</div>
<div class='row row-fluid' >
<div class='col-md-2 span2 center'>
{AVATAR}<br />
{USERCOMBO}<br />
{CUSTOMTITLE}
<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>
<div class='col-md-9 span9 '>
</div>
<div class='visible-xs col-xs-12'><hr /></div>
<div class='col-xs-12 col-md-9 span9 '>
{POLL}
{THREAD_TEXT}
{ATTACHMENTS}
@@ -354,14 +358,14 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
<div class='row row-fluid'>
<div class='col-md-2 span2 finfobar'>
<div class='col-xs-2 span2 finfobar'>
&nbsp;
</div>
<div class='col-md-9 span9 finfobar' >
<div class='col-xs-9 span9 finfobar' >
<small> {SIGNATURE=clean}</small>
</div>
<div class='col-md-3 span3'>
<div class='col-xs-3 span3'>
</div>
</div>
@@ -371,9 +375,10 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "</ul>
<div class='row row-fluid clearfix'>
<div class='col-xs-12'><hr /></div>
<div class='col-md-3 span3 pull-left'>{GOTOPAGES}</div>
<div class='col-md-6 text-center span6 center'>{QUICKREPLY}</div>
<div class='col-md-3 span3 pull-right right '>{BUTTONSX}</div>
<div class='col-xs-12 col-md-6 text-center span6 center'>{QUICKREPLY}</div>
<div class='col-xs-12 col-md-3 span3 pull-right right '>{BUTTONSX}</div>
</div>
{THREADSTATUS}

View File

@@ -717,6 +717,25 @@ $NEWSCAT_ITEM = "\n\n\n\n<!-- News Category Item -->\n\n\n\n
</td></tr></table></div>
";
$tp = e107::getParser();
// Used by Forum plugin.
define('IMAGE_e', 'e');
define('IMAGE_new', $tp->toGlyph('fa-star', 'size=2x'));
define('IMAGE_nonew', $tp->toGlyph('fa-comment', 'size=2x'));
define('IMAGE_new_small', $tp->toGlyph('fa-star'));
define('IMAGE_nonew_small', $tp->toGlyph('fa-comment-o'));
define('IMAGE_new_popular', $tp->toGlyph('fa-comments', 'size=2x'));
define('IMAGE_nonew_popular', $tp->toGlyph('fa-comments-o', 'size=2x'));
define('IMAGE_new_popular_small', $tp->toGlyph('fa-comments'));
define('IMAGE_nonew_popular_small', $tp->toGlyph('fa-comments-o'));
define('IMAGE_sticky', $tp->toGlyph('fa-thumb-tack', 'size=2x'));
define('IMAGE_stickyclosed', $tp->toGlyph('fa-lock', 'size=2x'));
define('IMAGE_sticky_small', $tp->toGlyph('fa-thumb-tack'));
define('IMAGE_stickyclosed_small', $tp->toGlyph('fa-lock'));
define('IMAGE_announce', $tp->toGlyph('fa-bullhorn', 'size=2x'));
define('IMAGE_announce_small', $tp->toGlyph('fa-bullhorn'));
define('IMAGE_closed_small', $tp->toGlyph('fa-lock'));
define('IMAGE_closed', $tp->toGlyph('fa-lock', 'size=2x'));
?>

View File

@@ -23,7 +23,9 @@
<custompages>FRONTPAGE</custompages>
</layout>
<layout name='modern_business_home' title='Modern Business: Home page carousel with fixed custom-menus' />
<layout name='jumbotron_full' title='Jumbotron (full-width)' />
<layout name='jumbotron_full' title='Jumbotron (full-width)' >
<custompages>forum</custompages>
</layout>
<layout name='jumbotron_sidebar_right' title='Jumbotron (sidebar-right)' default='true' >
<custompages>/news</custompages>
<menuPresets>