Exemplo n.º 1
0
/**
 * The HTML href link wrapper function
 *
 * @param $modul
 * @param $page
 * @param $parameters
 * @param $connection
 * @param $add_session_id
 * @param $search_engine_safe
 * @return string
 */
function oos_href_link($modul = '', $page = '', $parameters = null, $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
    global $oEvent, $spider_flag;
    if ($connection == 'NONSSL') {
        $link = OOS_HTTP_SERVER . OOS_SHOP;
    } elseif ($connection == 'SSL') {
        if (ENABLE_SSL == '1') {
            $link = OOS_HTTPS_SERVER . OOS_SHOP;
        } else {
            $link = OOS_HTTP_SERVER . OOS_SHOP;
        }
    } else {
        die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><b>Error!</b></font><br /><br /><b>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</b><br /><br />');
    }
    if (!empty($parameters)) {
        $link .= 'index.php?mp=' . $modul . '&amp;file=' . $page . '&amp;' . oos_output_string($parameters);
    } else {
        $link .= 'index.php?mp=' . $modul . '&amp;file=' . $page;
    }
    $separator = '&amp;';
    while (substr($link, -5) == '&amp;' || substr($link, -1) == '?') {
        if (substr($link, -1) == '?') {
            $link = substr($link, 0, -1);
        } else {
            $link = substr($link, 0, -5);
        }
    }
    // Add the session ID when moving from HTTP and HTTPS servers or when SID is defined
    if (ENABLE_SSL == '1' && $connection == 'SSL' && $add_session_id == true) {
        $_sid = oos_session_name() . '=' . oos_session_id();
    } elseif ($add_session_id == true && oos_is_not_null(SID)) {
        $_sid = SID;
    }
    if ($spider_flag === false) {
        $_sid = NULL;
    }
    if ($search_engine_safe == true && $oEvent->installed_plugin('sefu')) {
        $link = str_replace(array('?', '&amp;', '='), '/', $link);
        $separator = '?';
        $pos = strpos($link, 'action');
        if ($pos === false) {
            $url_rewrite = new url_rewrite();
            $link = $url_rewrite->transform_uri($link);
        }
    }
    if (isset($_sid)) {
        $link .= $separator . oos_output_string($_sid);
    }
    return $link;
}
Exemplo n.º 2
0
<?php

// ############################################
/*  Copyright (c) 2006 - 2015 IntenseCart eCommerce  */
// ############################################
require 'includes/application_top.php';
require DIR_WS_LANGUAGES . $language . '/' . 'information.php';
require DIR_WS_CLASSES . 'url_rewrite.php';
$url_rewrite = new url_rewrite();
$confirm = (int) $_REQUEST['info_title'];
$information_id = (int) $_REQUEST['information_id'];
function browse_information()
{
    global $languages_id;
    $query = tep_db_query("SELECT * FROM " . TABLE_INFORMATION . " WHERE languages_id = {$languages_id} AND SUBSTR(info_title,1,4) != 'inc_' ORDER BY v_order");
    $c = 0;
    while ($buffer = mysql_fetch_array($query)) {
        $result[$c] = $buffer;
        $c++;
    }
    return $result;
}
function browse_includes()
{
    global $languages_id;
    $query = tep_db_query("SELECT * FROM " . TABLE_INFORMATION . " WHERE languages_id = {$languages_id} AND SUBSTR(info_title,1,4) = 'inc_' ORDER BY v_order");
    $c = 0;
    while ($buffer = tep_db_fetch_array($query)) {
        $result[$c] = $buffer;
        $c++;
    }
Exemplo n.º 3
0
if (isset($cPath_array)) {
    for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
        $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int) $cPath_array[$i] . "' and language_id = '" . (int) $languages_id . "'");
        if (tep_db_num_rows($categories_query) > 0) {
            $categories = tep_db_fetch_array($categories_query);
            $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&cPath=' . implode('_', array_slice($cPath_array, 0, $i + 1))));
        } else {
            break;
        }
    }
}
require DIR_WS_CLASSES . 'currencies.php';
$currencies = new currencies();
// By MegaJim
require DIR_WS_CLASSES . 'url_rewrite.php';
$url_rewrite = new url_rewrite();
$ModelFieldsList = array('quantity');
$action = isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '';
$cus_groups = tep_get_customer_groups();
if (tep_not_null($action)) {
    if ($action == 'new_product_preview' && (isset($HTTP_POST_VARS['express_update']) || isset($HTTP_POST_VARS['express_update_x']))) {
        $action = isset($HTTP_GET_VARS['pID']) ? 'update_product' : 'insert_product';
        $express_update = true;
    }
    function get_upload_file($fld)
    {
        global $UploadCache;
        if (!isset($UploadCache)) {
            $UploadCache = array();
        }
        if (!isset($UploadCache[$fld])) {
/**
 * Smarty {html_href_link} function plugin
 *
 * Type:     function
 * Name:     html_href_link
 * @Version:  $Revision: 1.8 $ - changed by $Author: r23 $ on $Date: 2008/07/08 13:19:51 $
 * -------------------------------------------------------------
 */
function smarty_function_html_href_link($params, &$smarty)
{
    global $oEvent, $spider_flag;
    MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');
    $page = '';
    $parameters = '';
    $connection = 'NONSSL';
    $add_session_id = '1';
    $search_engine_safe = '1';
    foreach ($params as $_key => $_val) {
        switch ($_key) {
            case 'page':
                if (!is_array($_val)) {
                    ${$_key} = smarty_function_escape_special_chars($_val);
                } else {
                    $smarty->trigger_error("html_href_link: Unable to determine the page link!", E_USER_NOTICE);
                }
                break;
            case 'oos_get':
            case 'addentry_id':
            case 'connection':
            case 'add_session_id':
            case 'search_engine_safe':
                ${$_key} = (string) $_val;
                break;
            case 'anchor':
                $anchor = smarty_function_escape_special_chars($_val);
                break;
            default:
                if (!is_array($_val)) {
                    $parameters .= $_key . '=' . smarty_function_escape_special_chars($_val) . '&amp;';
                } else {
                    $smarty->trigger_error("html_href_link: parameters '{$_key}' cannot be an array", E_USER_NOTICE);
                }
                break;
        }
    }
    if (empty($page)) {
        $smarty->trigger_error("html_href_link: Unable to determine the page link!", E_USER_NOTICE);
    }
    if (isset($addentry_id)) {
        $addentry_id = $addentry_id + 2;
        $parameters .= 'entry_id=' . $addentry_id . '&amp;';
    }
    if (isset($oos_get)) {
        $parameters .= $oos_get;
    }
    $page = trim($page);
    if ($connection == 'NONSSL') {
        $link = OOS_HTTP_SERVER . OOS_SHOP;
    } elseif ($connection == 'SSL') {
        if (ENABLE_SSL == '1') {
            $link = OOS_HTTPS_SERVER . OOS_SHOP;
        } else {
            $link = OOS_HTTP_SERVER . OOS_SHOP;
        }
    } else {
        $smarty->trigger_error("html_href_link: Unable to determine the page link!", E_USER_NOTICE);
    }
    if (isset($parameters)) {
        $link .= 'index.php?page=' . $page . '&amp;' . oos_output_string($parameters);
    } else {
        $link .= 'index.php?page=' . $page;
    }
    $separator = '&amp;';
    while (substr($link, -5) == '&amp;' || substr($link, -1) == '?') {
        if (substr($link, -1) == '?') {
            $link = substr($link, 0, -1);
        } else {
            $link = substr($link, 0, -5);
        }
    }
    if (isset($anchor)) {
        $link .= '#' . $anchor;
    }
    // Add the session ID when moving from HTTP and HTTPS servers or when SID is defined
    if (ENABLE_SSL == '1' && $connection == 'SSL' && $add_session_id == '1') {
        $_sid = oos_session_name() . '=' . oos_session_id();
    } elseif ($add_session_id == '1' && oos_is_not_null(SID)) {
        $_sid = SID;
    }
    if ($spider_flag === false) {
        $_sid = NULL;
    }
    if ($search_engine_safe == '1' && $oEvent->installed_plugin('sefu')) {
        $link = str_replace(array('?', '&amp;', '='), '/', $link);
        $separator = '?';
        $pos = strpos($link, 'action');
        if ($pos === false) {
            $url_rewrite = new url_rewrite();
            $link = $url_rewrite->transform_uri($link);
        }
    }
    if (isset($_sid)) {
        $link .= $separator . oos_output_string($_sid);
    }
    return $link;
}