Example #1
0
if (isset($_GET['products_id'])) {
    if (!isset($nProductsId)) $nProductsId = oos_get_product_id($_GET['products_id']);
}

$aOption['popup_print'] = $sTheme . '/products/popup_print.html';

//smarty
require 'includes/classes/class_template.php';
$oSmarty = new Template;

$oSmarty->caching = true;

$popup_cache_id = $sTheme . '|products|' . $nGroupID . '|print|' . $nProductsId . '|' . $sLanguage;

if (!$oSmarty->is_cached($aOption['popup_print'], $popup_cache_id )) {
 
    $productstable = $oostable['products'];
    $products_descriptiontable = $oostable['products_description'];
    $product_info_sql = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_url,
                                pd.products_description_meta, pd.products_keywords_meta, p.products_model,
                                p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2,
                                p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6,
                                p.products_discount_allowed, p.products_price, p.products_base_price, p.products_base_unit,
                                p.products_quantity_order_min, p.products_quantity_order_units,
                                p.products_discount1, p.products_discount2, p.products_discount3, p.products_discount4,
                                p.products_discount1_qty, p.products_discount2_qty, p.products_discount3_qty,
                                p.products_discount4_qty, p.products_tax_class_id, p.products_units_id, p.products_date_added,
                                p.products_date_available, p.manufacturers_id, p.products_price_list
                          FROM $productstable p,
                             $products_descriptiontable pd
        $sql = "SELECT p.products_id, p.products_status, pd.products_name\n                FROM {$productstable} p,\n                     {$products_descriptiontable} pd\n                WHERE p.products_status >= '1'\n                  AND p.products_id = '" . oos_db_input($pr_ids[$i]) . "'\n                  AND pd.products_id = p.products_id\n                  AND pd.products_languages_id = '" . intval($nLanguageID) . "'";
        $result = $dbconn->Execute($sql);
        if ($row = $result->fields) {
            $prods .= '<br />' . $row["products_name"];
        }
    }
    if ($prods == '') {
        $prods = '<br />NONE';
    }
    $text_coupon_help .= $prods;
} else {
    $nCouponID = 0;
}
$aOption['popup_help'] = $sTheme . '/system/popup_help.html';
//smarty
require 'includes/classes/class_template.php';
$oSmarty = new Template();
$oSmarty->caching = true;
$nCouponID += 0;
$help_cache_id = $sTheme . '|popup|coupon|' . $nCouponID . '|' . $sLanguage;
if (!$oSmarty->is_cached($aOption['popup_help'], $help_cache_id)) {
    // assign Smarty variables;
    $oSmarty->assign('oos_base', ($request_type == 'SSL' ? OOS_HTTPS_SERVER : OOS_HTTP_SERVER) . OOS_SHOP);
    $oSmarty->assign('lang', $aLang);
    $oSmarty->assign('heading_titel', $aLang['heading_coupon_help']);
    $oSmarty->assign('help_text', $text_coupon_help);
    $oSmarty->assign('theme_image', 'themes/' . $sTheme . '/images');
    $oSmarty->assign('theme_css', 'themes/' . $sTheme);
}
// display the template
$oSmarty->display($aOption['popup_help'], $help_cache_id);
Example #3
0
}
$_GET['s'] = trim($_GET['s']);
$page = isset($_GET['p']) ? $_GET['p'] : 1;
$per_page = isset($_GET['pp']) ? $_GET['pp'] : 20;
$too_short = strlen($_GET['s']) < 4;
$search_id = md5("{$_GET['s']}-{$page}-{$_GET['c']}-{$_GET['f']}");
$t = new Template();
$t->caching = TRUE;
$t->cache_lifetime = 3600;
$DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']);
$DB->Connect();
$domain = $DB->Row('SELECT * FROM `tx_domains` WHERE `domain`=?', array(preg_replace('~^www\\.~i', '', strtolower($_SERVER['HTTP_HOST']))));
if ($domain) {
    $C['cookie_domain'] = $domain['domain'];
}
if (!$too_short && !$t->is_cached($domain['template_prefix'] . 'search-results.tpl', $search_id)) {
    $categories =& $DB->FetchAll('SELECT `name`,`tag` FROM `tx_categories` WHERE `hidden`=0 ORDER BY `name`', null, 'tag');
    $galleries = array();
    $search_wheres = array('MATCH(`description`,`keywords`) AGAINST(? IN BOOLEAN MODE)', '`status` IN (?,?)');
    $search_binds = array($_GET['s'], 'used', 'holding');
    // If category was specified, add it to the where clause
    if ($_GET['c']) {
        $search_wheres[] = 'MATCH(`categories`) AGAINST(? IN BOOLEAN MODE)';
        $search_binds[] = $_GET['c'];
    }
    // If format was specified, add it to the where clause
    if ($_GET['f']) {
        $search_wheres[] = '`format`=?';
        $search_binds[] = $_GET['f'];
    }
    $result = $DB->QueryWithPagination('SELECT * FROM `tx_galleries` WHERE ' . join(' AND ', $search_wheres), $search_binds, $page, $per_page);
Example #4
0
function DisplayCategory()
{
    global $C, $DB;
    $t = new Template();
    $t->caching = TRUE;
    $t->cache_lifetime = $C['cache_category'];
    $custom_sort = isset($_GET['s']);
    $from_path = FALSE;
    $template = 'directory-category.tpl';
    if ($custom_sort) {
        $t->caching = FALSE;
    }
    if ($C['mod_rewrite'] && !is_numeric($_GET['c'])) {
        $_GET['c'] = preg_replace('~^/|/$~', '', $_GET['c']);
        if (preg_match("~(.*?)/(\\d+)\\.{$C['extension']}\$~", $_GET['c'], $matches)) {
            $_GET['c'] = $matches[1];
            $_GET['p'] = $matches[2];
        }
        $from_path = TRUE;
    }
    $_GET['p'] = isset($_GET['p']) ? $_GET['p'] : 1;
    $cache_id = md5($_GET['c'] . '-' . $_GET['p']);
    if ($custom_sort || $C['custom_categories'] || !$t->is_cached($template, $cache_id)) {
        $DB->Connect();
        // Get the category
        if ($from_path) {
            $category = $DB->Row('SELECT * FROM lx_categories WHERE path_hash=?', array(md5($_GET['c'])));
        } else {
            $category = $DB->Row('SELECT * FROM lx_categories WHERE category_id=?', array($_GET['c']));
        }
        if ($category['template']) {
            $template = $category['template'];
        }
        if (!$category) {
            require_once 'includes/language.php';
            $t->caching = FALSE;
            $t->assign('error', $L['NO_SUCH_PAGE']);
            $t->assign_by_ref('config', $C);
            $t->display('error-nice.tpl');
            return;
        }
    }
    if ($custom_sort || !$t->is_cached($template, $cache_id)) {
        $category['path_parts'] = unserialize($category['path_parts']);
        $t->assign_by_ref('this_category', $category);
        $t->assign_by_ref('config', $C);
        $t->assign('page_num', $_GET['p']);
        $t->assign('get_c', $_GET['c']);
        $t->assign('template', $template);
        $t->assign_by_ref('request', $_GET);
    }
    $t->display($template, $cache_id);
}
Example #5
0
}
$_POST['s'] = trim($_POST['s']);
$page = !empty($_POST['p']) ? $_POST['p'] : 1;
$per_page = !empty($_POST['pp']) ? $_POST['pp'] : 20;
$too_short = strlen($_POST['s']) < 4;
$search_id = sha1("{$_POST['s']}-{$_POST['c']}-{$page}");
$t = new Template();
$t->caching = TRUE;
$t->cache_lifetime = 3600;
$t->assign('search_term', $_POST['s']);
$t->assign('search_category', $_POST['c']);
$t->assign('page', $page);
$t->assign('per_page', $per_page);
$t->assign('search_too_short', $too_short);
$t->assign_by_ref('config', $C);
if (!$too_short && !$t->is_cached('search-results.tpl', $search_id)) {
    $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']);
    $DB->Connect();
    $accounts = array();
    $result = $DB->QueryWithPagination('SELECT * FROM `tlx_accounts` JOIN `tlx_account_hourly_stats` USING (`username`) WHERE ' . 'MATCH(`title`,`description`,`keywords`) AGAINST(? IN BOOLEAN MODE) AND ' . '`status`=? AND ' . '`disabled`=0 ' . (!empty($_POST['c']) && is_numeric($_POST['c']) ? ' AND `category_id`=' . $DB->Escape($_POST['c']) . ' ' : '') . 'ORDER BY `unique_in_total` DESC', array($_POST['s'], 'active'), $page, $per_page);
    if ($result['result']) {
        while ($account = $DB->NextRow($result['result'])) {
            $accounts[] = array_merge($account, $DB->Row('SELECT * FROM `tlx_account_fields` WHERE `username`=?', array($account['username'])));
        }
        $DB->Free($result['result']);
        unset($result['result']);
    }
    $categories = $DB->FetchAll('SELECT * FROM `tlx_categories` ORDER BY `name`');
    if (!$categories) {
        $categories = array();
    }
Example #6
0
if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set('America/Chicago');
}
if (get_magic_quotes_gpc()) {
    _ArrayStripSlashes($_GET);
}
$link = array('link_id' => $_GET['id']);
$cache_id = md5($_GET['id']);
// Indicate if logged in
$C['logged_in'] = isset($_COOKIE['linkxuser']);
$t = new Template();
$t->caching = $C['cache_details'] > 0;
$t->cache_lifetime = $C['cache_details'];
$t->cache_dir = 'templates/cache_details';
$t->assign_by_ref('link', $link);
if (!$t->is_cached('directory-link-details.tpl', $cache_id)) {
    $DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']);
    $DB->Connect();
    $link = $DB->Row('SELECT * FROM lx_links JOIN lx_link_fields USING (link_id) WHERE lx_links.link_id=?', array($_GET['id']));
    if (!$link) {
        require_once 'includes/language.php';
        $t->caching = FALSE;
        $t->assign('error', $L['NO_SUCH_PAGE']);
        $t->assign_by_ref('config', $C);
        $t->display('error-nice.tpl');
        return;
    }
    // Get all categories for this link
    $categories = array();
    $result = $DB->Query('SELECT * FROM lx_link_cats JOIN lx_categories USING (category_id) WHERE link_id=?', array($_GET['id']));
    while ($category = $DB->NextRow($result)) {