コード例 #1
0
ファイル: maintenance.php プロジェクト: CamTosh/blogotext
# 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;
        if (is_dir($subelem)) {
コード例 #2
0
ファイル: preferences.php プロジェクト: CamTosh/blogotext
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";
}
コード例 #3
0
ファイル: fichiers.php プロジェクト: CamTosh/blogotext
    $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";
// SUBNAV
echo '<div id="page">' . "\n";
// vérifie que les fichiers de la liste sont bien présents sur le disque dur
$real_fichiers = array();
コード例 #4
0
ファイル: articles.php プロジェクト: CamTosh/blogotext
                $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());
echo '</div>' . "\n";
echo '</div>' . "\n";
echo '<div id="page">' . "\n";
afficher_liste_articles($tableau);
コード例 #5
0
ファイル: ecrire.php プロジェクト: CamTosh/blogotext
    }
}
// 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> &nbsp; – &nbsp; ';
    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";
// EDIT
if ($post != '') {
    apercu($post);
コード例 #6
0
ファイル: commentaires.php プロジェクト: CamTosh/blogotext
    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";
if ($param_makeup['menu_theme'] == 'for_article') {
    $dec_id = decode_id($article_id);
    $article_link = $GLOBALS['racine'] . '?d=' . $dec_id['annee'] . '/' . $dec_id['mois'] . '/' . $dec_id['jour'] . '/' . $dec_id['heure'] . '/' . $dec_id['minutes'] . '/' . $dec_id['secondes'] . '-' . titre_url($article_title);
    echo '<ul>' . "\n";
コード例 #7
0
ファイル: index.php プロジェクト: CamTosh/blogotext
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;
    $return = array();
    foreach ($tableau as $key => $value) {
        if ($ratio != 0) {
            $return[] = array('nb' => $value, 'nb_scale' => floor($value / $ratio), 'date' => $key);