check(1); include dirname(__FILE__).'/inc/connexion.php'; # Tableau des mois de l'année for ($i=1;$i<=12;$i++) { $m = sprintf('%02d',$i); $arry_dt_m[dt::str('%B',strtotime('2000-'.$m.'-01'))] = $m; } # Les catégories du blog $cat_id = (!empty($_GET['cat_id'])) ? $_GET['cat_id'] : ''; $rsCat = $blog->getCat(); while (!$rsCat->EOF()) { $arry_cat[$rsCat->f('cat_libelle')] = $rsCat->f('cat_id'); $rsCat->moveNext(); } # Valeurs par défaut $err = ''; $titre = ''; $titre_url = ''; $cat_id = $_SESSION['sess_user_pref_cat']; $dt_m = $dt_d = $dt_y = ''; $chapo = $preview_chapo = ''; $content = $preview_content = ''; $notes = ''; $is_editable = true; $format = $_SESSION['sess_user_format']; $etat = $_SESSION['sess_user_post_pub']; $open_comment = 1; $open_tb = 1; $lang = DC_LANG; $selected = 0; $return_link = 'index.php'; $do_trackbacks = false; $objWiki = new wiki2xhtml(); if (dc_encoding != 'UTF-8') { $objWiki->setOpt('active_fix_word_entities',1); } # Billet existant if (!empty($_REQUEST['post_id'])) { $post = $blog->getPostById($_REQUEST['post_id']); if (!$post->isEmpty()) { $post_id = $post->f('post_id'); $titre = $post->f('post_titre'); $titre_url = $post->f('post_titre_url'); $cat_id = $post->f('cat_id'); $format = $post->getFormat(); $etat = (integer) $post->f('post_pub'); $open_comment = (integer) $post->f('post_open_comment'); $open_tb = (integer) $post->f('post_open_tb'); $lang = $post->f('post_lang'); $selected = $post->f('post_selected'); $chapo = ($post->f('post_chapo_wiki') != '') ? $post->f('post_chapo_wiki') : $post->f('post_chapo'); $preview_chapo = $post->f('post_chapo'); $content = ($post->f('post_content_wiki') != '') ? $post->f('post_content_wiki') : $post->f('post_content'); $notes = $post->f('post_notes'); $preview_content = $post->f('post_content'); $return_link = 'index.php?m='.$post->f('postyear').$post->f('postmonth').'#p'.$post_id; $post_ts = $post->getTS(); $post_perm_url = $post->getPermURL(); $dt_y = date('Y',$post_ts); $dt_m = date('m',$post_ts); $dt_d = date('d',$post_ts); $dt_h = (string) date('H',$post_ts); $dt_i = (string) date('i',$post_ts); $dt_s = (string) date('s',$post_ts); $objWiki->setOpt('note_prefix','pnote-'.$post_id); $comments = $blog->getComments($post_id); # Le post n'est éditable que par un admin ou son rédacteur, # qu'on se le dise ! if ($post->f('user_id') != $_SESSION['sess_user_id'] && $_SESSION['sess_user_level'] < 9) { $is_editable = false; } # Changement du status ou suppression d'un commentaire if (!empty($_GET['comment_id'])) { if ($is_editable) { if (!empty($_GET['comment_del'])) { if ($blog->delComment($_GET['comment_id']) !== false) { header('Location: poster.php?post_id='.$post_id.'#comments'); exit; } else { $err = $blog->error(1); } } else { if ($blog->statusComment($_GET['comment_id']) !== false) { header('Location: poster.php?post_id='.$post_id.'#c'.$_GET['comment_id']); exit; } else { $err = $blog->error(1); } } } else { $err = '
'.__('Error(s)').' :
'. $err.''. __('Permanent link').' : '. util::getPageURL($post_perm_url).'
'; } } if (!empty($_POST['preview'])) { $titre = htmlspecialchars($titre); } /* Valeurs pouvant être passées en URL par un bookmarklet -------------------------------------------------------- */ if (!empty($_GET['dcb'])) { $purl = !empty($_GET['purl']) ? $_GET['purl'] : ''; $ptitle = !empty($_GET['ptitle']) ? $_GET['ptitle'] : ''; $ptext = !empty($_GET['ptext']) ? $_GET['ptext'] : ''; $titre = $ptitle; if ($format == 'wiki') { $content = '['.$ptitle.'|'.$purl."]\n\n".$ptext; } else { $content = ''.$ptitle."\n\n".$ptext.'
'; } } /* Entry form -------------------------------------------------------- */ if ($is_editable) { echo ''; } /* Comments -------------------------------------------------------- */ if (!empty($post_id)) { echo ''.__('Notice').' : '.__('This comment has to be in HTML format').'.
'; } # Affichage de commentaires ou trackbacks function showComments(&$rs) { global $is_editable, $post_id; while(!$rs->EOF()) { if ($rs->f('comment_pub')) { $com_style = ''; $com_cancel = __('set offline'); } else { $com_style = 'style="color:#999;"'; $com_cancel = __('set online'); } echo ''.(($rs->f('comment_trackback')==1) ? ''.__('Trackback').'
' : '').
__('From').' : '.$rs->f('comment_auteur').'
'.
dt::str(__('On %A %e %B %Y, %I:%M %p'),$rs->getTS()).'
'.
__('Email').' : '.$rs->f('comment_email').'
'.
__('Site').' : '.(($rs->f('comment_site')) ? 'http://'.$rs->f('comment_site') : '').'
'.
'@IP : '.$rs->f('comment_ip').'
'. ''.$com_cancel.''. ' - '.__('edit').''. ' - '.__('delete').''. '
'; } echo '