Example #1
0
 public function rewrite($link)
 {
     $seo = new SEO($this->registry);
     if ($this->config->get('config_seo_url')) {
         $url_data = parse_url(str_replace('&', '&', $link));
         $url = '';
         $data = array();
         if (isset($url_data['query'])) {
             parse_str($url_data['query'], $data);
         }
         foreach ($data as $key => $value) {
             if (isset($data['route'])) {
                 $url .= $seo->rewrite($data['route']);
                 if ($data['route'] == 'product/product' && $key == 'product_id' || ($data['route'] == 'product/manufacturer/product' || $data['route'] == 'product/product') && $key == 'manufacturer_id' || $data['route'] == 'information/information' && $key == 'information_id') {
                     $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int) $value) . "'");
                     if ($query->num_rows) {
                         $url .= '/' . $query->row['keyword'];
                         unset($data[$key]);
                     }
                 } elseif ($key == 'path') {
                     $categories = explode('_', $value);
                     foreach ($categories as $category) {
                         $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = 'category_id=" . (int) $category . "'");
                         if ($query->num_rows) {
                             $url .= '/' . $query->row['keyword'];
                         }
                     }
                     unset($data[$key]);
                 }
             }
         }
         if ($url) {
             unset($data['route']);
             $query = '';
             if ($data) {
                 foreach ($data as $key => $value) {
                     $query .= '&' . $key . '=' . $value;
                 }
                 if ($query) {
                     $query = '?' . trim($query, '&');
                 }
             }
             $this->log->write('url = ' . $url_data['path'] . ' ' . $url . ' ' . $query . '  | ');
             return strtolower($url_data['scheme'] . '://' . $url_data['host'] . (isset($url_data['port']) ? ':' . $url_data['port'] : '') . str_replace('/index.php', '', $url_data['path']) . $url . $query);
         } else {
             // rewrite URL base rule
             return $seo->rewrite_base_rule($link);
             // end
         }
     } else {
         // rewrite URL base rule
         return $seo->rewrite_base_rule($link);
         // end
     }
 }
Example #2
0
 private static function form($m_id = false)
 {
     if (!empty($m_id)) {
         CRUD::dataFetch('member', array('id' => $m_id));
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "gender":
                     $field = $field . '_CK' . $var;
                     $var = 'selected';
                     break;
             }
             $output['VALUE_' . strtoupper($field)] = $var;
         }
     }
     $output['VALUE_SUBJECT_OPTION'] = self::subjectOption($row['subject']);
     VIEW::assignGlobal($output);
     CRUD::args_output(true, true);
     SEO::load('contact');
     if (empty(SEO::$data["h1"])) {
         SEO::$data["h1"] = CORE::$lang["contact"];
     }
     SEO::output();
     CRUMBS::fetch('contact');
 }
Example #3
0
 function __construct()
 {
     list($args) = CORE::$args;
     self::$m_id = SESS::get('m_id');
     self::$temp = CORE::$temp_main;
     CRUMBS::fetch('feedback');
     SEO::load('feedback');
     if (empty(SEO::$data["h1"])) {
         SEO::$data["h1"] = CORE::$lang['feedback'];
     }
     SEO::output();
     switch ($args) {
         case "thankyou":
             new RESPONSE('feedback', CORE::$lang['feedbackThanks']);
             break;
         case "list":
             # 顯示反饋
             self::$temp["MAIN"] = 'ogs-feedback-list-tpl.html';
             self::row();
             break;
         case "add":
             # 執行增加反饋
             self::$temp["MAIN"] = CORE::$temp_option["MSG"];
             self::add();
             break;
         default:
             self::$temp["MAIN"] = 'ogs-feedback-tpl.html';
             break;
     }
     CORE::common_resource();
     new VIEW(CORE::$temp_option["HULL"], self::$temp, false, false);
 }
Example #4
0
 public static function notFound()
 {
     CORE::common_resource();
     SEO::load('nofound');
     SEO::output();
     VIEW::assignGlobal('SEO_H1', empty(SEO::$data['h1']) ? '404 not found' : SEO::$data['h1']);
     $temp = CORE::$temp_main;
     $temp["MAIN"] = 'ogs-fn-404-tpl.html';
     new VIEW(CORE::$temp_option["HULL"], $temp, false, false);
 }
Example #5
0
 private static function intro()
 {
     self::$rsnum[] = $rsnum = CRUD::dataFetch('intro', array('langtag' => CORE::$langtag, 'status' => '1', 'custom' => "(subject like '%" . self::$kw . "%' or content like '%" . self::$kw . "%')"));
     if (!empty($rsnum)) {
         $dataRow = CRUD::$data;
         foreach ($dataRow as $key => $row) {
             VIEW::newBlock("TAG_SEARCH_LIST");
             VIEW::assign(array("VALUE_SUBJECT" => $row["subject"], "VALUE_CONTENT" => mb_substr(strip_tags($row["content"]), 0, 50, 'UTF-8'), "VALUE_LINK" => CORE::$root . 'intro/' . SEO::link($row) . '/'));
         }
     }
 }
Example #6
0
 private static function nav()
 {
     VIEW::assignGlobal("NAV_CATE_TITLE", 'ABOUT');
     $rsnum = CRUD::dataFetch('intro', array('status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"]));
     if (!empty($rsnum)) {
         $dataRow = CRUD::$data;
         foreach ($dataRow as $key => $row) {
             VIEW::newBlock("TAG_NAV_LIST");
             VIEW::assign(array("VALUE_NAV_SUBJECT" => $row["subject"], "VALUE_NAV_LINK" => CORE::$root . 'intro/' . SEO::link($row) . '/', "VALUE_NAV_CURRENT" => empty(self::$id) && ++$i == 1 || self::$id == $row["id"] ? 'active' : ''));
         }
     }
 }
Example #7
0
 public static function modify(array $args)
 {
     if (!empty($args["filename"])) {
         $args["filename"] = self::filename_check($args["id"], $args["filename"]);
     }
     CRUD::dataUpdate('seo', $args);
     if (!empty(DB::$error)) {
         self::$error = DB::$error;
         return false;
     } else {
         return true;
     }
 }
Example #8
0
 public static function nav()
 {
     list($cate) = CORE::$args;
     VIEW::assignGlobal("NAV_CATE_TITLE", 'PRODUCTS CATE');
     $rsnum = CRUD::dataFetch('products_cate', array('status' => '1', 'parent' => 'null', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"]));
     if (!empty($rsnum)) {
         $dataRow = CRUD::$data;
         foreach ($dataRow as $key => $row) {
             VIEW::newBlock("TAG_NAV_LIST");
             VIEW::assign(array("VALUE_NAV_SUBJECT" => $row["subject"], "VALUE_NAV_LINK" => CORE::$root . 'products/' . SEO::link($row) . '/', "VALUE_NAV_CURRENT" => $cate == $row["id"] ? 'current' : ''));
         }
     }
 }
Example #9
0
 public static function dataLink($parent, $data = false)
 {
     $rsnum = CRUD::dataFetch('news_cate', array('id' => $parent));
     if (!empty($rsnum)) {
         list($cate) = CRUD::$data;
         $parentLink = SEO::link($cate);
     }
     if (!$data) {
         return CORE::$root . "news/{$parentLink}/";
     } else {
         $link = SEO::link($data);
         return CORE::$root . "news/{$parentLink}/{$link}/";
     }
 }
Example #10
0
File: List.php Project: andygoo/cms
 public function __construct(Request $request)
 {
     parent::__construct($request);
     $this->params = $this->request->param();
     //$this->params = $_GET;
     $this->params = array_filter($this->params, 'strlen');
     $this->all_brand_pinyin = SEO::getBrandPinyin();
     $this->all_series_pinyin = SEO::getSeriesPinyin();
     if (!empty($this->params['brand_pinyin'])) {
         $all_brand_pinyin = array_flip($this->all_brand_pinyin);
         if (isset($all_brand_pinyin[$this->params['brand_pinyin']])) {
             $this->params['brand_id'] = $all_brand_pinyin[$this->params['brand_pinyin']];
         }
     }
     if (!empty($this->params['series_pinyin'])) {
         $all_series_pinyin = array_flip($this->all_series_pinyin);
         if (isset($all_series_pinyin[$this->params['series_pinyin']])) {
             $this->params['series_id'] = $all_series_pinyin[$this->params['series_pinyin']];
         }
     }
     $allowed = array('city_pinyin', 'brand_id', 'series_id', 'brand_pinyin', 'series_pinyin', 'price_f', 'price_t', 'mile', 'mile_f', 'mile_t', 'year_f', 'year_t', 'sort_f', 'sort_d', 'format');
     $this->_filter_array = array_intersect_key($this->params, array_flip($allowed));
 }
<?php

SEO::setTitle('Be right back');
?>

@extends('layouts.errors')
@section('content')
<h1>Be right back</h1>
@endsection
Example #12
0
 public static function getBodyMetaTags()
 {
     if (empty(self::$loaded)) {
         self::$loaded = self::getContentData();
     }
     if (empty(self::$loaded) || isset(self::$loaded["data"]) == false || isset(self::$loaded["type"]) == false || (self::$loaded["type"] == "software" || self::$loaded["type"] == "vappliance") === false) {
         return "";
     }
     $data = SEO::$loaded["data"];
     $meta = SEO::$loaded["meta"];
     $link = SEO::$loaded["link"];
     $res = '<noscript>';
     $res .= '<style>.noscript.softwareentry {display: block;width: 1000px;}.noscript.softwareentry .field {display: block;padding-bottom: 0.5em;padding-left: 10em;width: auto;text-align:left;}';
     $res .= '.noscript.softwareentry .field .fieldtype {color: #444444;display: inline-block;font-weight: bold;min-width: 90px;vertical-align: top;width: 90px;}';
     $res .= '.noscript.softwareentry .field .fieldvalue {display: inline-block;max-width: 780px;text-align:left;}.noscript.softwareentry .field.image {height: 100px;left: -110px;position: absolute;top: 0;width: 100px;.height: 100px;border:none;}';
     $res .= '</style>';
     $res .= '<div class="noscript softwareentry" itemscope itemtype="https://schema.org/SoftwareApplication">';
     $res .= '<div class="field name"><span class="fieldtype">Name:</span><span class="fieldvalue" itemprop="name">' . htmlentities($data->name, ENT_QUOTES, "UTF-8") . '</span></div>';
     $res .= '<div class="field description"><span class="fieldtype">Description:</span><span class="fieldvalue" itemprop="description">' . $meta["description"] . '</span></div>';
     $res .= '<div class="field abstract"><span class="fieldtype">Abstract:</span><span class="fieldvalue" itemprop="text">' . htmlentities($data->abstract, ENT_QUOTES, "UTF-8") . '</span></div>';
     $res .= '<img class="field image" alt="' . htmlentities($data->name, ENT_QUOTES, "UTF-8") . ' logo" src="https://' . $_SERVER["SERVER_NAME"] . '/apps/getlogo?id=' . $data->id . '" width="100px" itemprop="image thumbnailUrl" />';
     $res .= '<div class="field canonical"><span class="fieldtype">Url:</span><span class="fieldvalue"><a href="' . $link["canonical"] . '" itemprop="url" >' . $link["canonical"] . '</a></span></div>';
     if ($data->dateAdded) {
         $res .= '<div class="field datecreated"><span class="fieldtype">Created:</span><span class="fieldvalue" itemprop="dateCreated">' . date('Y-m-d', strtotime($data->dateAdded)) . '</span></div>';
     }
     if ($data->lastUpdated) {
         $res .= '<div class="field lastupdated"><span class="fieldtype">Last updated:</span><span class="fieldvalue" itemprop="dateModified">' . date('Y-m-d', strtotime($data->lastUpdated)) . '</span></div>';
     }
     if ($data->rating) {
         $res .= '<div itemscope itemprop="aggregateRating" itemtype="https://schema.org/AggregateRating">';
         $res .= '<meta itemprop="bestRating" content="5">';
         $res .= '<meta itemprop="worstRating" content="0">';
         $res .= '<div class="field ratingvotes">';
         $res .= '<span class="fieldtype">Rating votes:</span>';
         $res .= '<span class="fieldvalue"><span itemprop="ratingCount">' . $data->getRatingcount() . '</span></span>';
         $res .= '</div>';
         $res .= '<div class="field rating">';
         $res .= '<span class="fieldtype">Rating score:</span>';
         $res .= '<span class="fieldvalue"><span itemprop="ratingValue">' . $data->getRating() . '</span><span> / 5 </span></span>';
         $res .= '</div></div>';
     }
     $res .= '</div>';
     $res .= '</noscript>';
     return $res;
 }
Example #13
0
<?php

include '../../config.php';
include ROOT . 'model/SEO.php';
$SEO = new SEO();
$SEO->setTitle('Telefones Úteis em Mogi das Cruzes');
include ROOT . 'view/pagina/telefones-uteis.php';
Example #14
0
 /**
  * Test setting and returning the pagination object
  */
 public function testPagination()
 {
     SEO::init();
     $obj = SEO::setPagination(100);
     $this->assertInstanceOf('SEOPagination', $obj);
 }
Example #15
0
//Initialize sessions
$GLOBALS['session'] = Session::getInstance();
//Initialize Smarty
$GLOBALS['smarty'] = new Smarty();
$GLOBALS['smarty']->muteExpectedErrors();
$GLOBALS['smarty']->error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING;
$GLOBALS['smarty']->compile_dir = CC_SKIN_CACHE_DIR;
$GLOBALS['smarty']->config_dir = CC_SKIN_CACHE_DIR;
$GLOBALS['smarty']->cache_dir = CC_SKIN_CACHE_DIR;
$GLOBALS['smarty']->debugging = false;
//Initialize language
$GLOBALS['language'] = Language::getInstance();
//Initialize hooks
$GLOBALS['hooks'] = HookLoader::getInstance();
//Initialize SEO
$GLOBALS['seo'] = SEO::getInstance();
if (isset($_GET['seo_path']) && !empty($_GET['seo_path'])) {
    $_GET['seo_path'] = preg_replace('/(\\/\\~[a-z0-9]{1,}\\/)/', '', $_GET['seo_path']);
    // Remove /~username/ from seo_path
    $GLOBALS['seo']->getItem($_GET['seo_path']);
}
//Initialize SSL
$GLOBALS['ssl'] = SSL::getInstance();
//Initialize GUI
$GLOBALS['gui'] = GUI::getInstance();
//Initialize Taxes
$GLOBALS['tax'] = Tax::getInstance();
//Initialize catalogue
$GLOBALS['catalogue'] = Catalogue::getInstance();
//Initialize cubecart
$GLOBALS['cubecart'] = Cubecart::getInstance();
Example #16
0
 private static function cate_detail($id)
 {
     $rsnum = CRUD::dataFetch('faq_cate', array('id' => $id));
     if (!empty($rsnum)) {
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "status":
                     VIEW::assignGlobal("VALUE_" . strtoupper($field) . "_CK" . $var, 'selected');
                     break;
                 default:
                     VIEW::assignGlobal("VALUE_" . strtoupper($field), $var);
                     break;
             }
         }
         $last_page = SESS::get("PAGE");
         if (!empty($last_page)) {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "faq/cate/page-{$last_page}/");
         } else {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "faq/cate/");
         }
         SEO::load($row["seo_id"]);
         SEO::output();
         parent::$langID = $row['lang_id'];
     } else {
         self::$temp["MAIN"] = self::$temp_option["MSG"];
         CORE::msg(self::$lang["no_args"], CORE::$manage . 'faq/cate/');
     }
 }
Example #17
0
 private static function detail($id)
 {
     $rsnum = CRUD::dataFetch('ad', array('id' => $id));
     if (!empty($rsnum)) {
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "cateID":
                     VIEW::assignGlobal("VALUE_" . strtoupper($field) . "_OPTION", AD::cateSelect($var));
                     break;
                 case "status":
                     VIEW::assignGlobal("VALUE_" . strtoupper($field) . "_CK" . $var, 'selected');
                     break;
                 default:
                     VIEW::assignGlobal("VALUE_" . strtoupper($field), $var);
                     break;
             }
         }
         IMAGES::output('ad', $row["id"]);
         SEO::load($row["seo_id"]);
         SEO::output();
         $last_page = SESS::get("PAGE");
         if (!empty($last_page)) {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "ad/page-{$last_page}/");
         } else {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "ad/");
         }
     } else {
         self::$temp["MAIN"] = self::$temp_option["MSG"];
         CORE::msg(self::$lang["no_args"], CORE::$manage . 'ad/');
     }
 }
Example #18
0
namespace DF56;

?>
<footer class="footer row">
    <div class="col-xs-12">
        <div class="row">
            <div class="col-lg-3 col-sm-4">
                <div><strong><span class="brand-name">Depan'Fermetures 56</span></strong></div>
                <div><a href="/contact">Nous contacter</a></div>
            </div>
            <div class="col-lg-3 col-sm-4">
                <div>Du lundi au vendredi</div>
                <div>8h30 - 12h00</div>
                <div>13h30 - 18h00</div>
            </div>
            <div class="col-lg-3 col-sm-4">
                <div><span class="icon icon-home"></span>Penhoët 56440 LANGUIDIC</div>
                <div><a href="tel:+33684873816"><span class="icon2 icon2-mobile"></span>06 84 87 38 16</a></div>
                <div><a href="tel:+33966838564"><span class="icon icon-phone"></span>09 66 83 85 64</a></div>
                <div><a href="mailto:contact@depanfermetures56.fr"><span class="icon icon-envelope"></span>contact@depanfermetures56.fr</a></div>
            </div>
            <div class="col-lg-3 col-sm-12 text-right">
                <a href="/mentions-legales">Mentions légales</a>   
            </div>
        </div>
<?php 
SEO::draw_footer_links_html();
?>
    </div>
</footer><?php 
Example #19
0
 private static function detail($id)
 {
     $rsnum = CRUD::dataFetch('gallery', array('id' => $id));
     if (!empty($rsnum)) {
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "related":
                     GALLERY::related($var);
                     break;
                 case "parent":
                     $field = $field . '_OPTION';
                     $var = self::cate_select($var);
                     break;
                 case "status":
                     $field = $field . '_ck' . $var;
                     $var = 'selected';
                     break;
             }
             $output["VALUE_" . strtoupper($field)] = $var;
         }
         VIEW::assignGlobal($output);
         IMAGES::output('gallery', $row["id"]);
         foreach (IMAGES::$data as $images) {
             VIEW::newBlock('TAG_IMAGES_LIST');
             foreach ($images as $field => $var) {
                 $images['IMAGES_' . strtoupper($field)] = $var;
             }
             VIEW::assign($images);
         }
         SEO::load($row["seo_id"]);
         SEO::output();
         $last_page = SESS::get("PAGE");
         if (!empty($last_page)) {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "gallery/page-{$last_page}/");
         } else {
             VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "gallery/");
         }
         parent::$langID = $row['lang_id'];
     } else {
         self::$temp["MAIN"] = self::$temp_option["MSG"];
         CORE::msg(self::$lang["no_args"], CORE::$manage . 'gallery/');
     }
 }
Example #20
0
/**
 * Sanitize SEO allowed path (Depreciated since 6.0.7)
 * Use static function SEO::sanitizeSEOPath instead
 *
 * @return string
 */
function sanitizeSEOPath($url)
{
    if (method_exists('SEO', 'sanitizeSEOPath')) {
        return SEO::sanitizeSEOPath($seo_path['path']);
    }
    $url = preg_replace("/\\.\\w{2,4}\$/", '', $url);
    ## Remove extention
    $url = trim($url);
    $url = str_replace(' ', '-', html_entity_decode($url, ENT_QUOTES));
    $url = preg_replace('#[^\\w\\-_/]#iuU', '-', str_replace('/', '/', $url));
    return preg_replace(array('#/{2,}#iu', '#-{2,}#'), array('/', '-'), $url);
}
Example #21
0
 private static function detail($id)
 {
     $rsnum = CRUD::dataFetch('products', array('id' => $id));
     if (!empty($rsnum)) {
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "related":
                     PRODUCTS::related($var);
                     break;
                 case "parent":
                     VIEW::assignGlobal("VALUE_" . strtoupper($field) . "_OPTION", self::cate_select($var));
                     break;
                 case "status":
                     VIEW::assignGlobal("VALUE_" . strtoupper($field) . "_CK" . $var, 'selected');
                     break;
                 default:
                     VIEW::assignGlobal("VALUE_" . strtoupper($field), $var);
                     break;
             }
         }
         IMAGES::output('products', $row["id"]);
         SEO::load($row["seo_id"]);
         SEO::output();
         $page_args = SESS::get("PAGE");
         $sk_args = SESS::get('SK');
         if (!empty($page_args)) {
             $page = "page-{$page_args}/";
         }
         if (!empty($sk_args)) {
             $sk = "{$sk_args}/";
         }
         VIEW::assignGlobal("VALUE_BACK_LINK", CORE::$manage . "products/{$sk}{$page}");
         parent::$langID = $row['lang_id'];
     } else {
         self::$temp["MAIN"] = self::$temp_option["MSG"];
         CORE::msg(self::$lang["no_args"], CORE::$manage . 'products/');
     }
 }
Example #22
0
 public function generateAll()
 {
     $seo = new SEO($this->registry);
     $seo->generateSEOURL();
 }
Example #23
0
                     }
                     $product_record['cat_id'] = $primary_category;
                 }
                 if (is_array($images)) {
                     $primary = 1;
                     foreach ($images as $file_id) {
                         $image_record = array('product_id' => $product_id, 'file_id' => $file_id, 'main_img' => $primary);
                         $GLOBALS['db']->insert('CubeCart_image_index', $image_record);
                         $primary = 0;
                     }
                 }
                 // Insert SEO custom URL
                 if (empty($product_record['seo_path'])) {
                     $product_record['seo_path'] = $GLOBALS['seo']->generatePath($product_id, 'prod');
                 }
                 $GLOBALS['db']->insert('CubeCart_seo_urls', array('path' => SEO::sanitizeSEOPath($product_record['seo_path']), 'item_id' => $product_id, 'type' => 'prod'));
             }
             unset($product_record, $category_record, $image_record, $image, $images);
         }
         fclose($fp);
     }
     unlink($this_import);
 }
 $next_cycle = $cycle + 1;
 if (file_exists(sprintf($import_source, $next_cycle))) {
     $data = array('next_cycle' => $next_cycle, 'total' => $has_header ? $GLOBALS['session']->get('columns', 'import') - 1 : $GLOBALS['session']->get('columns', 'import'), 'imported' => $cycle * $splitSize);
     $GLOBALS['smarty']->assign('DATA', $data);
     $page_content = $GLOBALS['smarty']->fetch('templates/products.importing.php');
 } else {
     $GLOBALS['main']->setACPNotify($lang['catalogue']['notify_import_complete']);
     $GLOBALS['session']->delete('', 'import');
Example #24
0
/**
 * Get the current page url
 *
 * @param array $excluded
 * @param array $included
 * @param bool $remove_excluded
 * @return string
 */
function currentPage($excluded = null, $included = null, $remove_excluded = true)
{
    static $base = null;
    if (is_null($base)) {
        $php_self = htmlentities($_SERVER['PHP_SELF']);
        // fixes XSS
        if (isset($GLOBALS['storeURL'], $GLOBALS['rootRel'])) {
            $base = $GLOBALS['storeURL'] . str_replace($GLOBALS['rootRel'], '/', $php_self);
        } else {
            $base = null;
        }
    }
    $currentPage = $base;
    // If there are GET variables, strip redir and rebuild query string
    if (!empty($_GET)) {
        $array = is_array($included) && !empty($included) ? array_merge($_GET, $included) : $_GET;
        $one_time = array('added', 'completed', 'deleted', 'edited', 'failed', 'removed', 'subscribed', 'submitted', 'unsubscribed', 'updated', session_name());
        if ($excluded === true) {
            // Drop *all* $_GET vars, except $protected
            $protected = array('_a');
            $excluded = array();
            foreach ($array as $key => $val) {
                if (!in_array($key, $protected)) {
                    $excluded[] = $key;
                }
            }
        } else {
            $excluded = is_array($excluded) && !empty($excluded) ? $excluded : array();
        }
        // Delete unwanted keys
        if (!empty($array)) {
            foreach ($excluded as $key) {
                if (isset($array[$key])) {
                    unset($array[$key]);
                    if (!CC_IN_ADMIN && $remove_excluded) {
                        unset($_GET[$key]);
                        // fix for other areas that want exclusion
                    }
                }
            }
            array_walk_recursive($array, 'custom_urlencode', $one_time);
            if (isset($array) && is_array($array)) {
                $currentPage .= '?' . http_build_query($array, '', '&');
            }
        }
    }
    if (!isset($GLOBALS['seo']) || !is_object($GLOBALS['seo'])) {
        return $currentPage;
    }
    // $_GET['seo_path'] should never be set... but if it is this will fix it
    if (isset($_GET['seo_path']) && !empty($_GET['seo_path'])) {
        $currentPage = SEO::getInstance()->getItem($_GET['seo_path'], true);
    }
    return SEO::getInstance()->SEOable($currentPage);
}
Example #25
0
 /**
  * Set a DB path
  *
  * @param string $type
  * @param int $item_id
  * @param string $path
  * @param bool $bool
  * @param bool $show_error
  * @return bool/string
  */
 public function setdbPath($type, $item_id, $path, $bool = true, $show_error = true)
 {
     if (in_array($type, array_merge($this->_dynamic_sections, $this->_static_sections))) {
         $custom = 1;
         // if path is empty or already taken generate one
         if (empty($path) || $GLOBALS['db']->count('CubeCart_seo_urls', 'id', "`path` = '{$path}' AND `type` = '{$type}' AND `item_id` <> {$item_id}") > 0) {
             // send warning if in use
             if (!empty($path)) {
                 if ($show_error) {
                     $GLOBALS['gui']->setError($GLOBALS['language']->settings['seo_path_taken'], true);
                 }
             }
             // try to generate
             $path = $this->generatePath($item_id, $type);
             $custom = 0;
         }
         $path = SEO::_safeUrl($path);
         if (empty($path)) {
             return $bool ? false : '';
         }
         if (($existing = $GLOBALS['db']->select('CubeCart_seo_urls', 'id', array('type' => $type, 'item_id' => $item_id))) !== false) {
             $GLOBALS['db']->update('CubeCart_seo_urls', array('type' => $type, 'item_id' => $item_id, 'path' => $path, 'custom' => $custom), array('id' => $existing[0]['id']));
         } else {
             //Check for dup path
             if (!$GLOBALS['db']->select('CubeCart_seo_urls', false, array('path' => $path))) {
                 $GLOBALS['db']->insert('CubeCart_seo_urls', array('type' => $type, 'item_id' => $item_id, 'path' => $path, 'custom' => $custom));
             } else {
                 // Force unique path is it's already taken
                 $unique_id = substr($type, 0, 1) . $item_id;
                 $GLOBALS['db']->insert('CubeCart_seo_urls', array('type' => $type, 'item_id' => $item_id, 'path' => $path . '-' . $unique_id, 'custom' => $custom));
                 $GLOBALS['gui']->setError($GLOBALS['language']->settings['seo_path_taken'], true);
             }
         }
         return $bool ? true : $path;
     } else {
         trigger_error('Invalid SEO path type ' . $type . '.', E_USER_NOTICE);
         return false;
     }
 }
Example #26
0
 public static function dataUpdate($tb_name, array $args, $seo = false, $images = false, $primary = false)
 {
     $new_args = self::match_field($tb_name, $args);
     CHECK::is_array_exist($new_args);
     if (CHECK::is_pass()) {
         $new_args = array_reverse($new_args);
         DB::update(CORE::$prefix . "_" . $tb_name, self::content_handle($new_args), $primary);
         # 自動排序
         if ($new_args["sort"]) {
             SORT::auto($tb_name, CORE::$langtag, $new_args["id"], $new_args["sort"]);
         }
         # 圖片處理
         if (is_array($args["images"]) && $images) {
             IMAGES::modify($args["images"], $tb_name, $new_args["id"]);
         }
         if ($seo) {
             $args["id"] = $args["seo_id"];
             SEO::modify($args);
         }
     } else {
         return false;
     }
 }
Example #27
0
} elseif (isset($_POST['price'])) {
    $GLOBALS['main']->setACPWarning($lang['common']['error_no_change']);
}
$GLOBALS['main']->addTabControl($lang['catalogue']['title_product_list'], null, currentPage(array('node')));
$GLOBALS['main']->addTabControl($lang['catalogue']['product_add'], null, currentPage(array('node'), array('action' => 'add')));
$GLOBALS['main']->addTabControl($lang['catalogue']['title_category_assign_to'], 'assign');
$GLOBALS['main']->addTabControl($lang['catalogue']['title_option_set_assign'], null, currentPage(null, array('node' => 'optionsets')));
$GLOBALS['gui']->addBreadcrumb($lang['catalogue']['title_category_assigned'], currentPage());
## Product list
if (($products = $GLOBALS['db']->select('CubeCart_inventory', array('product_id', 'name', 'product_code'), false, array('name' => 'ASC'))) !== false) {
    $GLOBALS['smarty']->assign('PRODUCTS', $products);
}
## Category list
if (($category_array = $GLOBALS['db']->select('CubeCart_category', array('cat_name', 'cat_parent_id', 'cat_id'))) !== false) {
    $cat_list[] = '/';
    $seo = SEO::getInstance();
    foreach ($category_array as $category) {
        if ($category['cat_id'] == $category['cat_parent_id']) {
            continue;
        }
        $cat_list[$category['cat_id']] = '/' . $seo->getDirectory($category['cat_id'], false, '/', false, false);
    }
    natcasesort($cat_list);
    foreach ($cat_list as $cat_id => $cat_name) {
        if (empty($cat_name)) {
            continue;
        }
        $data = array('id' => $cat_id, 'name' => $cat_name, 'selected' => isset($cats_selected) && in_array($cat_id, $cats_selected) ? ' checked="checked"' : '');
        $smarty_data['categories'][] = $data;
    }
    $GLOBALS['smarty']->assign('CATEGORIES', $smarty_data['categories']);
Example #28
0
    $comobj = new Common();
}
//echo $DEFAULT_LANGUAGE;exit;
if (!isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG']) || $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG'] == "") {
    $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG'] = $DEFAULT_LANGUAGE;
}
//define here lang for mysql quieres
define("LANG", $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG']);
//include language file
includeLang($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG']);
//print_r($_SESSION['SESS_'.PRJ_CONST_PREFIX.'_LANG']);exit;
//include seo file
$SEOID = "";
$PageType = "";
require_once SITE_CLASS_GEN . "class.seo.php";
$seoobj = new SEO($prefix, $scr, $SEOID, $PageType);
$seoArr = $seoobj->getmetaarray();
//assign the file names which won't include the total index page
// pr($_GET); exit;
$notincludeindex = array("m-changepass", "or-aj_organizationlist", "u-aj_organizationuserlist", "u-aj_grouplist", "or-aj_getSellerOrgAsso", "or-aj_associationlist", "or-aj_verifyorganizationlist", "or-aj_verifyassociationlist", "u-aj_getOrganizationUserStatus", "u-aj_verifyorganizationuserlist", "u-aj_verifygrouplist", "or-aj_verifyorgpreflist", "m-aj_loginlist", "m-aj_inbox", "or-aj_orgoverview", "or-aj_orgprfoverview", "or-aj_assocoverview", "u-aj_groupoverview", "u-aj_useroverview", "u-aj_invoicelist", "u-aj_invacptlist", "u-aj_polist", "u-aj_poacptlist", "or-orgprefviewhistory", "or-orgviewhistory", "or-asocviewhistory", "u-orguserviewhistory", "u-groupviewhistory", "u-urightsviewhistory", "u-poviewhistory", "u-invoiceviewhistory", "u-changesecans", "u-aj_getInvPoItem", "m-aj_getCombo", "u-aj_verifyrights", "u-aj_listrights", "m-aj_chkpage", "c-closepage", "or-aj_b2bprdtassoclist", "or-aj_b2bprdtascprv", "or-b2bprdthistory", "or-aj_b2bprdtassoclist_a", "or-aj_b2bprdtassovlist", "or-aj_b2sprdtassoclist", "or-b2sprdthistory", "or-aj_b2sprdtassoclist_a", "or-aj_b2sprdtassocvlist", "or-aj_b2buyerasoclist", "or-aj_b2buyerasocvlist", "or-b2buyerhistory", "or-aj_b2supplierasoclist", "or-aj_b2supplierasocvlist", "or-b2supplierhistory", "or-aj_b2bprdtbassoclist", "or-aj_b2bprdtbassovlist", "or-b2bprdtbhistory", "or-aj_b2sprdtsassoclist", "or-aj_b2sprdtsassovlist", "or-b2sprdtshistory", "or-aj_getb2bpdtlsfa", "u-aj_rfq2list", "u-aj_rfq2vlist", "u-aj_rfq2rlist", "u-rfq2viewhistory", "u-aj_b2rfq2list", "u-aj_getrfq2details", "u-viewrfq2bidhistory", "u-aj_b2rfq2bidlist", "u-aj_b2rfq2bidvlist", "u-aj_b2rfq2bidrlist", "u-aj_rfq2bidlist", "u-aj_addwatchlist", "u-aj_b2rfq2watchlist", "u-aj_removewatchlist", "u-aj_rfq2awardlist", "u-aj_b2rfq2awardlist", "u-viewrfq2awardhistory", "u-viewb2rfq2awardhistory", "m-inetreports");
if (isset($_GET['msg']) && $_GET['msg'] == 'pop') {
    $notincludeindex = array_merge($notincludeindex, array($_GET['file']));
}
//,"or-createorganization","sm-smdashboard","m-inbox"
//prints($notincludeindex); exit;
//echo $file;
$notUserLeft = array("c-home", "c-aboutus", "c-contactus", "c-privacypolicy", 'c-404error', 'c-closepage');
$notUserTop = array("c-home", "c-aboutus", "c-contactus", "c-privacypolicy", 'c-404error', 'c-closepage');
$bodyarr = array();
// if(!in_array($scr, $notincludeindex)) {
include_once SPATH_ROOT . "/section/content/common.php";
Example #29
0
<?php

include '../../config.php';
include ROOT . 'model/Usuario.php';
include ROOT . 'model/SEO.php';
$usuario_cdg = isset($_GET['u']) ? $_GET['u'] : -1;
$usuario_cdg = $usuario_cdg == -1 ? $_SESSION['USUARIO_CDG'] : $usuario_cdg;
$Usuario = new Usuario($usuario_cdg);
$SEO = new SEO();
$SEO->setTitle('Perfil - ' . $Usuario->getNome());
include ROOT . 'view/cadastro/perfil.php';
Example #30
0
<?php

include '../../config.php';
include ROOT . 'model/SEO.php';
$SEO = new SEO();
$SEO->setTitle('Cadastre-se - Diretório Mogi ');
$status = isset($_GET['s']) ? $_GET['s'] : -1;
include ROOT . 'view/login/login.php';