function afficher_form_captcha() { afficher_html_head($GLOBALS['lang']['preferences']); echo '<div id="top">'; afficher_msg(); afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['preferences']); echo '</div>'; echo '<div id="axe">' . "\n"; echo '<div id="page">' . "\n"; if (!empty($_SESSION['freecap_word_hash']) and !empty($_POST['word'])) { if (sha1(strtolower($_POST['word'])) == $_SESSION['freecap_word_hash']) { $_SESSION['freecap_word_hash'] = false; $word_ok = "yes"; } else { $word_ok = "no"; } } else { $word_ok = FALSE; } echo '<form id="preferences-captcha" action="' . basename($_SERVER['PHP_SELF']) . '?test_captcha" method="post" class="bordered-formbloc" >' . "\n"; echo '<div role="group" class="pref">'; echo '<div class="form-legend">' . legend('Captcha', 'legend-config') . '</div>' . "\n"; echo '<p>'; if ($word_ok !== FALSE) { if ($word_ok == "yes") { echo '<b style="color: green;">you got the word correct, rock on.</b>'; } else { echo '<b style="color: red;">sorry, that\'s not the right word, try again.</b>'; } } echo '</p>'; echo '<p><img src="../inc/freecap/freecap.php" id="freecap" alt="freecap"/></p>' . "\n"; echo '<p>If you can\'t read the word, <a href="#" onclick="new_freecap();return false;">click here to change image</a></p>' . "\n"; echo '<p>word above : <input type="text" class="text" name="word" /></p>' . "\n"; echo '<input class="submit blue-square" type="submit" name="valider" value="' . $GLOBALS['lang']['envoyer'] . '" />' . "\n"; echo '</div>'; echo '</form>' . "\n"; }
# # BlogoText is free software. # You can redistribute it under the terms of the MIT / X11 Licence. # # *** LICENSE *** $GLOBALS['BT_ROOT_PATH'] = '../'; require_once '../inc/inc.php'; error_reporting($GLOBALS['show_errors']); operate_session(); $begin = microtime(TRUE); $GLOBALS['db_handle'] = open_base($GLOBALS['db_location']); $GLOBALS['liste_fichiers'] = open_serialzd_file($GLOBALS['fichier_liste_fichiers']); $GLOBALS['liste_flux'] = open_serialzd_file($GLOBALS['fichier_liste_fluxrss']); afficher_html_head($GLOBALS['lang']['titre_maintenance']); echo '<div id="top">' . "\n"; afficher_msg(); afficher_topnav('preferences.php', $GLOBALS['lang']['titre_maintenance']); echo '</div>' . "\n"; echo '<div id="axe">' . "\n"; echo '<div id="page">' . "\n"; // création du dossier des backups creer_dossier($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_backup'], 0); /* * reconstruit la BDD des fichiers (qui n’est pas dans SQL, mais un fichier serializé à côte) */ function rebuilt_file_db() { $idir = rm_dots_dir(scandir($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_images'])); // scans also subdir of img/* (in one single array of paths) foreach ($idir as $i => $e) { $subelem = $GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_images'] . '/' . $e;
// $GLOBALS['liste_flux'][$url]['checksum'] = '42'; // $GLOBALS['liste_flux'][$url]['iserror'] = 1; //} //file_put_contents($GLOBALS['fichier_liste_fluxrss'], '<?php /* '.chunk_split(base64_encode(serialize($GLOBALS['liste_flux']))).' */'); //debug($GLOBALS['liste_flux']); // TRAITEMENT $erreurs = array(); if (isset($_POST['verif_envoi'])) { $erreurs = valider_form_rss(); if (empty($erreurs)) { traiter_form_rssconf(); } } afficher_top($GLOBALS['lang']['mesabonnements']); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['mesabonnements']); //echo moteur_recherche($GLOBALS['lang']['search_in_links']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); echo '</div>' . "\n"; echo '<div id="axe">' . "\n"; echo '<div id="page">' . "\n"; if (isset($_GET['config'])) { echo afficher_form_rssconf($erreurs); echo "\n" . '<script type="text/javascript">' . "\n"; echo js_rsscnf_marktoremove(0); echo "\n" . '</script>' . "\n"; } else { // get list of posts from DB $all_flux = liste_elements('SELECT * FROM rss WHERE bt_statut=1 ORDER BY bt_date DESC', array(), 'rss'); // send to browser $out_html = send_rss_json($all_flux);
$query = "SELECT * FROM articles WHERE bt_statut=? ORDER BY bt_date DESC"; $tableau = liste_elements($query, array($_GET['filtre'] == 'draft' ? 0 : 1), 'articles'); } elseif ($type == 'tag' and $search != '') { $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 class="p-edit-button">' . "\n"; echo $GLOBALS['lang']['le'] . ' ' . date_formate($comment['bt_id']) . ', ' . heure_formate($comment['bt_id']); if ($with_link == 1 and !empty($comment['bt_title'])) { echo ' ' . $GLOBALS['lang']['sur'] . ' <a href="' . $_SERVER['PHP_SELF'] . '?post_id=' . $comment['bt_article_id'] . '">' . $comment['bt_title'] . '</a>'; } echo "\t" . '<button class="comm-link cl-suppr" type="button" onclick="ask_suppr(this);" title="' . $GLOBALS['lang']['supprimer'] . '"></button>' . "\n"; echo "\t" . '<button class="comm-link cl-edit" type="button" onclick="unfold(this);" title="' . $GLOBALS['lang']['editer'] . '"></button> '; echo '</p>' . "\n"; echo $GLOBALS['form_commentaire']; echo '</div>' . "\n\n"; } // DEBUT PAGE $msgg = $GLOBALS['lang']['titre_commentaires'] . (!empty($article_title) ? ' | ' . $article_title : ''); afficher_top($msgg); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['titre_commentaires']); echo moteur_recherche($GLOBALS['lang']['search_in_comments']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); echo '</div>' . "\n"; echo '<div id="axe">' . "\n"; // SUBNAV echo '<div id="subnav">' . "\n"; // Affichage formulaire filtrage commentaires if (isset($_GET['filtre'])) { afficher_form_filtre('commentaires', htmlspecialchars($_GET['filtre'])); } else { afficher_form_filtre('commentaires', ''); } echo '</div>' . "\n"; echo erreurs($erreurs_form); echo '<div id="page">' . "\n";
# *** LICENSE *** if (!file_exists('../config/user.php') || !file_exists('../config/prefs.php')) { header('Location: install.php'); exit; } $begin = microtime(TRUE); $GLOBALS['BT_ROOT_PATH'] = '../'; require_once '../inc/inc.php'; error_reporting($GLOBALS['show_errors']); operate_session(); // open bases $GLOBALS['db_handle'] = open_base($GLOBALS['db_location']); $GLOBALS['liste_fichiers'] = open_serialzd_file($GLOBALS['fichier_liste_fichiers']); afficher_top($GLOBALS['lang']['label_resume']); echo '<div id="top">' . "\n"; afficher_msg(ucfirst($GLOBALS['lang']['label_resume'])); echo moteur_recherche($GLOBALS['lang']['search_everywhere']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); echo '</div>' . "\n"; $total_artic = liste_elements_count("SELECT count(ID) AS nbr FROM articles", array()); $total_links = liste_elements_count("SELECT count(ID) AS nbr FROM links", array()); $total_comms = liste_elements_count("SELECT count(ID) AS nbr FROM commentaires", array()); $total_nb_fichiers = sizeof($GLOBALS['liste_fichiers']); echo '<div id="axe">' . "\n"; echo '<div id="mainpage">' . "\n"; // transforme les valeurs numériques d’un tableau pour les ramener la valeur max du tableau à $maximum. Les autres valeurs du tableau sont à l’échelle function scaled_size($tableau, $maximum) { $ratio = max(array_values($tableau)) / $maximum; $return = array(); foreach ($tableau as $key => $value) {
// aucun filtre, les affiche tous } else { $fichiers = $GLOBALS['liste_fichiers']; } // traitement d’une action sur le fichier $erreurs = array(); if (isset($_POST['_verif_envoi'])) { $fichier = init_post_fichier(); $erreurs = valider_form_fichier($fichier); if (empty($erreurs)) { traiter_form_fichier($fichier); } } afficher_top($GLOBALS['lang']['titre_fichier']); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['titre_fichier']); echo moteur_recherche($GLOBALS['lang']['search_in_files']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); 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('fichiers', htmlspecialchars($_GET['filtre'])); } else { afficher_form_filtre('fichiers', ''); } echo '</div>' . "\n"; // SUBNAV echo '<div id="page">' . "\n";
$tableau = liste_elements($query, $arr, 'links'); } elseif (!empty($_GET['id']) and is_numeric($_GET['id'])) { // édition d’un lien spécifique $query = "SELECT * FROM links WHERE bt_id=?"; $tableau = liste_elements($query, array($_GET['id']), 'links'); } else { // aucun filtre : affiche TOUT $query = "SELECT * FROM links ORDER BY bt_id DESC LIMIT 0, " . $GLOBALS['max_linx_admin']; $tableau = liste_elements($query, array(), 'links'); } } // count total nb of links $nb_links_displayed = count($tableau); afficher_top($GLOBALS['lang']['mesliens']); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['mesliens']); echo moteur_recherche($GLOBALS['lang']['search_in_links']); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); 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', ''); } echo '</div>' . "\n"; echo '<div id="page">' . "\n"; if ($step == 'edit' and !empty($tableau[0])) {
$post = $posts[0]; } } // TITRE PAGE if (!empty($post)) { $titre_ecrire_court = $GLOBALS['lang']['titre_maj']; $titre_ecrire = $titre_ecrire_court . ' : ' . $post['bt_title']; } else { $post = ''; $titre_ecrire_court = $GLOBALS['lang']['titre_ecrire']; $titre_ecrire = $titre_ecrire_court; } // DEBUT PAGE afficher_top($titre_ecrire); echo '<div id="top">' . "\n"; afficher_msg($titre_ecrire_court); afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME)); echo '</div>' . "\n"; echo '<div id="axe">' . "\n"; echo '<div class="reminder"><span>' . 'Pensez à enregistrer votre article.' . '</span></div>' . "\n"; // SUBNAV if ($post != '') { echo '<div id="subnav">' . "\n"; echo '<p>'; echo '<a href="' . $post['bt_link'] . '">' . $GLOBALS['lang']['lien_article'] . '</a> – '; echo '<a href="commentaires.php?post_id=' . $article_id . '">' . ucfirst(nombre_commentaires($post['bt_nb_comments'])) . '</a>'; echo '</p>' . "\n"; echo '</div>' . "\n"; } echo '<div id="page">' . "\n"; // EDIT
# # BlogoText is free software. # You can redistribute it under the terms of the MIT / X11 Licence. # # *** LICENSE *** $GLOBALS['BT_ROOT_PATH'] = '../'; require_once '../inc/inc.php'; error_reporting($GLOBALS['show_errors']); operate_session(); $begin = microtime(TRUE); $GLOBALS['db_handle'] = open_base($GLOBALS['db_location']); $GLOBALS['liste_fichiers'] = open_serialzd_file($GLOBALS['fichier_liste_fichiers']); $GLOBALS['liste_flux'] = open_serialzd_file($GLOBALS['fichier_liste_fluxrss']); afficher_top($GLOBALS['lang']['titre_maintenance']); echo '<div id="top">' . "\n"; afficher_msg($GLOBALS['lang']['titre_maintenance']); afficher_menu('preferences.php'); echo '</div>' . "\n"; echo '<div id="axe">' . "\n"; echo '<div id="page">' . "\n"; // création du dossier des backups creer_dossier($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_backup'], 0); /* * reconstruit la BDD des fichiers (qui n’est pas dans SQL, mais un fichier serializé à côte) */ function rebuilt_file_db() { $idir = scandir($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_images']); unset($idir[0], $idir[1]); // unset '.' and '..' $fdir = scandir($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_fichiers']);