get_sql_row("SELECT name FROM " . DB_PREFIX . "auctions WHERE auction_id='" . intval($_REQUEST['auction_id']) . "'"); if(strcasecmp($_REQUEST['name'], sanitize_var($tempname['name'])) == 0) { $same = 1; } if (!empty($_REQUEST['auction_id']) && empty($same) && !$session->value('membersarea') == 'Active') { header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . ' http://' . $_SERVER['HTTP_HOST'] . '/item/' . sanitize_var($tempname['name']) . '-' . $_REQUEST['auction_id'] . '.html'); } $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" : ''; $item_details = $db->get_sql_row("SELECT a.*, di.url FROM " . DB_PREFIX . "auctions a LEFT JOIN " . DB_PREFIX . "digital_item di ON di.auction_id=a.auction_id WHERE a.auction_id='" . intval($_REQUEST['auction_id']) . "'"); if($setts["favorite_sellers"]){ if ($_REQUEST['option'] == 'add_fav_seller') { $favorite_details = $db->count_rows('favourite_sellers', "WHERE seller_id='" . intval($item_details['owner_id']) . "' AND user_id='".intval($session->value('user_id'))."'"); if (!$favorite_details){ $sql_add_seller = $db->query("INSERT INTO " . DB_PREFIX . "favourite_sellers (seller_id, user_id) VALUES ('".$item_details["owner_id"]."','".$session->value('user_id')."')"); $template->set('msg_saved', '

' . MSG_FAV_SELLER_ADDED . '

'); } else { $template->set('msg_saved', '

' . MSG_FAV_SELLER_ALREADY . '

'); } } if ($_REQUEST['do'] == 'delete_fav_seller') { $db->query("DELETE FROM " . DB_PREFIX . "favourite_sellers WHERE id='" . intval($_REQUEST['id']) . "' AND user_id='" . $session->value('user_id') . "'"); $template->set('msg_saved', '

' . MSG_FAV_SELLER_REMOVED . '

'); } $favorite_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "favourite_sellers WHERE seller_id='" . intval($item_details['owner_id']) . "' AND user_id='".intval($session->value('user_id'))."'"); $template->set('favorite_details', $favorite_details); } $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']) || $search_engine_output['result']) { $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; } } include_once ('includes/ip_brand.php'); if ($dc_arr_str && preg_match("/$dc_arr_str/i",$item_details['name']) && $item_details['active'] ==1 && !$setts['brand_item_details']) { $template_output .= $template->process('site_error.tpl.php'); } else if ($can_view) { $blocked_user = blocked_user($session->value('user_id'), $item_details['owner_id']); $template->set('blocked_user', $blocked_user); if ($blocked_user) { $template->set('block_reason_msg', block_reason($session->value('user_id'), $item_details['owner_id'])); } $template->set('auction_id', intval($_REQUEST['auction_id'])); $sql_add_click = $db->query("UPDATE " . DB_PREFIX . "auctions SET nb_clicks=nb_clicks+1 WHERE auction_id=" . intval($item_details['auction_id'])); $user_details = $db->get_sql_row("SELECT u.*, pg.* FROM " . DB_PREFIX . "users u LEFT JOIN " . DB_PREFIX . "users_payment_gateway pg ON pg.user_id=u.user_id WHERE u.user_id=" . $item_details['owner_id']); $custom_fld = new custom_field(); $msg = new messaging(); $msg->setts = &$setts; /** * if we have a user logged in, we mark as read any questions/answers he has received */ if ($session->value('user_id')) { $msg->mark_read($session->value('user_id'), 0, $item_details['auction_id'], 1); //<-- needs mysql optimization! } $blocked_user = blocked_user($session->value('user_id'), $item_details['owner_id'], 'message'); if (in_array($_REQUEST['option'], array('post_question', 'post_answer')) || in_array($_REQUEST['operation'], array('post_question', 'post_answer'))) { if ($blocked_user) { $msg_changes_saved = block_reason($session->value('user_id'), $item_details['owner_id'], 'message'); } else { if ($_REQUEST['option'] == 'post_question') { $msg->new_topic($item_details['auction_id'], $session->value('user_id'), $item_details['owner_id'], 1, '', $_REQUEST['message_content'], $_REQUEST['message_handle']); header_redirect('auction_details.php?auction_id=' . $item_details['auction_id'] . '&operation=post_question'); } else if ($_REQUEST['option'] == 'post_answer') { $msg->reply(intval($_REQUEST['question_id']), $session->value('user_id'), '', $_REQUEST['message_content']); header_redirect('auction_details.php?auction_id=' . $item_details['auction_id'] . '&operation=post_answer'); } if ($_REQUEST['operation'] == 'post_question') { $msg_changes_saved = '

' . MSG_QUESTION_POSTED_SUCCESSFULLY . '

'; } else if ($_REQUEST['operation'] == 'post_answer') { $msg_changes_saved = '

' . MSG_ANSWER_POSTED_SUCCESSFULLY . '

'; } } } if ($_REQUEST['option'] == 'item_watch') { $msg_changes_saved = $item->item_watch_add($item_details['auction_id'], $session->value('user_id'), $item_details['owner_id']); } ## PHP Pro Bid v6.00 send auction to a friend procedure if ($_REQUEST['option'] == 'auction_friend') { $form_submitted = 0; $user_details = $db->get_sql_row("SELECT name, email FROM " . DB_PREFIX . "users WHERE user_id='" . $session->value('user_id') . "'"); 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', '' . $fv->display_errors() . ''); } else { $auction_friend_output = $item->auction_friend($item_details, $session->value('user_id'), $af_details['friend_name'], $af_details['friend_email'], $_REQUEST['comments'], $user_details['name'], $user_details['email']); $msg_changes_saved = '

' . $auction_friend_output . '

'; $template->set('display_send_success', '' . MSG_AUCTION_FRIEND_SEND_SUCCESS . ''); } } $template->set('af_details', $af_details); $template->set('user_details', $user_details); $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_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'], false, false, 'categories.php')); $template->set('addl_category_display', category_navigator($item_details['addl_category_id'], false, false, 'categories.php')); $template->set('shop_category_display', category_navigator($item_details['shop_category_id'], $item_details['owner_id'], 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') ? 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 = $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); $reputation_output = $reputation->calc_reputation($user_details['user_id']); $template->set('reputation_output', $reputation_output); $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'], $db->main_category($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']); if(!$session->value('user_id') && !$_COOKIE['mobile_device']) { $full_size_images_link = ''; } else { $full_size_images_link = $item->full_size_images($item_details); } $template->set('ad_image_thumbnails', $ad_image_thumbnails . '
' . $full_size_images_link); $ad_jquery_thumbnails = $item->item_media_thumbnails($item_details, 1, false, false, 'v', true); $template->set('ad_jquery_thumbnails', $ad_jquery_thumbnails); $ad_video_thumbnails = $item->item_media_thumbnails($item_details, 2); $template->set('ad_video_thumbnails', $ad_video_thumbnails); $ad_dd_thumbnails = $item->item_media_thumbnails($item_details, 3); $template->set('ad_dd_thumbnails', $ad_dd_thumbnails); $video_play_file = (!empty($_REQUEST['video_name'])) ? $_REQUEST['video_name'] : $item_details['ad_video'][0]; $ad_video_main_box = $item->video_box($video_play_file); $template->set('ad_video_main_box', $ad_video_main_box);## PHP Pro Bid v6.00 auction questions $public_messages = $msg->public_messages($item_details['auction_id']); (string) $public_questions_content = null; while ($msg_details = $db->fetch_array($public_messages)) { $public_questions_content .= ' '. ' '. ' '. ' '. ' '. ' '. '
'. ''.$msg_details['username'].'
'. '' . MSG_QUESTION . '
'. ' ' . $msg_details['question_content'] . ''. ' '. ' '. ' '. ' '. ' '. ' '. ' '. '
' . MSG_ANSWER . '
'. ' ' . ((!empty($msg_details['answer_content'])) ? $msg_details['answer_content'] : '-') . ' '. ''; if ($session->value('adminarea') == 'Active') { $public_questions_content .= ' '. ' '. ' '. ' [ ' . MSG_DELETE_TOPIC . ' ] '. ''; } else if ($session->value('user_id') == $item_details['owner_id']) { $public_questions_content .= ' '. ' '. '
'. ' '. ' '. '
'. ''; } $public_questions_content .= ' '. ' '. ' '. ''; } $template->set('public_questions_content', $public_questions_content); if ($setts['enable_custom_payment_method'] && !empty($item_details['direct_payment'])) { $dp_methods = $item->select_direct_payment($item_details['direct_payment'] . ",18", $user_details['user_id'], true); } else { $global_paypal = ($user_details['pg_paypal_email']) ? '1,' : ''; $global_Worldpay = ($user_details['pg_worldpay_id']) ? '2,' : ''; $global_2Checkout = ($user_details['pg_checkout_id']) ? '3,' : ''; $global_Nochex = ($user_details['pg_nochex_email']) ? '4,' : ''; $global_glbpay = ($user_details['pg_glbpay_shopno'] && $user_details['pg_glbpay_key']) ? '5,' : ''; $global_Protx = ($user_details['pg_protx_username'] && $user_details['pg_protx_password']) ? '6,' : ''; $global_Authorize_net = ($user_details['pg_authnet_username'] && $user_details['pg_authnet_password']) ? '7,' : ''; $global_Moneybookers = ($user_details['pg_mb_email']) ? '9,' : ''; $global_Paymate = ($user_details['pg_paymate_merchant_id']) ? '10,' : ''; $global_Google_Checkout = ($user_details['pg_gc_merchant_id'] && $user_details['pg_gc_merchant_key']) ? '11,' : ''; $global_Amazon = ($user_details['pg_amazon_access_key'] && $user_details['pg_amazon_secret_key']) ? '12,' : ''; $global_AlertPay = ($user_details['pg_alertpay_id'] && $user_details['pg_alertpay_securitycode']) ? '13,' : ''; $global_GUNPAL = ($user_details['pg_gunpal_id']) ? '15,' : ''; $global_Alipay= ($user_details['pg_alipayescrow_partner_id'] && $user_details['pg_alipayescrow_key'] && $user_details['pg_alipayescrow_email_address']) ? '14,' : ''; $global_Alipayescrow = ($user_details['pg_alipayescrow_email_address']) ? '20,' : ''; $global_Western_Union = ($user_details['pg_wu_receiver_firstname'] && $user_details['pg_wu_receiver_lastname'] && $user_details['pg_wu_receiver_country'] && $user_details['pg_wu_receiver_city']) ? '21,' : ''; $global_Bank_Transfer = ($user_details['pg_bank_name'] && $user_details['pg_bank_address'] && $user_details['pg_bank_swift'] && $user_details['pg_bank_receiver_account'] && $user_details['pg_bank_receiver_name']) ? '17,' : ''; $global_direct_payment = $global_paypal . $global_Worldpay . $global_2Checkout . $global_Nochex . $global_glbpay . $global_Protx . $global_Authorize_net . $global_Moneybookers . $global_Paymate . $global_Google_Checkout . $global_Amazon . $global_AlertPay . $global_Alipay . $global_Alipayescrow . $global_Western_Union . $global_Bank_Transfer . $global_GUNPAL; $dp_methods = $item->select_direct_payment($global_direct_payment . "18", $user_details['user_id'], true); } $direct_payment_methods_display = $template->generate_table($dp_methods, 4, 1, 1, '75%'); $template->set('direct_payment_methods_display', $direct_payment_methods_display); /* BEGIN -> shipping calculator box code snippet */ $sc_disabled = 'disabled'; $sc_quantity = intval($_REQUEST['sc_quantity']); $sc_quantity = ($sc_quantity > $item_details['quantity']) ? $item_details['quantity'] : (($sc_quantity < 1) ? 1 : $sc_quantity); $template->set('sc_quantity', $sc_quantity); $tax->selected_cid = shipping_locations($item_details['owner_id']); $sc_country = intval($_REQUEST['sc_country']); $sc_state = intval($_REQUEST['sc_state']); $template->set('country_dropdown', $tax->countries_dropdown('sc_country', $sc_country, 'shipping_calculator_form', 'shipping_calculator', true, MSG_SELECT_COUNTRY)); if ($tax->is_states($sc_country)) { $template->set('state_dropdown', $tax->states_box('sc_state',$sc_state, $sc_country, 'shipping_calculator_form')); if ($sc_state) { $sc_disabled = ''; } } else if ($sc_country) { $sc_disabled = ''; } $sc_postage_value = null; if (isset($_REQUEST['form_calculate_postage'])) { $sc_quantity = intval($_REQUEST['sc_quantity']); $sc_quantity = ($sc_quantity > 0) ? $sc_quantity : 1; $calc_postage = calculate_postage(null, $item_details['owner_id'], $item_details['auction_id'], null, $sc_country, $sc_state, $sc_quantity); $sc_postage_value = $calc_postage['postage']; } $template->set('sc_postage_value', $sc_postage_value); $template->set('sc_disabled', $sc_disabled); $shipping_calculator_box = $template->process('shipping_calculator_box.tpl.php'); $template->set('shipping_calculator_box', $shipping_calculator_box); /* END -> shipping calculator box code snippet */ if ($setts['enable_other_items_adp']) { $select_condition = "WHERE a.active=1 AND a.closed=0 AND a.creation_in_progress=0 AND a.deleted=0 AND a.list_in!='store' AND a.owner_id=" . $item_details['owner_id'] . " AND a.auction_id!=" . intval($item_details['auction_id']); //$template->set('db', $db);## PHP Pro Bid v6.00 the design is handled in the mainpage.tpl.php file to allow liberty on skins design $other_items = $db->random_rows('auctions a', 'a.auction_id, a.name, a.buyout_price, a.start_price, a.max_bid, a.currency, a.end_time', $select_condition, $layout['hpfeat_nb']); $template->set('other_items', $other_items); } ## add the search details back link if the auction was accessed through the search page. (string) $search_url = null; if ($_REQUEST['auction_search'] == 1) { $additional_vars = '&option=' . $_REQUEST['option'] . '&src_auction_id=' . $_REQUEST['src_auction_id'] . '&keywords_search=' . $_REQUEST['keywords_search'] . '&buyout_price=' . $_REQUEST['buyout_price'] . '&reserve_price=' . $_REQUEST['reserve_price'] . '&quantity=' . $_REQUEST['quantity'] . '&enable_swap=' . $_REQUEST['enable_swap'] . '&list_in=' . $_REQUEST['list_in'] . '&results_view=' . $_REQUEST['results_view'] . '&country=' . $_REQUEST['country'] . '&zip_code=' . $_REQUEST['zip_code'] . '&username=' . $_REQUEST['username'] . '&basic_search=' . $_REQUEST['basic_search']; $search_url = 'auction_search.php?start=0' . $additional_vars; $template->set('search_url', $search_url); } $template->change_path('themes/' . $setts['default_theme'] . '/templates/'); $template_output .= $template->process('auction_details.tpl.php'); $template->change_path('templates/'); } else if ($adult_cat) { $template->set('categories_header_menu', $item_details['name']); $template->set('minimum_age', $category_details['minimum_age']); $template->set('auction_id', $item_details['auction_id']); $template_output .= $template->process('adult_category_warning.tpl.php'); } else { //header('HTTP/1.1 403 Forbidden'); header("HTTP/1.0 404 Not Found"); $template->set('message_header', header5(MSG_AUCTION_DETAILS_ERROR_TITLE)); $template->set('message_content', '

' . MSG_AUCTION_DETAILS_ERROR_CONTENT . '

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