################################################################# ## PHP Pro Bid v6.00 ## ##-------------------------------------------------------------## ## Copyright ©2007 PHP Pro Software LTD. All rights reserved. ## ##-------------------------------------------------------------## ################################################################# session_start(); define ('IN_SITE', 1); include_once ('includes/global.php'); include_once ('includes/class_formchecker.php'); include_once ('includes/class_custom_field.php'); include_once ('includes/class_user.php'); include_once ('includes/class_fees.php'); include_once ('includes/class_item.php'); include_once ('includes/class_reputation.php'); require ('global_header.php'); $user_id = intval($_REQUEST['user_id']); $rep_view = (in_array($_REQUEST['view'], array('all', 'positive', 'neutral', 'negative', 'from_buyers', 'from_sellers', 'left'))) ? $_REQUEST['view'] : 'all'; $limit = 20; $additional_vars = '&view=' . $rep_view . '&user_id=' . $user_id . '&auction_id=' . $auction_id; $user_details = $db->get_sql_row("SELECT user_id, username, shop_account_id, shop_categories, shop_active, preferred_seller, reg_date, country, state, zip_code, balance, default_name, default_description, default_duration, default_hidden_bidding, default_enable_swap, default_shipping_method, default_shipping_int, default_postage_amount, default_insurance_amount, default_type_service, default_shipping_details, default_payment_methods, default_public_questions FROM " . DB_PREFIX . "users WHERE user_id=" . $user_id); if (item::count_contents($user_details)) { $reputation = new reputation(); $reputation->setts = &$setts; $template->set('user_reputation_header', header5(MSG_VIEW_REPUTATION)); //$template->set('db', $db); $template->set('user_id', $user_id); $template->set('auction_id', $_REQUEST['auction_id']); $template->set('user_details', $user_details); $tax = new tax(); $seller_country = $tax->display_countries($user_details['country']); $template->set('seller_country', $seller_country); $template->set('one_month', 30 * 86400); $template->set('six_months', 180 * 86400); $template->set('twelve_months', 365 * 86400); $total_comments = $db->count_rows('reputation', "WHERE user_id='" . $user_id . "' AND submitted='1'"); $template->set('total_comments', $total_comments); $reputation_output = $reputation->calc_reputation($user_id); $template->set('reputation_rating', $reputation_output['percentage']); $template->set('rep_view', $rep_view); switch ($rep_view) { case 'positive': $search_pattern = " r.user_id='" . $user_id . "' AND r.reputation_rate>3 "; break; case 'neutral': $search_pattern = " r.user_id='" . $user_id . "' AND r.reputation_rate=3 "; break; case 'negative': $search_pattern = " r.user_id='" . $user_id . "' AND r.reputation_rate<3 "; break; case 'from_buyers': $search_pattern = " r.user_id='" . $user_id . "' AND r.reputation_type='sale' "; break; case 'from_sellers': $search_pattern = " r.user_id='" . $user_id . "' AND r.reputation_type='purchase' "; break; case 'left': $search_pattern = " r.from_id='" . $user_id . "' "; break; default: $search_pattern = " r.user_id='" . $user_id . "' "; } $sql_select_reputation = $db->query("SELECT r.*, f.username AS from_username, t.username AS to_username FROM " . DB_PREFIX . "reputation r LEFT JOIN " . DB_PREFIX . "users f ON r.from_id=f.user_id LEFT JOIN " . DB_PREFIX . "users t ON r.user_id=t.user_id WHERE " . $search_pattern . " AND r.submitted=1 ORDER BY r.reg_date DESC LIMIT ".$start.",".$limit); $total_rep = $db->count_rows('reputation r', "WHERE " . $search_pattern . " AND r.submitted=1"); (string) $rep_details_content = null; while ($rep_details = $db->fetch_array($sql_select_reputation)) { $rep_username = ($rep_view == 'left') ? $rep_details['to_username'] : $rep_details['from_username']; $rep_user_id = ($rep_view == 'left') ? $rep_details['user_id'] : $rep_details['from_id']; $background = ($counter++%2) ? 'c1' : 'c2'; $rep_details_content .= '
' . MSG_USER_DOESNT_EXIST . '
'); $template_output .= $template->process('single_message.tpl.php'); } include_once ('global_footer.php'); echo $template_output; ?>