Error!
Unable to determine the page link!
');
}
if ($connection == 'NONSSL') {
$link = HTTP_SERVER;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL == 'true') {
$link = HTTPS_SERVER ;
} else {
$link = HTTP_SERVER;
}
} else {
die('
Error!
Unable to determine connection method on a link!
Known methods: NONSSL SSL
');
}
if ($use_dir_ws_catalog) $link .= DIR_WS_CATALOG;
if (!$static) {
if (zen_not_null($parameters)) {
$link .= 'index.php?main_page='. $page . "&" . zen_output_string($parameters);
if (USER_FRIENDLY_URLS_REWRITE == 'true') {
if (ereg('product_info&cPath', $link)) {
$link = ereg_replace('&cPath=([0-9_]{1,})', '', $link);
}
if (ereg('product_info&products_id', $link)) {
$link = str_replace('index.php?main_page=product_info&products_id=', 'products/', $link);
$link = ereg_replace('&cPath=([0-9_]{1,})', '', $link);
$link = str_replace('&action=notify','notify', $link);
$link = str_replace('&action=add_product','add', $link);
$link = $link . ".html";
$link = str_replace('&','', $link);
}
if (ereg('main_page=index&cPath', $link)) {
$link = str_replace('index.php?main_page=index&cPath=', 'categories/', $link);
$link = str_replace('&sort=', '/sort', $link);
$link = str_replace('&page=', '/page', $link);
$link = str_replace('&filter_id=', '/filter', $link);
$link = $link . ".html";
}
if (ereg('disp_order=', $link)) {
$link = str_replace('/index.php?main_page=','/', $link);
$link = str_replace('&disp_order=','/display', $link);
$link = str_replace('&page=','_', $link);
$link = $link . ".html";
}
if (ereg('buy_now', $link)) {
$link = ereg_replace('/([a-z0-9_/]{1,})&action=buy_now&products_id=','/order/', $link);
}
if (ereg('product_reviews&products_id', $link)) {
$link = str_replace('/index.php?main_page=','/', $link);
$link = str_replace('&products_id=','/products', $link);
$link = $link . ".html";
$link = str_replace('&','', $link);
}
if (ereg('tell_a_friend&products_id=', $link)) {
$link = str_replace('/index.php?main_page=','/', $link);
$link = str_replace('&products_id=','/products', $link);
$link = $link . ".html";
}
if (ereg('manufacturers_id=', $link)) {
$link = str_replace('/index.php?main_page=','/', $link);
$link = str_replace('index&','', $link);
$link = str_replace('redirect&action=manufacturer&','redirect/', $link);
$link = str_replace('=','', $link);
$link = $link . ".html";
}
if (ereg('main_page=redirect&action', $link)) {
$link = str_replace('/index.php?main_page=','/', $link);
$link = str_replace('&action=url&goto=','_url-', $link);
$link = str_replace('%2F','/', $link);
}
}
} else {
if (USER_FRIENDLY_URLS_REWRITE == 'true') {
if (
($page == 'login') or
($page == 'advanced_search') or
($page == 'specials') or
($page == 'featured_products') or
($page == 'products_new') or
($page == 'products_all') or
($page == 'index') or
($page == 'shippinginfo') or
($page == 'privacy') or
($page == 'conditions') or
($page == 'contact_us') or
($page == 'gv_faq') or
($page == 'site_map') or
($page == 'logoff') or
($page == 'account') or
($page == 'shopping_cart') or
($page == 'popup_shipping_estimator') or
($page == 'checkout_shipping')
){
$link .= $page . ".html";
} else {
$link .= 'index.php?main_page=' . $page;
}
} else {
$link .= 'index.php?main_page=' . $page;
}
}
} else {
if (zen_not_null($parameters)) {
$link .= $page . "&" . zen_output_string($parameters);
} else {
$link .= $page;
}
}
$separator = '&';
while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
if (defined('SID') && zen_not_null(SID)) {
$sid = SID;
// } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL_ADMIN == 'true') ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
} elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == 'true') ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
if ($http_domain != $https_domain) {
$sid = zen_session_name() . '=' . zen_session_id();
}
}
}
// clean up the link before processing
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
$link = str_replace('&', '/', $link);
$link = str_replace('?', '/', $link);
$link = str_replace('&', '/', $link);
$link = str_replace('=', '/', $link);
$separator = '?';
}
if (isset($sid)) {
$link .= $separator . $sid;
}
// clean up the link after processing
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
$link = ereg_replace('&', '&', $link);
return $link;
}
// use when proportional images is turned off or from a template directory
////
// The HTML image wrapper function
function zen_image_OLD($src, $alt = '', $width = '', $height = '', $parameters = '') {
global $template_dir;
//auto replace with defined missing image
if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
$src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE;
}
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
return false;
}
// if not in current template switch to template_default
if (!file_exists($src)) {
$src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src);
}
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '
$height) {
$ratio = $height / $image_size[1];
$width = $image_size[0] * $ratio;
} else {
$height = $image_size[1] * $ratio;
}
$image .= ' width="' . $width . '" height="' . $height . '"';
} else {
// override on missing image to allow for proportional and required/not required
if (IMAGE_REQUIRED == 'false') {
return false;
} else {
$image .= ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '"';
}
}
if (zen_not_null($parameters)) $image .= ' ' . $parameters;
$image .= ' />';
return $image;
}
////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
function zen_image_submit($image, $alt = '', $parameters = '') {
global $template, $current_page_base;
$image_submit = 'get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . $image, $alt, '', '', $parameters);
}
////
// Output a separator either through whitespace, or with an image
function zen_draw_separator($image = 'true', $width = '100%', $height = '1') {
// set default to use from template - zen_image will translate if not found in current template
if ($image == 'true') {
$image = DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BLACK_SEPARATOR;
} else {
if (!strstr($image, DIR_WS_TEMPLATE_IMAGES)) {
$image = DIR_WS_TEMPLATE_IMAGES . $image;
}
}
return zen_image($image, '', $width, $height);
}
////
// Output a form
function zen_draw_form($name, $action, $method = 'post', $parameters = '') {
$form = '