Example #1
0
    $prefs = $row_author['prefs'] ? unserialize($row_author['prefs']) : array();
    $prefs['cnx'] = $session_remember == 'yes' ? 'perma' : '';
    lcm_query("UPDATE lcm_author \n\t\t\t\tSET prefs = '" . addslashes(serialize($prefs)) . "' \n\t\t\t\tWHERE id_author = " . $row_author['id_author']);
}
// Change the language of the private area (or login)
// [ML] I once wanted to put this in a function, and it did a hell
// of a mess because of the session handling stuff..
if (isset($_REQUEST['var_lang_lcm'])) {
    // ex: bg, fr, en, en_uk, etc. nothing else is accepted
    if (preg_match("/^[_A-Za-z]+[0-9]*\$/", $_REQUEST['var_lang_lcm'])) {
        include_lcm('inc_lang');
        include_lcm('inc_session');
        $new_lang = clean_input($_REQUEST['var_lang_lcm']);
        $valid_author = verifier_visiteur();
        if (lcm_set_language($new_lang)) {
            lcm_setcookie('lcm_lang', $new_lang, time() + 365 * 24 * 3600);
            // Save language preference only if we are installed and if author connected
            if ($valid_author && include_config_exists('inc_connect')) {
                include_lcm('inc_admin');
                lcm_query("UPDATE lcm_author \n\t\t\t\t\t\tSET lang = '" . $new_lang . "' \n\t\t\t\t\t\tWHERE id_author = " . $GLOBALS['author_session']['id_author']);
                $author_session['lang'] = $new_lang;
                lcm_add_session($author_session, $_COOKIE['lcm_session']);
            } else {
                lcm_log("Not valid_author ({$valid_author}) or not yet installed");
            }
            $cible->delvar('lang');
            $cible->addvar('lang', $new_lang);
        } else {
            lcm_log("lcm_set_language() is not happy, wrong lang code?");
        }
    }
Example #2
0
// Execute only once
if (defined("_INC_CALENDAR")) {
    return;
}
define("_INC_CALENDAR", "1");
define('DEFAULT_D_SCALE', 120);
# 1 pixel = 2 minutes
// Write cookies
if (isset($_REQUEST['set_echelle']) && $_REQUEST['set_echelle'] > 0) {
    lcm_setcookie('spip_calendrier_echelle', floor($_REQUEST['set_echelle']), time() + 365 * 24 * 3600);
    $GLOBALS['echelle'] = floor($_REQUEST['set_echelle']);
} elseif (isset($_COOKIE['spip_calendrier_echelle'])) {
    $GLOBALS['echelle'] = $_COOKIE['spip_calendrier_echelle'];
}
if (isset($_REQUEST['set_partie_cal']) && $_REQUEST['set_partie_cal']) {
    lcm_setcookie('spip_partie_cal', $_REQUEST['set_partie_cal'], time() + 365 * 24 * 3600);
    $GLOBALS['partie_cal'] = $_REQUEST['set_partie_cal'];
} elseif (isset($_COOKIE['spip_partie_cal'])) {
    $GLOBALS['partie_cal'] = $_COOKIE['spip_partie_cal'];
}
// General typography of the 3 types of calendars: day/month/year
global $lcm_lang_rtl;
global $bleu, $vert, $jaune;
// blue, green, yellow
$style = "style='width: 14px; height: 7px; border: 0px'";
$bleu = http_img_pack("m_envoi_bleu{$lcm_lang_rtl}.gif", 'B', $style);
$vert = http_img_pack("m_envoi{$lcm_lang_rtl}.gif", 'V', $style);
$jaune = http_img_pack("m_envoi_jaune{$lcm_lang_rtl}.gif", 'J', $style);
function http_calendrier_init($date = '', $ltype = '', $lechelle = '', $lpartie_cal = '', $script = '')
{
    // month, year, day, type, scale, part-of-cal