diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index 54c7bf7b7..23aad23db 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -92,11 +92,11 @@ class user_shortcodes extends e_shortcode $chatposts = 0; // In case plugin not installed if (e107::isInstalled("chatbox_menu")) { - $chatposts = $sql->count("chatbox"); + $chatposts = intval($sql->count("chatbox")); } e107::setRegistry('total_chatposts', $chatposts); } - return ($chatposts!=0) ? round(($this->var['user_chats']/$chatposts) * 100, 2): 0; + return ($chatposts > 0) ? round(($this->var['user_chats']/$chatposts) * 100, 2) : 0; } @@ -106,10 +106,10 @@ class user_shortcodes extends e_shortcode $sql = e107::getDb(); if(!$commentposts = e107::getRegistry('total_commentposts')) { - $commentposts = $sql->count("comments"); + $commentposts = intval($sql->count("comments")); e107::setRegistry('total_commentposts', $commentposts); } - return ($commentposts!=0) ? round(($this->var['user_comments']/$commentposts) * 100, 2): 0; + return ($commentposts > 0) ? round(($this->var['user_comments']/$commentposts) * 100, 2) : 0; } @@ -119,11 +119,11 @@ class user_shortcodes extends e_shortcode $sql = e107::getDb(); if(!$forumposts = e107::getRegistry('total_forumposts')) { - $forumposts = (e107::isInstalled("forum")) ? $sql->count("forum_thread"): 0; + $forumposts = (e107::isInstalled("forum")) ? intval($sql->count("forum_thread")) : 0; e107::setRegistry('total_forumposts', $forumposts); $user_forumposts = $sql->count("forum_thread","(*)","where thread_user=".$this->var['user_id']); } - return ($forumposts!==0) ? round(($user_forumposts/$forumposts) * 100, 2): 0; + return ($forumposts > 0) ? round(($user_forumposts/$forumposts) * 100, 2) : 0; } diff --git a/install.php b/install.php index af959e385..df9b08e08 100644 --- a/install.php +++ b/install.php @@ -386,7 +386,7 @@ class e_install // $page_info = nl2br(LANINS_023); $page_info = "