|
From: Jon O. <jon...@us...> - 2006-06-29 19:10:26
|
Update of /cvsroot/mxbb/mx_who_am_i/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21291/modules/mx_who_am_i/includes Modified Files: mx_common.php Log Message: code cleanup Index: mx_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_who_am_i/includes/mx_common.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_common.php 5 Apr 2006 23:03:19 -0000 1.5 --- mx_common.php 29 Jun 2006 19:10:10 -0000 1.6 *************** *** 25,29 **** | re...@di... | www.digitalhijinx.com ! | | description : The "Who Am I" block is a block is a block that | will be visable only to registered users who are --- 25,29 ---- | re...@di... | www.digitalhijinx.com ! | | description : The "Who Am I" block is a block is a block that | will be visable only to registered users who are *************** *** 54,67 **** | Class Declaration Section (Classes) \********************************************************************************/ - class mx_who_am_i { ! var $regdate; ! var $memberdays; ! var $posts_per_day; var $percentage; var $total_posts; ! var $avatar_img; ! var $no_avatar_img; /********************************************************************************\ --- 54,66 ---- | Class Declaration Section (Classes) \********************************************************************************/ class mx_who_am_i { ! var $regdate; ! var $memberdays; ! var $posts_per_day; var $percentage; var $total_posts; ! var $avatar_img; ! var $no_avatar_img; /********************************************************************************\ *************** *** 74,83 **** global $userdata; ! $this->regdate = $userdata['user_regdate']; ! $this->memberdays = max(1, round((time() - $this->regdate) / 86400)); ! $this->posts_per_day = round($userdata['user_posts'] / $this->memberdays, 2); $this->percentage = 0; $this->total_posts = 0; ! $this->avatar_img = ''; $this->no_avatar_img = 'noavatar.png'; } --- 73,82 ---- global $userdata; ! $this->regdate = $userdata['user_regdate']; ! $this->memberdays = max(1, round((time() - $this->regdate) / 86400)); ! $this->posts_per_day = round($userdata['user_posts'] / $this->memberdays, 2); $this->percentage = 0; $this->total_posts = 0; ! $this->avatar_img = ''; $this->no_avatar_img = 'noavatar.png'; } *************** *** 96,125 **** if ($userdata['user_posts'] != 0) ! { ! $this->total_posts = get_db_stat('postcount'); ! $this->percentage = round(($this->total_posts) ? min(100, ($userdata['user_posts'] / $this->total_posts) * 100) : 0, 2); ! } ! else ! { $this->percentage = 0; ! } ! if ($userdata['user_avatar_type'] && $userdata['user_allowavatar']) ! { ! switch($userdata['user_avatar_type']) { ! case USER_AVATAR_UPLOAD: ! $this->avatar_img = '<img src=' . '"' . PHPBB_URL . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; ! case USER_AVATAR_REMOTE: ! $this->avatar_img = '<img src=' . '"' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; ! case USER_AVATAR_GALLERY: ! $this->avatar_img = '<img src=' . '"' . PHPBB_URL . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; } } ! if (empty($this->avatar_img)) { if (file_exists($module_root_path . 'templates/' . $theme['template_name'] . '/' . 'images/' . $this->no_avatar_img)) --- 95,124 ---- if ($userdata['user_posts'] != 0) ! { ! $this->total_posts = get_db_stat('postcount'); ! $this->percentage = round(($this->total_posts) ? min(100, ($userdata['user_posts'] / $this->total_posts) * 100) : 0, 2); ! } ! else ! { $this->percentage = 0; ! } ! if ($userdata['user_avatar_type'] && $userdata['user_allowavatar']) ! { ! switch($userdata['user_avatar_type']) { ! case USER_AVATAR_UPLOAD: ! $this->avatar_img = '<img src=' . '"' . PHPBB_URL . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; ! case USER_AVATAR_REMOTE: ! $this->avatar_img = '<img src=' . '"' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; ! case USER_AVATAR_GALLERY: ! $this->avatar_img = '<img src=' . '"' . PHPBB_URL . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0">'; ! break; } } ! if (empty($this->avatar_img)) { if (file_exists($module_root_path . 'templates/' . $theme['template_name'] . '/' . 'images/' . $this->no_avatar_img)) *************** *** 177,188 **** 'L_POSTS_PER_DAY' => $lang['Posts_Per_Day'], ! 'USERNAME' => $userdata['username'], 'AVATAR_IMG' => '<a href="' . PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $userdata['user_id'] . '">' . $this->avatar_img . '</a>', 'U_PROFILE' => append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=editprofile'), ! 'JOINED' => create_date($lang['DATE_FORMAT'], $userdata['user_regdate'], $board_config['board_timezone']), ! 'POSTS' => $userdata['user_posts'], ! 'POST_PER_DAY' => $this->posts_per_day, 'POST_PERCENTAGE' => $this->percentage) ! ); $template->pparse('body_who_am_i'); --- 176,187 ---- 'L_POSTS_PER_DAY' => $lang['Posts_Per_Day'], ! 'USERNAME' => $userdata['username'], 'AVATAR_IMG' => '<a href="' . PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $userdata['user_id'] . '">' . $this->avatar_img . '</a>', 'U_PROFILE' => append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=editprofile'), ! 'JOINED' => create_date($lang['DATE_FORMAT'], $userdata['user_regdate'], $board_config['board_timezone']), ! 'POSTS' => $userdata['user_posts'], ! 'POST_PER_DAY' => $this->posts_per_day, 'POST_PERCENTAGE' => $this->percentage) ! ); $template->pparse('body_who_am_i'); *************** *** 203,207 **** | Main Body Section (Main Stuff) \********************************************************************************/ - $who_am_i = new mx_who_am_i; --- 202,205 ---- *************** *** 209,212 **** | End Of Function (Self Explainatory) \********************************************************************************/ - ?> \ No newline at end of file --- 207,209 ---- |