From 476b985dd087ebdb9943c06a42573b785e36c146 Mon Sep 17 00:00:00 2001 From: e107steved Date: Tue, 1 Apr 2008 19:58:41 +0000 Subject: [PATCH] Bugtracker #4376 - notice removal --- e107_files/shortcode/batch/user_shortcodes.php | 14 +++++++------- user.php | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e107_files/shortcode/batch/user_shortcodes.php b/e107_files/shortcode/batch/user_shortcodes.php index b322ca6e0..3c1ea3c5f 100644 --- a/e107_files/shortcode/batch/user_shortcodes.php +++ b/e107_files/shortcode/batch/user_shortcodes.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $ -| $Revision: 1.11 $ -| $Date: 2008-03-27 20:42:20 $ +| $Revision: 1.12 $ +| $Date: 2008-04-01 19:58:41 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -87,7 +87,7 @@ if(!$chatposts = getcachedvars('total_chatposts')) } cachevars('total_chatposts', $chatposts); } -return round(($user['user_chats']/$chatposts) * 100, 2); +return ($chatposts!=0) ? round(($user['user_chats']/$chatposts) * 100, 2): 0; SC_END SC_BEGIN USER_COMMENTPER @@ -97,17 +97,17 @@ if(!$commentposts = getcachedvars('total_commentposts')) $commentposts = $sql->db_Count("comments"); cachevars('total_commentposts', $commentposts); } -return round(($user['user_comments']/$commentposts) * 100, 2); +return ($commentposts!=0) ? round(($user['user_comments']/$commentposts) * 100, 2): 0; SC_END SC_BEGIN USER_FORUMPER global $sql, $user; if(!$forumposts = getcachedvars('total_forumposts')) { - $forumposts = $sql->db_Count("forum_t"); - cachevars('total_forumposts', $forumposts); + $forumposts = (isset($pref['plug_installed']['forum'])) ? $sql->db_Count("forum_t"): 0; + cachevars('total_forumposts', $forumposts); } -return round(($user['user_forums']/$forumposts) * 100, 2); +return ($forumposts!==0) ? round(($user['user_forums']/$forumposts) * 100, 2): 0; SC_END SC_BEGIN USER_LEVEL diff --git a/user.php b/user.php index f54dae289..04f9d7703 100644 --- a/user.php +++ b/user.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/user.php,v $ -| $Revision: 1.5 $ -| $Date: 2008-01-15 22:16:07 $ +| $Revision: 1.6 $ +| $Date: 2008-04-01 19:58:41 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -161,7 +161,7 @@ else { $userList = $sql->db_getList(); - $text .= $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes); + $text = $tp->parseTemplate($USER_SHORT_TEMPLATE_START, TRUE, $user_shortcodes); foreach ($userList as $row) { $loop_uid = $row['user_id'];