mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
$online_shortcodes now loaded correctly using e107::getScBatch(). (Could break old plugins)
This commit is contained in:
@@ -14,19 +14,13 @@
|
|||||||
* $Author$
|
* $Author$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if(!defined('e107_INIT'))
|
||||||
|
|
||||||
e107::includeLan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php');
|
|
||||||
|
|
||||||
if(class_exists('online_shortcodes'))
|
|
||||||
{
|
{
|
||||||
$online_shortcodes = new online_shortcodes;
|
exit;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
require_once(e_PLUGIN.'online/online_shortcodes.php');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$online_shortcodes = e107::getScBatch('online', true);
|
||||||
|
|
||||||
if(THEME_LEGACY !== true)
|
if(THEME_LEGACY !== true)
|
||||||
{
|
{
|
||||||
$LASTSEEN_TEMPLATE = e107::getTemplate('online', 'online_menu', 'lastseen'); // $ONLINE_MENU_TEMPLATE['lastseen'];
|
$LASTSEEN_TEMPLATE = e107::getTemplate('online', 'online_menu', 'lastseen'); // $ONLINE_MENU_TEMPLATE['lastseen'];
|
||||||
@@ -54,12 +48,14 @@ $sql->select('user', 'user_id, user_name, user_currentvisit', 'ORDER BY user_cur
|
|||||||
$lslist = $sql->db_getList();
|
$lslist = $sql->db_getList();
|
||||||
|
|
||||||
$text = $tp->parseTemplate($LASTSEEN_TEMPLATE['start'], true);
|
$text = $tp->parseTemplate($LASTSEEN_TEMPLATE['start'], true);
|
||||||
|
|
||||||
foreach($lslist as $row)
|
foreach($lslist as $row)
|
||||||
{
|
{
|
||||||
// setScVar('online_shortcodes', 'currentUser', $row);
|
// $online_shortcodes->setScVar('currentUser', $row);
|
||||||
$online_shortcodes->currentUser = $row;
|
$online_shortcodes->currentUser = $row;
|
||||||
$text .= $tp->parseTemplate($LASTSEEN_TEMPLATE['item'], true, $online_shortcodes);
|
$text .= $tp->parseTemplate($LASTSEEN_TEMPLATE['item'], true, $online_shortcodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= $tp->parseTemplate($LASTSEEN_TEMPLATE['end'], true, $online_shortcodes);
|
$text .= $tp->parseTemplate($LASTSEEN_TEMPLATE['end'], true, $online_shortcodes);
|
||||||
|
|
||||||
$caption = vartrue($menu_pref['online_ls_caption'], LAN_LASTSEEN_1);
|
$caption = vartrue($menu_pref['online_ls_caption'], LAN_LASTSEEN_1);
|
||||||
|
@@ -13,16 +13,16 @@
|
|||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
//global $pref;
|
//global $pref;
|
||||||
global $menu_pref;
|
$menu_pref = e107::getConfig('menu')->getPref();
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
e107::includeLan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php');
|
e107::includeLan(e_PLUGIN.'online/languages/'.e_LANGUAGE.'.php');
|
||||||
|
|
||||||
require_once(e_PLUGIN.'online/online_shortcodes.php');
|
// require_once(e_PLUGIN.'online/online_shortcodes.php');
|
||||||
$mode = empty($menu_pref['online_show_memberlist_extended']) ? 'default' : 'extended';
|
$mode = empty($menu_pref['online_show_memberlist_extended']) ? 'default' : 'extended';
|
||||||
|
|
||||||
$online_shortcodes = new online_shortcodes;
|
$online_shortcodes = e107::getScBatch('online', true);
|
||||||
$online_shortcodes->wrapper('online_menu/'.$mode);
|
$online_shortcodes->wrapper('online_menu/'.$mode);
|
||||||
|
|
||||||
if(deftrue('BOOTSTRAP'))
|
if(deftrue('BOOTSTRAP'))
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
|
||||||
register_shortcode('online_shortcodes', true);
|
//register_shortcode('online_shortcodes', true);
|
||||||
$online_shortcodes = initShortcodeClass('online_shortcodes');
|
// $online_shortcodes = initShortcodeClass('online_shortcodes');
|
||||||
|
|
||||||
e107::plugLan('online', null);
|
e107::plugLan('online', null);
|
||||||
|
|
||||||
@@ -73,6 +73,7 @@ class online_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seen_ago = $this->gen->computeLapse($this->currentUser['user_currentvisit'], false, false, true, 'short');
|
$seen_ago = $this->gen->computeLapse($this->currentUser['user_currentvisit'], false, false, true, 'short');
|
||||||
|
|
||||||
return $seen_ago;
|
return $seen_ago;
|
||||||
// return ($seen_ago ? $seen_ago : '1 '.LANDT_09).' '.LANDT_AGO;
|
// return ($seen_ago ? $seen_ago : '1 '.LANDT_09).' '.LANDT_AGO;
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ $ONLINE_MENU_TEMPLATE = array();
|
|||||||
|
|
||||||
// Last seen Menu
|
// Last seen Menu
|
||||||
$ONLINE_MENU_TEMPLATE['lastseen']['start'] = "<ul class='list-group lastseen-menu'>";
|
$ONLINE_MENU_TEMPLATE['lastseen']['start'] = "<ul class='list-group lastseen-menu'>";
|
||||||
$ONLINE_MENU_TEMPLATE['lastseen']['item'] = "<li class='list-group-item d-flex justify-content-between align-items-center'>{LASTSEEN_USERLINK} <small class='muted'>{LASTSEEN_DATE}</small></li>";
|
$ONLINE_MENU_TEMPLATE['lastseen']['item'] = "<li class='list-group-item d-flex justify-content-between align-items-center'>{LASTSEEN_USERLINK} <small class='muted pull-right'>{LASTSEEN_DATE}</small></li>";
|
||||||
$ONLINE_MENU_TEMPLATE['lastseen']['end'] = "</ul>";
|
$ONLINE_MENU_TEMPLATE['lastseen']['end'] = "</ul>";
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user