Beispiel #1
0
 /**
  * Constructeur qui initialise certaines variables de classe
  * et qui lance le traitement initial
  *
  * @param	filename	emplacement du fichier XML de configuration
  * @return	null
  * @author	Florent MONTHEL, Stéphane F
  **/
 protected function __construct($filename)
 {
     # On parse le fichier de configuration
     $this->getConfiguration($filename);
     # Chargement du fichier de langue
     loadLang(PLX_CORE . 'lang/' . $this->aConf['default_lang'] . '/core.php');
     # récupération des paramètres dans l'url
     $this->get = plxUtils::getGets();
     # gestion du timezone
     date_default_timezone_set($this->aConf['timezone']);
     # chargement des variables
     $this->racine = $this->aConf['racine'];
     $this->bypage = $this->aConf['bypage_feed'];
     $this->tri = 'desc';
     $this->clef = !empty($this->aConf['clef']) ? $this->aConf['clef'] : '';
     # Traitement des plugins
     $this->plxPlugins = new plxPlugins($this->aConf['default_lang']);
     $this->plxPlugins->loadPlugins();
     # Hook plugins
     eval($this->plxPlugins->callHook('plxFeedConstructLoadPlugins'));
     # Traitement sur les répertoires des articles et des commentaires
     $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles'], false, true, 'arts');
     $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']);
     # Récupération des données dans les autres fichiers xml
     $this->getCategories(path('XMLFILE_CATEGORIES'));
     $this->getUsers(path('XMLFILE_USERS'));
     $this->getTags(path('XMLFILE_TAGS'));
     # Récupération des articles appartenant aux catégories actives
     $this->getActiveArts();
     # Hook plugins
     eval($this->plxPlugins->callHook('plxFeedConstruct'));
 }
 /**
  * Constructeur de la classe inMyPluxml
  *
  * @param	default_lang	langue par défaut utilisée par PluXml
  * @return	null
  * @author	Stephane F
  **/
 public function __construct($default_lang)
 {
     # Appel du constructeur de la classe plxPlugin (obligatoire)
     parent::__construct($default_lang);
     if (defined('PLX_ADMIN')) {
         if (!empty($_GET['deletetoken']) && !empty($_GET['pasteid'])) {
             list($this->CIPHERDATA, $this->ERRORMESSAGE, $this->STATUS) = cmp_processPasteDelete(plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['pasteid'])), plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['deletetoken'])));
         } elseif (!empty($_SERVER['QUERY_STRING'])) {
             $zb = preg_replace('!(a=[0-9]+&?)*(zb=)?!', '', plxUtils::getGets($_SERVER['QUERY_STRING']));
             if (!empty($zb)) {
                 list($this->CIPHERDATA, $this->ERRORMESSAGE, $this->STATUS) = cmp_processPasteFetch($zb);
             }
         }
     }
     # Déclarations des hooks
     $this->addHook('ThemeEndHead', 'ThemeEndHead');
     $this->addHook('plxMotorPreChauffageBegin', 'plxMotorPreChauffageBegin');
     $this->addHook('plxMotorDemarrageBegin', 'plxMotorDemarrageBegin');
     $this->addHook('plxShowConstruct', 'plxShowConstruct');
     $this->addHook('AdminPrepend', 'Prepend');
     $this->addHook('IndexBegin', 'Prepend');
     $this->addHook('AdminTopEndHead', 'AdminTopEndHead');
     $this->addHook('AdminArticleTop', 'AdminArticleTop');
     // Pour n'enregistrer des données que via ZB, décommenter ces lignes
     // $this->addHook('AdminArticleContent', 'AdminArticleContent');
     // $this->addHook('AdminArticleFoot', 'AdminArticleFoot');
 }
Beispiel #3
0
 /**
  * Constructeur qui initialise certaines variables de classe
  * et qui lance le traitement initial
  *
  * @param	filename	emplacement du fichier XML de configuration
  * @return	null
  * @author	Anthony GUÉRIN, Florent MONTHEL, Stéphane F
  **/
 public function __construct($filename)
 {
     # Version de PluXml
     if (!is_readable(PLX_ROOT . 'version')) {
         header('Content-Type: text/plain charset=UTF-8');
         echo 'Le fichier "' . PLX_ROOT . 'version" est necessaire au fonctionnement de PluXml';
         exit;
     }
     $f = file(PLX_ROOT . 'version');
     $this->version = $f['0'];
     # Traitement initial
     $this->start = plxDate::microtime();
     $this->get = plxUtils::getGets();
     # On parse le fichier de configuration
     $this->getConfiguration($filename);
     # On vérifie s'il faut faire une mise à jour
     if ((!isset($this->aConf['version']) or $this->version != $this->aConf['version']) and !defined('PLX_UPDATER')) {
         header('Location: ' . PLX_ROOT . 'update/index.php');
         exit;
     }
     # Chargement des variables
     $this->racine = $this->aConf['racine'];
     $this->bypage = $this->aConf['bypage'];
     $this->tri = $this->aConf['tri'];
     $this->tri_coms = $this->aConf['tri_coms'];
     # On récupère le chemin de l'url
     $var = parse_url($this->racine);
     $this->path_url = str_replace(ltrim($var['path'], '\\/'), '', ltrim($_SERVER['REQUEST_URI'], '\\/'));
     # Definition du thème à afficher
     if (plxUtils::mobileDetect() and !empty($this->aConf['style_mobile']) and is_dir(PLX_ROOT . 'themes/' . $this->aConf['style_mobile'])) {
         $this->style = $this->aConf['style_mobile'];
     } else {
         $this->style = $this->aConf['style'];
     }
     # Traitement sur les répertoires des articles et des commentaires
     $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles']);
     $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']);
     # On récupère les catégories et les pages statiques
     $this->getCategories(PLX_ROOT . $this->aConf['categories']);
     $this->getStatiques(PLX_ROOT . $this->aConf['statiques']);
     $this->getTags(PLX_ROOT . $this->aConf['tags']);
     $this->getUsers(PLX_ROOT . $this->aConf['users']);
 }
Beispiel #4
0
 /**
  * Constructeur qui initialise certaines variables de classe
  * et qui lance le traitement initial
  *
  * @param	filename	emplacement du fichier XML de configuration
  * @return	null
  * @author	Florent MONTHEL, Stéphane F
  **/
 public function __construct($filename)
 {
     # Version de PluXml
     if (!is_readable(PLX_ROOT . 'version')) {
         header('Content-Type: text/plain charset=UTF-8');
         echo 'Le fichier "' . PLX_ROOT . 'version" est necessaire au fonctionnement de PluXml';
         exit;
     }
     $f = file(PLX_ROOT . 'version');
     $this->version = $f['0'];
     $this->get = plxUtils::getGets();
     $this->getConfiguration($filename);
     $this->racine = $this->aConf['racine'];
     $this->bypage = $this->aConf['bypage_feed'];
     $this->tri = 'desc';
     $this->clef = !empty($this->aConf['clef']) ? $this->aConf['clef'] : '';
     $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles']);
     $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']);
     $this->getCategories(PLX_ROOT . $this->aConf['categories']);
     $this->getUsers(PLX_ROOT . $this->aConf['users']);
 }
Beispiel #5
0
 /**
  * Méthode qui converti les liens relatifs en liens absolus
  *
  * @param	base		url du site qui sera rajoutée devant les liens relatifs
  * @param	html		chaine de caractères à convertir
  * @return	string		chaine de caractères modifiée
  **/
 public static function rel2abs($base, $html)
 {
     // generate server-only replacement for root-relative URLs
     $server = preg_replace('@^([^\\:]*)://([^/*]*)(/|$).*@', '\\1://\\2/', $base);
     // on repart les liens ne commençant que part #
     $get = plxUtils::getGets();
     $html = preg_replace('@\\<([^>]*) (href|src)="(#[^"]*)"@i', '<\\1 \\2="' . $get . '\\3"', $html);
     // replace root-relative URLs
     $html = preg_replace('@\\<([^>]*) (href|src)="/([^"]*)"@i', '<\\1 \\2="' . $server . '\\3"', $html);
     // replace base-relative URLs
     $html = preg_replace('@\\<([^>]*) (href|src)="(([^\\:"])*|([^"]*:[^/"].*))"@i', '<\\1 \\2="' . $base . '\\3"', $html);
     return $html;
 }
Beispiel #6
0
 /**
  * Constructeur qui initialise certaines variables de classe
  * et qui lance le traitement initial
  *
  * @param	filename	emplacement du fichier XML de configuration
  * @return	null
  * @author	Anthony GUÉRIN, Florent MONTHEL, Stéphane F
  **/
 protected function __construct($filename)
 {
     # On parse le fichier de configuration
     $this->getConfiguration($filename);
     # Chargement du fichier de langue
     $lang = isset($_SESSION['lang']) ? $_SESSION['lang'] : $this->aConf['default_lang'];
     $this->aConf['default_lang'] = $lang;
     loadLang(PLX_CORE . 'lang/' . $lang . '/core.php');
     # récupération des paramètres dans l'url
     $this->get = plxUtils::getGets();
     # gestion du timezone
     date_default_timezone_set($this->aConf['timezone']);
     # On vérifie s'il faut faire une mise à jour
     if ((!isset($this->aConf['version']) or PLX_VERSION != $this->aConf['version']) and !defined('PLX_UPDATER')) {
         header('Location: ' . PLX_ROOT . 'update/index.php');
         exit;
     }
     # Chargement des variables
     $this->style = $this->aConf['style'];
     $this->racine = $this->aConf['racine'];
     $this->bypage = $this->aConf['bypage'];
     $this->tri = $this->aConf['tri'];
     $this->tri_coms = $this->aConf['tri_coms'];
     # On récupère le chemin de l'url
     $var = parse_url($this->racine);
     $this->path_url = str_replace(ltrim($var['path'], '\\/'), '', ltrim($_SERVER['REQUEST_URI'], '\\/'));
     # Traitement des plugins
     $this->plxPlugins = new plxPlugins($lang);
     $this->plxPlugins->loadPlugins();
     # Hook plugins
     eval($this->plxPlugins->callHook('plxMotorConstructLoadPlugins'));
     # Traitement sur les répertoires des articles et des commentaires
     $this->plxGlob_arts = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_articles'], false, true, 'arts');
     $this->plxGlob_coms = plxGlob::getInstance(PLX_ROOT . $this->aConf['racine_commentaires']);
     # Récupération des données dans les autres fichiers xml
     $this->getCategories(path('XMLFILE_CATEGORIES'));
     $this->getStatiques(path('XMLFILE_STATICS'));
     $this->getTags(path('XMLFILE_TAGS'));
     $this->getUsers(path('XMLFILE_USERS'));
     # Récuperation des articles appartenant aux catégories actives
     $this->getActiveArts();
     # Hook plugins
     eval($this->plxPlugins->callHook('plxMotorConstruct'));
 }
Beispiel #7
0
 /**
  * Méthode qui converti les liens relatifs en liens absolus
  *
  * @param	base		url du site qui sera rajoutée devant les liens relatifs
  * @param	html		chaine de caractères à convertir
  * @return	string		chaine de caractères modifiée
  * @author	Stephane F., Amaury Graillat
  **/
 public static function rel2abs($base, $html)
 {
     // on protège les liens de type (href|src)="//" en doublant le caractère =
     $html = preg_replace('@(href|src)=(["\']\\/\\/)@i', '\\1==\\2', $html);
     // url des plugins
     $html = preg_replace('@\\<([^>]*) (href|src)=(["\'])[\\.]/plugins@i', '<$1 $2=$3' . $base . 'plugins', $html);
     // generate server-only replacement for root-relative URLs
     $server = preg_replace('@^([^:]+)://([^/]+)(/|$).*@', '\\1://\\2/', $base);
     // on repare les liens ne commençant que part #
     $get = plxUtils::getGets();
     $html = preg_replace('@\\<([^>]*) (href|src)=(["\'])#@i', '<\\1 \\2=\\3' . $get . '#', $html);
     // replace root-relative URLs
     $html = preg_replace('@\\<([^>]*) (href|src)=(["\']).?/@i', '<\\1 \\2=\\3' . $server, $html);
     // replace base-relative URLs
     $html = preg_replace('@\\<([^>]*) (href|src)=(["\'])([^:"]*|[^:"]*:[^/"][^"]*)(["\'])@i', '<\\1 \\2=\\3' . $base . '\\4\\5', $html);
     // unreplace fully qualified URLs with proto: that were wrongly added $base
     $html = preg_replace('@\\<([^>]*) (href|src)=(["\'])' . $base . '([a-zA-Z0-9]*):@i', '<\\1 \\2=\\3\\4:', $html);
     // on rétablit les liens de type (href|src)="//" en remplaçant les caractères == par =
     $html = preg_replace('@(href|src)==@i', '\\1=', $html);
     return $html;
 }
<?php

if (!defined('PLX_ROOT')) {
    exit;
}
$plxMotor = plxMotor::getInstance();
$plxShow = plxShow::getInstance();
$plxPlugin = $plxMotor->plxPlugins->getInstance('cryptMyPluxml');
if (!empty($_GET['deletetoken']) && !empty($_GET['pasteid'])) {
    list($plxPlugin->CIPHERDATA, $plxPlugin->ERRORMESSAGE, $plxPlugin->STATUS) = cmp_processPasteDelete(plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['pasteid'])), plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['deletetoken'])));
} elseif (!empty($_SERVER['QUERY_STRING'])) {
    $zb = preg_replace('!(a=[0-9]+&)*zb=!', '', plxUtils::getGets($_SERVER['QUERY_STRING']));
    $zb = str_replace(array('zb=', 'zb/'), '', $zb);
    list($plxPlugin->CIPHERDATA, $plxPlugin->ERRORMESSAGE, $plxPlugin->STATUS) = cmp_processPasteFetch($zb);
}
?>

<div id="infoZB">(?)<br/>
	<div id="aboutbox">
		<?php 
echo $plxPlugin->getLang('L_ZB_DESC');
?>

	</div>
</div>
<noscript><div class="nonworking"><?php 
echo $plxPlugin->getLang('L_JS_REQUIRED');
?>
</div></noscript>
<div id="oldienotice" class="nonworking"><?php 
echo $plxPlugin->getLang('L_MODERN_BROWSER');