Exemplo n.º 1
0
    public function hookDisplayTop($params)
    {
        $this->context->controller->addJS($this->_path . 'views/js/egmarketing.js', 'all');
        if (egmarketing::isMarketingSite() > 0) {
            $this->context->controller->addCSS($this->_path . 'views/css/messager.css', 'all');
            $this->context->controller->addCSS($this->_path . 'views/css/sbm.css', 'all');
        }
        if (egmarketing::isMarketingSite() > 0) {
            $context = Context::getContext();
            $id_shop = $context->shop->id;
            $sql = 'select i.*
				from `' . _DB_PREFIX_ . 'eginvate` i
				where i.id_shop=' . (int) $id_shop . '
				and i.deleted = 0
				and \'' . $_SERVER['REQUEST_URI'] . '\' like rules';
            if (Tools::getValue('id_product', false) !== false) {
                $sql .= ' and i.id_product=' . Tools::getValue('id_product');
            }
            if (Tools::getValue('id_category', false) !== false) {
                $sql .= ' and i.id_category=' . Tools::getValue('id_category');
            }
            if (!($link = Db::getInstance()->executeS($sql))) {
                return "";
            }
            $row = $link[0];
            if (1 == 1 && !$this->context->cookie->__isset($row['id_eginvate'])) {
                $this->context->cookie->__set($row['id_eginvate'], 'shown');
                $ceo_word = Meta::getCitysAddr();
                $this->smarty->assign(array('mname' => $row['mname'], 'mtiz' => $row['mtiz'], 'message' => Meta::sprintf2($row['message'], $ceo_word), 'message2' => Meta::sprintf2($row['message2'], $ceo_word), 'delay' => $row['delay'], 'oimg' => $this->_path . 'views/img/' . $row['mphoto']));
                return $this->display(__FILE__, 'displaytop.tpl');
            }
        }
    }
Exemplo n.º 2
0
 public function replaceCeoContact($page)
 {
     $ceo_word = Meta::getCitysAddr();
     $host = array('host' => $this->host);
     list($x1, $x2) = array_reverse(explode('.', $this->host));
     $xdomain = $x2 . '.' . $x1;
     $ceo_word = array_merge($ceo_word, $host, array('ehost' => $xdomain));
     return Meta::sprintf2($page, $ceo_word);
 }