mirror of
https://github.com/e107inc/e107.git
synced 2025-08-24 07:03:06 +02:00
Forum view-topic template wrapper fix. Custom-title styling subject to change. Default SEF-URL format now separates thread_id into 'folder'. (backward compat.)
This commit is contained in:
@@ -55,8 +55,8 @@ class forum_url // plugin-folder + '_url'
|
||||
);
|
||||
|
||||
$config['topic'] = array(
|
||||
'regex' => '^forum/(.*)/(\d*)-([\w-]*)/?\??(.*)',
|
||||
'sef' => 'forum/{forum_sef}/{thread_id}-{thread_sef}/',
|
||||
'regex' => '^forum/(.*)/(\d*)(?:-|/)([\w-]*)/?\??(.*)',
|
||||
'sef' => 'forum/{forum_sef}/{thread_id}/{thread_sef}/',
|
||||
'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4'
|
||||
);
|
||||
/*
|
||||
|
@@ -18,6 +18,17 @@ ul.newforumposts-menu { padding-left: 10px; }
|
||||
ul.newforumposts-menu li { margin-bottom: 15px; }
|
||||
|
||||
div.forum-poll-results { padding-left:0 }
|
||||
.forum-viewtopic-customtitle {
|
||||
display: block;
|
||||
background-color: #E0E0E0;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
margin-top: -3px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@media all and (min-height: 800px) {
|
||||
#forum, #forum-stats, #forum-rules { min-height: 500px; }
|
||||
|
@@ -199,36 +199,44 @@ if(file_exists(THEME.'forum_design.php')) // legacy file
|
||||
include_once (THEME.'forum_design.php');
|
||||
}
|
||||
|
||||
if (!vartrue($FORUMSTART))
|
||||
{
|
||||
if(file_exists(THEME.'forum_viewtopic_template.php'))
|
||||
{
|
||||
require_once(THEME.'forum_viewtopic_template.php');
|
||||
}
|
||||
elseif(file_exists(THEME.'templates/forum/forum_viewtopic_template.php'))
|
||||
{
|
||||
require_once(THEME.'templates/forum/forum_viewtopic_template.php');
|
||||
}
|
||||
elseif(file_exists(THEME.'forum_template.php'))
|
||||
{
|
||||
require_once(THEME.'forum_template.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(e_PLUGIN.'forum/templates/forum_viewtopic_template.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// New in v2.x
|
||||
if(is_array($FORUM_VIEWTOPIC_TEMPLATE) && deftrue('BOOTSTRAP',false))
|
||||
if(deftrue('BOOTSTRAP',false))
|
||||
{
|
||||
$FORUM_VIEWTOPIC_TEMPLATE = e107::getTemplate('forum','forum_viewtopic');
|
||||
|
||||
// print_a($FORUM_VIEWTOPIC_TEMPLATE);
|
||||
|
||||
$FORUMSTART = $FORUM_VIEWTOPIC_TEMPLATE['start'];
|
||||
$FORUMTHREADSTYLE = $FORUM_VIEWTOPIC_TEMPLATE['thread'];
|
||||
$FORUMEND = $FORUM_VIEWTOPIC_TEMPLATE['end'];
|
||||
$FORUMREPLYSTYLE = $FORUM_VIEWTOPIC_TEMPLATE['replies'];
|
||||
$FORUMDELETEDSTYLE = $FORUM_VIEWTOPIC_TEMPLATE['deleted'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!vartrue($FORUMSTART))
|
||||
{
|
||||
if(file_exists(THEME.'forum_viewtopic_template.php'))
|
||||
{
|
||||
require_once(THEME.'forum_viewtopic_template.php');
|
||||
}
|
||||
elseif(file_exists(THEME.'templates/forum/forum_viewtopic_template.php'))
|
||||
{
|
||||
require_once(THEME.'templates/forum/forum_viewtopic_template.php');
|
||||
}
|
||||
elseif(file_exists(THEME.'forum_template.php'))
|
||||
{
|
||||
require_once(THEME.'forum_template.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(e_PLUGIN.'forum/templates/forum_viewtopic_template.php');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO Clean up this mess!!
|
||||
|
||||
@@ -441,6 +449,9 @@ if (!$FORUMREPLYSTYLE) $FORUMREPLYSTYLE = $FORUMTHREADSTYLE;
|
||||
$alt = false;
|
||||
|
||||
$i = $thread->page;
|
||||
|
||||
$sc = e107::getScBatch('view', 'forum');
|
||||
|
||||
foreach ($postList as $postInfo)
|
||||
{
|
||||
if($postInfo['post_options'])
|
||||
@@ -462,23 +473,29 @@ foreach ($postList as $postInfo)
|
||||
$postInfo['thread_start'] = false;
|
||||
$alt = !$alt;
|
||||
|
||||
$sc->setScVar('postInfo', $postInfo);
|
||||
|
||||
if($postInfo['post_status'])
|
||||
{
|
||||
$_style = (isset($FORUMDELETEDSTYLE_ALT) && $alt ? $FORUMDELETEDSTYLE_ALT : $FORUMDELETEDSTYLE);
|
||||
$sc->wrapper('forum_viewtopic/deleted');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
|
||||
$sc->wrapper('forum_viewtopic/replies');
|
||||
}
|
||||
|
||||
$forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
||||
$forrep .= $tp->parseTemplate($_style, true, $forum_shortcodes) . "\n";
|
||||
|
||||
// $forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo)->wrapper('forum/viewtopic');
|
||||
$forrep .= $tp->parseTemplate($_style, true, $sc) . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$postInfo['thread_start'] = true;
|
||||
$forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
||||
$forthr = $tp->parseTemplate($FORUMTHREADSTYLE, true, vartrue($forum_shortcodes)) . "\n";
|
||||
$sc->setScVar('postInfo', $postInfo);
|
||||
$sc->wrapper('forum_viewtopic/thread');
|
||||
// $forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo)->wrapper('forum/viewtopic');
|
||||
$forthr = $tp->parseTemplate($FORUMTHREADSTYLE, true, vartrue($sc)) . "\n";
|
||||
}
|
||||
}
|
||||
unset($loop_uid);
|
||||
|
@@ -474,7 +474,9 @@ $FORUM_VIEWTOPIC_TEMPLATE['deleted'] = "
|
||||
|
||||
|
||||
|
||||
$FORUM_VIEWTOPIC_WRAPPER['ATTACHMENTS'] = "<div class='alert alert-default alert-block'>{---}</div>";
|
||||
$FORUM_VIEWTOPIC_WRAPPER['thread']['ATTACHMENTS'] = "<div class='forum-viewtopic-attachments'>{---}</div>";
|
||||
$FORUM_VIEWTOPIC_WRAPPER['thread']['CUSTOMTITLE'] = "<span class='forum-viewtopic-customtitle'><small>{---}</small></span>";
|
||||
|
||||
|
||||
//$FORUMDELETEDSTYLE = "<br />DELETED";
|
||||
|
||||
|
Reference in New Issue
Block a user