From 157a622681c5d8e1a5468da19b4c57388c4b8c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Thu, 3 Nov 2016 07:24:41 +0100 Subject: [PATCH] Fixed warning messages in "online" plugin. --- e107_plugins/online/online_shortcodes.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/e107_plugins/online/online_shortcodes.php b/e107_plugins/online/online_shortcodes.php index dbfc9827e..5875fa9be 100644 --- a/e107_plugins/online/online_shortcodes.php +++ b/e107_plugins/online/online_shortcodes.php @@ -30,6 +30,9 @@ class online_shortcodes extends e_shortcode public function __construct() { + // Need to set initial value for $scVars. Otherwise it results warning message. + parent::__construct(); + $this->e107 = e107::getInstance(); $this->memberInfo = e107::getConfig('history'); $this->gen = e107::getDateConvert(); @@ -136,14 +139,14 @@ class online_shortcodes extends e_shortcode if($ret == false) { - $newest_member_sql = $sql->select('user', 'user_id, user_name,user_image', "user_ban='0' ORDER BY user_join DESC LIMIT 1"); + $sql->select('user', 'user_id, user_name,user_image', "user_ban='0' ORDER BY user_join DESC LIMIT 1"); $row = $sql->fetch(); //$ret = "".$row['user_name'].""; - if($parm['type'] == 'avatar') + if(varset($parm['type']) == 'avatar') { $this->currentMember = array('oid' => $row['user_id'], 'oname'=> $row['user_name'], 'page' => null, 'pinfo' => null,'oimage' => $row['user_image'] ); - $ret = e107::getParser()->parseTemplate($this->newestTemplate, TRUE, $this); + //$ret = e107::getParser()->parseTemplate($this->newestTemplate, TRUE, $this); } else