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"; }
# 2006 Frederic Nassar. # 2010-2015 Timo Van Neerden <*****@*****.**> # # 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)
function afficher_form_3($erreurs = '') { afficher_html_head('Install'); echo '<div id="axe">' . "\n"; echo '<div id="pageauth">' . "\n"; echo '<h1>' . $GLOBALS['nom_application'] . '</h1>' . "\n"; echo '<h1 id="step">' . $GLOBALS['lang']['install'] . '</h1>' . "\n"; echo erreurs($erreurs); echo '<form method="post" action="' . basename($_SERVER['PHP_SELF']) . '?' . $_SERVER['QUERY_STRING'] . '">' . "\n"; echo '<div id="install">' . "\n"; echo '<p><label>' . $GLOBALS['lang']['install_choose_sgdb'] . '</label>'; echo '<select id="sgdb" name="sgdb" onchange="show_mysql_form()">' . "\n"; if (extension_loaded('pdo_sqlite')) { echo "\t" . '<option value="sqlite">SQLite</option>' . "\n"; } if (extension_loaded('pdo_mysql')) { echo "\t" . '<option value="mysql">MySQL</option>' . "\n"; } echo '</select></p>' . "\n"; echo '<div id="mysql_vars" style="display:none;">' . "\n"; if (extension_loaded('pdo_mysql')) { echo '<p><label for="mysql_user">MySQL User: </label><input type="text" id="mysql_user" name="mysql_user" size="30" value="" class="text" /></p>' . "\n"; echo '<p><label for="mysql_password">MySQL Password: </label><input id="mysql_password" type="password" name="mysql_passwd" size="30" value="" class="text" autocomplete="off" /></p>' . "\n"; echo '<p><label for="mysql_db">MySQL Database: </label><input type="text" id="mysql_db" name="mysql_db" size="30" value="" class="text" /></p>' . "\n"; echo '<p><label for="mysql_host">MySQL Host: </label><input type="text" id="mysql_host" name="mysql_host" size="30" value="" class="text" /></p>' . "\n"; } echo '</div>' . "\n"; echo '<div id="sqlite_vars">' . "\n"; echo $GLOBALS['lang']['install_sqlite_no_more_todo']; echo '</div>' . "\n"; echo hidden_input('langue', $GLOBALS['lang']['id']); echo hidden_input('verif_envoi_3', '1'); echo '<input class="inpauth blue-square" type="submit" name="enregistrer" value="Ok" />' . "\n"; echo '</div>' . "\n"; echo '</form>' . "\n"; }
// STATUT if ($article['bt_statut'] == '1') { $out .= "\t\t" . '<span><a href="' . $article['bt_link'] . '">' . $GLOBALS['lang']['lien_article'] . '</a></span>' . "\n"; } else { $out .= "\t\t" . '<span><a href="' . $article['bt_link'] . '">' . $GLOBALS['lang']['preview'] . '</a></span>' . "\n"; } $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());
$fichiers[$_GET['file_id']] = $fichier; } // 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_html_head($GLOBALS['lang']['titre_fichier']); echo '<div id="top">' . "\n"; afficher_msg(); echo moteur_recherche($GLOBALS['lang']['search_in_files']); afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['titre_fichier']); 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";
fichier_ip(); // Handle saved data/URL redirect if POST request made $location = 'index.php'; if (isset($_SESSION['BT-saved-url'])) { $location = $_SESSION['BT-saved-url']; unset($_SESSION['BT-saved-url']); } if (isset($_SESSION['BT-post-token'])) { // The login was right, so we give a token because the previous one expired with the session $_SESSION['BT-post-token'] = new_token(); } header('Location: ' . $location); } else { // On sort… // …et affiche la page d'auth afficher_html_head('Identification'); echo '<div id="axe">' . "\n"; echo '<div id="pageauth">' . "\n"; echo '<h1>' . $GLOBALS['nom_application'] . '</h1>' . "\n"; echo '<form method="post" action="auth.php">' . "\n"; echo '<div id="auth">' . "\n"; echo '<p><label for="user">' . ucfirst($GLOBALS['lang']['label_dp_identifiant']) . '</label><input class="text" type="text" autocomplete="off" id="user" name="nom_utilisateur" placeholder="John Doe" value="" /></p>' . "\n"; echo '<p><label for="password">' . ucfirst($GLOBALS['lang']['label_dp_motdepasse']) . '</label><input class="text" id="password" type="password" placeholder="••••••••••••" name="mot_de_passe" value="" /></p>' . "\n"; if (isset($GLOBALS['connexion_captcha']) and $GLOBALS['connexion_captcha'] == "1") { echo '<p><label for="word">' . ucfirst($GLOBALS['lang']['label_dp_word_captcha']) . '</label><input class="text" type="text" id="word" name="word" value="" /></p>' . "\n"; echo '<p><a href="#" onclick="new_freecap();return false;" title="' . $GLOBALS['lang']['label_dp_changer_captcha'] . '"><img src="../inc/freecap/freecap.php" id="freecap" alt="captcha"></a></p>' . "\n"; } echo '<p><label for="stay_logged">' . $GLOBALS['lang']['label_stay_logged'] . '</label><input type="checkbox" id="stay_logged" name="stay_logged" checked /></p>' . "\n"; echo '<input class="blue-square" type="submit" name="submit" value="' . $GLOBALS['lang']['connexion'] . '" />' . "\n"; echo '<input type="hidden" name="_verif_envoi" value="1" />' . "\n"; echo '</div>' . "\n";
// AND operator between words $query = "SELECT * FROM links WHERE " . $sql_where . "ORDER BY bt_id DESC"; $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_html_head($GLOBALS['lang']['mesliens']); echo '<div id="top">' . "\n"; 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) {
$posts = liste_elements($query, array($article_id), 'articles'); if (isset($posts[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_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> – '; 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";
echo "\t\t" . '</ul>' . "\n"; echo "\t" . '</div>' . "\n"; echo '</div>' . "\n"; echo $comment['bt_content']; echo '<p class="p-date-title">' . "\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="' . basename($_SERVER['PHP_SELF']) . '?post_id=' . $comment['bt_article_id'] . '">' . $comment['bt_title'] . '</a>'; } echo '</p>' . "\n"; echo $GLOBALS['form_commentaire']; echo '</div>' . "\n\n"; } // DEBUT PAGE $msgg = $GLOBALS['lang']['titre_commentaires'] . (!empty($article_title) ? ' | ' . $article_title : ''); afficher_html_head($msgg); echo '<div id="top">' . "\n"; afficher_msg(); echo moteur_recherche($GLOBALS['lang']['search_in_comments']); afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['titre_commentaires']); 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 class="nombre-elem">' . "\n";
$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']); // migration 2.1.0.0 => 2.1.0.1 FIXME : remove later if (!isset($GLOBALS['liste_fichiers'][0]['bt_path'])) { foreach ($GLOBALS['liste_fichiers'] as $i => $file) { $GLOBALS['liste_fichiers'][$i]['bt_path'] = ''; } file_put_contents($GLOBALS['fichier_liste_fichiers'], '<?php /* ' . chunk_split(base64_encode(serialize($GLOBALS['liste_fichiers']))) . ' */'); } afficher_html_head($GLOBALS['lang']['label_resume']); echo '<div id="top">' . "\n"; afficher_msg(); echo moteur_recherche($GLOBALS['lang']['search_everywhere']); afficher_topnav(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME), ucfirst($GLOBALS['lang']['label_resume'])); 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;