} $popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name']; $pop_size = @GetImageSize("{$popup_img}"); if ($pop_size[0] > $pop_width) { $pop_width = $pop_size[0]; } if ($pop_size[1] > $pop_height) { $pop_height = $pop_size[1]; } } if ($small_width_total > $pop_width) { $pop_width = $small_width_total; } $product_image = array_shift($products_image_name); $smarty->assign(array('box_width' => (int) ($pop_width + 50), 'box_height' => (int) ($pop_height + $small_height + 55), 'link_product_img' => xos_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&img_name=' . rawurlencode($product_image['name']), $request_type), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $product_info['products_id'], 'NONSSL', true, false, false, false, false), 'product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($product_image['name']), addslashes($product_info['products_name']), '', '', 'style="margin: 5px;"'))); } $back = sizeof($_SESSION['navigation']->path) - 2; if (!empty($_SESSION['navigation']->path[$back])) { $get_params_array = $_SESSION['navigation']->path[$back]['get']; $get_params_array['rmp'] = '0'; $back_link = xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']); } else { $back_link = 'javascript:history.go(-1)'; } $smarty->assign(array('form_begin' => xos_draw_form('product_reviews_write', xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'action')) . 'action=process', 'SSL'), 'post', 'onsubmit="return checkForm();"', true), 'form_end' => '</form>', 'radio_fields' => xos_draw_radio_field('rating', '1') . ' ' . xos_draw_radio_field('rating', '2') . ' ' . xos_draw_radio_field('rating', '3') . ' ' . xos_draw_radio_field('rating', '4') . ' ' . xos_draw_radio_field('rating', '5'), 'textarea_field' => xos_draw_textarea_field('review', '60', '15'), 'customers_name' => xos_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']), 'products_name' => $product_info['products_name'], 'products_p_unit' => $product_info['products_p_unit'], 'products_model' => $product_info['products_model'], 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($product_info['products_tax_class_id'], $products_tax_rate), 'td_width_img' => MEDIUM_PRODUCT_IMAGE_MAX_WIDTH + 10, 'link_back' => $back_link, 'link_buy_now' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=buy_now'))); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews_write'); $output_product_reviews_write = $smarty->fetch(SELECTED_TPL . '/product_reviews_write.tpl'); $smarty->assign('central_contents', $output_product_reviews_write); $smarty->display(SELECTED_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php'; }
} require DIR_WS_INCLUDES . 'html_header.php'; require DIR_WS_INCLUDES . 'boxes.php'; require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'footer.php'; if ($messageStack->size('addressbook') > 0) { $smarty->assign('message_stack', $messageStack->output('addressbook')); $smarty->assign('message_stack_error', $messageStack->output('addressbook', 'error')); $smarty->assign('message_stack_warning', $messageStack->output('addressbook', 'warning')); $smarty->assign('message_stack_success', $messageStack->output('addressbook', 'success')); } if (isset($_GET['delete'])) { $smarty->assign(array('delete_address' => true, 'address_label' => xos_address_label($_SESSION['customer_id'], $_GET['delete'], true, ' ', '<br />'), 'link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'link_filename_address_book_process_delete' => xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $_GET['delete'] . '&action=deleteconfirm&formid=' . md5($_SESSION['sessiontoken']), 'SSL'))); } elseif (isset($_GET['edit']) && is_numeric($_GET['edit'])) { $smarty->assign(array('edit_address' => true, 'form_begin' => xos_draw_form('addressbook', xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'hidden_field_update' => xos_draw_hidden_field('action', 'update'), 'hidden_field_edit' => xos_draw_hidden_field('edit', $_GET['edit']), 'form_end' => '</form>')); include DIR_WS_MODULES . 'address_book_details.php'; } else { if (sizeof($_SESSION['navigation']->snapshot) > 0) { $back_link = xos_href_link($_SESSION['navigation']->snapshot['page'], xos_array_to_query_string($_SESSION['navigation']->snapshot['get'], array(xos_session_name())), $_SESSION['navigation']->snapshot['mode']); } else { $back_link = xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'); } $smarty->assign(array('form_begin' => xos_draw_form('addressbook', xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'link_back' => $back_link, 'hidden_field_process' => xos_draw_hidden_field('action', 'process'), 'form_end' => '</form>')); include DIR_WS_MODULES . 'address_book_details.php'; } $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'address_book_process'); $output_address_book_process = $smarty->fetch(SELECTED_TPL . '/address_book_process.tpl'); $smarty->assign('central_contents', $output_address_book_process); $smarty->display(SELECTED_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php'; }
function internal_link_replacement($match) { global $linkable_files; $filename = ''; $replacement = ''; if ($match[3] == '.php') { $filename = str_replace(array(HTTP_SERVER, HTTPS_SERVER, DIR_WS_CATALOG), '', $match[2] . $match[3]); } elseif ((stripos($match[2], HTTP_SERVER) !== false || stripos($match[2], HTTPS_SERVER) !== false) && (DIR_WS_CATALOG != '' && stripos($match[2], DIR_WS_CATALOG) !== false || DIR_WS_CATALOG == '')) { switch ($match[3]) { case '.html/a': $filename = 'index.php'; break; case '.html/b': $filename = 'product_info.php'; break; case '.html/c': $filename = 'content.php'; break; case '.html/d': $filename = 'specials.php'; break; case '.html/e': $filename = 'products_new.php'; break; case '.html/f': $filename = 'newsletter_subscribe.php'; break; case '.html/g': $filename = 'reviews.php'; break; case '.html/h': $filename = 'product_reviews.php'; break; case '.html/i': $filename = 'product_reviews_info.php'; break; case '.html/k': $filename = 'tell_a_friend.php'; break; case '.html/l': $filename = 'shopping_cart.php'; break; case '.html/m': $filename = 'login.php'; break; case '.html/n': $filename = 'create_account.php'; break; case '.html/o': $filename = 'password_forgotten.php'; break; case '.html/p': $filename = 'advanced_search_and_results.php'; break; case '.html/q': $filename = 'search_result.php'; break; case '.html/r': $filename = 'cookie_usage.php'; break; } } if (array_key_exists($filename, $linkable_files)) { $p_url = parse_url($match[4]); if (!empty($p_url['path'])) { $get_params = array(); $get_array = array(); $vars = explode('/', substr(rawurldecode($p_url['path']), 1)); for ($i = 0, $n = sizeof($vars) - 1; $i < $n; $i++) { if (strpos($vars[$i], '[]')) { $get_array[substr($vars[$i], 0, -2)][] = $vars[$i + 1]; } else { $vars[$i + 1] = str_replace(array('_.~', '~._'), array('/', '\\'), $vars[$i + 1]); $vars[$i + 1] == '^' ? $get_params[$vars[$i]] = ' ' : ($get_params[$vars[$i]] = $vars[$i + 1]); } $i++; } if (sizeof($get_array) > 0) { while (list($key, $value) = each($get_array)) { $get_params[$key] = $value; } } } elseif (!empty($p_url['query'])) { parse_str(htmlspecialchars_decode($p_url['query']), $get_params); } $query_return = xos_array_to_query_string($get_params, array('action', 'cur', 'lnc', 'tpl', 'rmp', 'XOSsid')); $replacement = str_replace($match[1], '[@{link xos_href_link(\'' . $filename . '\', \'' . $query_return . '\', \'' . ($linkable_files[$filename] == 'REQUEST_TYPE' ? $linkable_files[$filename] : (stripos($match[2], HTTP_SERVER) !== false ? 'NONSSL' : (stripos($match[2], HTTPS_SERVER) !== false ? 'SSL' : $linkable_files[$filename]))) . '\')}@]', $match[0]); } else { $replacement = $match[0]; } return $replacement; }
$smarty->assign('products_date_added', xos_date_long($product_info['products_date_added'])); } if (PRODUCT_REVIEWS_ENABLED == 'true') { $smarty->assign('link_filename_product_reviews', xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('lnc', 'cur', 'tpl')))); } $smarty->assign(array('input_products_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity" style="text-align: center; width: 60px;" class="form-control" maxlength="5"'), 'hidden_field_products_id' => xos_draw_hidden_field('p', $product_info['products_id']), 'javascript' => $jscript_op, 'form_begin' => xos_draw_form('cart_quantity', xos_href_link(FILENAME_PRODUCT_INFO, xos_get_all_get_params(array('action')) . 'action=add_product')), 'form_end' => '</form>')); $smarty->caching = 0; include DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS; include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS; if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true') && !isset($_GET['noscript'])) { $smarty->caching = 1; } } $smarty->assign('link_filename_default', xos_href_link(FILENAME_DEFAULT)); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_info'); } // link_back will not be cached (nocache) $back = sizeof($_SESSION['navigation']->path) - 2; if (!empty($_SESSION['navigation']->path[$back])) { $get_params_array = $_SESSION['navigation']->path[$back]['get']; $get_params_array['rmp'] = '0'; $smarty->assign('link_back', xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']), true); } else { $smarty->assign('link_back', 'javascript:history.go(-1)', true); } $output_product_info = $smarty->fetch(SELECTED_TPL . '/product_info.tpl', $cache_id); $smarty->assign('central_contents', $output_product_info); $smarty->caching = 0; $smarty->display(SELECTED_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php'; return 'overwrite_all';
function debug() { for ($i = 0, $n = sizeof($this->path); $i < $n; $i++) { echo $this->path[$i]['page']; $get_string = ''; reset($this->path[$i]['get']); while (list($key, $value) = each($this->path[$i]['get'])) { $get_string .= $key . '=' . $value . '&'; } if ($get_string != '') { $get_string = '?' . $get_string; } echo substr($get_string, 0, -1); if (sizeof($this->path[$i]['post']) > 0) { reset($this->path[$i]['post']); while (list($key, $value) = each($this->path[$i]['post'])) { echo ' / <b>' . $key . '=' . $value . '</b>'; } } echo '<br />'; } if (sizeof($this->snapshot) > 0) { echo '<br /><br />'; echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . xos_array_to_query_string($this->snapshot['get'], array(xos_session_name())) . '<br />'; } }