mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +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_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_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_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_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_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
|
'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(isset($SC_WRAPPER))
|
||||||
{
|
{
|
||||||
|
if(E107_DBG_BBSC)
|
||||||
|
{
|
||||||
|
e107::getMessage()->addDebug("Found wrapper: ".$SC_WRAPPER);
|
||||||
|
}
|
||||||
self::scStyle($SC_WRAPPER);
|
self::scStyle($SC_WRAPPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ID_WRAPPER support
|
// ID_WRAPPER support
|
||||||
if(isset($$wrapper) && !empty($$wrapper) && is_array($$wrapper))
|
if(isset($$wrapper) && !empty($$wrapper) && is_array($$wrapper))
|
||||||
{
|
{
|
||||||
|
if(E107_DBG_BBSC)
|
||||||
|
{
|
||||||
|
e107::getMessage()->addDebug("Found ID wrapper: ".$wrapper);
|
||||||
|
}
|
||||||
self::setRegistry($wrapperRegPath, $$wrapper);
|
self::setRegistry($wrapperRegPath, $$wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -762,6 +762,7 @@ class e_parse_shortcode
|
|||||||
{
|
{
|
||||||
// $cname = get_class($this->addedCodes);
|
// $cname = get_class($this->addedCodes);
|
||||||
|
|
||||||
|
|
||||||
$tmpWrap = e107::templateWrapper($this->addedCodes->wrapper());
|
$tmpWrap = e107::templateWrapper($this->addedCodes->wrapper());
|
||||||
if(!empty($tmpWrap)) // FIX for #3 above.
|
if(!empty($tmpWrap)) // FIX for #3 above.
|
||||||
{
|
{
|
||||||
@@ -769,6 +770,10 @@ class e_parse_shortcode
|
|||||||
$this->wrapper = $this->addedCodes->getWrapperID();
|
$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(
|
$config['topic'] = array(
|
||||||
'regex' => '^forum/(.*)/(\d*)-([\w-]*)/?\??(.*)',
|
'regex' => '^forum/(.*)/(\d*)(?:-|/)([\w-]*)/?\??(.*)',
|
||||||
'sef' => 'forum/{forum_sef}/{thread_id}-{thread_sef}/',
|
'sef' => 'forum/{forum_sef}/{thread_id}/{thread_sef}/',
|
||||||
'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4'
|
'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; }
|
ul.newforumposts-menu li { margin-bottom: 15px; }
|
||||||
|
|
||||||
div.forum-poll-results { padding-left:0 }
|
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) {
|
@media all and (min-height: 800px) {
|
||||||
#forum, #forum-stats, #forum-rules { min-height: 500px; }
|
#forum, #forum-stats, #forum-rules { min-height: 500px; }
|
||||||
|
@@ -199,8 +199,25 @@ if(file_exists(THEME.'forum_design.php')) // legacy file
|
|||||||
include_once (THEME.'forum_design.php');
|
include_once (THEME.'forum_design.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vartrue($FORUMSTART))
|
|
||||||
|
|
||||||
|
// New in v2.x
|
||||||
|
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'))
|
if(file_exists(THEME.'forum_viewtopic_template.php'))
|
||||||
{
|
{
|
||||||
require_once(THEME.'forum_viewtopic_template.php');
|
require_once(THEME.'forum_viewtopic_template.php');
|
||||||
@@ -217,17 +234,8 @@ if (!vartrue($FORUMSTART))
|
|||||||
{
|
{
|
||||||
require_once(e_PLUGIN.'forum/templates/forum_viewtopic_template.php');
|
require_once(e_PLUGIN.'forum/templates/forum_viewtopic_template.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// New in v2.x
|
|
||||||
if(is_array($FORUM_VIEWTOPIC_TEMPLATE) && deftrue('BOOTSTRAP',false))
|
|
||||||
{
|
|
||||||
$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'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO Clean up this mess!!
|
//TODO Clean up this mess!!
|
||||||
@@ -441,6 +449,9 @@ if (!$FORUMREPLYSTYLE) $FORUMREPLYSTYLE = $FORUMTHREADSTYLE;
|
|||||||
$alt = false;
|
$alt = false;
|
||||||
|
|
||||||
$i = $thread->page;
|
$i = $thread->page;
|
||||||
|
|
||||||
|
$sc = e107::getScBatch('view', 'forum');
|
||||||
|
|
||||||
foreach ($postList as $postInfo)
|
foreach ($postList as $postInfo)
|
||||||
{
|
{
|
||||||
if($postInfo['post_options'])
|
if($postInfo['post_options'])
|
||||||
@@ -462,23 +473,29 @@ foreach ($postList as $postInfo)
|
|||||||
$postInfo['thread_start'] = false;
|
$postInfo['thread_start'] = false;
|
||||||
$alt = !$alt;
|
$alt = !$alt;
|
||||||
|
|
||||||
|
$sc->setScVar('postInfo', $postInfo);
|
||||||
|
|
||||||
if($postInfo['post_status'])
|
if($postInfo['post_status'])
|
||||||
{
|
{
|
||||||
$_style = (isset($FORUMDELETEDSTYLE_ALT) && $alt ? $FORUMDELETEDSTYLE_ALT : $FORUMDELETEDSTYLE);
|
$_style = (isset($FORUMDELETEDSTYLE_ALT) && $alt ? $FORUMDELETEDSTYLE_ALT : $FORUMDELETEDSTYLE);
|
||||||
|
$sc->wrapper('forum_viewtopic/deleted');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
|
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
|
||||||
|
$sc->wrapper('forum_viewtopic/replies');
|
||||||
}
|
}
|
||||||
|
|
||||||
$forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
// $forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo)->wrapper('forum/viewtopic');
|
||||||
$forrep .= $tp->parseTemplate($_style, true, $forum_shortcodes) . "\n";
|
$forrep .= $tp->parseTemplate($_style, true, $sc) . "\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$postInfo['thread_start'] = true;
|
$postInfo['thread_start'] = true;
|
||||||
$forum_shortcodes = e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
$sc->setScVar('postInfo', $postInfo);
|
||||||
$forthr = $tp->parseTemplate($FORUMTHREADSTYLE, true, vartrue($forum_shortcodes)) . "\n";
|
$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);
|
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";
|
//$FORUMDELETEDSTYLE = "<br />DELETED";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user