/** * Fonction de conversion de date ISO en format RFC822 * * @param date date à convertir * @return string date au format iso. * @author Amaury GRAILLAT **/ public static function dateIso2rfc822($date) { $tmpDate = plxDate::date2Array($date); return date(DATE_RSS, mktime(substr($tmpDate['time'], 0, 2), substr($tmpDate['time'], 3, 2), 0, $tmpDate['month'], $tmpDate['day'], $tmpDate['year'])); }
# 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 {
if (!isset($plxAdmin->aStats[$id])) { plxMsg::Error(L_STATIC_UNKNOWN_PAGE); header('Location: statiques.php'); exit; } # On récupère le contenu $content = trim($plxAdmin->getFileStatique($id)); $title = $plxAdmin->aStats[$id]['name']; $url = $plxAdmin->aStats[$id]['url']; $active = $plxAdmin->aStats[$id]['active']; $title_htmltag = $plxAdmin->aStats[$id]['title_htmltag']; $meta_description = $plxAdmin->aStats[$id]['meta_description']; $meta_keywords = $plxAdmin->aStats[$id]['meta_keywords']; $template = $plxAdmin->aStats[$id]['template']; $date_creation = plxDate::date2Array($plxAdmin->aStats[$id]['date_creation']); $date_update = plxDate::date2Array($plxAdmin->aStats[$id]['date_update']); } else { # Sinon, on redirige header('Location: statiques.php'); exit; } # On récupère les templates des pages statiques $aTemplates = array(); $files = plxGlob::getInstance(PLX_ROOT . $plxAdmin->aConf['racine_themes'] . $plxAdmin->aConf['style']); if ($array = $files->query('/^static(-[a-z0-9-_]+)?.php$/')) { foreach ($array as $k => $v) { $aTemplates[$v] = $v; } } if (empty($aTemplates)) { $aTemplates[''] = L_NONE1;
# On génère notre lien $article = '<a href="' . $plxAdmin->aConf['racine'] . 'index.php?article' . intval($result['numero']) . '/' . $result['url'] . '" title="' . L_COMMENT_ARTICLE_LINKED_TITLE . '">'; $article .= plxUtils::strCheck($result['title']); $article .= '</a>'; } # Statut du commentaire $com = $plxAdmin->comInfoFromFilename($_GET['c'] . '.xml'); if ($com['comStatus'] == '_') { $statut = '<strong>' . L_COMMENT_OFFLINE . '</strong>'; } elseif ($com['comStatus'] == '') { $statut = '<a href="' . PLX_ROOT . '?article' . intval($plxAdmin->plxRecord_coms->f('article')) . '/#c' . $plxAdmin->plxRecord_coms->f('index') . '" title="' . L_COMMENT_ONLINE_TITLE . '">' . L_COMMENT_ONLINE . '</a>'; } else { $statut = ''; } # Date du commentaire $date = plxDate::date2Array($plxAdmin->plxRecord_coms->f('date')); # On inclut le header include dirname(__FILE__) . '/top.php'; ?> <form action="comment.php<?php echo !empty($_GET['a']) ? '?a=' . plxUtils::strCheck($_GET['a']) : ''; ?> " method="post" id="form_comment"> <div class="inline-form action-bar"> <h2><?php echo L_COMMENT_EDITING; ?> </h2> <?php