Beispiel #1
0
 /**
  * Méthode qui applique la compression gzip avant affichage
  *
  * @param	rel2bas		conversion des urls relatives en url absolues. Si conversion contient la racine du site
  * @return	stout
  * @return	stout
  **/
 public static function ob_gzipped_page($rel2abs = false)
 {
     if ($encoding = plxUtils::httpEncoding()) {
         $contents = ob_get_clean();
         if ($rel2abs) {
             $contents = plxUtils::rel2abs($rel2abs, $contents);
         }
         header('Content-Encoding: ' . $encoding);
         echo "�";
         $size = strlen($contents);
         $contents = gzcompress($contents, 9);
         $contents = substr($contents, 0, $size);
     } else {
         $contents = ob_get_clean();
         if ($rel2abs) {
             $contents = plxUtils::rel2abs($rel2abs, $contents);
         }
     }
     echo $contents;
     exit;
 }
Beispiel #2
0
<p><a href="./">&laquo; Retour &agrave; la liste des articles</a></p>

<h2><?php 
echo empty($_GET['a']) ? 'Nouvel article' : 'Modification d\'un article';
?>
</h2>

<?php 
# On a un aperçu
if (isset($_POST['preview'])) {
    # On remplace les chemins relatifs en chemin absolus
    $_chapo = Markdown($chapo);
    $_content = Markdown($content);
    $_chapo = plxUtils::rel2abs($plxAdmin->aConf['racine'], $_chapo);
    $_content = plxUtils::rel2abs($plxAdmin->aConf['racine'], $_content);
    echo '<blockquote id="preview">';
    echo "<h3>Pr&eacute;visualisation : " . plxUtils::strCheck($title) . "</h3>\n";
    echo '<div class="preview">' . $_chapo . '</div><div class="preview">' . $_content . '</div>';
    echo "</blockquote>\n";
}
?>
<p style="clear:both;"></p>

<form action="article.php" method="post" id="change-art-content">
	<div style="float:left;width:590px">
		<fieldset>
			<?php 
plxUtils::printInput('artId', $artId, 'hidden');
?>
			<p class="field"><label>Titre&nbsp;:</label>
Beispiel #3
0
 /**
  * Méthode qui affiche le flux rss des articles du site
  *
  * @return	flux sur stdout
  * @author	Florent MONTHEL, Stephane F, Amaury GRAILLAT
  **/
 public function getRssArticles()
 {
     # Initialisation
     $last_updated = '197001010100';
     $entry_link = '';
     $entry = '';
     if ($this->mode == 'tag') {
         $title = $this->aConf['title'] . ' - ' . L_PAGETITLE_TAG . ' ' . $this->cible;
         $link = $this->urlRewrite('?tag/' . $this->cible);
     } elseif ($this->cible) {
         # Articles d'une catégorie
         $catId = $this->cible + 0;
         $title = $this->aConf['title'] . ' - ' . $this->aCats[$this->cible]['name'];
         $link = $this->urlRewrite('?categorie' . $catId . '/' . $this->aCats[$this->cible]['url']);
     } else {
         # Articles globaux
         $title = $this->aConf['title'];
         $link = $this->urlRewrite();
     }
     # On va boucler sur les articles (s'il y en a)
     if ($this->plxRecord_arts) {
         while ($this->plxRecord_arts->loop()) {
             # Traitement initial
             if ($this->aConf['feed_chapo']) {
                 $content = $this->plxRecord_arts->f('chapo');
                 if (trim($content) == '') {
                     $content = $this->plxRecord_arts->f('content');
                 }
             } else {
                 $content = $this->plxRecord_arts->f('chapo') . $this->plxRecord_arts->f('content');
             }
             $content .= $this->aConf['feed_footer'];
             $artId = $this->plxRecord_arts->f('numero') + 0;
             $author = $this->aUsers[$this->plxRecord_arts->f('author')]['name'];
             # On vérifie la date de publication
             if ($this->plxRecord_arts->f('date') > $last_updated) {
                 $last_updated = $this->plxRecord_arts->f('date');
             }
             # On affiche le flux dans un buffer
             $entry .= "\t<item>\n";
             $entry .= "\t\t" . '<title>' . plxUtils::strCheck($this->plxRecord_arts->f('title')) . '</title> ' . "\n";
             $entry .= "\t\t" . '<link>' . $this->urlRewrite('?article' . $artId . '/' . $this->plxRecord_arts->f('url')) . '</link>' . "\n";
             $entry .= "\t\t" . '<guid>' . $this->urlRewrite('?article' . $artId . '/' . $this->plxRecord_arts->f('url')) . '</guid>' . "\n";
             $entry .= "\t\t" . '<description>' . plxUtils::strCheck(plxUtils::rel2abs($this->racine, $content)) . '</description>' . "\n";
             $entry .= "\t\t" . '<pubDate>' . plxDate::dateIso2rfc822($this->plxRecord_arts->f('date')) . '</pubDate>' . "\n";
             $entry .= "\t\t" . '<dc:creator>' . plxUtils::strCheck($author) . '</dc:creator>' . "\n";
             # Hook plugins
             eval($this->plxPlugins->callHook('plxFeedRssArticlesXml'));
             $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" . '<link>' . $link . '</link>' . "\n";
     echo "\t" . '<language>' . $this->aConf['default_lang'] . '</language>' . "\n";
     echo "\t" . '<description>' . plxUtils::strCheck($this->aConf['description']) . '</description>' . "\n";
     echo '<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="' . $this->urlRewrite('feed.php?rss') . '" />' . "\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>';
 }
Beispiel #4
0
    # Insertion du template
    include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template;
} else {
    header('Content-Type: text/plain; charset=' . PLX_CHARSET);
    echo L_ERR_FILE_NOTFOUND . ' (' . PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template . ') !';
}
# Récuperation de la bufférisation
$output = ob_get_clean();
# Hooks spécifiques au thème
ob_start();
eval($plxMotor->plxPlugins->callHook('ThemeEndHead'));
$output = str_replace('</head>', ob_get_clean() . '</head>', $output);
ob_start();
eval($plxMotor->plxPlugins->callHook('ThemeEndBody'));
$output = str_replace('</body>', ob_get_clean() . '</body>', $output);
# Hook Plugins
eval($plxMotor->plxPlugins->callHook('IndexEnd'));
# On applique la réécriture d'url si nécessaire
if ($plxMotor->aConf['urlrewriting']) {
    $output = plxUtils::rel2abs($plxMotor->aConf['racine'], $output);
}
# On applique la compression gzip si nécessaire et disponible
if ($plxMotor->aConf['gzip']) {
    if ($encoding = plxUtils::httpEncoding()) {
        header('Content-Encoding: ' . $encoding);
        $output = gzencode($output, -1, FORCE_GZIP);
    }
}
# Restitution écran
echo $output;
exit;
Beispiel #5
0
 /**
  * Méthode qui affiche le flux rss des articles du site
  *
  * @return	flux sur stdout
  * @author	Florent MONTHEL, Stephane F
  **/
 public function getRssArticles()
 {
     # Initialisation
     $last_updated = '';
     $entry_link = '';
     $entry = '';
     if ($this->cible) {
         # Articles d'une catégorie
         $catId = $this->cible + 0;
         $title = $this->aConf['title'] . ' - ' . $this->aCats[$this->cible]['name'];
         $link = $this->urlRewrite('?categorie' . $catId . '/' . $this->aCats[$this->cible]['url']);
     } else {
         # Articles globaux
         $title = $this->aConf['title'];
         $link = $this->urlRewrite();
     }
     # On va boucler sur les articles (si il y'en a)
     if ($this->plxRecord_arts) {
         while ($this->plxRecord_arts->loop()) {
             # Traitement initial
             # Traitement initial
             if ($this->aConf['feed_chapo']) {
                 $content = Markdown($this->plxRecord_arts->f('chapo'));
                 if (trim($content) == '') {
                     $content = Markdown($this->plxRecord_arts->f('content'));
                 }
             } else {
                 $content = Markdown($this->plxRecord_arts->f('chapo')) . Markdown($this->plxRecord_arts->f('content'));
             }
             $content .= $this->aConf['feed_footer'];
             $artId = $this->plxRecord_arts->f('numero') + 0;
             $author = $this->aUsers[$this->plxRecord_arts->f('author')]['name'];
             # On check la date de publication
             if ($this->plxRecord_arts->f('date') > $last_updated) {
                 $last_updated = $this->plxRecord_arts->f('date');
             }
             # On affiche le résumé dans un buffer
             $entry_link .= "\t\t\t" . '<rdf:li rdf:resource="' . $this->urlRewrite('?article' . $artId . '/' . $this->plxRecord_arts->f('url')) . '"/>' . "\n";
             # On affiche le flux dans un buffer
             $entry .= '<item rdf:about="' . $this->urlRewrite('?article' . $artId . '/' . $this->plxRecord_arts->f('url')) . '">' . "\n";
             $entry .= "\t" . '<title>' . plxUtils::strCheck($this->plxRecord_arts->f('title')) . '</title> ' . "\n";
             $entry .= "\t" . '<link>' . $this->urlRewrite('?article' . $artId . '/' . $this->plxRecord_arts->f('url')) . '</link>' . "\n";
             $entry .= "\t" . '<dc:date>' . $this->plxRecord_arts->f('date') . '</dc:date>' . "\n";
             $entry .= "\t" . '<dc:creator>' . plxUtils::strCheck($author) . '</dc:creator>' . "\n";
             $entry .= "\t" . '<description>' . plxUtils::strCheck(plxUtils::rel2abs($this->racine, $content)) . '</description>' . "\n";
             $entry .= '</item>' . "\n";
         }
     }
     # On affiche le flux
     header('Content-Type: text/xml; charset=' . PLX_CHARSET);
     echo '<?xml version="1.0" encoding="' . PLX_CHARSET . '" ?>' . "\n";
     echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">' . "\n";
     echo '<channel rdf:about="' . $link . '">' . "\n";
     echo "\t" . '<title>' . plxUtils::strCheck($title) . '</title>' . "\n";
     echo "\t" . '<link>' . $link . '</link>' . "\n";
     echo "\t" . '<description>' . plxUtils::strCheck($this->aConf['description']) . '</description>' . "\n";
     echo "\t" . '<lastBuildDate>' . $last_updated . '</lastBuildDate>' . "\n";
     echo "\t" . '<generator>PluXml ' . $this->version . '</generator>' . "\n";
     echo "\t" . '<dc:language>fr</dc:language>' . "\n";
     echo "\t" . '<items>' . "\n";
     echo "\t\t" . '<rdf:Seq>' . "\n";
     echo $entry_link;
     echo "\t\t" . '</rdf:Seq>' . "\n";
     echo "\t" . '</items>' . "\n";
     echo '</channel>' . "\n";
     echo $entry;
     echo '</rdf:RDF>';
 }