mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
PHP8 fixes and shortcode tests for forum, gallery, hero and login_menu. admin-shortcode time fix.
This commit is contained in:
@@ -108,7 +108,9 @@ class admin_shortcodes
|
|||||||
function sc_admin_docs()
|
function sc_admin_docs()
|
||||||
{
|
{
|
||||||
if (!ADMIN) { return ''; }
|
if (!ADMIN) { return ''; }
|
||||||
global $ns;
|
|
||||||
|
$helplist = array();
|
||||||
|
|
||||||
$i=1;
|
$i=1;
|
||||||
if (!$handle=opendir(e_DOCS.e_LANGUAGE.'/'))
|
if (!$handle=opendir(e_DOCS.e_LANGUAGE.'/'))
|
||||||
{
|
{
|
||||||
@@ -125,6 +127,7 @@ class admin_shortcodes
|
|||||||
closedir($handle);
|
closedir($handle);
|
||||||
|
|
||||||
unset($e107_var);
|
unset($e107_var);
|
||||||
|
$e107_var = array();
|
||||||
foreach ($helplist as $key => $value)
|
foreach ($helplist as $key => $value)
|
||||||
{
|
{
|
||||||
$e107_var['x'.$key]['text'] = str_replace('_', ' ', $value);
|
$e107_var['x'.$key]['text'] = str_replace('_', ' ', $value);
|
||||||
@@ -136,7 +139,7 @@ class admin_shortcodes
|
|||||||
if(function_exists('show_admin_menu'))
|
if(function_exists('show_admin_menu'))
|
||||||
{
|
{
|
||||||
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
|
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
|
||||||
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
return e107::getRender()->tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1009,6 +1012,7 @@ class admin_shortcodes
|
|||||||
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
|
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
|
||||||
|
|
||||||
$nav_sql = new db;
|
$nav_sql = new db;
|
||||||
|
$tmp = array();
|
||||||
if ($nav_sql ->select('plugin', '*', 'plugin_installflag=1'))
|
if ($nav_sql ->select('plugin', '*', 'plugin_installflag=1'))
|
||||||
{
|
{
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
@@ -1038,9 +1042,9 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Links Plugins
|
// Links Plugins
|
||||||
if ($eplug_conffile)
|
if(!empty($eplug_conffile))
|
||||||
{
|
{
|
||||||
$tmp['plug_'.$plugin_id]['text'] = $eplug_caption;
|
$tmp['plug_'.$plugin_id]['text'] = varset($eplug_caption);
|
||||||
$tmp['plug_'.$plugin_id]['link'] = e_PLUGIN.$plugin_path.'/'.$eplug_conffile;
|
$tmp['plug_'.$plugin_id]['link'] = e_PLUGIN.$plugin_path.'/'.$eplug_conffile;
|
||||||
$tmp['plug_'.$plugin_id]['perm'] = 'P'.$plugin_id;
|
$tmp['plug_'.$plugin_id]['perm'] = 'P'.$plugin_id;
|
||||||
}
|
}
|
||||||
@@ -1171,16 +1175,20 @@ class admin_shortcodes
|
|||||||
|
|
||||||
function sc_admin_siteinfo($parm='')
|
function sc_admin_siteinfo($parm='')
|
||||||
{
|
{
|
||||||
if($parm == 'creditsonly' && e_PAGE != "credits.php" && e_PAGE != "phpinfo.php" && e_PAGE != 'e107_update.php')
|
if($parm == 'creditsonly' && e_PAGE !== "credits.php" && e_PAGE !== "phpinfo.php" && e_PAGE !== 'e107_update.php')
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ADMIN)
|
if (!ADMIN)
|
||||||
{
|
{
|
||||||
global $ns, $pref, $themename, $themeversion, $themeauthor, $themedate, $themeinfo, $mySQLdefaultdb;
|
return null;
|
||||||
|
}
|
||||||
|
global $themename, $themeversion, $themeauthor, $themedate, $themeinfo, $mySQLdefaultdb;
|
||||||
|
|
||||||
|
$pref = e107::getPref();
|
||||||
|
$ns = e107::getRender();
|
||||||
// if (file_exists(e_ADMIN.'ver.php'))
|
// if (file_exists(e_ADMIN.'ver.php'))
|
||||||
{
|
{
|
||||||
// include(e_ADMIN.'ver.php');
|
// include(e_ADMIN.'ver.php');
|
||||||
@@ -1191,8 +1199,7 @@ class admin_shortcodes
|
|||||||
return e_VERSION;
|
return e_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = e107::getDateConvert();
|
$install_date = e107::getDate()->convert_date($pref['install_date'], '%A %d %B %Y - %H:%M');
|
||||||
$install_date = $obj->convert_date($pref['install_date'], 'long');
|
|
||||||
|
|
||||||
if(is_readable(THEME."theme.xml"))
|
if(is_readable(THEME."theme.xml"))
|
||||||
{
|
{
|
||||||
@@ -1267,7 +1274,7 @@ class admin_shortcodes
|
|||||||
"<br />";
|
"<br />";
|
||||||
|
|
||||||
return e107::getRender()->tablerender(FOOTLAN_13, $text, '', TRUE);
|
return e107::getRender()->tablerender(FOOTLAN_13, $text, '', TRUE);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getLastGitUpdate()
|
private function getLastGitUpdate()
|
||||||
|
@@ -143,9 +143,15 @@
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($parms[1] == 'value')
|
if ($parms[1] === 'value')
|
||||||
{
|
{
|
||||||
$uVal = isset($parms[0]) && isset($udata['user_'.$parms[0]]) ? str_replace(chr(1), '', $udata['user_'.$parms[0]]) : '';
|
$uVal = isset($parms[0]) && isset($udata['user_'.$parms[0]]) ? str_replace(chr(1), '', $udata['user_'.$parms[0]]) : '';
|
||||||
|
|
||||||
|
if(!isset($parms[0]) || !isset($ueStruct["user_".$parms[0]]) || !isset($ueStruct["user_".$parms[0]]['user_extended_struct_type']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($ueStruct["user_".$parms[0]]['user_extended_struct_type'])
|
switch ($ueStruct["user_".$parms[0]]['user_extended_struct_type'])
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -1744,7 +1744,7 @@ class e107
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve date handler singleton object
|
* Retrieve date handler singleton object
|
||||||
*
|
* @deprecated Use e107::getDate();
|
||||||
* @return convert
|
* @return convert
|
||||||
*/
|
*/
|
||||||
public static function getDateConvert()
|
public static function getDateConvert()
|
||||||
@@ -3495,6 +3495,9 @@ class e107
|
|||||||
* // import defeinitions from /e107_plugins/myplug/languages/[CurrentLanguage]_admin.php
|
* // import defeinitions from /e107_plugins/myplug/languages/[CurrentLanguage]_admin.php
|
||||||
* e107::plugLan('myplug', true);
|
* e107::plugLan('myplug', true);
|
||||||
*
|
*
|
||||||
|
* // import defeinitions from /e107_plugins/myplug/languages/[CurrentLanguage].php // FOR BC only.
|
||||||
|
* e107::plugLan('myplug', null);
|
||||||
|
*
|
||||||
* // import defeinitions from /e107_plugins/myplug/languages/[CurrentLanguage]/[CurrentLanguage]_front.php
|
* // import defeinitions from /e107_plugins/myplug/languages/[CurrentLanguage]/[CurrentLanguage]_front.php
|
||||||
* e107::plugLan('myplug', 'front', true);
|
* e107::plugLan('myplug', 'front', true);
|
||||||
*
|
*
|
||||||
@@ -3530,6 +3533,10 @@ class e107
|
|||||||
//$fname = "admin/".e_LANGUAGE;
|
//$fname = "admin/".e_LANGUAGE;
|
||||||
$fname = e_LANGUAGE."_admin";
|
$fname = e_LANGUAGE."_admin";
|
||||||
}
|
}
|
||||||
|
elseif($fname === null)
|
||||||
|
{
|
||||||
|
$fname = e_LANGUAGE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// $fname = e_LANGUAGE;
|
// $fname = e_LANGUAGE;
|
||||||
|
@@ -1449,7 +1449,8 @@ class e_parse_shortcode
|
|||||||
*/
|
*/
|
||||||
private function makeWrapper($ret, $code, $fullShortcodeKey, $sc_mode)
|
private function makeWrapper($ret, $code, $fullShortcodeKey, $sc_mode)
|
||||||
{
|
{
|
||||||
$pre = $post = '';
|
$pre = '';
|
||||||
|
$post = '';
|
||||||
|
|
||||||
if(!empty($fullShortcodeKey) && !empty($this->wrappers[$fullShortcodeKey]) ) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1']
|
if(!empty($fullShortcodeKey) && !empty($this->wrappers[$fullShortcodeKey]) ) // eg: $NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1']
|
||||||
{
|
{
|
||||||
@@ -1505,6 +1506,7 @@ class e_parse_shortcode
|
|||||||
$this->nowrap = false;
|
$this->nowrap = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $pre.$ret.$post;
|
return $pre.$ret.$post;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1942,6 +1942,11 @@ class e107forum
|
|||||||
|
|
||||||
function forumGetAllowed($type='view')
|
function forumGetAllowed($type='view')
|
||||||
{
|
{
|
||||||
|
if(empty($this->permList[$type]))
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$forumList = implode(',', $this->permList[$type]);
|
$forumList = implode(',', $this->permList[$type]);
|
||||||
$qry = "
|
$qry = "
|
||||||
|
@@ -18,14 +18,19 @@
|
|||||||
protected $e107;
|
protected $e107;
|
||||||
protected $defaultImgAttachSize = false;
|
protected $defaultImgAttachSize = false;
|
||||||
public $pref;
|
public $pref;
|
||||||
|
public $param;
|
||||||
|
|
||||||
// $param is sent from nfp menu.
|
// $param is sent from nfp menu.
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->e107 = e107::getInstance();
|
$this->e107 = e107::getInstance();
|
||||||
|
require_once(e_PLUGIN . "forum/forum_class.php");
|
||||||
$this->forum = new e107forum();
|
$this->forum = new e107forum();
|
||||||
$this->pref = e107::pref('forum');
|
|
||||||
|
$this->pref = (array) e107::pref('forum');
|
||||||
|
|
||||||
$this->defaultImgAttachSize = e107::pref('forum', 'maxwidth', false); // don't resize here if set to 0.
|
$this->defaultImgAttachSize = e107::pref('forum', 'maxwidth', false); // don't resize here if set to 0.
|
||||||
}
|
}
|
||||||
@@ -43,6 +48,7 @@
|
|||||||
|
|
||||||
function sc_post_url($parm = null)
|
function sc_post_url($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$url = e107::url('forum', 'topic', $this->var, array(
|
$url = e107::url('forum', 'topic', $this->var, array(
|
||||||
'query' => array(
|
'query' => array(
|
||||||
'f' => 'post',
|
'f' => 'post',
|
||||||
@@ -55,16 +61,19 @@
|
|||||||
|
|
||||||
function sc_post_datestamp($parm = null)
|
function sc_post_datestamp($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_threaddatestamp('relative');
|
return $this->sc_threaddatestamp('relative');
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_post_topic($parm = null)
|
function sc_post_topic($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_threadname($parm);
|
return $this->sc_threadname($parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_post_content($parm = null)
|
function sc_post_content($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$post = strip_tags($tp->toHTML($this->var['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
|
$post = strip_tags($tp->toHTML($this->var['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
|
||||||
@@ -75,11 +84,13 @@
|
|||||||
|
|
||||||
function sc_post_author_name($parm = null)
|
function sc_post_author_name($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_poster();
|
return $this->sc_poster();
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_post_author_avatar($parm = null)
|
function sc_post_author_avatar($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return e107::getParser()->toAvatar($this->postInfo, $parm);
|
return e107::getParser()->toAvatar($this->postInfo, $parm);
|
||||||
// return $this->sc_avatar($parm);
|
// return $this->sc_avatar($parm);
|
||||||
}
|
}
|
||||||
@@ -88,17 +99,19 @@
|
|||||||
|
|
||||||
function sc_topic_name($parm = null)
|
function sc_topic_name($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_threadname($parm);
|
return $this->sc_threadname($parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_topic_author_name($parm = null)
|
function sc_topic_author_name($parm = null)
|
||||||
{
|
{
|
||||||
if($this->var['thread_user_username'])
|
|
||||||
|
if(!empty($this->var['thread_user_username']))
|
||||||
{
|
{
|
||||||
return "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['thread_user_username'], 'id' => $this->postInfo['thread_user'])) . "'>{$this->postInfo['thread_user_username']}</a>";
|
return "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['thread_user_username'], 'id' => $this->postInfo['thread_user'])) . "'>{$this->postInfo['thread_user_username']}</a>";
|
||||||
}
|
}
|
||||||
else
|
elseif(!empty($this->postInfo['thread_user_anon']))
|
||||||
{
|
{
|
||||||
return '<b>' . e107::getParser()->toHTML($this->postInfo['thread_user_anon']) . '</b>';
|
return '<b>' . e107::getParser()->toHTML($this->postInfo['thread_user_anon']) . '</b>';
|
||||||
}
|
}
|
||||||
@@ -107,6 +120,7 @@
|
|||||||
|
|
||||||
function sc_topic_author_url($parm = null)
|
function sc_topic_author_url($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(empty($this->var['thread_user_username']) || empty($this->var['thread_user']))
|
if(empty($this->var['thread_user_username']) || empty($this->var['thread_user']))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
@@ -118,11 +132,12 @@
|
|||||||
|
|
||||||
function sc_topic_author_avatar($parm = null)
|
function sc_topic_author_avatar($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$arr = array(
|
$arr = array(
|
||||||
'user_id' => $this->var['thread_user'], // standardized field names.
|
'user_id' => $this->var['thread_user'], // standardized field names.
|
||||||
'user_name' => $this->var['thread_user_username'],
|
'user_name' => varset($this->var['thread_user_username']),
|
||||||
'user_image' => $this->var['thread_user_userimage'],
|
'user_image' => varset($this->var['thread_user_userimage']),
|
||||||
'user_currentvisit' => $this->var['thread_user_usercurrentvisit']
|
'user_currentvisit' => varset($this->var['thread_user_usercurrentvisit'])
|
||||||
);
|
);
|
||||||
|
|
||||||
return e107::getParser()->toAvatar($arr, $parm);
|
return e107::getParser()->toAvatar($arr, $parm);
|
||||||
@@ -130,45 +145,51 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_topic_url($parm = null)
|
function sc_topic_url($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return e107::url('forum', 'topic', $this->var);
|
return e107::url('forum', 'topic', $this->var);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_topic_views($parm = null)
|
function sc_topic_views($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$val = ($this->var['thread_views']) ? $this->var['thread_views'] : '0';
|
$val = ($this->var['thread_views']) ? $this->var['thread_views'] : '0';
|
||||||
|
|
||||||
return e107::getParser()->toBadge($val);
|
return e107::getParser()->toBadge($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_topic_replies($parm = null)
|
function sc_topic_replies($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';
|
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';
|
||||||
|
|
||||||
return e107::getParser()->toBadge($val);
|
return e107::getParser()->toBadge($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @example {TOPIC_DATESTAMP: format=relative}
|
|
||||||
* @param string $parm ['format'] short|long|forum|relative
|
* @param string $parm ['format'] short|long|forum|relative
|
||||||
* @return string HTML
|
* @return string HTML
|
||||||
|
* @example {TOPIC_DATESTAMP: format=relative}
|
||||||
*/
|
*/
|
||||||
function sc_topic_datestamp($parm = null)
|
function sc_topic_datestamp($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$mode = empty($parm['format']) ? 'forum' : $parm['format'];
|
$mode = empty($parm['format']) ? 'forum' : $parm['format'];
|
||||||
|
|
||||||
return e107::getParser()->toDate($this->var['thread_datestamp'], $mode);
|
return e107::getParser()->toDate($this->var['thread_datestamp'], $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @example {TOPIC_LASTPOST_DATE: format=relative}
|
|
||||||
* @param string $parm ['format'] short|long|forum|relative
|
* @param string $parm ['format'] short|long|forum|relative
|
||||||
* @return string
|
* @return string
|
||||||
|
* @example {TOPIC_LASTPOST_DATE: format=relative}
|
||||||
*/
|
*/
|
||||||
function sc_topic_lastpost_date($parm = null)
|
function sc_topic_lastpost_date($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(empty($this->var['thread_total_replies']))
|
if(empty($this->var['thread_total_replies']))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
@@ -176,6 +197,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$mode = empty($parm['format']) ? 'forum' : $parm['format'];
|
$mode = empty($parm['format']) ? 'forum' : $parm['format'];
|
||||||
|
|
||||||
return e107::getParser()->toDate($this->var['thread_lastpost'], $mode);
|
return e107::getParser()->toDate($this->var['thread_lastpost'], $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,9 +208,10 @@
|
|||||||
if($this->var['thread_views'] && !empty($this->var['thread_total_replies']))
|
if($this->var['thread_views'] && !empty($this->var['thread_total_replies']))
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->var['thread_lastuser_username'])
|
if(!empty($this->var['thread_lastuser_username']))
|
||||||
{
|
{
|
||||||
$url = e107::getUrl()->create('user/profile/view', "name={$this->var['thread_lastuser_username']}&id={$this->var['thread_lastuser']}");
|
$url = e107::getUrl()->create('user/profile/view', "name={$this->var['thread_lastuser_username']}&id={$this->var['thread_lastuser']}");
|
||||||
|
|
||||||
return "<a href='{$url}'>" . $this->var['thread_lastuser_username'] . "</a>";
|
return "<a href='{$url}'>" . $this->var['thread_lastuser_username'] . "</a>";
|
||||||
}
|
}
|
||||||
elseif($this->var['thread_lastuser_anon'])
|
elseif($this->var['thread_lastuser_anon'])
|
||||||
@@ -210,30 +233,30 @@
|
|||||||
function sc_topic_icon($parm = null)
|
function sc_topic_icon($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $this->forum->threadGetUserViewed()));
|
$newflag = (USER && defined('USERLV') && ($this->var['thread_lastpost'] > USERLV) && !in_array($this->var['thread_id'], $this->forum->threadGetUserViewed()));
|
||||||
|
|
||||||
$ICON = ($newflag ? IMAGE_new : IMAGE_nonew);
|
$ICON = ($newflag ? defset('IMAGE_new') : defset('IMAGE_nonew'));
|
||||||
|
|
||||||
if($this->var['thread_total_replies'] >= vartrue($this->pref['popular'], 10))
|
if($this->var['thread_total_replies'] >= vartrue($this->pref['popular'], 10))
|
||||||
{
|
{
|
||||||
$ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular);
|
$ICON = ($newflag ? defset('IMAGE_new_popular') : defset('IMAGE_nonew_popular'));
|
||||||
}
|
}
|
||||||
elseif(empty($this->var['thread_total_replies']) && defined('IMAGE_noreplies'))
|
elseif(empty($this->var['thread_total_replies']) && defined('IMAGE_noreplies'))
|
||||||
{
|
{
|
||||||
$ICON = IMAGE_noreplies;
|
$ICON = defset('IMAGE_noreplies');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->var['thread_sticky'] == 1)
|
if($this->var['thread_sticky'] == 1)
|
||||||
{
|
{
|
||||||
$ICON = ($this->var['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
|
$ICON = ($this->var['thread_active'] ? defset('IMAGE_sticky') : defset('IMAGE_stickyclosed'));
|
||||||
}
|
}
|
||||||
elseif($this->var['thread_sticky'] == 2)
|
elseif($this->var['thread_sticky'] == 2)
|
||||||
{
|
{
|
||||||
$ICON = IMAGE_announce;
|
$ICON = defset('IMAGE_announce');
|
||||||
}
|
}
|
||||||
elseif(!$this->var['thread_active'])
|
elseif(!$this->var['thread_active'])
|
||||||
{
|
{
|
||||||
$ICON = IMAGE_closed;
|
$ICON = defset('IMAGE_closed');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ICON;
|
return $ICON;
|
||||||
@@ -244,6 +267,7 @@
|
|||||||
|
|
||||||
function sc_forum_name($parm = null)
|
function sc_forum_name($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(substr($this->var['forum_name'], 0, 1) === '*')
|
if(substr($this->var['forum_name'], 0, 1) === '*')
|
||||||
{
|
{
|
||||||
$this->var['forum_name'] = substr($this->var['forum_name'], 1);
|
$this->var['forum_name'] = substr($this->var['forum_name'], 1);
|
||||||
@@ -256,6 +280,7 @@
|
|||||||
|
|
||||||
function sc_forum_url($parm = null)
|
function sc_forum_url($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return e107::url('forum', 'forum', $this->var);
|
return e107::url('forum', 'forum', $this->var);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,29 +290,22 @@
|
|||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_breadcrumb()
|
function sc_breadcrumb()
|
||||||
{
|
{
|
||||||
return $this->var['breadcrumb'];
|
|
||||||
|
return !empty($this->var['breadcrumb']) ? $this->var['breadcrumb'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_backlink()
|
function sc_backlink()
|
||||||
{
|
{
|
||||||
return $this->var['breadcrumb'];
|
|
||||||
|
return !empty($this->var['breadcrumb']) ? $this->var['breadcrumb'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_top($parm = '')
|
function sc_top($parm = '')
|
||||||
{
|
{
|
||||||
$text = ($parm == 'caret') ? "<span class='caret'></span>" : LAN_FORUM_2030;
|
|
||||||
|
$text = ($parm === 'caret') ? "<span class='caret'></span>" : LAN_FORUM_2030;
|
||||||
|
|
||||||
return "<a href='" . e_SELF . '?' . e_QUERY . "#top' onclick=\"window.scrollTo(0,0);\">" . $text . '</a>';
|
return "<a href='" . e_SELF . '?' . e_QUERY . "#top' onclick=\"window.scrollTo(0,0);\">" . $text . '</a>';
|
||||||
}
|
}
|
||||||
@@ -298,8 +316,9 @@
|
|||||||
*/
|
*/
|
||||||
function sc_joined($parm = null)
|
function sc_joined($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$gen = e107::getDate();
|
$gen = e107::getDate();
|
||||||
if($this->postInfo['post_user'])
|
if(!empty($this->postInfo['post_user']))
|
||||||
{
|
{
|
||||||
|
|
||||||
if(empty($parm['dateformat']))
|
if(empty($parm['dateformat']))
|
||||||
@@ -316,9 +335,16 @@
|
|||||||
|
|
||||||
function sc_threaddatestamp($parm = '')
|
function sc_threaddatestamp($parm = '')
|
||||||
{
|
{
|
||||||
$gen = e107::getDateConvert(); // XXX _URL_ check if all required info is there
|
|
||||||
|
|
||||||
if($parm == 'relative')
|
|
||||||
|
if(empty($this->postInfo['post_datestamp']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$gen = e107::getDate();
|
||||||
|
|
||||||
|
if($parm === 'relative')
|
||||||
{
|
{
|
||||||
return $gen->computeLapse($this->postInfo['post_datestamp'], time(), false, true, 'short');
|
return $gen->computeLapse($this->postInfo['post_datestamp'], time(), false, true, 'short');
|
||||||
}
|
}
|
||||||
@@ -330,20 +356,28 @@
|
|||||||
|
|
||||||
function sc_postid()
|
function sc_postid()
|
||||||
{
|
{
|
||||||
return $this->postInfo['post_id'];
|
|
||||||
|
return !empty($this->postInfo['post_id']) ? $this->postInfo['post_id'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Preferred - as {POST} may conflict with other shortcodes */
|
/* Preferred - as {POST} may conflict with other shortcodes */
|
||||||
function sc_thread_text($parm = null)
|
function sc_thread_text($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_post($parm = null);
|
return $this->sc_post($parm = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @DEPRECATED - use {THREAD_TEXT}
|
* @deprecated - use {THREAD_TEXT}
|
||||||
*/
|
*/
|
||||||
function sc_post($parm)
|
function sc_post($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(empty($this->postInfo['post_entry']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// return print_a($this->postInfo['post_entry'],true);
|
// return print_a($this->postInfo['post_entry'],true);
|
||||||
$emote = (isset($this->postInfo['post_options']['no_emote']) ? ',emotes_off' : '');
|
$emote = (isset($this->postInfo['post_options']['no_emote']) ? ',emotes_off' : '');
|
||||||
|
|
||||||
@@ -354,7 +388,8 @@
|
|||||||
|
|
||||||
function sc_postdeleted()
|
function sc_postdeleted()
|
||||||
{
|
{
|
||||||
if($this->postInfo['post_status'])
|
|
||||||
|
if(!empty($this->postInfo['post_status']))
|
||||||
{
|
{
|
||||||
$info = unserialize($this->postInfo['post_options']);
|
$info = unserialize($this->postInfo['post_options']);
|
||||||
|
|
||||||
@@ -369,9 +404,10 @@
|
|||||||
|
|
||||||
function sc_attachments($parm = array())
|
function sc_attachments($parm = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
if($this->postInfo['post_attachments'])
|
if(!empty($this->postInfo['post_attachments']))
|
||||||
{
|
{
|
||||||
$baseDir = $this->forum->getAttachmentPath($this->postInfo['post_user']);
|
$baseDir = $this->forum->getAttachmentPath($this->postInfo['post_user']);
|
||||||
|
|
||||||
@@ -469,21 +505,24 @@
|
|||||||
|
|
||||||
function sc_privmessage()
|
function sc_privmessage()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(e107::isInstalled('pm') && ($this->postInfo['post_user'] > 0))
|
if(e107::isInstalled('pm') && ($this->postInfo['post_user'] > 0))
|
||||||
{
|
{
|
||||||
return e107::getParser()->parseTemplate("{SENDPM={$this->postInfo['post_user']}}");
|
return e107::getParser()->parseTemplate("{SENDPM={$this->postInfo['post_user']}}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_avatar($opts)
|
function sc_avatar($opts = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return e107::getParser()->toAvatar($this->postInfo, $opts);
|
return e107::getParser()->toAvatar($this->postInfo, $opts);
|
||||||
// return $tp->parseTemplate("{USER_AVATAR=".$this->postInfo['user_image']."}", true);
|
// return $tp->parseTemplate("{USER_AVATAR=".$this->postInfo['user_image']."}", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_anon_ip()
|
function sc_anon_ip()
|
||||||
{
|
{
|
||||||
if($this->postInfo['post_user_anon'] && (ADMIN || MODERATOR))
|
|
||||||
|
if(!empty($this->postInfo['post_user_anon']) && (ADMIN || deftrue('MODERATOR')))
|
||||||
{
|
{
|
||||||
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
||||||
}
|
}
|
||||||
@@ -491,7 +530,8 @@
|
|||||||
|
|
||||||
function sc_ip()
|
function sc_ip()
|
||||||
{
|
{
|
||||||
if((ADMIN || MODERATOR) && !$this->postInfo['user_admin'])
|
|
||||||
|
if((ADMIN || deftrue('MODERATOR')) && empty($this->postInfo['user_admin']) && !empty($this->postInfo['post_ip']))
|
||||||
{
|
{
|
||||||
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
return e107::getIPHandler()->ipDecode($this->postInfo['post_ip']);
|
||||||
}
|
}
|
||||||
@@ -500,11 +540,12 @@
|
|||||||
|
|
||||||
function sc_poster()
|
function sc_poster()
|
||||||
{
|
{
|
||||||
if($this->postInfo['user_name'])
|
|
||||||
|
if(!empty($this->postInfo['user_name']))
|
||||||
{
|
{
|
||||||
return "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['user_name'], 'id' => $this->postInfo['post_user'])) . "'>{$this->postInfo['user_name']}</a>";
|
return "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $this->postInfo['user_name'], 'id' => $this->postInfo['post_user'])) . "'>{$this->postInfo['user_name']}</a>";
|
||||||
}
|
}
|
||||||
else
|
elseif(!empty($this->postInfo['post_user_anon']))
|
||||||
{
|
{
|
||||||
return '<b>' . e107::getParser()->toHTML($this->postInfo['post_user_anon']) . '</b>';
|
return '<b>' . e107::getParser()->toHTML($this->postInfo['post_user_anon']) . '</b>';
|
||||||
}
|
}
|
||||||
@@ -513,7 +554,8 @@
|
|||||||
|
|
||||||
function sc_emailimg()
|
function sc_emailimg()
|
||||||
{
|
{
|
||||||
if($this->postInfo['user_name'])
|
|
||||||
|
if(!empty($this->postInfo['user_name']))
|
||||||
{
|
{
|
||||||
return (!$this->postInfo['user_hideemail'] ? e107::getParser()->parseTemplate("{EMAILTO={$this->postInfo['user_email']}}") : '');
|
return (!$this->postInfo['user_hideemail'] ? e107::getParser()->parseTemplate("{EMAILTO={$this->postInfo['user_email']}}") : '');
|
||||||
}
|
}
|
||||||
@@ -524,7 +566,8 @@
|
|||||||
|
|
||||||
function sc_emailitem()
|
function sc_emailitem()
|
||||||
{
|
{
|
||||||
if($this->postInfo['thread_start'])
|
|
||||||
|
if(!empty($this->postInfo['thread_start']))
|
||||||
{
|
{
|
||||||
return e107::getParser()->parseTemplate("{EMAIL_ITEM=" . LAN_FORUM_2044 . "^plugin:forum.{$this->postInfo['post_thread']}}");
|
return e107::getParser()->parseTemplate("{EMAIL_ITEM=" . LAN_FORUM_2044 . "^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||||
}
|
}
|
||||||
@@ -532,7 +575,8 @@
|
|||||||
|
|
||||||
function sc_printitem()
|
function sc_printitem()
|
||||||
{
|
{
|
||||||
if($this->postInfo['thread_start'])
|
|
||||||
|
if(!empty($this->postInfo['thread_start']))
|
||||||
{
|
{
|
||||||
return e107::getParser()->parseTemplate("{PRINT_ITEM=" . LAN_FORUM_2045 . "^plugin:forum.{$this->postInfo['post_thread']}}");
|
return e107::getParser()->parseTemplate("{PRINT_ITEM=" . LAN_FORUM_2045 . "^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||||
}
|
}
|
||||||
@@ -540,14 +584,14 @@
|
|||||||
|
|
||||||
function sc_signature($parm = '')
|
function sc_signature($parm = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!USER)
|
if(!USER)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
global $forum;
|
|
||||||
$tp = e107::getParser();
|
|
||||||
static $forum_sig_shown;
|
static $forum_sig_shown;
|
||||||
if($forum->prefs->get('sig_once'))
|
if(!empty($this->pref['sig_once']))
|
||||||
{
|
{
|
||||||
$_tmp = 'forum_sig_shown_' . $this->postInfo['post_user'];
|
$_tmp = 'forum_sig_shown_' . $this->postInfo['post_user'];
|
||||||
if(e107::getRegistry($_tmp))
|
if(e107::getRegistry($_tmp))
|
||||||
@@ -557,18 +601,21 @@
|
|||||||
e107::setRegistry($_tmp, 1);
|
e107::setRegistry($_tmp, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
if($parm == 'clean')
|
if($parm == 'clean')
|
||||||
{
|
{
|
||||||
return ($this->postInfo['user_signature'] ? trim($tp->toHTML($this->postInfo['user_signature'], true)) : "");
|
return ($this->postInfo['user_signature'] ? trim($tp->toHTML($this->postInfo['user_signature'], true)) : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return ($this->postInfo['user_signature'] ? "<br /><hr style='width:15%; text-align:left' /><span class='smalltext'>" . trim($tp->toHTML($this->postInfo['user_signature'], true)) . '</span>' : '');
|
return (!empty($this->postInfo['user_signature']) ? "<br /><hr style='width:15%; text-align:left' /><span class='smalltext'>" . trim($tp->toHTML($this->postInfo['user_signature'], true)) . '</span>' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_profileimg()
|
function sc_profileimg()
|
||||||
{
|
{
|
||||||
if(USER && $this->postInfo['user_name'])
|
|
||||||
|
if(USER && !empty($this->postInfo['user_name']))
|
||||||
{
|
{
|
||||||
return e107::getParser()->parseTemplate("{PROFILE={$this->postInfo['post_user']}}");
|
return e107::getParser()->parseTemplate("{PROFILE={$this->postInfo['post_user']}}");
|
||||||
}
|
}
|
||||||
@@ -576,7 +623,8 @@
|
|||||||
|
|
||||||
function sc_posts()
|
function sc_posts()
|
||||||
{
|
{
|
||||||
if($this->postInfo['post_user'])
|
|
||||||
|
if(!empty($this->postInfo['post_user']))
|
||||||
{
|
{
|
||||||
return LAN_FORUM_2032 . ': ' . (int) $this->postInfo['user_plugin_forum_posts'] . '<br />';
|
return LAN_FORUM_2032 . ': ' . (int) $this->postInfo['user_plugin_forum_posts'] . '<br />';
|
||||||
}
|
}
|
||||||
@@ -584,15 +632,17 @@
|
|||||||
|
|
||||||
function sc_visits()
|
function sc_visits()
|
||||||
{
|
{
|
||||||
if($this->postInfo['user_name'])
|
|
||||||
|
if(!empty($this->postInfo['user_name']))
|
||||||
{
|
{
|
||||||
return LAN_FORUM_2033 . ': ' . $this->postInfo['user_visits'] . '<br />';
|
return LAN_FORUM_2033 . ': ' . varset($this->postInfo['user_visits']) . '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_customtitle()
|
function sc_customtitle()
|
||||||
{
|
{
|
||||||
if($this->postInfo['user_customtitle'])
|
|
||||||
|
if(!empty($this->postInfo['user_customtitle']))
|
||||||
{
|
{
|
||||||
return e107::getParser()->toHTML($this->postInfo['user_customtitle']) . '<br />';
|
return e107::getParser()->toHTML($this->postInfo['user_customtitle']) . '<br />';
|
||||||
}
|
}
|
||||||
@@ -600,6 +650,7 @@
|
|||||||
|
|
||||||
function sc_website()
|
function sc_website()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!empty($this->postInfo['user_homepage']))
|
if(!empty($this->postInfo['user_homepage']))
|
||||||
{
|
{
|
||||||
return LAN_FORUM_2034 . ': ' . $this->postInfo['user_homepage'] . '<br />';
|
return LAN_FORUM_2034 . ': ' . $this->postInfo['user_homepage'] . '<br />';
|
||||||
@@ -608,15 +659,17 @@
|
|||||||
|
|
||||||
function sc_websiteimg()
|
function sc_websiteimg()
|
||||||
{
|
{
|
||||||
if($this->postInfo['user_homepage'] && $this->postInfo['user_homepage'] != 'http://')
|
|
||||||
|
if(!empty($this->postInfo['user_homepage']) && $this->postInfo['user_homepage'] !== 'http://')
|
||||||
{
|
{
|
||||||
return "<a href='{$this->postInfo['user_homepage']}'>" . IMAGE_website . '</a>';
|
return "<a href='{$this->postInfo['user_homepage']}'>" . defset('IMAGE_website') . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_editimg()
|
function sc_editimg()
|
||||||
{
|
{
|
||||||
if(USER && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active'])
|
|
||||||
|
if(USER && !empty($this->postInfo['post_user']) && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active'])
|
||||||
{
|
{
|
||||||
$qry = array('f' => 'edit', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
$qry = array('f' => 'edit', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
||||||
$editURL = e107::url('forum', 'post', null, array('query' => $qry));
|
$editURL = e107::url('forum', 'post', null, array('query' => $qry));
|
||||||
@@ -627,7 +680,8 @@
|
|||||||
|
|
||||||
function sc_quoteimg()
|
function sc_quoteimg()
|
||||||
{
|
{
|
||||||
if($this->forum->checkperm($this->postInfo['post_forum'], 'post'))
|
|
||||||
|
if(isset($this->postInfo['post_forum']) && $this->forum->checkperm($this->postInfo['post_forum'], 'post'))
|
||||||
{
|
{
|
||||||
$qry = array('f' => 'quote', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
$qry = array('f' => 'quote', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
||||||
$quoteURL = e107::url('forum', 'post', null, array('query' => $qry));
|
$quoteURL = e107::url('forum', 'post', null, array('query' => $qry));
|
||||||
@@ -638,7 +692,8 @@
|
|||||||
|
|
||||||
function sc_reportimg()
|
function sc_reportimg()
|
||||||
{
|
{
|
||||||
if(USER)
|
|
||||||
|
if(USER && !empty($this->postInfo['post_thread']))
|
||||||
{
|
{
|
||||||
$qry = array('f' => 'report', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
$qry = array('f' => 'report', 'id' => $this->postInfo['post_thread'], 'post' => $this->postInfo['post_id']);
|
||||||
$reportURL = e107::url('forum', 'post', null, array('query' => $qry));
|
$reportURL = e107::url('forum', 'post', null, array('query' => $qry));
|
||||||
@@ -649,12 +704,19 @@
|
|||||||
|
|
||||||
function sc_rpg()
|
function sc_rpg()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(!function_exists('rpg'))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return rpg($this->postInfo['user_join'], $this->postInfo['user_plugin_forum_posts']);
|
return rpg($this->postInfo['user_join'], $this->postInfo['user_plugin_forum_posts']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_memberid()
|
function sc_memberid()
|
||||||
{
|
{
|
||||||
if(!$this->postInfo['post_user'])
|
|
||||||
|
if(empty($this->postInfo['post_user']))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -662,7 +724,7 @@
|
|||||||
return "<span class='smalltext'>" . LAN_FORUM_2035 . ' #' . $this->postInfo['post_user'] . '</span>';
|
return "<span class='smalltext'>" . LAN_FORUM_2035 . ' #' . $this->postInfo['post_user'] . '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_level($parm)
|
function sc_level($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(isset($this->pref['ranks']) && empty($this->pref['ranks']))
|
if(isset($this->pref['ranks']) && empty($this->pref['ranks']))
|
||||||
@@ -671,7 +733,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!$this->postInfo['post_user'])
|
if(empty($this->postInfo['post_user']))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -735,7 +797,8 @@
|
|||||||
|
|
||||||
function sc_modoptions()
|
function sc_modoptions()
|
||||||
{
|
{
|
||||||
if(MODERATOR)
|
|
||||||
|
if(deftrue('MODERATOR'))
|
||||||
{
|
{
|
||||||
return showmodoptions();
|
return showmodoptions();
|
||||||
}
|
}
|
||||||
@@ -743,15 +806,16 @@
|
|||||||
|
|
||||||
function sc_lastedit()
|
function sc_lastedit()
|
||||||
{
|
{
|
||||||
$gen = e107::getDate();
|
|
||||||
if($this->postInfo['post_edit_datestamp'])
|
if(!empty($this->postInfo['post_edit_datestamp']))
|
||||||
{
|
{
|
||||||
return $gen->convert_date($this->postInfo['post_edit_datestamp'], 'forum');
|
return e107::getDate()->convert_date($this->postInfo['post_edit_datestamp'], 'forum');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_lasteditby($parm = '')
|
function sc_lasteditby($parm = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if(isset($this->postInfo['edit_name']))
|
if(isset($this->postInfo['edit_name']))
|
||||||
{
|
{
|
||||||
if($parm == 'link')
|
if($parm == 'link')
|
||||||
@@ -767,7 +831,8 @@
|
|||||||
|
|
||||||
function sc_poll()
|
function sc_poll()
|
||||||
{
|
{
|
||||||
if($this->postInfo['thread_start'] == 1)
|
|
||||||
|
if(isset($this->postInfo['thread_start']) && ($this->postInfo['thread_start'] == 1))
|
||||||
{
|
{
|
||||||
global $pollstr;
|
global $pollstr;
|
||||||
|
|
||||||
@@ -777,6 +842,7 @@
|
|||||||
|
|
||||||
function sc_newflag()
|
function sc_newflag()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Defined in case an indicator is required
|
// Defined in case an indicator is required
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -841,39 +907,44 @@
|
|||||||
|
|
||||||
function sc_postoptions()
|
function sc_postoptions()
|
||||||
{
|
{
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
$threadID = !empty($this->postInfo['post_thread']) ? $this->postInfo['post_thread'] : 0;
|
||||||
|
$postID = !empty($this->postInfo['post_id']) ? $this->postInfo['post_id'] : 0;
|
||||||
// {EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
|
// {EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
|
||||||
|
|
||||||
$text = '<div class="btn-group pull-right float-right">
|
$text = '<div class="btn-group pull-right float-right">
|
||||||
<button class="btn btn-default btn-secondary btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
|
<button class="btn btn-default btn-secondary btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
|
||||||
' . LAN_FORUM_8013 . '
|
' . LAN_FORUM_8013 . '
|
||||||
';
|
';
|
||||||
|
|
||||||
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
|
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
|
||||||
{
|
{
|
||||||
$text .= '<span class="caret"></span>';
|
$text .= '<span class="caret"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= '
|
$text .= '
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu pull-right float-right text-right">';
|
<ul class="dropdown-menu pull-right float-right text-right">';
|
||||||
|
|
||||||
|
|
||||||
$text .= "<li class='text-right float-right float-right'><a href='" . e_HTTP . "email.php?plugin:forum." . $this->postInfo['post_thread'] . "'>" . LAN_FORUM_2044 . " " . $tp->toGlyph('fa-envelope') . "</a></li>";
|
$text .= "<li class='text-right float-right float-right'><a href='" . e_HTTP . "email.php?plugin:forum." . $threadID . "'>" . LAN_FORUM_2044 . " " . $tp->toGlyph('fa-envelope') . "</a></li>";
|
||||||
$text .= "<li class='text-right float-right'><a href='" . e_HTTP . "print.php?plugin:forum." . $this->postInfo['post_thread'] . "'>" . LAN_FORUM_2045 . " " . $tp->toGlyph('fa-print') . "</a></li>"; // FIXME
|
$text .= "<li class='text-right float-right'><a href='" . e_HTTP . "print.php?plugin:forum." . $threadID . "'>" . LAN_FORUM_2045 . " " . $tp->toGlyph('fa-print') . "</a></li>"; // FIXME
|
||||||
|
|
||||||
if(USER) // Report
|
if(USER) // Report
|
||||||
{
|
{
|
||||||
$urlReport = e107::url('forum', 'post') . "?f=report&id=" . $this->postInfo['post_thread'] . "&post=" . $this->postInfo['post_id'];
|
$urlReport = e107::url('forum', 'post') . "?f=report&id=" . $threadID . "&post=" . $postID;
|
||||||
// $urlReport = $this->e107->url->create('forum/thread/report', "id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}");
|
// $urlReport = $this->e107->url->create('forum/thread/report', "id={$threadID}&post={$postID}");
|
||||||
$text .= "<li class='text-right float-right'><a href='" . $urlReport . "'>" . LAN_FORUM_2046 . " " . $tp->toGlyph('fa-flag') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . $urlReport . "'>" . LAN_FORUM_2046 . " " . $tp->toGlyph('fa-flag') . "</a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if((USER && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active']))
|
if((USER && isset($this->postInfo['post_user']) && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active']))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$url = e107::url('forum', 'post') . "?f=edit&id=" . $this->postInfo['post_thread'] . "&post=" . $this->postInfo['post_id'];
|
$url = e107::url('forum', 'post') . "?f=edit&id=" . $threadID . "&post=" . $postID;
|
||||||
//$url = e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
|
//$url = e107::getUrl()->create('forum/thread/edit', array('id' => $threadID, 'post'=>$postID));
|
||||||
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -885,51 +956,51 @@
|
|||||||
* AND if this post is the last post in the thread */
|
* AND if this post is the last post in the thread */
|
||||||
if($this->thread->threadInfo['thread_active'] && empty($this->postInfo['thread_start']))
|
if($this->thread->threadInfo['thread_active'] && empty($this->postInfo['thread_start']))
|
||||||
{
|
{
|
||||||
$text .= "<li class='text-right float-right'><a href='" . e_REQUEST_URI . "' data-forum-action='deletepost' data-confirm='".LAN_JSCONFIRM."' data-forum-post='" . $this->postInfo['post_id'] . "'>" . LAN_DELETE . " " . $tp->toGlyph('fa-trash') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . e_REQUEST_URI . "' data-forum-action='deletepost' data-confirm='" . LAN_JSCONFIRM . "' data-forum-post='" . $postID . "'>" . LAN_DELETE . " " . $tp->toGlyph('fa-trash') . "</a></li>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->forum->checkperm($this->postInfo['post_forum'], 'post'))
|
if(isset($this->postInfo['post_forum']) && $this->forum->checkperm($this->postInfo['post_forum'], 'post'))
|
||||||
{
|
{
|
||||||
$url = e107::url('forum', 'post') . "?f=quote&id=" . $this->postInfo['post_thread'] . "&post=" . $this->postInfo['post_id'];
|
$url = e107::url('forum', 'post') . "?f=quote&id=" . $threadID . "&post=" . $postID;
|
||||||
//$url = e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
|
//$url = e107::getUrl()->create('forum/thread/quote', array('id' => $threadID, 'post'=>$postID));
|
||||||
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_FORUM_2041 . " " . $tp->toGlyph('fa-share-alt') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_FORUM_2041 . " " . $tp->toGlyph('fa-share-alt') . "</a></li>";
|
||||||
|
|
||||||
// $text .= "<li class='text-right float-right'><a href='".e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2041." ".$tp->toGlyph('share-alt')."</a></li>";
|
// $text .= "<li class='text-right float-right'><a href='".e107::getUrl()->create('forum/thread/quote', array('id' => $postID))."'>".LAN_FORUM_2041." ".$tp->toGlyph('share-alt')."</a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(MODERATOR)
|
if(defset('MODERATOR'))
|
||||||
{
|
{
|
||||||
$text .= "<li role='presentation' class='divider'> </li>";
|
$text .= "<li role='presentation' class='divider'> </li>";
|
||||||
$type = ($this->postInfo['thread_start']) ? 'thread' : 'Post';
|
$type = ($this->postInfo['thread_start']) ? 'thread' : 'Post';
|
||||||
|
|
||||||
// print_a($this->postInfo);
|
// print_a($this->postInfo);
|
||||||
|
|
||||||
if((USER && $this->postInfo['post_user'] != USERID && $this->thread->threadInfo['thread_active']))
|
if((USER && isset($this->postInfo['post_user']) && $this->postInfo['post_user'] != USERID && $this->thread->threadInfo['thread_active']))
|
||||||
{
|
{
|
||||||
|
|
||||||
$url = e107::url('forum', 'post') . "?f=edit&id=" . $this->postInfo['post_thread'] . "&post=" . $this->postInfo['post_id'];
|
$url = e107::url('forum', 'post') . "?f=edit&id=" . $threadID . "&post=" . $postID;
|
||||||
// $url = e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
|
// $url = e107::getUrl()->create('forum/thread/edit', array('id' => $threadID, 'post'=>$postID));
|
||||||
|
|
||||||
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('fa-edit') . "</a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// only show delete button when post is not the initial post of the topic
|
// only show delete button when post is not the initial post of the topic
|
||||||
// if(!$this->forum->threadDetermineInitialPost($this->postInfo['post_id']))
|
// if(!$this->forum->threadDetermineInitialPost($postID))
|
||||||
if(empty($this->postInfo['thread_start']))
|
if(empty($this->postInfo['thread_start']))
|
||||||
{
|
{
|
||||||
$text .= "<li class='text-right float-right'><a href='" . e_REQUEST_URI . "' data-forum-action='deletepost' data-confirm='".LAN_JSCONFIRM."' data-forum-post='" . $this->postInfo['post_id'] . "'>" . LAN_DELETE . " " . $tp->toGlyph('fa-trash') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . e_REQUEST_URI . "' data-forum-action='deletepost' data-confirm='" . LAN_JSCONFIRM . "' data-forum-post='" . $postID . "'>" . LAN_DELETE . " " . $tp->toGlyph('fa-trash') . "</a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type == 'thread')
|
if($type == 'thread')
|
||||||
{
|
{
|
||||||
$url = e107::url('forum', 'move', array('thread_id' => $this->postInfo['post_thread']));
|
$url = e107::url('forum', 'move', array('thread_id' => $threadID));
|
||||||
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_FORUM_2042 . " " . $tp->toGlyph('fa-arrows') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . $url . "'>" . LAN_FORUM_2042 . " " . $tp->toGlyph('fa-arrows') . "</a></li>";
|
||||||
}
|
}
|
||||||
elseif(e_DEVELOPER === true) //TODO
|
elseif(e_DEVELOPER === true) //TODO
|
||||||
{
|
{
|
||||||
$text .= "<li class='text-right float-right'><a href='" . e107::url('forum', 'split', array('thread_id' => $this->postInfo['post_thread'], 'post_id' => $this->postInfo['post_id'])) . "'>" . LAN_FORUM_2043 . " " . $tp->toGlyph('fa-cut') . "</a></li>";
|
$text .= "<li class='text-right float-right'><a href='" . e107::url('forum', 'split', array('thread_id' => $threadID, 'post_id' => $postID)) . "'>" . LAN_FORUM_2043 . " " . $tp->toGlyph('fa-cut') . "</a></li>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -947,14 +1018,22 @@
|
|||||||
//---- SHORTCODES CONVERTED FROM $tVars....
|
//---- SHORTCODES CONVERTED FROM $tVars....
|
||||||
function sc_threadname($parm = null)
|
function sc_threadname($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return e107::getParser()->toHTML($this->var['thread_name'], true, 'no_hook, emotes_off');
|
return e107::getParser()->toHTML($this->var['thread_name'], true, 'no_hook, emotes_off');
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_nextprev()
|
function sc_nextprev()
|
||||||
{
|
{
|
||||||
global $forum, $thread;
|
|
||||||
$prev = $forum->threadGetNextPrev('prev', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
global $thread;
|
||||||
$next = $forum->threadGetNextPrev('next', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
|
||||||
|
if(!is_object($thread))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$prev = $this->forum->threadGetNextPrev('prev', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
||||||
|
$next = $this->forum->threadGetNextPrev('next', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
@@ -974,8 +1053,9 @@
|
|||||||
|
|
||||||
function sc_track()
|
function sc_track()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $forum;
|
global $forum;
|
||||||
if($forum->prefs->get('track') && USER)
|
if(!empty($this->pref['track']) && USER)
|
||||||
{
|
{
|
||||||
// BC Fix for old template.
|
// BC Fix for old template.
|
||||||
if(!defined('IMAGE_track'))
|
if(!defined('IMAGE_track'))
|
||||||
@@ -989,7 +1069,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$img = ($this->var['track_userid'] ? IMAGE_track : IMAGE_untrack);
|
$img = (!empty($this->var['track_userid']) ? defset('IMAGE_track') : defset('IMAGE_untrack'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1018,7 +1098,7 @@
|
|||||||
";*/
|
";*/
|
||||||
|
|
||||||
|
|
||||||
$trackDiz = ($forum->prefs->get('trackemail', true)) ? LAN_FORUM_3040 : LAN_FORUM_3041;
|
$trackDiz = (varset($this->pref['track'], true)) ? LAN_FORUM_3040 : LAN_FORUM_3041;
|
||||||
|
|
||||||
// $tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".$trackDiz."\" data-token='".deftrue('e_TOKEN','')."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>";
|
// $tVars->TRACK = "<a id='forum-track-button' href='#' title=\"".$trackDiz."\" data-token='".deftrue('e_TOKEN','')."' data-forum-insert='forum-track-button' data-forum-post='".$thread->threadInfo['thread_forum_id']."' data-forum-thread='".$thread->threadInfo['thread_id']."' data-forum-action='track' name='track' class='e-tip btn btn-default' >".$img."</a>";
|
||||||
return "<a id='forum-track-button' href='#' title=\"" . $trackDiz . "\" data-token='" . deftrue('e_TOKEN', '') . "' data-forum-insert='forum-track-button' data-forum-post='" . $this->var['thread_forum_id'] . "' data-forum-thread='" . $this->var['thread_id'] . "' data-forum-action='track' name='track' class='e-tip btn btn-default' >" . $img . "</a>";
|
return "<a id='forum-track-button' href='#' title=\"" . $trackDiz . "\" data-token='" . deftrue('e_TOKEN', '') . "' data-forum-insert='forum-track-button' data-forum-post='" . $this->var['thread_forum_id'] . "' data-forum-thread='" . $this->var['thread_id'] . "' data-forum-action='track' name='track' class='e-tip btn btn-default' >" . $img . "</a>";
|
||||||
@@ -1030,6 +1110,7 @@
|
|||||||
|
|
||||||
function sc_moderators()
|
function sc_moderators()
|
||||||
{
|
{
|
||||||
|
|
||||||
$modUser = array();
|
$modUser = array();
|
||||||
foreach($this->forum->modArray as $user)
|
foreach($this->forum->modArray as $user)
|
||||||
{
|
{
|
||||||
@@ -1043,13 +1124,24 @@
|
|||||||
|
|
||||||
function sc_threadstatus()
|
function sc_threadstatus()
|
||||||
{
|
{
|
||||||
|
|
||||||
return (!$this->var['thread_active'] ? LAN_FORUM_2004 : '');
|
return (!$this->var['thread_active'] ? LAN_FORUM_2004 : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_gotopages()
|
function sc_gotopages()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $thread;
|
global $thread;
|
||||||
|
|
||||||
|
if(!is_object($thread))
|
||||||
|
{
|
||||||
|
e107::getDebug()->log('$thread was empty');
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($thread->pages > 1)
|
if($thread->pages > 1)
|
||||||
{
|
{
|
||||||
if(!$thread->page)
|
if(!$thread->page)
|
||||||
@@ -1070,9 +1162,10 @@
|
|||||||
|
|
||||||
function sc_buttons()
|
function sc_buttons()
|
||||||
{
|
{
|
||||||
global $forum, $thread;
|
|
||||||
|
global $thread;
|
||||||
//----$tVars->BUTTONS = '';
|
//----$tVars->BUTTONS = '';
|
||||||
if($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
if($this->forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
||||||
{
|
{
|
||||||
// print_a($thread->threadInfo);
|
// print_a($thread->threadInfo);
|
||||||
$url = e107::url('forum', 'post') . "?f=rp&id=" . $this->var['thread_id'] . "&post=" . $thread->threadId;
|
$url = e107::url('forum', 'post') . "?f=rp&id=" . $this->var['thread_id'] . "&post=" . $thread->threadId;
|
||||||
@@ -1080,7 +1173,7 @@
|
|||||||
// $url = $e107->url->create('forum/thread/reply', array('id' => $thread->threadId));
|
// $url = $e107->url->create('forum/thread/reply', array('id' => $thread->threadId));
|
||||||
return "<a href='" . $url . "'>" . IMAGE_reply . "</a>";
|
return "<a href='" . $url . "'>" . IMAGE_reply . "</a>";
|
||||||
}
|
}
|
||||||
if($forum->checkPerm($this->var['thread_forum_id'], 'thread'))
|
if($this->forum->checkPerm($this->var['thread_forum_id'], 'thread'))
|
||||||
{
|
{
|
||||||
$ntUrl = e107::url('forum', 'post') . "?f=nt&id=" . $this->var['thread_forum_id'];
|
$ntUrl = e107::url('forum', 'post') . "?f=nt&id=" . $this->var['thread_forum_id'];
|
||||||
|
|
||||||
@@ -1095,18 +1188,27 @@
|
|||||||
|
|
||||||
function sc_buttonsx()
|
function sc_buttonsx()
|
||||||
{
|
{
|
||||||
global $forum, $thread;
|
|
||||||
|
|
||||||
if($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
global $thread;
|
||||||
|
|
||||||
|
if(!is_object($thread))
|
||||||
|
{
|
||||||
|
e107::getDebug()->log('$thread object is missing');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = '';
|
||||||
|
|
||||||
|
if($this->forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
||||||
{
|
{
|
||||||
$url = e107::url('forum', 'post') . "?f=rp&id=" . $this->var['thread_id'] . "&post=" . $thread->threadId;
|
$url = e107::url('forum', 'post') . "?f=rp&id=" . $this->var['thread_id'] . "&post=" . $thread->threadId;
|
||||||
// $url = e107::getUrl()->create('forum/thread/reply', array('id' => $thread->threadId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$replyUrl = "<a class='btn btn-primary" . ($url ? "" : " disabled") . "' "
|
$replyUrl = "<a class='btn btn-primary" . ($url ? "" : " disabled") . "' "
|
||||||
. ($url ? "" : " data-toggle='tooltip' title='" . LAN_FORUM_0046 . "'
|
. ($url ? "" : " data-toggle='tooltip' title='" . LAN_FORUM_0046 . "'
|
||||||
style='cursor: not-allowed; pointer-events: all !important;'") . " href='" . ($url ?: "#") . "'>" . LAN_FORUM_2006 . "</a>" . ($url ? "" : "<span> </span>");
|
style='cursor: not-allowed; pointer-events: all !important;'") . " href='" . ($url ?: "#") . "'>" . LAN_FORUM_2006 . "</a>" . ($url ? "" : "<span> </span>");
|
||||||
|
|
||||||
if($forum->checkPerm($this->var['thread_forum_id'], 'post'))
|
if($this->forum->checkPerm($this->var['thread_forum_id'], 'post'))
|
||||||
{
|
{
|
||||||
$ntUrl = e107::url('forum', 'post') . "?f=nt&id=" . $this->var['thread_forum_id'];
|
$ntUrl = e107::url('forum', 'post') . "?f=nt&id=" . $this->var['thread_forum_id'];
|
||||||
// $ntUrl = e107::getUrl()->create('forum/thread/new', array('id' => $thread->threadInfo['thread_forum_id']));
|
// $ntUrl = e107::getUrl()->create('forum/thread/new', array('id' => $thread->threadInfo['thread_forum_id']));
|
||||||
@@ -1117,8 +1219,8 @@
|
|||||||
// $options[] = "<a href='" . e107::getUrl()->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>".LAN_FORUM_1017." ".LAN_FORUM_2002."</a>";
|
// $options[] = "<a href='" . e107::getUrl()->create('forum/thread/prev', array('id' => $thread->threadId)) . "'>".LAN_FORUM_1017." ".LAN_FORUM_2002."</a>";
|
||||||
|
|
||||||
//---- SIMILAR CODE AS SC_NEXTPREV!!!!!!!
|
//---- SIMILAR CODE AS SC_NEXTPREV!!!!!!!
|
||||||
$prev = $forum->threadGetNextPrev('prev', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
$prev = $this->forum->threadGetNextPrev('prev', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
||||||
$next = $forum->threadGetNextPrev('next', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
$next = $this->forum->threadGetNextPrev('next', $thread->threadId, $this->var['forum_id'], $this->var['thread_lastpost']);
|
||||||
|
|
||||||
if($prev !== false)
|
if($prev !== false)
|
||||||
{
|
{
|
||||||
@@ -1130,24 +1232,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
$text = '<div class="btn-group">
|
|
||||||
'.($replyUrl?:"").'
|
|
||||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
|
||||||
'.($replyUrl?"":LAN_FORUM_1003." ".LAN_FORUM_8013).'<span class="caret"></span>
|
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu pull-right">
|
|
||||||
';
|
|
||||||
*/
|
|
||||||
$text = '<div class="btn-group">
|
$text = '<div class="btn-group">
|
||||||
' . $replyUrl . '
|
' . $replyUrl . '
|
||||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
';
|
';
|
||||||
|
|
||||||
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
|
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
|
||||||
{
|
{
|
||||||
$text .= '<span class="caret"></span>';
|
$text .= '<span class="caret"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= '
|
$text .= '
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -1159,7 +1253,7 @@
|
|||||||
$text .= '<li>' . $val . '</li>';
|
$text .= '<li>' . $val . '</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$jumpList = $forum->forumGetAllowed();
|
$jumpList = $this->forum->forumGetAllowed();
|
||||||
|
|
||||||
$text .= "<li class='divider'></li>";
|
$text .= "<li class='divider'></li>";
|
||||||
|
|
||||||
@@ -1185,8 +1279,7 @@
|
|||||||
----*/
|
----*/
|
||||||
function sc_forumjump()
|
function sc_forumjump()
|
||||||
{
|
{
|
||||||
global $forum;
|
$jumpList = $this->forum->forumGetAllowed();
|
||||||
$jumpList = $forum->forumGetAllowed();
|
|
||||||
$text = "<form method='post' action='" . e_SELF . "'><p>" . LAN_FORUM_1017 . ": <select name='forumjump' class='tbox'>";
|
$text = "<form method='post' action='" . e_SELF . "'><p>" . LAN_FORUM_1017 . ": <select name='forumjump' class='tbox'>";
|
||||||
//-- foreach ($jumpList as $key => $val)
|
//-- foreach ($jumpList as $key => $val)
|
||||||
foreach($jumpList as $val)
|
foreach($jumpList as $val)
|
||||||
@@ -1200,13 +1293,20 @@
|
|||||||
|
|
||||||
function sc_message()
|
function sc_message()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $thread;
|
global $thread;
|
||||||
|
|
||||||
|
if(!is_object($thread))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $thread->message;
|
return $thread->message;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_quickreply()
|
function sc_quickreply()
|
||||||
{
|
{
|
||||||
|
|
||||||
global $forum, $forum_quickreply, $thread;
|
global $forum, $forum_quickreply, $thread;
|
||||||
|
|
||||||
// Define which tinymce4 template should be used, depending if the current user is registered or a guest
|
// Define which tinymce4 template should be used, depending if the current user is registered or a guest
|
||||||
@@ -1215,7 +1315,7 @@
|
|||||||
define('e_TINYMCE_TEMPLATE', (USER ? 'member' : 'public')); // allow images / videos.
|
define('e_TINYMCE_TEMPLATE', (USER ? 'member' : 'public')); // allow images / videos.
|
||||||
}
|
}
|
||||||
|
|
||||||
if($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
if($this->forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
|
||||||
{
|
{
|
||||||
//XXX Show only on the last page??
|
//XXX Show only on the last page??
|
||||||
if(!vartrue($forum_quickreply))
|
if(!vartrue($forum_quickreply))
|
||||||
@@ -1246,7 +1346,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$editor = $this->forum->prefs->get('editor');
|
$editor = varset($this->pref['editor'], null);
|
||||||
$editor = is_null($editor) ? 'default' : $editor;
|
$editor = is_null($editor) ? 'default' : $editor;
|
||||||
$text = "
|
$text = "
|
||||||
<form action='" . $url . "' method='post'>
|
<form action='" . $url . "' method='post'>
|
||||||
|
@@ -312,7 +312,7 @@ class gallery_shortcodes extends e_shortcode
|
|||||||
* limit - (optional) total limit of pcitures to be shown
|
* limit - (optional) total limit of pcitures to be shown
|
||||||
* template - (optional) template - name of template to be used for parsing the slideshow item
|
* template - (optional) template - name of template to be used for parsing the slideshow item
|
||||||
*/
|
*/
|
||||||
function sc_gallery_slides($parm)
|
function sc_gallery_slides($parm=null)
|
||||||
{
|
{
|
||||||
$plugPrefs = e107::getPlugConfig('gallery')->getPref();
|
$plugPrefs = e107::getPlugConfig('gallery')->getPref();
|
||||||
$orderBy = varset($plugPrefs['orderby'], 'media_id DESC');
|
$orderBy = varset($plugPrefs['orderby'], 'media_id DESC');
|
||||||
@@ -359,7 +359,7 @@ class gallery_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_gallery_jumper($parm)
|
function sc_gallery_jumper($parm=null)
|
||||||
{
|
{
|
||||||
// echo "SlideCount=".$this->slideCount;
|
// echo "SlideCount=".$this->slideCount;
|
||||||
if($this->slideCount == 1 && deftrue('E107_DBG_BASIC'))
|
if($this->slideCount == 1 && deftrue('E107_DBG_BASIC'))
|
||||||
|
@@ -7,7 +7,7 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
|
|
||||||
class plugin_hero_hero_shortcodes extends e_shortcode
|
class plugin_hero_hero_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
public $count;
|
public $count =0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {hero_ID}
|
* {hero_ID}
|
||||||
@@ -52,7 +52,7 @@ class plugin_hero_hero_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$target = !empty($parm['target']) ? $parm['target'] : 'carousel-hero';
|
$target = !empty($parm['target']) ? $parm['target'] : 'carousel-hero';
|
||||||
$class = !empty($parm['class']) ? $parm['class'] : '';
|
$class = !empty($parm['class']) ? $parm['class'] : '';
|
||||||
$total = (int) $this->var['hero_total_slides'];
|
$total = (int) vartrue($this->var['hero_total_slides'], 0);
|
||||||
|
|
||||||
if(empty($total))
|
if(empty($total))
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,7 @@ class plugin_hero_hero_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
public function sc_hero_slide_active($parm=null)
|
public function sc_hero_slide_active($parm=null)
|
||||||
{
|
{
|
||||||
return $this->var['hero_slide_active'];
|
return varset($this->var['hero_slide_active']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sc_hero_slide_interval($parm=null)
|
public function sc_hero_slide_interval($parm=null)
|
||||||
@@ -135,7 +135,8 @@ class plugin_hero_hero_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
public function sc_hero_text()
|
public function sc_hero_text()
|
||||||
{
|
{
|
||||||
return e107::getParser()->toHTML($this->var['hero_bullets'][$this->count]['text'],true,'BODY');
|
$count = (int) $this->count;
|
||||||
|
return e107::getParser()->toHTML($this->var['hero_bullets'][$count]['text'],true,'BODY');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -209,12 +210,12 @@ class plugin_hero_hero_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {HERO_BULLETS}
|
* {HERO_BULLETS}
|
||||||
*/
|
*//*
|
||||||
public function sc_hero_bullets($parm=null)
|
public function sc_hero_bullets($parm=null)
|
||||||
{
|
{
|
||||||
return $this->var['hero_bullets'];
|
return $this->var['hero_bullets'];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {hero_BUTTON1_xxxx}
|
* {hero_BUTTON1_xxxx}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
if (!defined('e107_INIT')) { exit(); }
|
if (!defined('e107_INIT')) { exit(); }
|
||||||
global $tp;
|
global $tp;
|
||||||
|
|
||||||
|
e107::plugLan('login_menu', null);
|
||||||
|
|
||||||
// BC LAN Fix.
|
// BC LAN Fix.
|
||||||
|
|
||||||
@@ -190,7 +191,7 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
if($parm == "hidden"){
|
if($parm == "hidden"){
|
||||||
return "<input type='hidden' name='autologin' id='autologin' value='1' />";
|
return "<input type='hidden' name='autologin' id='autologin' value='1' />";
|
||||||
}
|
}
|
||||||
if($pref['user_tracking'] != "session")
|
if(varset($pref['user_tracking']) !== "session")
|
||||||
{
|
{
|
||||||
return "<label for='autologin'><input type='checkbox' name='autologin' id='autologin' value='1' checked='checked' />".($parm ? $parm : "".LAN_LOGINMENU_6."</label>");
|
return "<label for='autologin'><input type='checkbox' name='autologin' id='autologin' value='1' checked='checked' />".($parm ? $parm : "".LAN_LOGINMENU_6."</label>");
|
||||||
}
|
}
|
||||||
@@ -252,9 +253,11 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
{
|
{
|
||||||
if(ADMIN)
|
if(ADMIN)
|
||||||
{
|
{
|
||||||
$data = e107::getRegistry('login_menu_data');
|
if($data = e107::getRegistry('login_menu_data'))
|
||||||
|
{
|
||||||
return $parm == 'src' ? $data['link_bullet_src'] : $data['link_bullet'];
|
return $parm == 'src' ? $data['link_bullet_src'] : $data['link_bullet'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +279,11 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
|
|
||||||
function sc_lm_bullet($parm='')
|
function sc_lm_bullet($parm='')
|
||||||
{
|
{
|
||||||
$data = e107::getRegistry('login_menu_data');
|
if(!$data = e107::getRegistry('login_menu_data'))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $parm == 'src' ? $data['link_bullet_src'] : $data['link_bullet'];
|
return $parm == 'src' ? $data['link_bullet_src'] : $data['link_bullet'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,6 +330,7 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
global $menu_pref, $login_menu_shortcodes, $LOGIN_MENU_EXTERNAL_LINK;
|
global $menu_pref, $login_menu_shortcodes, $LOGIN_MENU_EXTERNAL_LINK;
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
require_once(e_PLUGIN."login_menu/login_menu_class.php");
|
||||||
$lmc = new login_menu_class;
|
$lmc = new login_menu_class;
|
||||||
|
|
||||||
if(!vartrue($menu_pref['login_menu']['external_links']))
|
if(!vartrue($menu_pref['login_menu']['external_links']))
|
||||||
@@ -361,6 +369,12 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
function sc_lm_external_link($parm='')
|
function sc_lm_external_link($parm='')
|
||||||
{
|
{
|
||||||
$lbox_item = e107::getRegistry('login_menu_linkdata');
|
$lbox_item = e107::getRegistry('login_menu_linkdata');
|
||||||
|
|
||||||
|
if(empty($lbox_item['link_url']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $parm == 'href' ? $lbox_item['link_url'] : '<a href="'.$lbox_item['link_url'].'" class="login_menu_link external" id="login_menu_link_external_'.$lbox_item['link_id'].'">'.vartrue($lbox_item['link_label'], '['.LAN_LOGINMENU_44.']').'</a>';
|
return $parm == 'href' ? $lbox_item['link_url'] : '<a href="'.$lbox_item['link_url'].'" class="login_menu_link external" id="login_menu_link_external_'.$lbox_item['link_id'].'">'.vartrue($lbox_item['link_label'], '['.LAN_LOGINMENU_44.']').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,10 +386,16 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
|
|
||||||
function sc_lm_stats($parm='')
|
function sc_lm_stats($parm='')
|
||||||
{
|
{
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
global $LOGIN_MENU_STATS;
|
global $LOGIN_MENU_STATS;
|
||||||
$data = e107::getRegistry('login_menu_data');
|
$data = e107::getRegistry('login_menu_data');
|
||||||
if(!$data['enable_stats']) return '';
|
|
||||||
|
if(empty($data['enable_stats']) || empty($LOGIN_MENU_STATS))
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
return $tp->parseTemplate($LOGIN_MENU_STATS, true, $this);
|
return $tp->parseTemplate($LOGIN_MENU_STATS, true, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +459,7 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
global $tp, $menu_pref, $new_total, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR;
|
global $tp, $menu_pref, $new_total, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR;
|
||||||
|
|
||||||
if(!vartrue($menu_pref['login_menu']['external_stats'])) return '';
|
if(!vartrue($menu_pref['login_menu']['external_stats'])) return '';
|
||||||
|
require_once(e_PLUGIN."login_menu/login_menu_class.php");
|
||||||
$lm = new login_menu_class;
|
$lm = new login_menu_class;
|
||||||
|
|
||||||
$lbox_infos = $lm->parse_external_list(true, false);
|
$lbox_infos = $lm->parse_external_list(true, false);
|
||||||
@@ -485,8 +505,17 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
|
|
||||||
function sc_lm_listnew_link($parm = '')
|
function sc_lm_listnew_link($parm = '')
|
||||||
{
|
{
|
||||||
$data = e107::getRegistry('login_menu_data');
|
|
||||||
if($parm == 'href') return $data['listnew_link'];
|
if(!$data = e107::getRegistry('login_menu_data'))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($parm === 'href')
|
||||||
|
{
|
||||||
|
return $data['listnew_link'];
|
||||||
|
}
|
||||||
|
|
||||||
return $data['listnew_link'] ? '<a href="' . $data['listnew_link'] . '" class="login_menu_link listnew" id="login_menu_link_listnew">' . LAN_LOGINMENU_24 . '</a>' : '';
|
return $data['listnew_link'] ? '<a href="' . $data['listnew_link'] . '" class="login_menu_link listnew" id="login_menu_link_listnew">' . LAN_LOGINMENU_24 . '</a>' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -907,31 +907,236 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testForumViewShortcodes()
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."forum/shortcodes/batch/view_shortcodes.php");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/** @var plugin_forum_view_shortcodes $sc */
|
||||||
|
$sc = $this->make('plugin_forum_view_shortcodes');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
$this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$vars = array(
|
||||||
|
'forum_id' => '2',
|
||||||
|
'forum_name' => 'Parent Number Two',
|
||||||
|
'forum_description' => 'Forum Description',
|
||||||
|
'forum_parent' => '0',
|
||||||
|
'forum_sub' => '0',
|
||||||
|
'forum_datestamp' => '1367304545',
|
||||||
|
'forum_moderators' => '248',
|
||||||
|
'forum_threads' => '0',
|
||||||
|
'forum_replies' => '0',
|
||||||
|
'forum_lastpost_user' => '0',
|
||||||
|
'forum_lastpost_user_anon' => NULL,
|
||||||
|
'forum_lastpost_info' => '',
|
||||||
|
'forum_class' => '253',
|
||||||
|
'forum_order' => '300',
|
||||||
|
'forum_postclass' => '253',
|
||||||
|
'forum_threadclass' => '0',
|
||||||
|
'forum_options' => '',
|
||||||
|
'forum_sef' => 'parent-number-two',
|
||||||
|
'forum_image' => NULL,
|
||||||
|
'forum_icon' => NULL,
|
||||||
|
'thread_id' => '1',
|
||||||
|
'thread_name' => '3 Duis tempus enim vitae magna placerat vel dapibus tellus feugiat.',
|
||||||
|
'thread_forum_id' => '4',
|
||||||
|
'thread_views' => '53',
|
||||||
|
'thread_active' => '1',
|
||||||
|
'thread_lastpost' => '1434584999',
|
||||||
|
'thread_sticky' => '0',
|
||||||
|
'thread_datestamp' => '1367307189',
|
||||||
|
'thread_user' => '2',
|
||||||
|
'thread_user_anon' => NULL,
|
||||||
|
'thread_lastuser' => '1',
|
||||||
|
'thread_lastuser_anon' => NULL,
|
||||||
|
'thread_total_replies' => '7',
|
||||||
|
'thread_options' => NULL,
|
||||||
|
'post_id' => '1',
|
||||||
|
'post_entry' => '4 Morbi eleifend auctor quam, ac consequat ipsum dictum vitae. Curabitur egestas lacinia mi, in venenatis mi euismod eu.',
|
||||||
|
'post_thread' => '1',
|
||||||
|
'post_forum' => '4',
|
||||||
|
'post_status' => '0',
|
||||||
|
'post_datestamp' => '1367307189',
|
||||||
|
'post_user' => '2',
|
||||||
|
'post_edit_datestamp' => NULL,
|
||||||
|
'post_edit_user' => NULL,
|
||||||
|
'post_ip' => NULL,
|
||||||
|
'post_user_anon' => NULL,
|
||||||
|
'post_attachments' => NULL,
|
||||||
|
'post_options' => NULL
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$sc->__construct();
|
||||||
|
|
||||||
|
$sc->setVars($vars);
|
||||||
|
|
||||||
|
$this->processShortcodeMethods($sc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testGalleryShortcodes()
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."gallery/e_shortcode.php");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/** @var gallery_shortcodes $sc */
|
||||||
|
$sc = $this->make('gallery_shortcodes');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
$this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$vars = array(
|
||||||
|
'media_id' => '227',
|
||||||
|
'media_type' => 'image/jpeg',
|
||||||
|
'media_name' => 'gasmask.jpg',
|
||||||
|
'media_caption' => 'gasmask.jpg',
|
||||||
|
'media_description' => '',
|
||||||
|
'media_category' => '_common_image',
|
||||||
|
'media_datestamp' => '1464646050',
|
||||||
|
'media_author' => '1',
|
||||||
|
'media_url' => '{e_THEME}voux/install/gasmask.jpg',
|
||||||
|
'media_size' => '91054',
|
||||||
|
'media_dimensions' => '1200 x 830',
|
||||||
|
'media_userclass' => '0',
|
||||||
|
'media_usedby' => '',
|
||||||
|
'media_tags' => '',
|
||||||
|
'media_cat_id' => '1',
|
||||||
|
'media_cat_owner' => '_common',
|
||||||
|
'media_cat_category' => '_common_image',
|
||||||
|
'media_cat_title' => '(Common Images)',
|
||||||
|
'media_cat_sef' => '',
|
||||||
|
'media_cat_diz' => 'Media in this category will be available in all areas of admin.',
|
||||||
|
'media_cat_class' => '253',
|
||||||
|
'media_cat_image' => '',
|
||||||
|
'media_cat_order' => '0'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$sc->setVars($vars);
|
||||||
|
$exclude = array('sc_gallery_slides'); // uses a counter.
|
||||||
|
$this->processShortcodeMethods($sc, $exclude);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testHeroShortcodes()
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."hero/hero_shortcodes.php");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/** @var plugin_hero_hero_shortcodes $sc */
|
||||||
|
$sc = $this->make('plugin_hero_hero_shortcodes');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
$this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$vars = array(
|
||||||
|
'hero_id' => '1',
|
||||||
|
'hero_title' => 'A [powerful] & [free] hero area',
|
||||||
|
'hero_description' => '[Easy] to Use',
|
||||||
|
'hero_bg' => '{e_MEDIA_IMAGE}2020-12/4.sm.webp',
|
||||||
|
'hero_media' => '{e_MEDIA_IMAGE}2020-12/horse.jpg',
|
||||||
|
'hero_bullets' => e107::unserialize('[
|
||||||
|
{
|
||||||
|
"icon": "fa-sun-o.glyph",
|
||||||
|
"icon_style": "warning",
|
||||||
|
"text": "Add some bullet text",
|
||||||
|
"animation": "fadeInRight",
|
||||||
|
"animation_delay": "15"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "fa-font-awesome.glyph",
|
||||||
|
"icon_style": "success",
|
||||||
|
"text": "Select an Icon from FontAwesome or others",
|
||||||
|
"animation": "fadeInRight",
|
||||||
|
"animation_delay": "25"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "fa-adjust.glyph",
|
||||||
|
"icon_style": "danger",
|
||||||
|
"text": "Choose a Style from Bootstrap",
|
||||||
|
"animation": "fadeInRight",
|
||||||
|
"animation_delay": "35"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "",
|
||||||
|
"icon_style": "",
|
||||||
|
"text": "",
|
||||||
|
"animation": "",
|
||||||
|
"animation_delay": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "",
|
||||||
|
"icon_style": "",
|
||||||
|
"text": "",
|
||||||
|
"animation": "",
|
||||||
|
"animation_delay": "0"
|
||||||
|
}
|
||||||
|
]'),
|
||||||
|
'hero_button1' => e107::unserialize('{
|
||||||
|
"icon": "fa-",
|
||||||
|
"label": "",
|
||||||
|
"url": "",
|
||||||
|
"class": ""
|
||||||
|
}'),
|
||||||
|
'hero_button2' => e107::unserialize('{
|
||||||
|
"icon": "fa-",
|
||||||
|
"label": "",
|
||||||
|
"url": "",
|
||||||
|
"class": ""
|
||||||
|
}'),
|
||||||
|
'hero_order' => '1',
|
||||||
|
'hero_class' => '0'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$sc->setVars($vars);
|
||||||
|
// $exclude = array('sc_gallery_slides'); // uses a counter.
|
||||||
|
$this->processShortcodeMethods($sc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testLoginMenuShortcodes()
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."login_menu/login_menu_shortcodes.php");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/** @var login_menu_shortcodes $sc */
|
||||||
|
$sc = $this->make('login_menu_shortcodes');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
$this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$this->processShortcodeMethods($sc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
e107_plugins\faqs/
|
|
||||||
faqs_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
e107_plugins\forum\shortcodes\batch (4 usages found)
|
|
||||||
forum_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
post_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
view_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
viewforum_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
e107_plugins\forum\todelete (2 usages found)
|
|
||||||
forum_post_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
forum_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
e107_plugins\gallery\shortcodes\batch (1 usage found)
|
|
||||||
gallery_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
e107_plugins\hero (1 usage found)
|
|
||||||
hero_shortcodes.php (1 usage found)
|
|
||||||
1 <?php
|
|
||||||
e107_plugins\links_page (1 usage found)
|
e107_plugins\links_page (1 usage found)
|
||||||
links_page_shortcodes.php (1 usage found)
|
links_page_shortcodes.php (1 usage found)
|
||||||
1 <?php
|
1 <?php
|
||||||
|
Reference in New Issue
Block a user