Exemplo n.º 1
0
function conversions_theme_article($texte, $billet)
{
    // Formulaire commentaires
    if (isset($GLOBALS['form_commentaire'])) {
        $texte = str_replace($GLOBALS['balises']['form_commentaire'], $GLOBALS['form_commentaire'], $texte);
    } else {
        $texte = str_replace($GLOBALS['balises']['form_commentaire'], '', $texte);
    }
    // FIXME : remplacer uniquement dans le texte, pas les liens.
    //	$billet['bt_content'] = str_replace($q, '<mark>'.$q.'</mark>', $billet['bt_content']);
    $texte = str_replace($GLOBALS['balises']['blog_auteur'], $GLOBALS['auteur'], $texte);
    $texte = str_replace($GLOBALS['balises']['style'], $GLOBALS['theme_style'], $texte);
    $texte = str_replace($GLOBALS['balises']['rss_comments'], 'rss.php?id=' . $billet['bt_id'], $texte);
    $texte = str_replace($GLOBALS['balises']['article_titre'], $billet['bt_title'], $texte);
    $texte = str_replace($GLOBALS['balises']['article_chapo'], $billet['bt_abstract'], $texte);
    $texte = str_replace($GLOBALS['balises']['article_contenu'], $billet['bt_content'], $texte);
    $texte = str_replace($GLOBALS['balises']['article_date'], date_formate($billet['bt_date']), $texte);
    $texte = str_replace($GLOBALS['balises']['article_date_iso'], date_formate_iso($billet['bt_date']), $texte);
    $texte = str_replace($GLOBALS['balises']['article_heure'], heure_formate($billet['bt_date']), $texte);
    // comments closed (globally or only for this article) and no comments => say « comments closed »
    if (($billet['bt_allow_comments'] == 0 or $GLOBALS['global_com_rule'] == 1) and $billet['bt_nb_comments'] == 0) {
        $texte = str_replace($GLOBALS['balises']['nb_commentaires'], $GLOBALS['lang']['note_comment_closed'], $texte);
    }
    // comments open OR ( comments closed AND comments exists ) => say « nb comments ».
    if (!($billet['bt_allow_comments'] == 0 or $GLOBALS['global_com_rule'] == 1) or $billet['bt_nb_comments'] != 0) {
        $texte = str_replace($GLOBALS['balises']['nb_commentaires'], nombre_objets($billet['bt_nb_comments'], 'commentaire'), $texte);
    }
    $texte = str_replace($GLOBALS['balises']['article_lien'], $billet['bt_link'], $texte);
    $texte = str_replace($GLOBALS['balises']['article_tags'], liste_tags($billet, '1'), $texte);
    $texte = str_replace($GLOBALS['balises']['article_tags_plain'], liste_tags($billet, '0'), $texte);
    return $texte;
}
Exemplo n.º 2
0
            $out .= "\t" . '</li>' . "\n";
            $i++;
        }
        $out .= '</ul>' . "\n\n";
        echo $out;
    } else {
        echo info($GLOBALS['lang']['note_no_article']);
    }
}
afficher_html_head($GLOBALS['lang']['mesarticles']);
echo '<div id="top">' . "\n";
afficher_msg();
echo moteur_recherche($GLOBALS['lang']['search_in_articles']);
afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['mesarticles']);
echo '</div>' . "\n";
echo '<div id="axe">' . "\n";
// SUBNAV
echo '<div id="subnav">' . "\n";
if (isset($_GET['filtre'])) {
    afficher_form_filtre('articles', htmlspecialchars($_GET['filtre']));
} else {
    afficher_form_filtre('articles', '');
}
echo '<div class="nombre-elem">' . "\n";
echo ucfirst(nombre_objets(count($tableau), 'article')) . ' ' . $GLOBALS['lang']['sur'] . ' ' . liste_elements_count("SELECT count(*) AS nbr FROM articles", array());
echo '</div>' . "\n";
echo '</div>' . "\n";
echo '<div id="page">' . "\n";
afficher_liste_articles($tableau);
echo "\n" . '<script src="style/javascript.js" type="text/javascript"></script>' . "\n";
footer('', $begin);
Exemplo n.º 3
0
afficher_msg();
echo moteur_recherche($GLOBALS['lang']['search_in_links']);
afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['mesliens']);
echo '</div>' . "\n";
echo '<div id="axe">' . "\n";
// SUBNAV
echo '<div id="subnav">' . "\n";
// Affichage formulaire filtrage liens
if (isset($_GET['filtre'])) {
    afficher_form_filtre('links', htmlspecialchars($_GET['filtre']));
} else {
    afficher_form_filtre('links', '');
}
if ($step != 'edit' and $step != 2) {
    echo "\t" . '<div class="nombre-elem">';
    echo "\t\t" . ucfirst(nombre_objets($nb_links_displayed, 'link')) . ' ' . $GLOBALS['lang']['sur'] . ' ' . liste_elements_count("SELECT count(*) AS nbr FROM links", array(), 'links') . "\n";
    echo "\t" . '</div>' . "\n";
}
echo '</div>' . "\n";
echo '<div id="page">' . "\n";
if ($step == 'edit' and !empty($tableau[0])) {
    // edit un lien : affiche le lien au dessus du champ d’édit
    //afficher_liens($tableau[0]);
    echo afficher_form_link($step, $erreurs_form, $tableau[0]);
} elseif ($step == 2) {
    // lien donné dans l’URL
    echo afficher_form_link($step, $erreurs_form);
} else {
    // aucun lien à ajouter ou éditer : champ nouveau lien + listage des liens en dessus.
    echo afficher_form_link(1, $erreurs_form);
    echo '<div id="list-link">' . "\n";
Exemplo n.º 4
0
    $titre_ecrire_court = $GLOBALS['lang']['titre_ecrire'];
    $titre_ecrire = $titre_ecrire_court;
}
// DEBUT PAGE
afficher_html_head($titre_ecrire);
echo '<div id="top">' . "\n";
afficher_msg();
afficher_topnav(basename($_SERVER['PHP_SELF']), $titre_ecrire_court);
echo '</div>' . "\n";
echo '<div id="axe">' . "\n";
// SUBNAV
if ($post != '') {
    echo '<div id="subnav">' . "\n";
    echo '<div class="nombre-elem">';
    echo '<a href="' . $post['bt_link'] . '">' . $GLOBALS['lang']['lien_article'] . '</a> &nbsp; – &nbsp; ';
    echo '<a href="commentaires.php?post_id=' . $article_id . '">' . ucfirst(nombre_objets($post['bt_nb_comments'], 'commentaire')) . '</a>';
    echo '</div>' . "\n";
    echo '</div>' . "\n";
}
echo '<div id="page">' . "\n";
// EDIT
if ($post != '') {
    apercu($post);
}
afficher_form_billet($post, $erreurs_form);
echo "\n" . '<script src="style/javascript.js" type="text/javascript"></script>' . "\n";
echo '<script type="text/javascript">';
echo js_alert_before_quit(0);
echo js_red_button_event(0);
echo '</script>';
footer('', $begin);
Exemplo n.º 5
0
if (isset($_GET['filtre'])) {
    afficher_form_filtre('commentaires', htmlspecialchars($_GET['filtre']));
} else {
    afficher_form_filtre('commentaires', '');
}
echo '<div class="nombre-elem">' . "\n";
if ($param_makeup['menu_theme'] == 'for_article') {
    $dec_id = decode_id($article_id);
    $article_link = $GLOBALS['racine'] . '?d=' . $dec_id['annee'] . '/' . $dec_id['mois'] . '/' . $dec_id['jour'] . '/' . $dec_id['heure'] . '/' . $dec_id['minutes'] . '/' . $dec_id['secondes'] . '-' . titre_url($article_title);
    echo '<ul>' . "\n";
    echo "\t" . '<li><a href="ecrire.php?post_id=' . $article_id . '">' . $GLOBALS['lang']['ecrire'] . $article_title . '</a></li>' . "\n";
    echo "\t" . '<li><a href="' . $article_link . '">' . $GLOBALS['lang']['lien_article'] . '</a></li>' . "\n";
    echo '</ul>' . "\n";
    echo '– &nbsp; ' . ucfirst(nombre_objets(count($commentaires), 'commentaire'));
} elseif ($param_makeup['menu_theme'] == 'for_comms') {
    echo ucfirst(nombre_objets(count($commentaires), 'commentaire')) . ' ' . $GLOBALS['lang']['sur'] . ' ' . $nb_total_comms;
}
echo '</div>' . "\n";
echo '</div>' . "\n";
//echo erreurs($erreurs_form);
echo '<div id="page">' . "\n";
// COMMENTAIRES
echo '<div id="liste-commentaires">' . "\n";
if (count($commentaires) > 0) {
    $token = new_token();
    foreach ($commentaires as $content) {
        $content['comm-token'] = $token;
        afficher_commentaire($content, $param_makeup['show_links']);
    }
} else {
    echo info($GLOBALS['lang']['note_no_commentaire']);
Exemplo n.º 6
0
    }
    return $table_months;
}
/* Une recherche a été faite : affiche la recherche */
if (!empty($_GET['q'])) {
    $q = htmlspecialchars($_GET['q']);
    $nb_commentaires = liste_elements_count("SELECT count(ID) AS nbr FROM commentaires WHERE bt_content LIKE ?", array('%' . $q . '%'));
    $nb_articles = liste_elements_count("SELECT count(ID) AS nbr FROM articles WHERE ( bt_content LIKE ? OR bt_title LIKE ? )", array('%' . $q . '%', '%' . $q . '%'));
    $nb_liens = liste_elements_count("SELECT count(ID) AS nbr FROM links WHERE ( bt_content LIKE ? OR bt_title LIKE ? OR bt_link LIKE ? )", array('%' . $q . '%', '%' . $q . '%', '%' . $q . '%'));
    $nb_files = sizeof(liste_base_files('recherche', urldecode($_GET['q']), ''));
    echo '<h2>' . $GLOBALS['lang']['recherche'] . ' "<span style="font-style: italic">' . htmlspecialchars($_GET['q']) . '</span>" :</h2>' . "\n";
    echo '<ul id="resultat-recherche">';
    echo "\t" . '<li><a href="commentaires.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_objets($nb_commentaires, 'commentaire') . '</a></li>';
    echo "\t" . '<li><a href="articles.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_objets($nb_articles, 'article') . '</a></li>';
    echo "\t" . '<li><a href="links.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_objets($nb_liens, 'link') . '</a></li>';
    echo "\t" . '<li><a href="fichiers.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_objets($nb_files, 'fichier') . '</a></li>';
    echo '</ul>';
} else {
    mb_internal_encoding('UTF-8');
    echo '<div id="graphs">' . "\n";
    $nothingyet = 0;
    if (!$total_artic == 0) {
        // print sur chaque div pour les articles.
        echo '<p>' . ucfirst($GLOBALS['lang']['label_articles']) . ' :</p>' . "\n";
        echo '<div class="graphique" id="articles">' . "\n";
        $table = scaled_size(get_tableau_date('articles'), 150);
        while ($table[0]['nb'] === 0) {
            $first = array_shift($table);
        }
        foreach ($table as $i => $data) {
            echo '<div class="month"><div class="month-bar" style="height: ' . $data['nb_scale'] . 'px; margin-top:' . max(20 - $data['nb_scale'], 0) . 'px"></div><span class="month-nb">' . $data['nb'] . '</span><a href="articles.php?filtre=' . $data['date'] . '"><span class="month-name">' . mb_substr(mois_en_lettres(substr($data['date'], 4, 2)), 0, 3) . "\n" . substr($data['date'], 2, 2) . '</span></a></div>';