$fichiers = liste_base_files('statut', '0', ''); // publiés } elseif ($_GET['filtre'] == 'pub') { $fichiers = liste_base_files('statut', '1', ''); // liste selon type de fichier } elseif ($type == 'type' and $search != '') { $fichiers = liste_base_files('type', $search, ''); } else { $fichiers = $GLOBALS['liste_fichiers']; } // recheche par mot clé } elseif (!empty($_GET['q'])) { $fichiers = liste_base_files('recherche', htmlspecialchars(urldecode($_GET['q'])), ''); // par extension } elseif (!empty($_GET['extension'])) { $fichiers = liste_base_files('extension', htmlspecialchars($_GET['extension']), ''); // par fichier unique (id) } elseif (isset($_GET['file_id']) and preg_match('/\\d{14}/', $_GET['file_id'])) { foreach ($GLOBALS['liste_fichiers'] as $fich) { if ($fich['bt_id'] == $_GET['file_id']) { $fichier = $fich; break; } } if (!empty($fichier)) { $fichiers[$_GET['file_id']] = $fichier; } // aucun filtre, les affiche tous } else { $fichiers = $GLOBALS['liste_fichiers']; }
if (isset($table_months[$month['date']])) { $table_months[$month['date']] = $month['idbydate']; } } } 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) {