mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Forum Template BC fixes. Old template will be used if bootstrap not found.
This commit is contained in:
@@ -1603,6 +1603,7 @@ function init_session()
|
|||||||
define('GUEST', true);
|
define('GUEST', true);
|
||||||
define('USERCLASS', '');
|
define('USERCLASS', '');
|
||||||
define('USEREMAIL', '');
|
define('USEREMAIL', '');
|
||||||
|
define('USERSIGNATURE', '');
|
||||||
|
|
||||||
if($user->hasSessionError())
|
if($user->hasSessionError())
|
||||||
{
|
{
|
||||||
@@ -1623,6 +1624,7 @@ function init_session()
|
|||||||
define('USERPHOTO', $user->get('user_sess'));
|
define('USERPHOTO', $user->get('user_sess'));
|
||||||
define('USERJOINED', $user->get('user_join'));
|
define('USERJOINED', $user->get('user_join'));
|
||||||
define('USERVISITS', $user->get('user_visits'));
|
define('USERVISITS', $user->get('user_visits'));
|
||||||
|
define('USERSIGNATURE', $user->get('user_signature'));
|
||||||
|
|
||||||
define('ADMIN', $user->isAdmin());
|
define('ADMIN', $user->isAdmin());
|
||||||
define('ADMINID', $user->getAdminId());
|
define('ADMINID', $user->getAdminId());
|
||||||
|
@@ -213,7 +213,7 @@ if (!isset($FORUM_MAIN_START))
|
|||||||
include(e_PLUGIN.'forum/templates/forum_template.php');
|
include(e_PLUGIN.'forum/templates/forum_template.php');
|
||||||
|
|
||||||
|
|
||||||
if(is_array($FORUM_TEMPLATE)) // new v2.x format.
|
if(is_array($FORUM_TEMPLATE) && (e_BOOTSTRAP === true)) // new v2.x format.
|
||||||
{
|
{
|
||||||
|
|
||||||
$FORUM_MAIN_START = $FORUM_TEMPLATE['main-start'];
|
$FORUM_MAIN_START = $FORUM_TEMPLATE['main-start'];
|
||||||
|
@@ -176,7 +176,7 @@ class e107forum
|
|||||||
$postInfo['user_name'] = USERNAME;
|
$postInfo['user_name'] = USERNAME;
|
||||||
$postInfo['user_email'] = USEREMAIL;
|
$postInfo['user_email'] = USEREMAIL;
|
||||||
$postInfo['user_image'] = USERIMAGE;
|
$postInfo['user_image'] = USERIMAGE;
|
||||||
$postInfo['user_signature'] = USERSIG;
|
$postInfo['user_signature'] = USERSIGNATURE;
|
||||||
|
|
||||||
if($_POST['insert'] == 1)
|
if($_POST['insert'] == 1)
|
||||||
{
|
{
|
||||||
|
@@ -352,6 +352,9 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
|
|||||||
require_once(e_PLUGIN."forum/templates/forum_posted_template.php");
|
require_once(e_PLUGIN."forum/templates/forum_posted_template.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED);
|
echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED);
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
@@ -503,6 +506,11 @@ if (!vartrue($FORUMPOST))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($FORUMPOST_TEMPLATE) && (e_BOOTSTRAP === true))
|
||||||
|
{
|
||||||
|
$FORUMPOST = $FORUMPOST_TEMPLATE['form'];
|
||||||
|
$FORUMPOST_REPLY = $FORUMPOST_TEMPLATE['form'];
|
||||||
|
}
|
||||||
|
|
||||||
if($action == 'rp')
|
if($action == 'rp')
|
||||||
{
|
{
|
||||||
|
@@ -86,21 +86,21 @@ if (!vartrue($FORUM_VIEW_START))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(is_array($FORUM_VIEWFORUM_TEMPLATE)) // New Template.
|
if(is_array($FORUM_VIEWFORUM_TEMPLATE) && (e_BOOTSTRAP === true)) // New v2.x bootstrap Template.
|
||||||
{
|
{
|
||||||
|
|
||||||
$FORUM_VIEW_START_CONTAINER = $FORUM_VIEWFORUM_TEMPLATE['start'];
|
$FORUM_VIEW_START_CONTAINER = $FORUM_VIEWFORUM_TEMPLATE['start'];
|
||||||
$FORUM_VIEW_START = $FORUM_VIEWFORUM_TEMPLATE['header'];
|
$FORUM_VIEW_START = $FORUM_VIEWFORUM_TEMPLATE['header'];
|
||||||
$FORUM_VIEW_FORUM = $FORUM_VIEWFORUM_TEMPLATE['item'];
|
$FORUM_VIEW_FORUM = $FORUM_VIEWFORUM_TEMPLATE['item'];
|
||||||
$FORUM_VIEW_FORUM_STICKY = $FORUM_VIEWFORUM_TEMPLATE['item-sticky'];
|
$FORUM_VIEW_FORUM_STICKY = $FORUM_VIEWFORUM_TEMPLATE['item-sticky'];
|
||||||
$FORUM_VIEW_FORUM_ANNOUNCE = $FORUM_VIEWFORUM_TEMPLATE['item-announce'];
|
$FORUM_VIEW_FORUM_ANNOUNCE = $FORUM_VIEWFORUM_TEMPLATE['item-announce'];
|
||||||
$FORUM_VIEW_END = $FORUM_VIEWFORUM_TEMPLATE['footer'];
|
$FORUM_VIEW_END = $FORUM_VIEWFORUM_TEMPLATE['footer'];
|
||||||
$FORUM_VIEW_END_CONTAINER = $FORUM_VIEWFORUM_TEMPLATE['end'];
|
$FORUM_VIEW_END_CONTAINER = $FORUM_VIEWFORUM_TEMPLATE['end'];
|
||||||
$FORUM_VIEW_SUB_START = $FORUM_VIEWFORUM_TEMPLATE['sub-header'];
|
$FORUM_VIEW_SUB_START = $FORUM_VIEWFORUM_TEMPLATE['sub-header'];
|
||||||
$FORUM_VIEW_SUB = $FORUM_VIEWFORUM_TEMPLATE['sub-item'];
|
$FORUM_VIEW_SUB = $FORUM_VIEWFORUM_TEMPLATE['sub-item'];
|
||||||
$FORUM_VIEW_SUB_END = $FORUM_VIEWFORUM_TEMPLATE['sub-footer'];
|
$FORUM_VIEW_SUB_END = $FORUM_VIEWFORUM_TEMPLATE['sub-footer'];
|
||||||
$FORUM_IMPORTANT_ROW = $FORUM_VIEWFORUM_TEMPLATE['divider-important'];
|
$FORUM_IMPORTANT_ROW = $FORUM_VIEWFORUM_TEMPLATE['divider-important'];
|
||||||
$FORUM_NORMAL_ROW = $FORUM_VIEWFORUM_TEMPLATE['divider-normal'];
|
$FORUM_NORMAL_ROW = $FORUM_VIEWFORUM_TEMPLATE['divider-normal'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,6 +185,12 @@ if($forum->checkPerm($forumId, 'post'))
|
|||||||
$fVars->NEWTHREADBUTTONX = newthreadjump($e107->url->create('forum/thread/new', array('id' => $forumId))); // "<a class='btn btn-primary' href='".."'>New Thread</a>";
|
$fVars->NEWTHREADBUTTONX = newthreadjump($e107->url->create('forum/thread/new', array('id' => $forumId))); // "<a class='btn btn-primary' href='".."'>New Thread</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e_BOOTSTRAP !== true)
|
||||||
|
{
|
||||||
|
$fVars->NEWTHREADBUTTONX = $fVars->NEWTHREADBUTTON;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(substr($forumInfo['forum_name'], 0, 1) == '*')
|
if(substr($forumInfo['forum_name'], 0, 1) == '*')
|
||||||
{
|
{
|
||||||
$forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
|
$forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
|
||||||
@@ -570,6 +576,14 @@ function parse_thread($thread_info)
|
|||||||
$_TEMPLATE = "<tr id='thread-{$threadId}'>".substr($_TEMPLATE,4);
|
$_TEMPLATE = "<tr id='thread-{$threadId}'>".substr($_TEMPLATE,4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e_BOOTSTRAP !== true)
|
||||||
|
{
|
||||||
|
$tVars->REPLIESX = $tVars->REPLIES;
|
||||||
|
$tVars->VIEWSX = $tVars->VIEWS;
|
||||||
|
$tVars->ADMINOPTIONS = $tVars->ADMIN_ICONS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $tp->simpleParse($_TEMPLATE, $tVars);
|
return $tp->simpleParse($_TEMPLATE, $tVars);
|
||||||
}
|
}
|
||||||
|
@@ -168,7 +168,7 @@ if (!vartrue($FORUMSTART))
|
|||||||
|
|
||||||
|
|
||||||
// New in v2.x
|
// New in v2.x
|
||||||
if(is_array($FORUM_VIEWTOPIC_TEMPLATE))
|
if(is_array($FORUM_VIEWTOPIC_TEMPLATE) && (e_BOOTSTRAP === true))
|
||||||
{
|
{
|
||||||
$FORUMSTART = $FORUM_VIEWTOPIC_TEMPLATE['start'];
|
$FORUMSTART = $FORUM_VIEWTOPIC_TEMPLATE['start'];
|
||||||
$FORUMTHREADSTYLE = $FORUM_VIEWTOPIC_TEMPLATE['thread'];
|
$FORUMTHREADSTYLE = $FORUM_VIEWTOPIC_TEMPLATE['thread'];
|
||||||
|
@@ -225,21 +225,22 @@ $THREADTOPIC_REPLY = "
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// New in v2.x - requires a bootstrap theme be loaded.
|
||||||
|
|
||||||
$FORUMPOST_TEMPLATE['form'] = "
|
$FORUMPOST_TEMPLATE['form'] = "
|
||||||
<div style='text-align:center'>
|
<div style='text-align:center'>
|
||||||
<div class='spacer'>
|
<div class='spacer'>
|
||||||
{FORMSTART}
|
{FORMSTART}
|
||||||
<table style='".USER_WIDTH."' class='fborder table'>
|
<table class='table'>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='2' class='fcaption'>{BACKLINK}
|
<td colspan='2'>{BACKLINK}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{USERBOX}
|
{USERBOX}
|
||||||
{SUBJECTBOX}
|
{SUBJECTBOX}
|
||||||
<tr>
|
<tr>
|
||||||
<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
|
<td style='width:20%'>{POSTTYPE}</td>
|
||||||
<td class='forumheader2' style='width:80%'>
|
<td style='width:80%'>
|
||||||
{POSTBOX}<br />
|
{POSTBOX}<br />
|
||||||
{EMAILNOTIFY}<br />
|
{EMAILNOTIFY}<br />
|
||||||
{NOEMOTES}<br />
|
{NOEMOTES}<br />
|
||||||
@@ -247,10 +248,10 @@ $FORUMPOST_TEMPLATE['form'] = "
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{POLL}
|
{POLL}
|
||||||
{FILEATTACH}
|
{FILEATTACH}
|
||||||
|
|
||||||
<tr style='vertical-align:top'>
|
<tr style='vertical-align:top'>
|
||||||
<td colspan='2' class='forumheader' style='text-align:center'>
|
<td colspan='2' style='text-align:center'>
|
||||||
{BUTTONS}
|
{BUTTONS}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -262,9 +263,6 @@ $FORUMPOST_TEMPLATE['form'] = "
|
|||||||
$FORUMPOST_TEMPLATE['reply'] = "";
|
$FORUMPOST_TEMPLATE['reply'] = "";
|
||||||
|
|
||||||
|
|
||||||
$FORUMPOST = $FORUMPOST_TEMPLATE['form'];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
||||||
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
||||||
|
@@ -79,12 +79,16 @@ $FORUM_TRACK_MAIN = "<br />TRACK-MAIN";
|
|||||||
$FORUM_TRACK_END = "<br />TRACK-END";
|
$FORUM_TRACK_END = "<br />TRACK-END";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// New in v2.x - requires a bootstrap theme be loaded.
|
||||||
|
|
||||||
|
|
||||||
$FORUM_TEMPLATE['main-start'] = "<div class='row'>
|
$FORUM_TEMPLATE['main-start'] = "<div class='row'>
|
||||||
<div class='right'>
|
<div class='right'>
|
||||||
{SEARCH}
|
{SEARCH}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div><table class='table table-striped'>
|
</div>
|
||||||
|
<table class='table table-striped'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style='width:3%' />
|
<col style='width:3%' />
|
||||||
<col />
|
<col />
|
||||||
|
@@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
|
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (!$FORUM_VIEW_START)
|
if (!$FORUM_VIEW_START)
|
||||||
{
|
{
|
||||||
$FORUM_VIEW_START = "
|
$FORUM_VIEW_START = "
|
||||||
@@ -257,7 +257,7 @@ if (!$FORUM_NORMAL_ROW) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ $FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// New in v2.x - replaces all of the above $FORUM_VIEW_xxxx etc.
|
// New in v2.x - requires a bootstrap theme be loaded.
|
||||||
|
|
||||||
// <small>{BREADCRUMB}</small> //FIXME Breadcrumb looks crummy
|
// <small>{BREADCRUMB}</small> //FIXME Breadcrumb looks crummy
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ $sc_style['USER_EXTENDED']['location.text_value']['post'] = "<br />";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
$FORUMSTART = "<a id='top'></a><div style='text-align:center'>
|
$FORUMSTART = "<a id='top'></a><div style='text-align:center'>
|
||||||
<div class='spacer'>
|
<div class='spacer'>
|
||||||
<table style='".USER_WIDTH."' class='fborder table'>
|
<table style='".USER_WIDTH."' class='fborder table'>
|
||||||
@@ -287,7 +287,7 @@ $FORUMDELETEDSTYLE = "<tr>
|
|||||||
<td colspan='2'>
|
<td colspan='2'>
|
||||||
</td>
|
</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
*/
|
|
||||||
|
|
||||||
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' href='{SITENAME_HREF}'>{SITENAME}</a>";
|
||||||
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
$FORUM_CRUMB['sitename']['sep'] = " :: ";
|
||||||
@@ -305,92 +305,8 @@ $FORUM_CRUMB['forum']['value'] = "<a class='forumlink' href='{FORUM_HREF}'>{FORU
|
|||||||
|
|
||||||
|
|
||||||
// {MODERATORS} {THREADSTATUS}
|
// {MODERATORS} {THREADSTATUS}
|
||||||
/*
|
|
||||||
$FORUM_VIEWTOPIC_TEMPLATE['start'] = "<a id='top'></a>
|
|
||||||
|
|
||||||
<div class='row'>
|
|
||||||
<div class='span6 pull-left'>{BACKLINK}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='row'>
|
|
||||||
<div class='span9 pull-left'><h3>{THREADNAME}</h3></div><div class='span3 pull-right right' style='padding-top:10px'>{BUTTONSX}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{MESSAGE}
|
|
||||||
|
|
||||||
|
// New in v2.x - requires a bootstrap theme be loaded.
|
||||||
<table id='forum-viewtopic' class='table table-striped'>
|
|
||||||
<colgroup>
|
|
||||||
<col style='width:20%' />
|
|
||||||
<col />
|
|
||||||
<col />
|
|
||||||
</colgroup>
|
|
||||||
<tr>
|
|
||||||
<th>".LAN_402."</th>
|
|
||||||
<th colspan='2'>".LAN_403."</th>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "</tr></table>
|
|
||||||
|
|
||||||
|
|
||||||
<div class='row clearfix'>
|
|
||||||
<div class='span3 pull-left'>{GOTOPAGES}</div>
|
|
||||||
<div class='span6 center'>{QUICKREPLY}</div>
|
|
||||||
<div class='span3 pull-right right '>{BUTTONSX}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
$FORUM_VIEWTOPIC_TEMPLATE['thread'] ="
|
|
||||||
<tr>
|
|
||||||
<td>{NEWFLAG} {USERCOMBO}{ANON_IP}</td>
|
|
||||||
<td>{THREADDATESTAMP=relative}</td>
|
|
||||||
<td style='text-align:right'>{POSTOPTIONS}</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{CUSTOMTITLE}
|
|
||||||
{AVATAR}
|
|
||||||
<div>
|
|
||||||
<small>
|
|
||||||
{LEVEL=badge} {LEVEL=pic}
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td colspan='2'>
|
|
||||||
{POLL}
|
|
||||||
{POST}
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class='finfobar'>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td class='finfobar'>
|
|
||||||
{ATTACHMENTS}
|
|
||||||
{LASTEDIT}{LASTEDITBY=link}
|
|
||||||
{SIGNATURE}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td style='text-align:right'>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td colspan='3'>
|
|
||||||
</td>
|
|
||||||
</tr>";
|
|
||||||
*/
|
|
||||||
|
|
||||||
$FORUM_VIEWTOPIC_TEMPLATE['start'] = "
|
$FORUM_VIEWTOPIC_TEMPLATE['start'] = "
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user