mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
Issue #2016 Fix: Forum Topic/Thread Move link was failing when SEF Urls not in use.
This commit is contained in:
@@ -52,10 +52,12 @@ class forum_url // plugin-folder + '_url'
|
||||
// only create url - parsed above.
|
||||
$config['move'] = array(
|
||||
'sef' => 'forum/post/?f=move&id={thread_id}',
|
||||
'legacy' => '{e_PLUGIN}forum/forum_post.php?f=move&id={thread_id}'
|
||||
);
|
||||
|
||||
$config['split'] = array(
|
||||
'sef' => 'forum/post/?f=split&id={thread_id}&post={post_id}',
|
||||
'legacy' => '{e_PLUGIN}forum/forum_post.php?f=split&id={thread_id}&post={post_id}'
|
||||
);
|
||||
|
||||
$config['topic'] = array(
|
||||
|
@@ -5,33 +5,60 @@
|
||||
* Forum plugin - view shortcodess
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if(!defined('e107_INIT'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
class plugin_forum_viewforum_shortcodes extends e_shortcode
|
||||
{
|
||||
|
||||
private $gen;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->gen = new convert;
|
||||
$this->gen = new convert; // TODO replace all usage with e107::getParser()->toDate();
|
||||
// $this->forum_rules = forum_rules('check');
|
||||
}
|
||||
|
||||
// LEGACY shortcodes, to be deprecated & directly handled in template file???
|
||||
function sc_startertitle() {return LAN_FORUM_1004;}
|
||||
function sc_startertitle()
|
||||
{
|
||||
return LAN_FORUM_1004;
|
||||
}
|
||||
|
||||
function sc_threadtitle() {return LAN_FORUM_1003;}
|
||||
function sc_threadtitle()
|
||||
{
|
||||
return LAN_FORUM_1003;
|
||||
}
|
||||
|
||||
function sc_replytitle() {return LAN_FORUM_0003;}
|
||||
function sc_replytitle()
|
||||
{
|
||||
return LAN_FORUM_0003;
|
||||
}
|
||||
|
||||
function sc_lastpostitle() {return LAN_FORUM_0004;}
|
||||
function sc_lastpostitle()
|
||||
{
|
||||
return LAN_FORUM_0004;
|
||||
}
|
||||
|
||||
function sc_viewtitle()
|
||||
{
|
||||
return LAN_FORUM_1005;
|
||||
}
|
||||
|
||||
function sc_viewtitle() {return LAN_FORUM_1005;}
|
||||
// End of LEGACY shortcodes...
|
||||
|
||||
function sc_message() {return $this->var['message'];}
|
||||
function sc_message()
|
||||
{
|
||||
return $this->var['message'];
|
||||
}
|
||||
|
||||
function sc_threadpages() {return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}");}
|
||||
function sc_threadpages()
|
||||
{
|
||||
return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}");
|
||||
}
|
||||
|
||||
function sc_newthreadbutton()
|
||||
{
|
||||
@@ -43,16 +70,25 @@ class plugin_forum_viewforum_shortcodes extends e_shortcode
|
||||
|
||||
if(!BOOTSTRAP)
|
||||
{
|
||||
return sc_newthreadbutton;
|
||||
return $this->sc_newthreadbutton();
|
||||
}
|
||||
|
||||
//--function newthreadjump($url)
|
||||
//--{
|
||||
|
||||
|
||||
global $forum;
|
||||
$jumpList = $forum->forumGetAllowed('view');
|
||||
|
||||
|
||||
$text = '<div class="btn-group">
|
||||
<a href="'.$this->var['ntUrl'].'" class="btn btn-primary">'.LAN_FORUM_1018.'</a>
|
||||
$text = '<div class="btn-group">';
|
||||
|
||||
if(!empty($this->var['ntUrl']))
|
||||
{
|
||||
$text .= '<a href="' . $this->var['ntUrl'] . '" class="btn btn-primary">' . LAN_FORUM_1018 . '</a>';
|
||||
}
|
||||
|
||||
$text .= '
|
||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
@@ -78,7 +114,6 @@ if(!BOOTSTRAP)
|
||||
|
||||
function sc_breadcrumb()
|
||||
{
|
||||
// var_dump ($this->var);
|
||||
return $this->var['breadcrumb'];
|
||||
}
|
||||
|
||||
@@ -104,11 +139,13 @@ if(!BOOTSTRAP)
|
||||
|
||||
function sc_browsers()
|
||||
{
|
||||
global $member_users, $users, $guest_users;
|
||||
|
||||
if($this->var['track_online'])
|
||||
{
|
||||
return $users . ' ' . ($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060) . ' (' . $member_users . ' ' . ($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062) . ", " . $guest_users . " " . ($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064) . ')';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function sc_iconkey()
|
||||
@@ -232,6 +269,7 @@ if(!empty($viewable))
|
||||
return empty($viewable) ? '' : $viewable;
|
||||
}
|
||||
|
||||
|
||||
function sc_search()
|
||||
{
|
||||
return "
|
||||
@@ -246,6 +284,7 @@ return "
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sc_perms()
|
||||
{
|
||||
global $forum, $forumId;
|
||||
@@ -406,7 +445,6 @@ global $FORUM_VIEW_SUB, $FORUM_VIEW_SUB_START, $FORUM_VIEW_SUB_END;
|
||||
//var_dump ($sc);
|
||||
|
||||
|
||||
|
||||
}
|
||||
//var_dump ("----------->".$FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END."<-----------");
|
||||
|
||||
@@ -432,39 +470,47 @@ class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortc
|
||||
// $this->forum_rules = forum_rules('check');
|
||||
}
|
||||
------*/
|
||||
|
||||
|
||||
function sc_sub_forumtitle()
|
||||
{
|
||||
$forumName = e107::getParser()->toHTML($this->var['forum_name'], true);
|
||||
return "<a href='" . e107::getUrl()->create('forum/forum/view', $this->var) . "'>{$forumName}</a>";
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_description()
|
||||
{
|
||||
return e107::getParser()->toHTML($this->var['forum_description'], false, 'no_hook');
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_threads()
|
||||
{
|
||||
return $this->var['forum_threads'];
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_replies()
|
||||
{
|
||||
return $this->var['forum_replies'];
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_threadsx()
|
||||
{
|
||||
$badgeThreads = ($this->var['forum_replies']) ? "badge-info" : "";
|
||||
return "<span class='badge {$badgeThreads}'>" . $this->var['forum_threads'] . "</span>";
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_repliesx()
|
||||
{
|
||||
$badgeReplies = ($this->var['forum_replies']) ? "badge-info" : "";
|
||||
return "<span class='badge {$badgeReplies}'>" . $this->var['forum_replies'] . "</span>";
|
||||
}
|
||||
|
||||
|
||||
function sc_newflag()
|
||||
{
|
||||
//-- global $newflag_list;
|
||||
@@ -481,10 +527,15 @@ class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortc
|
||||
|
||||
}
|
||||
|
||||
function sc__wrapper_() { return 'forum_viewforum';}
|
||||
|
||||
function sc__wrapper_() // TODO XXX ??
|
||||
{
|
||||
return 'forum_viewforum';
|
||||
}
|
||||
|
||||
|
||||
function subinfo() {
|
||||
function subinfo()
|
||||
{
|
||||
$caller = debug_backtrace()[1]['function'];
|
||||
if($this->var['forum_lastpost_info'])
|
||||
{
|
||||
@@ -527,16 +578,19 @@ class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortc
|
||||
return ($caller == 'sc_sub_lastpost' ? '-' : '');
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_lastpostuser()
|
||||
{
|
||||
return $this->subinfo();
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_lastpostdate()
|
||||
{
|
||||
return $this->subinfo();
|
||||
}
|
||||
|
||||
|
||||
function sc_sub_lastpost()
|
||||
{
|
||||
return $this->subinfo();
|
||||
@@ -557,16 +611,19 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho
|
||||
}
|
||||
------*/
|
||||
|
||||
|
||||
function sc_views()
|
||||
{
|
||||
return $this->var['thread_views'];
|
||||
}
|
||||
|
||||
|
||||
function sc_replies()
|
||||
{
|
||||
return ($this->var['thread_total_replies'] ?: "0");
|
||||
}
|
||||
|
||||
|
||||
function sc_viewsx()
|
||||
{
|
||||
/*--
|
||||
@@ -581,6 +638,7 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho
|
||||
return deftrue('BOOTSTRAP') ? "<span class='badge {$badge}'>" . $this->sc_views() . "</span>" : $this->sc_views();
|
||||
}
|
||||
|
||||
|
||||
function sc_repliesx()
|
||||
{
|
||||
/*--
|
||||
@@ -597,7 +655,8 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho
|
||||
|
||||
// function sc__wrapper_() { return 'forum_viewforum';}
|
||||
|
||||
function threadlastpostdata() {
|
||||
function threadlastpostdata()
|
||||
{
|
||||
$caller = debug_backtrace()[1]['function'];
|
||||
// if($this->var['thread_views'])
|
||||
//($this->var['thread_total_replies']?:"0")
|
||||
@@ -660,33 +719,39 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return ($caller == 'sc_lastpostuser' ? '' : '-');
|
||||
}
|
||||
|
||||
|
||||
function sc_lastpostuser()
|
||||
{
|
||||
return $this->threadlastpostdata();
|
||||
}
|
||||
|
||||
|
||||
function sc_lastpostdate()
|
||||
{
|
||||
return $this->threadlastpostdata();
|
||||
}
|
||||
|
||||
|
||||
function sc_lastpost()
|
||||
{
|
||||
return $this->threadlastpostdata();
|
||||
}
|
||||
|
||||
|
||||
function sc_threaddate()
|
||||
{
|
||||
// global $gen;
|
||||
return $this->gen->convert_date($this->var['thread_datestamp'], 'forum');
|
||||
}
|
||||
|
||||
|
||||
function sc_threadtimelapse()
|
||||
{
|
||||
// global $gen;
|
||||
return $this->gen->computeLapse($this->var['thread_datestamp'], time(), false, false, 'short'); // convert_date($thread_info['thread_datestamp'], 'forum');
|
||||
}
|
||||
|
||||
|
||||
function sc_icon()
|
||||
{
|
||||
global $forum;
|
||||
@@ -722,6 +787,7 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return $ICON;
|
||||
}
|
||||
|
||||
|
||||
function sc_threadtype()
|
||||
{
|
||||
//-- CANDIDATE FOR TERNARY IF
|
||||
@@ -737,6 +803,7 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
function sc_threadname()
|
||||
{
|
||||
global $menu_pref, $forum;
|
||||
@@ -783,18 +850,21 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return "<a {$title} href='" . $url . "'>{$thread_name}</a>";
|
||||
}
|
||||
|
||||
|
||||
function sc_pages()
|
||||
{
|
||||
// $tVars['PAGES'] = fpages($thread_info, $tVars['REPLIES']);
|
||||
return fpages($this->var, $this->sc_replies());
|
||||
}
|
||||
|
||||
|
||||
function sc_pagesx()
|
||||
{
|
||||
// $tVars['PAGESX'] = fpages($thread_info, $tVars['REPLIES']);
|
||||
return $this->sc_pages();
|
||||
}
|
||||
|
||||
|
||||
function sc_admin_icons()
|
||||
{
|
||||
|
||||
@@ -820,6 +890,7 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
function sc_adminoptions()
|
||||
{
|
||||
/*--
|
||||
@@ -836,6 +907,7 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return (!deftrue('BOOTSTRAP') ? $this->sc_admin_icons() : ((MODERATOR) ? fadminoptions($this->var) : ''));
|
||||
}
|
||||
|
||||
|
||||
function sc_poster()
|
||||
{
|
||||
/*--
|
||||
@@ -906,4 +978,6 @@ $LASTPOSTUSER = $this->var['lastpost_username'];
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user