Example #1
0
<?php

$path = '';
$html = '';
/*******
* Добавление в таблицу логов запись о просмотренном товаре
*/
$this->db->insert(TABLE_AUDIT, array('product_id' => $_GET['id'], 'date' => date('Y-m-d'), 'time' => date('H:i:s'), 'status' => 1));
$product_db = $this->db->get(TABLE_PRODUCTS, $_GET['id']);
$product = new Product($product_db);
if (!empty($this->sets['mod_hide_text']) && empty($_SESSION['user']) && $this->check_reg_cat($product->get('cat_id'))) {
    $path = $this->get_path($product->get('cat_id'));
    $path = $path . ' » <span class="curr_page">' . htmlspecialchars($product->get('title')) . '</span>';
    $content = array('html' => 'Для просмотра раздела необходимо <a href="' . SITE_URL . 'reg/registr">зарегистрироваться</a>', 'meta_title' => $product->paramNotEmpty('metatitle') ? $product->get('metatitle') : '', 'meta_keys' => $product->paramNotEmpty('metakeys') ? $product->get('metakeys') : '', 'meta_desc' => $product->paramNotEmpty('metadesc') ? $product->get('metadesc') : '', 'path' => $path);
} else {
    $cat_inf = $this->cat($product->get('cat_id'));
    if ($product->paramNotEmpty('vlink') && $product->get('vlink') != Site::gI()->rel_url) {
        header("HTTP/1.1 301 Moved Permanently");
        $this->redirect($product->get('vlink'));
        exit;
    }
    $this->update_all();
    if ($_GET['id'] < 0 || !is_numeric($_GET['id']) || count($product) == 0 || empty($product_db) || in_array($product->get('cat_id'), $this->disabled) || $product->get('enabled') == 0) {
        $product = $this->_404();
    } else {
        if (isset($_POST['captcha'])) {
            if (isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] != $_POST['captcha']) {
                $this->redirect(SITE_URL . "ishop/product/" . $_GET['id'] . "?captcha=error");
            }
        }
        $this->get_menu($product->get('cat_id'), $this->getMenuRows());