Beispiel #1
0
	</tr>
</thead>
<tbody>

<?php 
# On va lister les articles
if ($plxAdmin->plxGlob_arts->count and $plxAdmin->plxRecord_arts->size) {
    # On a des articles
    while ($plxAdmin->plxRecord_arts->loop()) {
        # Pour chaque article
        $author = $plxAdmin->aUsers[$plxAdmin->plxRecord_arts->f('author')]['name'];
        # Date
        $year = substr($plxAdmin->plxRecord_arts->f('date'), 0, 4);
        $month = substr($plxAdmin->plxRecord_arts->f('date'), 5, 2);
        $day = substr($plxAdmin->plxRecord_arts->f('date'), 8, 2);
        $publi = $plxAdmin->plxRecord_arts->f('date') > plxDate::timestampToIso(time(), $plxAdmin->aConf['delta']) ? false : true;
        # Catégories : liste des libellelés toutes les categories
        $draft = '';
        $libCats = '';
        $catIds = explode(',', $plxAdmin->plxRecord_arts->f('categorie'));
        if (sizeof($catIds) > 0) {
            $catsName = array();
            foreach ($catIds as $catId) {
                if ($catId == 'home') {
                    $catsName[] = 'Accueil';
                } elseif ($catId == 'draft') {
                    $draft = ' - <strong>Brouillon</strong>';
                } elseif (!isset($plxAdmin->aCats[$catId])) {
                    $catsName[] = 'Non class&eacute;';
                } else {
                    $catsName[] = plxUtils::strCheck($plxAdmin->aCats[$catId]['name']);
Beispiel #2
0
 /**
  * Méthode qui parse le commentaire du fichier $filename
  *
  * @param	filename	fichier du commentaire à parser
  * @return	array
  * @author	Florent MONTHEL
  **/
 public function parseCommentaire($filename)
 {
     # Mise en place du parseur XML
     $data = implode('', file($filename));
     $parser = xml_parser_create(PLX_CHARSET);
     xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
     xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0);
     xml_parse_into_struct($parser, $data, $values, $iTags);
     xml_parser_free($parser);
     # Recuperation des valeurs de nos champs XML
     $com['author'] = trim($values[$iTags['author'][0]]['value']);
     $com['type'] = isset($values[$iTags['type'][0]]['value']) ? trim($values[$iTags['type'][0]]['value']) : 'normal';
     $com['ip'] = isset($values[$iTags['ip'][0]]['value']) ? trim($values[$iTags['ip'][0]]['value']) : '';
     $com['mail'] = isset($values[$iTags['mail'][0]]['value']) ? trim($values[$iTags['mail'][0]]['value']) : '';
     $com['site'] = isset($values[$iTags['site'][0]]['value']) ? trim($values[$iTags['site'][0]]['value']) : '';
     $com['content'] = trim($values[$iTags['content'][0]]['value']);
     # Informations obtenues en analysant le nom du fichier
     $tmp = $this->comInfoFromFilename($filename);
     $com['numero'] = $tmp['comId'];
     $com['article'] = $tmp['artId'];
     $com['date'] = plxDate::timestampToIso($tmp['comDate'], $this->aConf['delta']);
     # On retourne le tableau
     return $com;
 }