} } else { $libCats = L_UNCLASSIFIED; } } # en attente de validation ? $idArt = $plxAdmin->plxRecord_arts->f('numero'); $awaiting = $idArt[0] == '_' ? ' - <strong>' . L_AWAITING . '</strong>' : ''; # Commentaires $nbComsToValidate = $plxAdmin->getNbCommentaires('/^_' . $idArt . '.(.*).xml$/', 'all'); $nbComsValidated = $plxAdmin->getNbCommentaires('/^' . $idArt . '.(.*).xml$/', 'all'); # On affiche la ligne echo '<tr>'; echo '<td><input type="checkbox" name="idArt[]" value="' . $idArt . '" /></td>'; echo '<td>' . $idArt . '</td>'; echo '<td>' . plxDate::formatDate($plxAdmin->plxRecord_arts->f('date')) . ' </td>'; echo '<td class="wrap"><a href="article.php?a=' . $idArt . '" title="' . L_ARTICLE_EDIT_TITLE . '">' . plxUtils::strCheck($plxAdmin->plxRecord_arts->f('title')) . '</a>' . $draft . $awaiting . ' </td>'; echo '<td>' . $libCats . ' </td>'; echo '<td><a title="' . L_NEW_COMMENTS_TITLE . '" href="comments.php?sel=offline&a=' . $plxAdmin->plxRecord_arts->f('numero') . '&page=1">' . $nbComsToValidate . '</a> / <a title="' . L_VALIDATED_COMMENTS_TITLE . '" href="comments.php?sel=online&a=' . $plxAdmin->plxRecord_arts->f('numero') . '&page=1">' . $nbComsValidated . '</a> </td>'; echo '<td>' . plxUtils::strCheck($author) . ' </td>'; echo '<td>'; echo '<a href="article.php?a=' . $idArt . '" title="' . L_ARTICLE_EDIT_TITLE . '">' . L_ARTICLE_EDIT . '</a>'; if ($publi and $draft == '') { # Si l'article est publié echo ' | <a href="' . PLX_ROOT . '?article' . intval($idArt) . '/' . $plxAdmin->plxRecord_arts->f('url') . '" title="' . L_ARTICLE_VIEW_TITLE . '">' . L_ARTICLE_VIEW . '</a>'; } echo " </td>"; echo "</tr>"; } } else { # Pas d'article
} echo '</td>'; echo '<td>'; echo '<a onclick="this.target=\'_blank\';return true;" title="' . plxUtils::strCheck($v['name']) . '" href="' . $v['path'] . '">' . plxUtils::strCheck($v['name']) . '</a><br />'; if ($isImage and is_file(plxUtils::thumbName($v['path']))) { echo '<a onclick="this.target=\'_blank\';return true;" title="' . L_MEDIAS_THUMB . ' : ' . plxUtils::strCheck($v['name']) . '" href="' . plxUtils::thumbName($v['path']) . '">' . L_MEDIAS_THUMB . '</a> : ' . $v['thumb']['infos'][0] . ' x ' . $v['thumb']['infos'][1] . ' (' . plxUtils::formatFilesize($v['thumb']['filesize']) . ')'; } echo '</td>'; echo '<td>' . strtoupper($v['extension']) . '</td>'; echo '<td>' . plxUtils::formatFilesize($v['filesize']) . '</td>'; $dimensions = ' '; if ($isImage and (isset($v['infos']) and isset($v['infos'][0]) and isset($v['infos'][1]))) { $dimensions = $v['infos'][0] . ' x ' . $v['infos'][1]; } echo '<td>' . $dimensions . '</td>'; echo '<td>' . plxDate::formatDate(plxDate::timestamp2Date($v['date'])) . '</td>'; echo '</tr>'; } } else { echo '<tr><td colspan="7" class="center">' . L_MEDIAS_NO_FILE . '</td></tr>'; } ?> </tbody> </table> </div> </div> </form> <form action="medias.php" method="post" id="form_uploader" class="form_uploader" enctype="multipart/form-data"> <div id="files_uploader" style="display:none">
$art = $plxMotor->parseArticle(PLX_ROOT . $plxMotor->aConf['racine_articles'] . $v); $tags = implode(" ", array_map("trim", explode(',', strtolower($art['tags'])))); $searchstring = strtolower(plxUtils::strRevCheck($art['title'] . $art['chapo'] . $art['content']) . $tags); $searchstring = plxUtils::unSlash($searchstring); $searchok = false; foreach ($searchwords as $word) { if (strpos($searchstring, $word) !== false) { $searchok = true; } } if ($searchok) { $searchresults = true; $art_num = intval($art['numero']); $art_url = $art['url']; $art_title = plxUtils::strCheck($art['title']); $art_date = plxDate::formatDate($art['date'], $format_date); echo '<li>' . $art_date . ': <a href="' . $plxMotor->urlRewrite('?article' . $art_num . '/' . $art_url) . '">' . $art_title . '</a></li>'; } } } # recherche dans les pages statiques if ($plxMotor->aStats) { foreach ($plxMotor->aStats as $k => $v) { if ($v['active'] == 1 and $v['url'] != $plxMotor->mode) { # si la page est bien active $filename = PLX_ROOT . $plxMotor->aConf['racine_statiques'] . $k . '.' . $v['url'] . '.php'; if (file_exists($filename)) { $searchstring = strtolower(plxUtils::strRevCheck(file_get_contents($filename))); $searchstring = plxUtils::unSlash($searchstring); $searchok = false; foreach ($searchwords as $word) {
/** * Méthode qui affiche la date de la dernière modification du produit selon le format choisi * * @param format format du texte de la date (variable: #minute, #hour, #day, #month, #num_day, #num_month, #num_year(4), #num_year(2)) * @return stdout * @scope product * @author David.L **/ public function productDate($format = '#day #num_day #month #num_year(4)') { # On genere le nom du fichier dont on veux récupérer la date $file = PLX_ROOT . 'data/products/' . $this->productNumber(); $file .= '.' . $this->aProds[$this->productNumber()]['url'] . '.php'; # Test de l'existence du fichier if (!is_file($file)) { return; } # On récupère la date de la dernière modification du fichier qu'on formate echo plxDate::formatDate(date('YmdHi', filemtime($file)), $format); }
?> "> <div id="com-<?php echo $plxAdmin->plxRecord_coms->f('index'); ?> "> <small> <span class="nbcom">#<?php echo $plxAdmin->plxRecord_coms->i + 1; ?> </span> <time datetime="<?php echo plxDate::formatDate($plxAdmin->plxRecord_coms->f('date'), '#num_year(4)-#num_month-#num_day #hour:#minute'); ?> "><?php echo plxDate::formatDate($plxAdmin->plxRecord_coms->f('date'), '#day #num_day #month #num_year(4) à #hour:#minute'); ?> </time> - <?php echo L_COMMENT_WRITTEN_BY; ?> <strong><?php echo $plxAdmin->plxRecord_coms->f('author'); ?> </strong> - <a href="comment.php<?php echo !empty($_GET['a']) ? '?c=' . $comId . '&a=' . $_GET['a'] : '?c=' . $comId; ?> " title="<?php echo L_COMMENT_EDIT_TITLE; ?>
<?php include dirname(__FILE__) . '/header.php'; ?> <section class="archives"> <div id="container"> <div class="width-sidebar"> <p class="directory"> <strong><?php echo plxDate::formatDate($plxShow->plxMotor->cible, $plxShow->lang('ARCHIVES') . ": " . ' #month #num_year(4)'); ?> </strong> </p> <?php while ($plxShow->plxMotor->plxRecord_arts->loop()) { ?> <article role="article" id="post-<?php echo $plxShow->artId(); ?> "> <header> <h1> <?php $plxShow->artTitle('link');
/** * Méthode qui affiche la date de modification de la page statique selon le format choisi * * @param format format du texte de la date (variable: #minute, #hour, #day, #month, #num_day, #num_day(1), #num_day(2), #num_month, #num_year(4), #num_year(2)) * @return stdout * @scope static * @author Stephane F. **/ public function staticUpdateDate($format = '#num_day/#num_month/#num_year(4) #time') { echo plxDate::formatDate($this->plxMotor->aStats[$this->plxMotor->cible]['date_update'], $format); }
/** * Méthode qui affiche la date de la dernière modification de la page statique selon le format choisi * * @param format format du texte de la date (variable: #minute, #hour, #day, #month, #num_day, #num_day(1), #num_day(2), #num_month, #num_year(4), #num_year(2)) * @return stdout * @scope static * @author Anthony T. **/ public function staticDate($format = '#day #num_day #month #num_year(4)') { # On genere le nom du fichier dont on veux récupérer la date $file = PLX_ROOT . $this->plxMotor->aConf['racine_statiques'] . $this->plxMotor->cible; $file .= '.' . $this->plxMotor->aStats[$this->plxMotor->cible]['url'] . '.php'; # Test de l'existence du fichier if (!file_exists($file)) { return; } # On récupère la date de la dernière modification du fichier qu'on formate echo plxDate::formatDate(date('YmdHi', filemtime($file)), $format); }
$coms = $plxAdmin->getCommentaires($comSelMotif, 'rsort', $start, $plxAdmin->aConf['bypage_admin_coms'], 'all'); if ($coms) { $num = 0; while ($plxAdmin->plxRecord_coms->loop()) { # On boucle $artId = $plxAdmin->plxRecord_coms->f('article'); $status = $plxAdmin->plxRecord_coms->f('status'); $id = $status . $artId . '.' . $plxAdmin->plxRecord_coms->f('numero'); $content = nl2br($plxAdmin->plxRecord_coms->f('content')); if ($_SESSION['selCom'] == 'all') { $content = '<strong>' . ($status == '' ? L_COMMENT_ONLINE : L_COMMENT_OFFLINE) . '</strong> - ' . $content; } # On génère notre ligne echo '<tr class="line-' . ++$num % 2 . ' top type-' . $plxAdmin->plxRecord_coms->f('type') . '">'; echo '<td><input type="checkbox" name="idCom[]" value="' . $id . '" /></td>'; echo '<td class="datetime">' . plxDate::formatDate($plxAdmin->plxRecord_coms->f('date')) . ' </td>'; echo '<td class="wrap">' . $content . ' </td>'; echo '<td>' . plxUtils::strCut($plxAdmin->plxRecord_coms->f('author'), 30) . ' </td>'; echo '<td class="action">'; echo '<a href="comment_new.php?c=' . $id . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : '') . '" title="' . L_COMMENT_ANSWER . '">' . L_COMMENT_ANSWER . '</a> '; echo '<a href="comment.php?c=' . $id . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : '') . '" title="' . L_COMMENT_EDIT_TITLE . '">' . L_COMMENT_EDIT . '</a> '; echo '<a href="article.php?a=' . $artId . '" title="' . L_COMMENT_ARTICLE_LINKED_TITLE . '">' . L_COMMENT_ARTICLE_LINKED . '</a>'; echo '</td></tr>'; } } else { # Pas de commentaires echo '<tr><td colspan="5" class="center">' . L_NO_COMMENT . '</td></tr>'; } ?> </tbody> </table>
/** * Méthode qui affiche le flux RSS des commentaires du site pour l'administration * * @return flux sur stdout * @author Florent MONTHEL, Amaury GRAILLAT **/ public function getAdminComments() { # Traitement initial $last_updated = '197001010100'; $entry = ''; if ($this->cible == '_') { # Commentaires hors ligne $link = $this->racine . 'core/admin/comments.php?sel=offline&page=1'; $title = $this->aConf['title'] . ' - ' . L_FEED_OFFLINE_COMMENTS; $link_feed = $this->racine . 'feed.php?admin' . $this->clef . '/commentaires/hors-ligne'; } else { # Commentaires en ligne $link = $this->racine . 'core/admin/comments.php?sel=online&page=1'; $title = $this->aConf['title'] . ' - ' . L_FEED_ONLINE_COMMENTS; $link_feed = $this->racine . 'feed.php?admin' . $this->clef . '/commentaires/en-ligne'; } # On va boucler sur les commentaires (s'il y en a) if ($this->plxRecord_coms) { while ($this->plxRecord_coms->loop()) { $artId = $this->plxRecord_coms->f('article') + 0; $comId = $this->cible . $this->plxRecord_coms->f('article') . '.' . $this->plxRecord_coms->f('numero'); $title_com = $this->plxRecord_coms->f('author') . ' @ '; $title_com .= plxDate::formatDate($this->plxRecord_coms->f('date'), '#day #num_day #month #num_year(4), #hour:#minute'); $link_com = $this->racine . 'core/admin/comment.php?c=' . $comId; # On vérifie la date de publication if ($this->plxRecord_coms->f('date') > $last_updated) { $last_updated = $this->plxRecord_coms->f('date'); } # On affiche le flux dans un buffer $entry .= "\t<item>\n"; $entry .= "\t\t" . '<title>' . strip_tags(html_entity_decode($title_com, ENT_QUOTES, PLX_CHARSET)) . '</title> ' . "\n"; $entry .= "\t\t" . '<link>' . $link_com . '</link>' . "\n"; $entry .= "\t\t" . '<guid>' . $link_com . '</guid>' . "\n"; $entry .= "\t\t" . '<description>' . plxUtils::strCheck(strip_tags($this->plxRecord_coms->f('content'))) . '</description>' . "\n"; $entry .= "\t\t" . '<pubDate>' . plxDate::dateIso2rfc822($this->plxRecord_coms->f('date')) . '</pubDate>' . "\n"; $entry .= "\t\t" . '<dc:creator>' . plxUtils::strCheck($this->plxRecord_coms->f('author')) . '</dc:creator>' . "\n"; # Hook plugins eval($this->plxPlugins->callHook('plxFeedAdminCommentsXml')); $entry .= "\t</item>\n"; } } # On affiche le flux header('Content-Type: text/xml; charset=' . PLX_CHARSET); echo '<?xml version="1.0" encoding="' . PLX_CHARSET . '" ?>' . "\n"; echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">' . "\n"; echo '<channel>' . "\n"; echo "\t" . '<title>' . plxUtils::strCheck($title) . '</title>' . "\n"; echo "\t" . '<description>' . plxUtils::strCheck($this->aConf['description']) . '</description>' . "\n"; echo "\t" . '<link>' . $link . '</link>' . "\n"; echo "\t" . '<language>' . $this->aConf['default_lang'] . '</language>' . "\n"; echo '<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="' . $link_feed . '" />' . "\n"; $last_updated = plxDate::dateIso2rfc822($last_updated); echo "\t" . '<lastBuildDate>' . $last_updated . '</lastBuildDate>' . "\n"; echo "\t" . '<generator>PluXml</generator>' . "\n"; echo $entry; echo '</channel>' . "\n"; echo '</rss>'; }
$plxRecord_arts = false; $array = array(); foreach ($aFiles as $k => $v) { # On parcourt tous les fichiers $array[$k] = $plxMotor->parseArticle(PLX_ROOT . $plxMotor->aConf['racine_articles'] . $v); } # On stocke les enregistrements dans un objet plxRecord $plxRecord_arts = new plxRecord($array); if ($plxRecord_arts) { # On boucle sur nos articles while ($plxRecord_arts->loop()) { $num = intval($plxRecord_arts->f('numero')); echo "\n"; echo "\t<url>\n"; echo "\t\t<loc>" . $plxMotor->urlRewrite("?article" . $num . "/" . plxUtils::strCheck($plxRecord_arts->f('url'))) . "</loc>\n"; echo "\t\t<lastmod>" . plxDate::formatDate($plxRecord_arts->f('date'), '#num_year(4)-#num_month-#num_day') . "</lastmod>\n"; echo "\t\t<changefreq>monthly</changefreq>\n"; echo "\t\t<priority>0.5</priority>\n"; echo "\t</url>\n"; } } } eval($plxMotor->plxPlugins->callHook('SitemapArticles')); ?> </urlset> <?php # Récuperation de la bufférisation $output = ob_get_clean(); # Hook Plugins eval($plxMotor->plxPlugins->callHook('SitemapEnd')); # Restitution écran