################################################################# ## Verified Scripts v6.10 ## ##-------------------------------------------------------------## ## Copyright ©2007 Verified Scripts. All rights reserved. ## ##-------------------------------------------------------------## ################################################################# session_start(); define ('IN_SITE', 1); include_once ('includes/global.php'); include_once ('includes/class_shop.php'); include_once ('includes/functions_item.php'); include_once ('includes/class_formchecker.php'); include_once ('includes/class_custom_field.php'); include_once ('includes/class_item.php'); include_once ('includes/class_reputation.php'); $user_id = intval($_REQUEST['user_id']); $protected_page = protected_page($user_id, 0); if ($protected_page['private_store'] && !store_logged_in($user_id)) { header_redirect('protected_page.php?redirect_url=shop&user_id=' . $user_id); } else if ($setts['enable_stores']) { include_once ('global_header.php'); $parent_id = intval($_REQUEST['parent_id']); $keywords_search = $db->rem_special_chars($_REQUEST['keywords_search']); $is_store = false; if ($user_id) { $template->set('user_id', $user_id); $template->set('parent_id', $parent_id); $template->set('keywords_search', $keywords_search); $shop = new shop(); $shop->setts = &$setts; $shop->user_id = $user_id; $reputation = new reputation(); $reputation->setts = &$setts; $user_details = $db->get_sql_row("SELECT * FROM " . DB_PREFIX . "users WHERE user_id=" . $user_id); $shop_status = $shop->shop_status($user_details); if ($shop_status['enabled']) { if ($session->value('user_id')) { $is_favorite_store = $db->count_rows('favourite_stores', "WHERE store_id='" . $user_details['user_id'] . "' AND user_id='" . $session->value('user_id') . "'"); if ($_GET['option'] == 'favorites') { if (!$is_favorite_store) { $db->query("INSERT INTO " . DB_PREFIX . "favourite_stores (store_id, user_id) VALUES ('" . $user_id . "', '" . $session->value('user_id') . "')"); $is_favorite_store = 1; } else { $db->query("DELETE FROM " . DB_PREFIX . "favourite_stores WHERE store_id='" . $user_id . "' AND user_id='" . $session->value('user_id') . "'"); $is_favorite_store = 0; } } $favorite_store = '[ ' . ((!$is_favorite_store) ? MSG_ADD_TO_FAVORITES : MSG_REMOVE_FROM_FAVORITES) . ' ]'; } (array) $query = null; define('IS_SHOP', 1); $shop_pages = array('shop_about', 'shop_specials', 'shop_shipping_info', 'shop_company_policies'); $template->set('page', $_REQUEST['page']); $is_store = true; $reputation_output = $reputation->calc_reputation($user_details['user_id']); $shop_header_msg = GMSG_STORE . ' - ' . $user_details['shop_name'] . ' (' . MSG_REPUTATION_RATING . ': ' . $reputation_output['percentage'] . ') ' . $favorite_store; $template->set('shop_header_msg', $shop_header_msg); (string) $shop_header = null; (string) $shop_footer = null; $shop_header = ' '; //$template->set('db', $db); //$template->set('fees', $fees); $template->set('user_details', $user_details); if (!in_array($_REQUEST['page'], $shop_pages))## Verified Scripts v6.00 header details (for the shop listings page) { (string) $shop_subcategories_content = null; $shop_categories_header = category_navigator($parent_id, true, true, 'shop.php', 'user_id=' . $user_id . '&keywords_search=' . $keywords_search); $template->set('shop_categories_header', $shop_categories_header); $is_subcategories = $db->count_rows('categories', "WHERE parent_id='" . $parent_id . "'"); $template->set('is_subcategories', $is_subcategories); if (!empty($user_details['shop_categories']) && !$parent_id) { $shop_categories = last_char($user_details['shop_categories']); $categories_query = " AND category_id IN (" . $shop_categories . ")"; } $sql_select_categories = $db->query("SELECT category_id FROM " . DB_PREFIX . "categories WHERE parent_id='" . $parent_id . "' AND (user_id=0 OR user_id='" . $user_details['user_id'] . "') " . $categories_query . " ORDER BY order_id ASC, name ASC"); while ($cat_details = $db->fetch_array($sql_select_categories)) { $background = ($counter++%2) ? 'c2_shop' : 'c3_shop'; $shop_subcategories_content .= '
' . $db->add_special_chars($user_details[$_REQUEST['page']]) . '
' . $shop_footer); $template_output .= $template->process('single_message.tpl.php'); } else { /** * below we have the variables that need to be declared in each separate browse page */ $page_url = 'shop'; $where_query = "WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND a.list_in!='auction' AND a.owner_id='" . $user_id . "' AND a.creation_in_progress=0 "; $order_field = (in_array($_REQUEST['order_field'], $auction_ordering)) ? $_REQUEST['order_field'] : 'a.end_time'; $order_type = (in_array($_REQUEST['order_type'], $order_types)) ? $_REQUEST['order_type'] : 'ASC'; $template->set('shop_header', $shop_header); $template->set('shop_footer', $shop_footer); include_once('includes/page_browse_auctions.php'); } } } if (!$is_store) { $template->set('message_header', header5(MSG_STORE_ERROR_TITLE)); $template->set('message_content', '' . MSG_STORE_ERROR_CONTENT . '
'); $template_output .= $template->process('single_message.tpl.php'); } include_once ('global_footer.php'); echo $template_output; } else { header_redirect('index.php'); } ?>