Example #1
0
    echo '<p class="email"><a href="mailto:' . $comment['bt_email'] . '">' . $comment['bt_email'] . '</a></p>' . "\n";
    echo $comment['bt_content'];
    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";
Example #2
0
//foreach ($GLOBALS['liste_flux'] as $url => $arr) {
//	$GLOBALS['liste_flux'][$url]['time'] -= 80000;
//	$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');
Example #3
0
function afficher_form_3($erreurs = '')
{
    afficher_top('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="' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '">' . "\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 '</form>' . "\n";
}
Example #4
0
function afficher_form_captcha()
{
    afficher_top($GLOBALS['lang']['preferences']);
    echo '<div id="top">';
    afficher_msg($GLOBALS['lang']['preferences']);
    afficher_menu(pathinfo($_SERVER['PHP_SELF'], PATHINFO_BASENAME));
    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 action="' . $_SERVER['PHP_SELF'] . '?test_captcha" method="post" class="bordered-formbloc" >' . "\n";
    echo '<fieldset class="pref">';
    echo legend('Captcha', 'legend-config');
    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 '</fieldset>';
    echo '</form>' . "\n";
}
Example #5
0
# You can redistribute it under the terms of the MIT / X11 Licence.
#
# *** 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;
Example #6
0
        $tableau = liste_elements($query, array($_GET['filtre'] . '%'), 'articles');
    } elseif ($_GET['filtre'] == 'draft' or $_GET['filtre'] == 'pub') {
        $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";
Example #7
0
        $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_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";
Example #8
0
        // 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_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";
Example #9
0
    $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_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> &nbsp; – &nbsp; ';
    echo '<a href="commentaires.php?post_id=' . $article_id . '">' . ucfirst(nombre_commentaires($post['bt_nb_comments'])) . '</a>';
    echo '</p>' . "\n";
    echo '</div>' . "\n";
}
Example #10
0
    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_top('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" 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" /></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";
Example #11
0
# 2006      Frederic Nassar.
# 2010-2014 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_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]);