diff --git a/manifest.json b/manifest.json
index 09be951..82f97cc 100644
--- a/manifest.json
+++ b/manifest.json
@@ -12,7 +12,7 @@
"name": "matlink",
"email": "matlink@matlink.fr"
},
- "multi_instance": true,
+ "multi_instance": false,
"services": [
"nginx",
"php5-fpm"
diff --git a/sources/.htaccess b/sources/.htaccess
deleted file mode 100644
index e69de29..0000000
diff --git a/sources/config.php b/sources/config.php
deleted file mode 100644
index 6344ccc..0000000
--- a/sources/config.php
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/sources/core/.htaccess b/sources/core/.htaccess
deleted file mode 100644
index 45552cb..0000000
--- a/sources/core/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-Options -Indexes
\ No newline at end of file
diff --git a/sources/core/admin/article.php b/sources/core/admin/article.php
deleted file mode 100644
index ded9dbe..0000000
--- a/sources/core/admin/article.php
+++ /dev/null
@@ -1,493 +0,0 @@
-plxPlugins->callHook('AdminArticlePrepend'));
-
-# validation de l'id de l'article si passé en parametre
-if(isset($_GET['a']) AND !preg_match('/^_?[0-9]{4}$/',$_GET['a'])) {
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE); # Article inexistant
- header('Location: index.php');
- exit;
-}
-
-# Formulaire validé
-if(!empty($_POST)) { # Création, mise à jour, suppression ou aperçu
-
- if(!isset($_POST['catId'])) $_POST['catId']=array();
- # Titre par défaut si titre vide
- if(trim($_POST['title'])=='') $_POST['title'] = L_DEFAULT_NEW_ARTICLE_TITLE;
- # Si demande d'enregistrement en brouillon on ajoute la categorie draft à la liste et on retire la demande de validation
- if(isset($_POST['draft']) AND !in_array('draft',$_POST['catId'])) array_unshift($_POST['catId'], 'draft');
- # si aucune catégorie sélectionnée on place l'article dans la catégorie "non classé"
- if(sizeof($_POST['catId'])==1 AND $_POST['catId'][0]=='draft') $_POST['catId'][]='000';
- else $_POST['catId'] = array_filter($_POST['catId'], create_function('$a', 'return $a!="000";'));
- # Si demande de publication ou demande de validation, on supprime la catégorie draft si elle existe
- if((isset($_POST['update']) OR isset($_POST['publish']) OR isset($_POST['moderate'])) AND isset($_POST['catId'])) $_POST['catId'] = array_filter($_POST['catId'], create_function('$a', 'return $a!="draft";'));
- # Si profil PROFIL_WRITER on vérifie l'id du rédacteur connecté et celui de l'article
- if($_SESSION['profil']==PROFIL_WRITER AND isset($_POST['author']) AND $_SESSION['user']!=$_POST['author']) $_POST['author']=$_SESSION['user'];
- # Si profil PROFIL_WRITER on vérifie que l'article n'est pas celui d'un autre utilisateur
- if($_SESSION['profil']==PROFIL_WRITER AND isset($_POST['artId']) AND $_POST['artId']!='0000') {
- # On valide l'article
- if(($aFile = $plxAdmin->plxGlob_arts->query('/^'.$_POST['artId'].'.([home[draft|0-9,]*).'.$_SESSION['user'].'.(.+).xml$/')) == false) { # Article inexistant
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE);
- header('Location: index.php');
- exit;
- }
- }
- # Previsualisation d'un article
- if(!empty($_POST['preview'])) {
- $art=array();
- $art['title'] = trim($_POST['title']);
- $art['allow_com'] = $_POST['allow_com'];
- $art['template'] = basename($_POST['template']);
- $art['chapo'] = trim($_POST['chapo']);
- $art['content'] = trim($_POST['content']);
- $art['tags'] = trim($_POST['tags']);
- $art['meta_description'] = $_POST['meta_description'];
- $art['meta_keywords'] = $_POST['meta_keywords'];
- $art['title_htmltag'] = $_POST['title_htmltag'];
- $art['filename'] = '';
- $art['numero'] = $_POST['artId'];
- $art['author'] = $_POST['author'];
- $art['categorie'] = '';
- if(!empty($_POST['catId'])) {
- $array=array();
- foreach($_POST['catId'] as $k => $v) {
- if($v!='draft') $array[]=$v;
- }
- $art['categorie']=implode(',',$array);
- }
- $art['date'] = $_POST['year'].$_POST['month'].$_POST['day'].substr(str_replace(':','',$_POST['time']),0,4);
- $art['nb_com'] = 0;
- if(trim($_POST['url']) == '')
- $art['url'] = plxUtils::title2url($_POST['title']);
- else
- $art['url'] = plxUtils::title2url($_POST['url']);
- if($art['url'] == '') $art['url'] = L_DEFAULT_NEW_ARTICLE_URL;
-
- # Hook Plugins
- eval($plxAdmin->plxPlugins->callHook('AdminArticlePreview'));
-
- $article[0] = $art;
- $_SESSION['preview'] = $article;
- header('Location: '.PLX_ROOT.'index.php?preview');
- exit;
- }
- # Suppression d'un article
- if(isset($_POST['delete'])) {
- $plxAdmin->delArticle($_POST['artId']);
- header('Location: index.php');
- exit;
- }
- # Mode création ou maj
- if(isset($_POST['update']) OR isset($_POST['publish']) OR isset($_POST['moderate']) OR isset($_POST['draft'])) {
-
- $valid = true;
- # Vérification de l'unicité de l'url
- $_POST['url'] = plxUtils::title2url(trim($_POST['url'])==''?$_POST['title']:$_POST['url']);
- foreach($plxAdmin->plxGlob_arts->aFiles as $numart => $filename) {
- if(preg_match("/^_?[0-9]{4}.([0-9,|home|draft]*).[0-9]{3}.[0-9]{12}.".$_POST["url"].".xml$/", $filename)) {
- if($numart!=str_replace('_', '',$_POST['artId'])) {
- $valid = plxMsg::Error(L_ERR_URL_ALREADY_EXISTS." : ".plxUtils::strCheck($_POST["url"])) AND $valid;
- }
- }
- }
- # Vérification de la validité de la date de publication
- if(!plxDate::checkDate($_POST['day'],$_POST['month'],$_POST['year'],$_POST['time'])) {
- $valid = plxMsg::Error(L_ERR_INVALID_PUBLISHING_DATE) AND $valid;
- }
- if($valid) {
- $plxAdmin->editArticle($_POST,$_POST['artId']);
- header('Location: article.php?a='.$_POST['artId']);
- exit;
- # Si url ou date invalide, on ne sauvegarde pas mais on repasse en mode brouillon
- }else{
- array_unshift($_POST['catId'], 'draft');
- }
-
- }
- # Ajout d'une catégorie
- if(isset($_POST['new_category'])) {
- # Ajout de la nouvelle catégorie
- $plxAdmin->editCategories($_POST);
- # On recharge la nouvelle liste
- $plxAdmin->getCategories(path('XMLFILE_CATEGORIES'));
- $_GET['a']=$_POST['artId'];
- }
- # Alimentation des variables
- $artId = $_POST['artId'];
- $title = trim($_POST['title']);
- $author = $_POST['author'];
- $catId = isset($_POST['catId'])?$_POST['catId']:array();
- $date['day'] = $_POST['day'];
- $date['month'] = $_POST['month'];
- $date['year'] = $_POST['year'];
- $date['time'] = $_POST['time'];
- $chapo = trim($_POST['chapo']);
- $content = trim($_POST['content']);
- $tags = trim($_POST['tags']);
- $url = $_POST['url'];
- $allow_com = $_POST['allow_com'];
- $template = $_POST['template'];
- $meta_description = $_POST['meta_description'];
- $meta_keywords = $_POST['meta_keywords'];
- $title_htmltag = $_POST['title_htmltag'];
- # Hook Plugins
- eval($plxAdmin->plxPlugins->callHook('AdminArticlePostData'));
-} elseif(!empty($_GET['a'])) { # On n'a rien validé, c'est pour l'édition d'un article
- # On va rechercher notre article
- if(($aFile = $plxAdmin->plxGlob_arts->query('/^'.$_GET['a'].'.(.+).xml$/')) == false) { # Article inexistant
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE);
- header('Location: index.php');
- exit;
- }
- # On parse et alimente nos variables
- $result = $plxAdmin->parseArticle(PLX_ROOT.$plxAdmin->aConf['racine_articles'].$aFile['0']);
- $title = trim($result['title']);
- $chapo = trim($result['chapo']);
- $content = trim($result['content']);
- $tags = trim($result['tags']);
- $author = $result['author'];
- $url = $result['url'];
- $date = plxDate::date2Array($result['date']);
- $catId = explode(',', $result['categorie']);
- $artId = $result['numero'];
- $allow_com = $result['allow_com'];
- $template = $result['template'];
- $meta_description=$result['meta_description'];
- $meta_keywords=$result['meta_keywords'];
- $title_htmltag = $result['title_htmltag'];
-
- if($author!=$_SESSION['user'] AND $_SESSION['profil']==PROFIL_WRITER) {
- plxMsg::Error(L_ERR_FORBIDDEN_ARTICLE);
- header('Location: index.php');
- exit;
- }
- # Hook Plugins
- eval($plxAdmin->plxPlugins->callHook('AdminArticleParseData'));
-
-} else { # On a rien validé, c'est pour la création d'un article
- $title = plxUtils::strRevCheck(L_DEFAULT_NEW_ARTICLE_TITLE);
- $chapo = $url = '';
- $content = '';
- $tags = '';
- $author = $_SESSION['user'];
- $date = array ('year' => date('Y'),'month' => date('m'),'day' => date('d'),'time' => date('H:i'));
- $catId = array('draft');
- $artId = '0000';
- $allow_com = $plxAdmin->aConf['allow_com'];
- $template = 'article.php';
- $meta_description=$meta_keywords=$title_htmltag='';
- # Hook Plugins
- eval($plxAdmin->plxPlugins->callHook('AdminArticleInitData'));
-}
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-
-# On construit la liste des utilisateurs
-foreach($plxAdmin->aUsers as $_userid => $_user) {
- if($_user['active'] AND !$_user['delete'] ) {
- if($_user['profil']==PROFIL_ADMIN)
- $_users[L_PROFIL_ADMIN][$_userid] = plxUtils::strCheck($_user['name']);
- elseif($_user['profil']==PROFIL_MANAGER)
- $_users[L_PROFIL_MANAGER][$_userid] = plxUtils::strCheck($_user['name']);
- elseif($_user['profil']==PROFIL_MODERATOR)
- $_users[L_PROFIL_MODERATOR][$_userid] = plxUtils::strCheck($_user['name']);
- elseif($_user['profil']==PROFIL_EDITOR)
- $_users[L_PROFIL_EDITOR][$_userid] = plxUtils::strCheck($_user['name']);
- else
- $_users[L_PROFIL_WRITER][$_userid] = plxUtils::strCheck($_user['name']);
- }
-}
-
-# On récupère les templates des articles
-$aTemplates = array();
-$files = plxGlob::getInstance(PLX_ROOT.$plxAdmin->aConf['racine_themes'].$plxAdmin->aConf['style']);
-if ($array = $files->query('/^article(-[a-z0-9-_]+)?.php$/')) {
- foreach($array as $k=>$v)
- $aTemplates[$v] = $v;
-}
-if(empty($aTemplates)) $aTemplates[''] = L_NONE1;
-$cat_id='000';
-?>
-
-
-plxPlugins->callHook('AdminArticleFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
diff --git a/sources/core/admin/auth.php b/sources/core/admin/auth.php
deleted file mode 100644
index b2b54b1..0000000
--- a/sources/core/admin/auth.php
+++ /dev/null
@@ -1,139 +0,0 @@
-plxPlugins->callHook('AdminAuthPrepend'));
-
-# Initialisation variable erreur
-$error = '';
-$msg = '';
-
-# Control et filtrage du parametre $_GET['p']
-$redirect=$plxAdmin->aConf['racine'].'core/admin/';
-if(!empty($_GET['p'])) {
- $racine = parse_url($plxAdmin->aConf['racine']);
- $get_p = parse_url(urldecode($_GET['p']));
- $error = (!$get_p OR (isset($get_p['host']) AND $racine['host']!=$get_p['host']));
- if(!$error AND !empty($get_p['path']) AND file_exists(PLX_ROOT.'core/admin/'.basename($get_p['path']))) {
- # filtrage des parametres de l'url
- $query='';
- if(isset($get_p['query'])) {
- $query=strtok($get_p['query'],'=');
- $query=($query[0]!='d'?'?'.$get_p['query']:'');
- }
- # url de redirection
- $redirect=$get_p['path'].$query;
- }
-}
-
-# Déconnexion
-if(!empty($_GET['d']) AND $_GET['d']==1) {
-
- $_SESSION = array();
- session_destroy();
- header('Location: auth.php');
- exit;
-
- $formtoken = $_SESSION['formtoken']; # sauvegarde du token du formulaire
- $_SESSION = array();
- session_destroy();
- session_start();
- $msg = L_LOGOUT_SUCCESSFUL;
- $_GET['p']='';
- $_SESSION['formtoken']=$formtoken; # restauration du token du formulaire
- unset($formtoken);
-}
-
-# Authentification
-if(!empty($_POST['login']) AND !empty($_POST['password'])) {
- $connected = false;
- foreach($plxAdmin->aUsers as $userid => $user) {
- if ($_POST['login']==$user['login'] AND sha1($user['salt'].md5($_POST['password']))===$user['password'] AND $user['active'] AND !$user['delete']) {
- $_SESSION['user'] = $userid;
- $_SESSION['profil'] = $user['profil'];
- $_SESSION['hash'] = plxUtils::charAleatoire(10);
- $_SESSION['domain'] = $session_domain;
- $_SESSION['lang'] = $user['lang'];
- $connected = true;
- break;
- }
- }
- if($connected) {
- header('Location: '.htmlentities($redirect));
- exit;
- } else {
- $msg = L_ERR_WRONG_PASSWORD;
- $error = 'error';
- }
-}
-plxUtils::cleanHeaders();
-?>
-
-
-
-
-
-
- PluXml -
-
-
-
-
- plxPlugins->callHook('AdminAuthEndHead')) ?>
-
-
-
-
-
-
-
- plxPlugins->callHook('AdminAuthTop')) ?>
-
-
- -
-
-
-
-
-
-plxPlugins->callHook('AdminAuthEndBody')) ?>
-
-
\ No newline at end of file
diff --git a/sources/core/admin/categorie.php b/sources/core/admin/categorie.php
deleted file mode 100644
index 09d41fb..0000000
--- a/sources/core/admin/categorie.php
+++ /dev/null
@@ -1,110 +0,0 @@
-plxPlugins->callHook('AdminCategoryPrepend'));
-
-# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
-$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR, PROFIL_EDITOR);
-
-# On édite la catégorie
-if(!empty($_POST) AND isset($plxAdmin->aCats[ $_POST['id'] ])) {
- $plxAdmin->editCategorie($_POST);
- header('Location: categorie.php?p='.$_POST['id']);
- exit;
-}
-elseif(!empty($_GET['p'])) { # On vérifie l'existence de la catégorie
- $id = plxUtils::strCheck($_GET['p']);
- if(!isset($plxAdmin->aCats[ $id ])) {
- plxMsg::Error(L_CAT_UNKNOWN);
- header('Location: categorie.php');
- exit;
- }
-} else { # Sinon, on redirige
- header('Location: categories.php');
- exit;
-}
-
-# On récupère les templates des catégories
-$aTemplates = array();
-$files = plxGlob::getInstance(PLX_ROOT.$plxAdmin->aConf['racine_themes'].$plxAdmin->aConf['style']);
-if ($array = $files->query('/^categorie(-[a-z0-9-_]+)?.php$/')) {
- foreach($array as $k=>$v)
- $aTemplates[$v] = $v;
-}
-if(empty($aTemplates)) $aTemplates[''] = L_NONE1;
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-?>
-
-
-
-plxPlugins->callHook('AdminCategoryFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
\ No newline at end of file
diff --git a/sources/core/admin/categories.php b/sources/core/admin/categories.php
deleted file mode 100644
index 701f8ba..0000000
--- a/sources/core/admin/categories.php
+++ /dev/null
@@ -1,136 +0,0 @@
-plxPlugins->callHook('AdminCategoriesPrepend'));
-
-# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
-$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR, PROFIL_EDITOR);
-
-# On édite les catégories
-if(!empty($_POST)) {
- $plxAdmin->editCategories($_POST);
- header('Location: categories.php');
- exit;
-}
-
-# Tableau du tri
-$aTri = array('desc'=>L_SORT_DESCENDING_DATE, 'asc'=>L_SORT_ASCENDING_DATE, 'alpha'=>L_SORT_ALPHABETICAL);
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-?>
-
-
-
-plxPlugins->callHook('AdminCategoriesFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
diff --git a/sources/core/admin/comment.php b/sources/core/admin/comment.php
deleted file mode 100644
index a49783f..0000000
--- a/sources/core/admin/comment.php
+++ /dev/null
@@ -1,211 +0,0 @@
-plxPlugins->callHook('AdminCommentPrepend'));
-
-# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
-$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR);
-
-# Interdire de l'accès à la page si les commentaires sont désactivés
-if(!$plxAdmin->aConf['allow_com']) {
- header('Location: index.php');
- exit;
-}
-
-# validation de l'id de l'article si passé en parametre
-if(isset($_GET['a']) AND !preg_match('/^_?[0-9]{4}$/',$_GET['a'])) {
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE); # Article inexistant
- header('Location: index.php');
- exit;
-}
-
-# On édite, supprime ou valide notre commentaire
-if(!empty($_POST) AND !empty($_POST['comId'])) {
-
- # validation du numero de commentaire
- if(!preg_match('/[[:punct:]]?[0-9]{4}.[0-9]{10}-[0-9]+$/', $_POST['comId'])) {
- plxMsg::Error(L_ERR_UNKNOWN_COMMENT);
- header('Location: comments.php');
- exit;
- }
-
- # Suppression, on redirige
- if(isset($_POST['delete'])) {
- $plxAdmin->delCommentaire($_POST['comId']);
- header('Location: comments.php');
- exit;
- }
- # Commentaire en ligne
- if(isset($_POST['online'])) {
- $plxAdmin->editCommentaire($_POST,$_POST['comId']);
- $plxAdmin->modCommentaire($_POST['comId'],'online');
- header('Location: comment.php?c='.$_POST['comId'].(!empty($_GET['a'])?'&a='.$_GET['a']:''));
- exit;
- }
- # Commentaire hors-ligne
- if(isset($_POST['offline'])) {
- $plxAdmin->editCommentaire($_POST,$_POST['comId']);
- $plxAdmin->modCommentaire($_POST['comId'],'offline');
- header('Location: comment.php?c='.$_POST['comId'].(!empty($_GET['a'])?'&a='.$_GET['a']:''));
- exit;
- }
- # Répondre au commentaire
- if(isset($_POST['answer'])) {
- header('Location: comment_new.php?c='.$_POST['comId']).(!empty($_GET['a'])?'&a='.$_GET['a']:'');
- exit;
- }
- # Edition
- $plxAdmin->editCommentaire($_POST,$_POST['comId']);
- header('Location: comment.php?c='.$_POST['comId'].(!empty($_GET['a'])?'&a='.$_GET['a']:''));
- exit;
-}
-
-# On va récupérer les infos sur le commentaire
-if(!$plxAdmin->getCommentaires('/^'.plxUtils::nullbyteRemove($_GET['c']).'.xml$/','',0,1,'all')) {
- # Commentaire inexistant, on redirige
- plxMsg::Error(L_ERR_UNKNOWN_COMMENT);
- header('Location: comments.php');
- exit;
-}
-
-# On va récupérer les infos sur l'article
-$artId = $plxAdmin->plxRecord_coms->f('article');
-# On va rechercher notre article
-if(($aFile = $plxAdmin->plxGlob_arts->query('/^'.$artId.'.(.+).xml$/','','sort',0,1)) == false) {
- # On indique que le commentaire est attaché à aucun article
- $article = ''.L_COMMENT_ORPHAN.'';
- # Statut du commentaire
- $statut = ''.L_COMMENT_ORPHAN_STATUS.'';
-} else {
- $result = $plxAdmin->parseArticle(PLX_ROOT.$plxAdmin->aConf['racine_articles'].$aFile['0']);
- # On génère notre lien
- $article = '';
- $article .= plxUtils::strCheck($result['title']);
- $article .= '';
-}
-
-# Statut du commentaire
-$com=$plxAdmin->comInfoFromFilename($_GET['c'].'.xml');
-if($com['comStatus']=='_')
- $statut = ''.L_COMMENT_OFFLINE.'';
-elseif($com['comStatus']=='')
- $statut = ''.L_COMMENT_ONLINE.'';
-else
- $statut = '';
-
-# Date du commentaire
-$date = plxDate::date2Array($plxAdmin->plxRecord_coms->f('date'));
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-
-?>
-
-
-
-plxPlugins->callHook('AdminCommentFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
diff --git a/sources/core/admin/comment_new.php b/sources/core/admin/comment_new.php
deleted file mode 100644
index 5ccf13a..0000000
--- a/sources/core/admin/comment_new.php
+++ /dev/null
@@ -1,163 +0,0 @@
-plxPlugins->callHook('AdminCommentNewPrepend'));
-
-# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
-$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR);
-
-# Interdire de l'accès à la page si les commentaires sont désactivés
-if(!$plxAdmin->aConf['allow_com']) {
- header('Location: index.php');
- exit;
-}
-
-# validation de l'id de l'article si passé en parametre
-if(isset($_GET['a']) AND !preg_match('/^_?[0-9]{4}$/',$_GET['a'])) {
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE); # Article inexistant
- header('Location: index.php');
- exit;
-}
-
-# On va checker le mode (répondre ou écrire)
-if(!empty($_GET['c'])) { # Mode "answer"
- # On check que le commentaire existe et est "online"
-// if(!$plxAdmin->getCommentaires('/^'.plxUtils::nullbyteRemove($_GET['c']).'.xml$/','')) { # Commentaire inexistant
- if(!$plxAdmin->getCommentaires('/^'.plxUtils::nullbyteRemove($_GET['c']).'.xml$/','',0,1,'all')) {
- # On redirige
- plxMsg::Error(L_ERR_ANSWER_UNKNOWN_COMMENT);
- header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
- exit;
- }
- # Commentaire offline
- if(preg_match('/^_/',$_GET['c'])) {
- # On redirige
- plxMsg::Error(L_ERR_ANSWER_OFFLINE_COMMENT);
- header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
- exit;
- }
- # On va rechercher notre article
- if(($aFile = $plxAdmin->plxGlob_arts->query('/^'.$plxAdmin->plxRecord_coms->f('article').'.(.+).xml$/','','sort',0,1)) == false) { # Article inexistant
- plxMsg::Error(L_ERR_COMMENT_UNKNOWN_ARTICLE);
- header('Location: index.php');
- exit;
- }
- # Variables de traitement
- $artId = $plxAdmin->plxRecord_coms->f('article');
- if(!empty($_GET['a'])) $get = 'c='.$_GET['c'].'&a='.$_GET['a'];
- else $get = 'c='.$_GET['c'];
- $aArt = $plxAdmin->parseArticle(PLX_ROOT.$plxAdmin->aConf['racine_articles'].$aFile['0']);
- # Variable du formulaire
- $content = '@'.$plxAdmin->plxRecord_coms->f('author')." :\n";
- $article = '';
- $article .= plxUtils::strCheck($aArt['title']);
- $article .= '';
- # Ok, on récupère les commentaires de l'article
- $plxAdmin->getCommentaires('/^'.str_replace('_','',$artId).'.(.*).xml$/','rsort');
-} elseif(!empty($_GET['a'])) { # Mode "new"
- # On check l'article si il existe bien
- if(($aFile = $plxAdmin->plxGlob_arts->query('/^'.$_GET['a'].'.(.+).xml$/','','sort',0,1)) == false) {
- plxMsg::Error(L_ERR_COMMENT_UNEXISTENT_ARTICLE);
- header('Location: index.php');
- exit;
- }
- # Variables de traitement
- $artId = $_GET['a'];
- $get = 'a='.$_GET['a'];
- $aArt = $plxAdmin->parseArticle(PLX_ROOT.$plxAdmin->aConf['racine_articles'].$aFile['0']);
- # Variable du formulaire
- $content = '';
- $article = '';
- $article .= plxUtils::strCheck($aArt['title']);
- $article .= '';
- # Ok, on récupère les commentaires de l'article
- $plxAdmin->getCommentaires('/^'.str_replace('_','',$artId).'.(.*).xml$/','rsort');
-} else { # Mode inconnu
- header('Location: .index.php');
- exit;
-}
-
-# On a validé le formulaire
-if(!empty($_POST) AND !empty($_POST['content'])) {
- # Création du commentaire
- if(!$plxAdmin->newCommentaire(str_replace('_','',$artId),$_POST['content'])) { # Erreur
- plxMsg::Error(L_ERR_CREATING_COMMENT);
- } else { # Ok
- plxMsg::Info(L_CREATING_COMMENT_SUCCESSFUL);
- }
- header('Location: comment_new.php?a='.$artId);
- exit;
-}
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-?>
-
-
-plxRecord_coms)) : # On a des commentaires ?>
-
- plxRecord_coms->loop()) : # On boucle ?>
- plxRecord_coms->f('article').'.'.$plxAdmin->plxRecord_coms->f('numero'); ?>
-
-
-
-
-plxPlugins->callHook('AdminCommentNewFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
diff --git a/sources/core/admin/comments.php b/sources/core/admin/comments.php
deleted file mode 100644
index e3407b7..0000000
--- a/sources/core/admin/comments.php
+++ /dev/null
@@ -1,237 +0,0 @@
-plxPlugins->callHook('AdminCommentsPrepend'));
-
-# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
-$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR);
-
-# validation de l'id de l'article si passé en parametre
-if(isset($_GET['a']) AND !preg_match('/^_?[0-9]{4}$/',$_GET['a'])) {
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE); # Article inexistant
- header('Location: index.php');
- exit;
-}
-
-# Suppression des commentaires selectionnes
-if(isset($_POST['selection']) AND (!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='delete') AND isset($_POST['idCom'])) {
- foreach ($_POST['idCom'] as $k => $v) $plxAdmin->delCommentaire($v);
- header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
- exit;
-}
-# Validation des commentaires selectionnes
-elseif(isset($_POST['selection']) AND (!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='online') AND isset($_POST['idCom'])) {
- foreach ($_POST['idCom'] as $k => $v) $plxAdmin->modCommentaire($v, 'online');
- header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
- exit;
-}
-# Mise hors-ligne des commentaires selectionnes
-elseif (isset($_POST['selection']) AND (!empty($_POST['btn_ok1']) AND $_POST['selection'][0]=='offline') AND isset($_POST['idCom'])) {
- foreach ($_POST['idCom'] as $k => $v) $plxAdmin->modCommentaire($v, 'offline');
- header('Location: comments.php'.(!empty($_GET['a'])?'?a='.$_GET['a']:''));
- exit;
-}
-
-# Récuperation des infos sur l'article attaché au commentaire si passé en paramètre
-if(!empty($_GET['a'])) {
- # Infos sur notre article
- if(!$globArt = $plxAdmin->plxGlob_arts->query('/^'.$_GET['a'].'.(.*).xml$/','','sort',0,1)) {
- plxMsg::Error(L_ERR_UNKNOWN_ARTICLE); # Article inexistant
- header('Location: index.php');
- exit;
- }
- # Infos sur l'article
- $aArt = $plxAdmin->parseArticle(PLX_ROOT.$plxAdmin->aConf['racine_articles'].$globArt['0']);
- $portee = L_COMMENTS_ARTICLE_SCOPE.' «'.$aArt['title'].'»';
-} else { # Commentaires globaux
- $portee = '';
-}
-
-# On inclut le header
-include(dirname(__FILE__).'/top.php');
-
-# Récuperation du type de commentaire à afficher
-$_GET['sel'] = !empty($_GET['sel']) ? $_GET['sel'] : '';
-if(in_array($_GET['sel'], array('online', 'offline', 'all')))
- $comSel = plxUtils::nullbyteRemove($_GET['sel']);
-else
- $comSel = ((isset($_SESSION['selCom']) AND !empty($_SESSION['selCom'])) ? $_SESSION['selCom'] : 'all');
-
-if(!empty($_GET['a'])) {
- $comSelMotif = '/^[[:punct:]]?'.str_replace('_','',$_GET['a']).'.(.*).xml$/';
- $_SESSION['selCom'] = 'all';
- $nbComPagination=$plxAdmin->nbComments($comSelMotif);
- $h2 = ''.L_COMMENTS_ALL_LIST.'
';
-}
-elseif($comSel=='online') {
- $comSelMotif = '/^[0-9]{4}.(.*).xml$/';
- $_SESSION['selCom'] = 'online';
- $nbComPagination=$plxAdmin->nbComments('online');
- $h2 = ''.L_COMMENTS_ONLINE_LIST.'
';
-}
-elseif($comSel=='offline') {
- $comSelMotif = '/^_[0-9]{4}.(.*).xml$/';
- $_SESSION['selCom'] = 'offline';
- $nbComPagination=$plxAdmin->nbComments('offline');
- $h2 = ''.L_COMMENTS_OFFLINE_LIST.'
';
-}
-elseif($comSel=='all') { // all
- $comSelMotif = '/^[[:punct:]]?[0-9]{4}.(.*).xml$/';
- $_SESSION['selCom'] = 'all';
- $nbComPagination=$plxAdmin->nbComments('all');
- $h2 = ''.L_COMMENTS_ALL_LIST.'
';
-}
-
-if($portee!='') {
- $h3 = ''.$portee.'
';
-}
-
-$breadcrumbs = array();
-$breadcrumbs[] = ''.L_ALL.' ('.$plxAdmin->nbComments('all').')';
-$breadcrumbs[] = ''.L_COMMENT_ONLINE.' ('.$plxAdmin->nbComments('online').')';
-$breadcrumbs[] = ''.L_COMMENT_OFFLINE.' ('.$plxAdmin->nbComments('offline').')';
-if(!empty($_GET['a'])) {
- $breadcrumbs[] = ''.L_COMMENT_NEW_COMMENT.'';
-}
-
-function selector($comSel, $id) {
- ob_start();
- if($comSel=='online')
- plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'offline' => L_COMMENT_SET_OFFLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'no-margin',$id);
- elseif($comSel=='offline')
- plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, '-'=>'-----', 'delete' => L_COMMENT_DELETE), '', false,'no-margin',$id);
- elseif($comSel=='all')
- plxUtils::printSelect('selection[]', array(''=> L_FOR_SELECTION, 'online' => L_COMMENT_SET_ONLINE, 'offline' => L_COMMENT_SET_OFFLINE, '-'=>'-----','delete' => L_COMMENT_DELETE), '', false,'no-margin',$id);
- return ob_get_clean();
-}
-
-$selector1=selector($comSel, 'id_selection1');
-
-?>
-
-plxPlugins->callHook('AdminCommentsTop')) # Hook Plugins ?>
-
-
-
-plxPlugins->callHook('AdminCommentsPagination'));
-# Affichage de la pagination
-if($coms) { # Si on a des commentaires (hors page)
- # Calcul des pages
- $last_page = ceil($nbComPagination/$plxAdmin->aConf['bypage_admin_coms']);
- if($plxAdmin->page > $last_page) $plxAdmin->page = $last_page;
- $prev_page = $plxAdmin->page - 1;
- $next_page = $plxAdmin->page + 1;
- # Generation des URLs
- $p_url = 'comments.php?page='.$prev_page.'&sel='.$_SESSION['selCom'].(!empty($_GET['a'])?'&a='.$_GET['a']:''); # Page precedente
- $n_url = 'comments.php?page='.$next_page.'&sel='.$_SESSION['selCom'].(!empty($_GET['a'])?'&a='.$_GET['a']:''); # Page suivante
- $l_url = 'comments.php?page='.$last_page.'&sel='.$_SESSION['selCom'].(!empty($_GET['a'])?'&a='.$_GET['a']:''); # Derniere page
- $f_url = 'comments.php?page=1'.'&sel='.$_SESSION['selCom'].(!empty($_GET['a'])?'&a='.$_GET['a']:''); # Premiere page
- # On effectue l'affichage
- if($plxAdmin->page > 2) # Si la page active > 2 on affiche un lien 1ere page
- echo ''.L_PAGINATION_FIRST.'';
- if($plxAdmin->page > 1) # Si la page active > 1 on affiche un lien page precedente
- echo ''.L_PAGINATION_PREVIOUS.'';
- # Affichage de la page courante
- printf(''.L_PAGINATION.'',$plxAdmin->page,$last_page);
- if($plxAdmin->page < $last_page) # Si la page active < derniere page on affiche un lien page suivante
- echo ''.L_PAGINATION_NEXT.'';
- if(($plxAdmin->page + 1) < $last_page) # Si la page active++ < derniere page on affiche un lien derniere page
- echo ''.L_PAGINATION_LAST.'';
-}
-?>
-
-
-aConf['clef'])) : ?>
-
-
- - :
- racine.'feed.php?admin'.$plxAdmin->aConf['clef'].'/commentaires/hors-ligne'; ?>
-
- racine.'feed.php?admin'.$plxAdmin->aConf['clef'].'/commentaires/en-ligne'; ?>
-
-
-
-
-
-plxPlugins->callHook('AdminCommentsFoot'));
-# On inclut le footer
-include(dirname(__FILE__).'/foot.php');
-?>
diff --git a/sources/core/admin/foot.php b/sources/core/admin/foot.php
deleted file mode 100644
index 174b5b1..0000000
--- a/sources/core/admin/foot.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-plxPlugins->callHook('AdminFootEndBody')) ?>
-
-
-
-
plxRecord_coms->f('author'); ?> - @ plxRecord_coms->f('date'), '#day #num_day #month #num_year(4) à #hour:#minute'); ?> - - - - -
- - plxPlugins->callHook('AdminCommentNewList')) # Hook Plugins ?> -