################################################################# ## PHP Pro Bid v6.10 ## ##-------------------------------------------------------------## ## Copyright ©2007 PHP Pro Software LTD. All rights reserved. ## ##-------------------------------------------------------------## ################################################################# session_start(); define('IN_SITE', 1); define('AUCTION_DETAILS', 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/functions_item.php'); include_once('includes/class_messaging.php'); include_once('includes/class_reputation.php'); include_once('includes/functions_browse.php'); $template->set('auction_id', intval($_REQUEST['auction_id'])); $item_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "auctions WHERE auction_id='" . intval($_REQUEST['auction_id']) . "'"); $template->set('item_details', $item_details); require('global_header.php'); (array) $user_details = null; $start_time_id = 1; $end_time_id = 2; $item = new item(); $item->setts =& $setts; $item->layout =& $layout; $reputation = new reputation(); $reputation->setts =& $setts; $page_handle = 'auction'; $addl_query = ($session->value('adminarea') != "Active") ? " AND active=1 AND approved=1" : ''; $protected_page = protected_page($item_details['owner_id'], $item_details['category_id']); if (($protected_page['private_store'] && !store_logged_in($item_details['owner_id']) && $item_details['list_in'] != 'auction') || ($protected_page['private_category'] && !category_logged_in($item_details['category_id']))) { header_redirect('protected_page.php?redirect_url=auction_details&auction_id=' . $item_details['auction_id'] . '&user_id=' . $item_details['owner_id'] . '&category_id=' . $item_details['category_id']); } else { $main_category_id = $db->main_category($item_details['category_id']); $category_details = $db->get_sql_row("SELECT minimum_age FROM " . DB_PREFIX . "categories WHERE category_id='" . $main_category_id . "'"); if ($_REQUEST['option'] == 'agree_adult') { $session->set('adult_category', 1); } $can_view = false; $adult_cat = false; if ($item_details['auction_id']) { if (($session->value('adminarea') == "Active") || ($item_details['active'] == 1 && $item_details['approved'] == 1) || ($session->value('user_id') == $item_details['owner_id'])) { $can_view = true; $adult_cat = false; } if ($session->value('adminarea') != "Active" && $category_details['minimum_age'] > 0 && !$session->value('adult_category')) { $can_view = false; $adult_cat = true; } } if ($can_view) { $blocked_user = blocked_user($session->value('user_id'), $item_details['owner_id']); $template->set('blocked_user', $blocked_user); $user_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "users WHERE user_id=" . $item_details['owner_id']); $block_reason_msg = null; if ($blocked_user) { $block_reason_msg = block_reason($session->value('user_id'), $item_details['owner_id']); } if ($user_details['is_vacation']) { $block_reason_msg .= '
'; } $template->set('block_reason_msg', $block_reason_msg); $template->set('auction_id', intval($_REQUEST['auction_id'])); ## PHP Pro Bid v6.00 add click if ($_SERVER['REMOTE_ADDR'] != $item_details['seller_ip']) { $sql_add_click = $db->query("UPDATE " . DB_PREFIX . "auctions SET nb_clicks=nb_clicks+1 WHERE auction_id=" . $item_details['auction_id']); } $custom_fld = new custom_field(); if ($item_details['closed']==1) { $checkme = $session->value('user_id'); $is_digital = $db->count_rows('auction_media', "WHERE auction_id='" . $item_details['auction_id'] . "' AND media_type=3 AND upload_in_progress=0"); if ($is_digital) { $dhg = $db->count_rows('winners', "WHERE auction_id='" . $item_details['auction_id'] . "' AND buyer_id='".$checkme."' AND flag_paid=1"); } } if ($dhg) { $digital_content = '' . MSG_QUESTION_POSTED_SUCCESSFULLY . '
'; } else if ($_REQUEST['operation'] == 'post_answer') { $msg_changes_saved = '' . MSG_ANSWER_POSTED_SUCCESSFULLY . '
'; } } } ## PHP Pro Bid v6.00 item watch procedure if ($_REQUEST['option'] == 'item_watch') { if ($session->value('user_id')) { $item_watch = $item->item_watch_add($item_details['auction_id'], $session->value('user_id'), $item_details['owner_id']); $msg_changes_saved = '' . $item_watch . '
'; } else { $msg_changes_saved = '' . MSG_LOGIN_FOR_ITEM_WATCH . '
'; } } ## PHP Pro Bid v6.00 send auction to a friend procedure if ($_REQUEST['option'] == 'auction_friend') { $form_submitted = 0; if (isset($_REQUEST['form_auction_friend'])) { define('FRMCHK_AUCTION_FRIEND', 1); (int) $item_post = 1; $af_details = $_REQUEST; $frmchk_details = $af_details; include('includes/procedure_frmchk_auction_friend.php'); if ($fv->is_error()) { $template->set('display_formcheck_errors', '' . $auction_friend_output . '
'; $form_submitted = 1; } } if (!$form_submitted) { if (!$item_post && $session->value('user_id')) { $af_details = $db->get_sql_row("SELECT name, email FROM " . DB_PREFIX . "users WHERE user_id='" . $session->value('user_id') . "'"); } $post_details = ($item_post) ? $_GET : $af_details; $template->set('post_details', $post_details); $session->set('pin_value', md5(rand(2, 99999999))); $generated_pin = generate_pin($session->value('pin_value')); $pin_image_output = show_pin_image($session->value('pin_value'), $generated_pin); $template->set('pin_image_output', $pin_image_output); $template->set('generated_pin', $generated_pin); $auction_friend_form = $template->process('auction_friend.tpl.php'); $template->set('auction_friend_form', $auction_friend_form); } } if ($_REQUEST['do'] == 'delete_topic' && $session->value('adminarea') == 'Active') /* delete public question - admin area feature only */ { $db->query("DELETE FROM " . DB_PREFIX . "messaging WHERE topic_id='" . intval($_REQUEST['topic_id']) . "'"); $msg_changes_saved = '' . MSG_TOPIC_DELETED . '
'; } $template->set('msg_changes_saved', $msg_changes_saved); $item_details['quantity'] = $item->set_quantity($item_details['quantity']); $custom_fld->save_edit_vars($item_details['owner_id'], $page_handle); $media_details = $item->get_media_values(intval($_REQUEST['auction_id'])); $item_details['ad_image'] = $media_details['ad_image']; $item_details['ad_video'] = $media_details['ad_video']; $item_details['ad_mp3'] = $media_details['ad_mp3']; $item_details['ad_digital'] = $media_details['ad_digital']; $item_details['ad_dd'] = $media_details['ad_dd']; $template->set('item_details', $item_details); $template->set('buyout_only', $item->buyout_only($item_details)); $template->set('user_details', $user_details); //$template->set('fees', $fees); $template->set('session', $session); $template->set('item', $item); $template->set('item_can_bid', $item->can_bid($session->value('user_id'), $item_details)); $template->set('main_category_display', category_navigator($item_details['category_id'], true, false, 'categories.php')); $template->set('addl_category_display', category_navigator($item_details['addl_category_id'], true, false, 'categories.php')); $template->set('direct_payment_box', $item->direct_payment_box($item_details, $session->value('user_id'))); $template->set('ad_display', 'live'); /* if ad_display = preview, then some table fields will be disabled */ $template->set('show_buyout', show_buyout($item_details)); $template->set('your_bid', $item->your_bid($item_details['auction_id'], $session->value('user_id'))); $tax = new tax(); $seller_country = $tax->display_countries($user_details['country']); $template->set('seller_country', $seller_country); $template->set('auction_location', $item->item_location($item_details)); $template->set('auction_country', $tax->display_countries($item_details['country'])); $swap_offer_link = ($item_details['enable_swap'] && $session->value('user_id') != $item_details['owner_id']) ? '[ ' . MSG_MAKE_SWAP_OFFER . ' ]' : ''; $template->set('swap_offer_link', $swap_offer_link); $item->show_hidden_bid = ($item_details['owner_id'] == $session->value('user_id') || $session->value('adminarea') == 'Active' || $item_details['closed'] == 1) ? true : false; $template->set('high_bidders_content', $item->show_high_bid($item_details, 'high_bid')); $template->set('winners_content', $item->show_high_bid($item_details, 'winner')); $winners_message_board = $item->winners_message_board_link($item_details, $session->value('user_id')); $template->set('winners_message_board', $winners_message_board); $item_watch_text = null; if ($user_details['show_watch_list']) { $item_watch_text = $item->item_watch_text($item_details['auction_id']); } $template->set('item_watch_text', $item_watch_text); $reputation_table_small = $reputation->rep_table_small($item_details['owner_id'], $item_details['auction_id']); $template->set('reputation_table_small', $reputation_table_small); $auction_tax = $tax->auction_tax($user_details['user_id'], $setts['enable_tax'], $session->value('user_id')); $template->set('auction_tax', $auction_tax); $custom_fld->new_table = ($setts['default_theme'] == 'ultra') ? true : false; $custom_fld->field_colspan = 1; $custom_sections_table = $custom_fld->display_sections($item_details, $page_handle, true, $item_details['auction_id'], $item_details['category_id']); $template->set('custom_sections_table', $custom_sections_table); $ad_image_thumbnails = $item->item_media_thumbnails($item_details, 1, true, false, $setts['thumb_display_type']); $full_size_images_link = $item->full_size_images($item_details); $template->set('ad_image_thumbnails', $ad_image_thumbnails . '' . ' | ' . MSG_QUESTION . ' | ' . '
' . ' | ' . MSG_ANSWER . ' | ' . '
' . MSG_AUCTION_DETAILS_ERROR_CONTENT . '
'); $template_output .= $template->process('single_message.tpl.php'); } include_once('global_footer.php'); echo $template_output; } ?>