mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +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:
@@ -272,7 +272,7 @@ class users_admin_ui extends e_admin_ui
|
||||
'user_name' => array('title' => LAN_USER_01, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto','thclass' => 'left first'), // Display name
|
||||
'user_loginname' => array('title' => LAN_USER_02, 'tab'=>0, 'type' => 'text', 'data'=>'str', 'width' => 'auto'), // User name
|
||||
'user_login' => array('title' => LAN_USER_03, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'), // Real name (no real vetting)
|
||||
'user_customtitle' => array('title' => LAN_USER_04, 'tab'=>0, 'type' => 'text', 'data'=>'str', 'width' => 'auto'), // No real vetting
|
||||
'user_customtitle' => array('title' => LAN_USER_04, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'), // No real vetting
|
||||
'user_password' => array('title' => LAN_PASSWORD, 'tab'=>0, 'type' => 'method', 'data'=>'str', 'width' => 'auto'), //TODO add md5 option to form handler?
|
||||
'user_sess' => array('title' => 'Session', 'tab'=>0, 'noedit'=>true, 'type' => 'text', 'width' => 'auto'), // Photo
|
||||
'user_image' => array('title' => LAN_USER_07, 'tab'=>0, 'type' => 'dropdown', 'data'=>'str', 'width' => 'auto'), // Avatar
|
||||
|
@@ -2541,12 +2541,20 @@ class e107
|
||||
{
|
||||
if(isset($SC_WRAPPER))
|
||||
{
|
||||
if(E107_DBG_BBSC)
|
||||
{
|
||||
e107::getMessage()->addDebug("Found wrapper: ".$SC_WRAPPER);
|
||||
}
|
||||
self::scStyle($SC_WRAPPER);
|
||||
}
|
||||
|
||||
// ID_WRAPPER support
|
||||
if(isset($$wrapper) && !empty($$wrapper) && is_array($$wrapper))
|
||||
{
|
||||
if(E107_DBG_BBSC)
|
||||
{
|
||||
e107::getMessage()->addDebug("Found ID wrapper: ".$wrapper);
|
||||
}
|
||||
self::setRegistry($wrapperRegPath, $$wrapper);
|
||||
}
|
||||
}
|
||||
|
@@ -762,6 +762,7 @@ class e_parse_shortcode
|
||||
{
|
||||
// $cname = get_class($this->addedCodes);
|
||||
|
||||
|
||||
$tmpWrap = e107::templateWrapper($this->addedCodes->wrapper());
|
||||
if(!empty($tmpWrap)) // FIX for #3 above.
|
||||
{
|
||||
@@ -769,6 +770,10 @@ class e_parse_shortcode
|
||||
$this->wrapper = $this->addedCodes->getWrapperID();
|
||||
|
||||
}
|
||||
elseif(E107_DBG_BBSC)
|
||||
{
|
||||
// e107::getMessage()->addDebug("Wrapper Empty: ".$this->addedCodes->wrapper());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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