mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Forum shortcodes. {TOPIC_TITLE} and {TOPIC_URL}
This commit is contained in:
@@ -802,7 +802,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_threadname()
|
/**
|
||||||
|
*
|
||||||
|
* @outdated use {TOPIC_TITLE} or {TOPIC_URL}
|
||||||
|
* @param null $parm
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function sc_threadname($parm=null)
|
||||||
{
|
{
|
||||||
global $menu_pref, $forum;
|
global $menu_pref, $forum;
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -845,9 +851,43 @@
|
|||||||
$this->addVars($temp);
|
$this->addVars($temp);
|
||||||
|
|
||||||
$url = e107::url('forum', 'topic', $this->var);
|
$url = e107::url('forum', 'topic', $this->var);
|
||||||
|
|
||||||
|
if($parm === 'url')
|
||||||
|
{
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($parm === 'title')
|
||||||
|
{
|
||||||
|
return $thread_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return "<a {$title} href='" . $url . "'>{$thread_name}</a>";
|
return "<a {$title} href='" . $url . "'>{$thread_name}</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//v2.1.4
|
||||||
|
function sc_topic_title($parm=null)
|
||||||
|
{
|
||||||
|
return $this->sc_threadname('title');
|
||||||
|
}
|
||||||
|
|
||||||
|
//v2.1.4
|
||||||
|
function sc_topic_url($parm=null)
|
||||||
|
{
|
||||||
|
return $this->sc_threadname('url');
|
||||||
|
}
|
||||||
|
|
||||||
|
//v2.1.4
|
||||||
|
function sc_topic_date($parm=null)
|
||||||
|
{
|
||||||
|
return $this->sc_threaddate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@todo more topic_xxxx shortcode aliases.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_pages()
|
function sc_pages()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user