/**
 * Smarty {seo_rewrite module=""} function plugin
 *
 * Type:     function
 * Name:     SEO REWRITE METAS
 * Date:     JUNY 29, 2011
 * Update 		25/07/2011
 * Purpose:  
 * Examples: {seo_rewrite config_param=['level'=>'3','idmetas'=>'1','default'=>''] category="" subcategory="" record=""}
 * Output:   
 * @link 
 * @author   Gerits Aurelien
 * @version  1.1
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_seo_rewrite($params, $template)
{
    if (!isset($params['config_param'])) {
        trigger_error("config_param: missing 'config_param' parameter");
        return;
    }
    if (is_array($params['config_param'])) {
        $tabs = $params['config_param'];
    }
    $record = $params['record'];
    $category = $params['category'];
    $subcategory = $params['subcategory'];
    if (isset($_GET['magixmod'])) {
        $magixmod = magixcjquery_filter_var::clean($_GET['magixmod']);
    }
    $filename = substr($_SERVER['SCRIPT_NAME'], 1);
    $position = strpos($filename, '.');
    $attribute = substr($filename, 0, $position);
    if ($attribute == 'plugins') {
        $module = $attribute . ':' . $magixmod;
    } else {
        $module = $attribute;
    }
    $iniseo = new frontend_controller_seo($module, $tabs['level'], $tabs['idmetas'], frontend_model_template::current_Language());
    if ($iniseo->replace_var_rewrite($record, $category, $subcategory) != null) {
        return $iniseo->replace_var_rewrite($record, $category, $subcategory);
    } else {
        if (!isset($tabs['default'])) {
            trigger_error("default: missing 'default' parameter");
            return;
        } else {
            return $tabs['default'];
        }
    }
}
Example #2
0
 /**
  * function construct
  */
 function __construct()
 {
     $FilterRequest = new magixcjquery_filter_request();
     $CleanUrl = new magixcjquery_url_clean();
     if ($FilterRequest->isGet('getnews')) {
         $this->idNews = magixcjquery_filter_var::clean($_GET['getnews']);
     }
     if ($FilterRequest->isGet('getdate')) {
         $this->dateNews = $_GET['getdate'];
     }
     $this->idPagination = 1;
     if ($FilterRequest->isGet('page') and is_numeric($_GET['page'])) {
         $this->idPagination = intval($_GET['page']);
     }
     if ($FilterRequest->isGet('tag')) {
         $this->idTag = $CleanUrl->make2tagString($_GET['tag']);
     }
 }
Example #3
0
 /**
  * protected var for dbLayer
  *
  * @var void
  */
 function __construct()
 {
     if (class_exists('backend_model_message')) {
         $this->message = new backend_model_message();
     }
     if (magixcjquery_filter_request::isPost('passwd_admin')) {
         $this->passwd_admin = sha1(magixcjquery_form_helpersforms::inputClean($_POST['passwd_admin']));
     }
     if (magixcjquery_filter_request::isPost('hashtoken')) {
         $this->hashtoken = magixcjquery_filter_var::escapeHTML($_POST['hashtoken']);
     }
     if (magixcjquery_filter_request::isGet('logout')) {
         $this->logout = magixcjquery_filter_isVar::isPostAlpha($_GET['logout']);
     }
     if (magixcjquery_filter_request::isPost('email_admin')) {
         $this->email_admin = magixcjquery_filter_isVar::isMail($_POST['email_admin']);
     }
     //LOSTPASSWORD
     if (magixcjquery_filter_request::isPost('lo_email_admin')) {
         $this->lo_email_admin = magixcjquery_filter_isVar::isMail($_POST['lo_email_admin']);
     }
 }
Example #4
0
 /**
  * Création des tables avec la lecture du fichier SQL
  * @param void $sqlfile
  */
 public function create_new_sqltable($sqlfile)
 {
     if (self::load_sql_file($sqlfile) != false) {
         foreach (self::load_sql_file($sqlfile) as $query) {
             $query = magixcjquery_filter_var::trimText($query);
             self::layerDB()->createTable($query);
         }
         return true;
     }
 }
Example #5
0
 /**
  * create childnode url
  * @param URL $loc
  * @param void $writeImageLoc
  */
 public function writeMakeNodeImage($loc, $imageloc, $uri = '', $forimage = false)
 {
     if ($this->validElement($loc) == true) {
         $this->writer->startElement('url');
         // [2] Second Node
         $this->writer->writeElement('loc', magixcjquery_filter_isVar::isURL(magixcjquery_filter_var::escapeHTML($loc)));
         if ($forimage != false) {
             foreach ($forimage as $img) {
                 if ($img[$imageloc] != NULL) {
                     self::writeImageLoc($uri . $img[$imageloc]);
                 }
             }
         } else {
             self::writeImageLoc($uri . $imageloc);
         }
         $this->writer->endElement();
     }
 }
Example #6
0
 /**
  * function isEmpty
  *
  * @param string $val
  * @return false
  */
 public static function isEmpty($val)
 {
     $val = magixcjquery_filter_var::trimText($val);
     return empty($val) && $val !== 0;
 }
Example #7
0
 /**
  * Combine function trimText and isPostNumeric for input
  * @param string $str
  * 
  */
 public static function inputNumeric($str)
 {
     return magixcjquery_filter_var::trimText(magixcjquery_filter_isVar::isPostNumeric($str));
 }
Example #8
0
 /**
  * Join function for get Intéger
  * 
  * 
  * @see magixcjquery_filter_var::trimText
  * @see magixcjquery_filter_isVar::isPostNumeric
  * @see magixcjquery_filter_isVar::sizeLargestString
  * 
  * @param string $str
  * @param intéger $lg_max
  */
 public static function getCleanInteger($str, $lg_max)
 {
     $string = magixcjquery_filter_isVar::isPostNumeric(magixcjquery_filter_var::trimText($str));
     $string .= magixcjquery_filter_isVar::sizeLargestString($str, $lg_max);
     return $string;
 }
Example #9
0
 public static function make2tagString($str)
 {
     /**Clean accent*/
     $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", "à" => "a", "á" => "a", "â" => "a", "ã" => "a", "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", "ý" => "y", "ÿ" => "y");
     $str = strtr("{$str}", $Caracs);
     $str = magixcjquery_filter_var::trimText($str);
     /* stripcslashes backslash */
     $str = magixcjquery_filter_var::cleanQuote($str);
     /*replace blank and special caractère*/
     $cSpec = array("@'@i", '[\\?]', '[\\#]', '[\\@]', '[\\,]', '[\\!]', '[\\:]', '[\\(]', '[\\)]');
     $rSpec = array(" ", " ", " ", " ", " ", " ", " ", " ", " ");
     /*Removes the indent if end of string*/
     $str = rtrim(preg_replace($cSpec, $rSpec, $str), "");
     /*Convert UTF8 encode*/
     $str = magixcjquery_string_convert::decode_utf8($str);
     /*Convert lower case*/
     $str = magixcjquery_string_convert::downTextCase($str);
     return $str;
 }