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 .= ' '. ' '. $reputation->rep_rate($rep_details['reputation_rate']) . ' | '. ' ' . GMSG_DATE . ': ' . show_date($rep_details['reg_date']) . ' | '. ' ' . MSG_TYPE . ': ' . $rep_details['reputation_type'] . ' | '. ' ' . (($rep_view == 'left') ? GMSG_TO : GMSG_FROM) . ': '. ' ' . $rep_username . user_pics($rep_user_id) . ' | '. ' ' . MSG_AUCTION_ID . ': '. ' ' . $rep_details['auction_id'] . ' | '. ' [ ' . MSG_DETAILS . ' ]
'. ' ' . $rep_details['reputation_content']; ' '. ''; } $template->set('rep_details_content', $rep_details_content); $pagination = paginate($start, $limit, $total_rep, 'user_reputation.php', $additional_vars . $order_link); $template->set('pagination', $pagination); $template_output .= $template->process('user_reputation.tpl.php'); } else { $template->set('message_header', header5(MSG_VIEW_REPUTATION)); $template->set('message_content', '

' . MSG_USER_DOESNT_EXIST . '

'); $template_output .= $template->process('single_message.tpl.php'); } include_once ('global_footer.php'); echo $template_output; ?>