$query = "SELECT * FROM articles WHERE bt_categories LIKE ? OR bt_categories LIKE ? OR bt_categories LIKE ? OR bt_categories LIKE ? ORDER BY bt_date DESC"; $tableau = liste_elements($query, array($search, $search . ',%', '%, ' . $search, '%, ' . $search . ', %'), 'articles'); } else { $query = "SELECT * FROM articles ORDER BY bt_date DESC LIMIT 0, " . $GLOBALS['max_bill_admin']; $tableau = liste_elements($query, array(), 'articles'); } } else { $query = "SELECT * FROM articles ORDER BY bt_date DESC LIMIT 0, " . $GLOBALS['max_bill_admin']; $tableau = liste_elements($query, array(), 'articles'); } afficher_top($GLOBALS['lang']['mesarticles']); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['mesarticles']); echo moteur_recherche($GLOBALS['lang']['search_in_articles']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); 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>' . "\n"; echo '<div id="page">' . "\n"; echo '<p class="nombre-elem">' . "\n"; echo ucfirst(nombre_articles(count($tableau))) . ' ' . $GLOBALS['lang']['sur'] . ' ' . liste_elements_count("SELECT count(*) AS nbr FROM articles", array()); echo '</p>' . "\n"; afficher_liste_articles($tableau); footer('', $begin);
} catch (Exception $e) { die('Erreur 86459: ' . $e->getMessage()); } 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_commentaires($nb_commentaires) . '</a></li>'; echo "\t" . '<li><a href="articles.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_articles($nb_articles) . '</a></li>'; echo "\t" . '<li><a href="links.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_liens($nb_liens) . '</a></li>'; echo "\t" . '<li><a href="fichiers.php?q=' . htmlspecialchars($_GET['q']) . '">' . nombre_fichiers($nb_files) . '</a></li>'; echo '</ul>'; } else { // print sur chaque div pour les articles. echo '<div id="graphs">' . "\n"; $nothingyet = 0; if (!$total_artic == 0) { echo '<div class="graphique" id="articles"><h3>' . ucfirst($GLOBALS['lang']['label_articles']) . ' :</h3>' . "\n"; $table = scaled_size(get_tableau_date('articles'), 130); foreach ($table as $month => $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=' . $month . '"><span class="month-name">' . substr($month, 4, 2) . " \n " . substr($month, 2, 2) . '</span></a></div>'; } echo '</div>' . "\n"; } else {