[Résolu] Debutant : Modification des dimensions d’un calendrier (Créer un compte)

  • Statut : non résolu
2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #452416
    Fred981
    Participant
    Initié WordPress
    34 contributions

    Bonjour,

    Dites moi si je suis au bon endroit pour poser la question…

    Ma configuration WP actuelle
    – Version de WordPress : 2.1
    – Thème utilisé : Spring
    – Plugins en place : Calendar – WP-ContactForm – WP-SimpleViewer
    – Nom de l’hebergeur : Oxito
    – Adresse du site :www.981.be

    Problème(s) rencontré(s) : Modification des dimensions d’un calendrier

    Comme vous pouvez voir sur http://www.981.be, le calendrier n’a pas la meme largeur que le contenu du bas (Search this site, Archives, etc) et j’aimerai la modifier afin que mon calendrier soit justifié mais je ne trouve pas l’endroit, je débute et en même temps, je commence à avoir mal aux yeux… J’ai bien tenter de modifier quelques données chiffres comme “absolute; width:200px;” mais à chaque coup, ça foire…

    Un grand merci.

    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

    /*
    Plugin Name: Calendar
    Plugin URI: http://n0id.hexium.net/plugins
    Description: Nice and simple Calendar with events support and full customization:)
    Author: Vanguard
    Version: 2.0
    Author URI: http://n0id.hexium.net/
    */

    // mySQL table
    $calendar_table = $table_prefix.”calendar”;

    // default options
    $calendar_defaults = array(

    ‘bgcolor’ => ‘#CACACA’,
    ‘shadow_color’ => ‘#777777’,
    ‘weekdays_color’ => ‘#000000’,
    ‘weekdays_bgcolor’ => ‘#EAEAEA’,
    ‘weekend_bgcolor’ => ‘#F6F6F6’,
    ‘weekend_textcolor’ => ‘#000000’,
    ‘month_color’ => ‘#000000’,
    ‘month_bgcolor’ => ‘#FFFFFF’,
    ‘day_color’ => ‘#FFFFFF’,
    ‘day_textcolor’ => ‘#000000’,
    ‘today_color’ => ‘#D0D0D0’,
    ‘today_textcolor’ => ‘#000000’,
    ‘event_bgcolor’ => ‘#F0F0F0’,
    ‘event_textcolor’ => ‘#000000’,
    ‘event_bgcolor2’ => ‘#FFFFFF’,
    ‘event_textcolor2’ => ‘#000000’,
    ‘event_border’ => ‘#000000’,
    ‘start_day’ => ‘1’,
    );

    // presets
    // lightblue
    $calendar_preset[lightblue] = array(

    ‘bgcolor’ => ‘#d6e6ff’,
    ‘shadow_color’ => ‘#777777’,
    ‘weekdays_color’ => ‘#333333’,
    ‘weekdays_bgcolor’ => ‘#b5d2ff’,
    ‘weekend_bgcolor’ => ‘#e9f2ff’,
    ‘weekend_textcolor’ => ‘#333333’,
    ‘month_color’ => ‘#333333’,
    ‘month_bgcolor’ => ‘#FFFFFF’,
    ‘day_color’ => ‘#FFFFFF’,
    ‘day_textcolor’ => ‘#333333’,
    ‘today_color’ => ‘#99BBFF’,
    ‘today_textcolor’ => ‘#333333’,
    ‘event_bgcolor’ => ‘#f1f6fe’,
    ‘event_textcolor’ => ‘#000000’,
    ‘event_bgcolor2’ => ‘#FFFFFF’,
    ‘event_textcolor2’ => ‘#333333’,
    ‘event_border’ => ‘#005581’,
    ‘start_day’ => ‘1’,
    );

    // red
    $calendar_preset[red] = array(

    ‘bgcolor’ => ‘#FFFFFF’,
    ‘shadow_color’ => ‘#a82727’,
    ‘weekdays_color’ => ‘#ffffff’,
    ‘weekdays_bgcolor’ => ‘#a82727’,
    ‘weekend_bgcolor’ => ‘#eaa2a2’,
    ‘weekend_textcolor’ => ‘#ffffff’,
    ‘month_color’ => ‘#333333’,
    ‘month_bgcolor’ => ‘#fff2f2’,
    ‘day_color’ => ‘#ffe7e7’,
    ‘day_textcolor’ => ‘#333333’,
    ‘today_color’ => ‘#b93b3b’,
    ‘today_textcolor’ => ‘#FFFFFF’,
    ‘event_bgcolor’ => ‘#f9d3d3’,
    ‘event_textcolor’ => ‘#000000’,
    ‘event_bgcolor2’ => ‘#fff2f2’,
    ‘event_textcolor2’ => ‘#333333’,
    ‘event_border’ => ‘#a82727’,
    ‘start_day’ => ‘1’,
    );

    // light green
    $calendar_preset[green] = array (

    ‘bgcolor’ => ‘#FFFFFF’,
    ‘shadow_color’ => ‘#4c7f30’,
    ‘weekdays_color’ => ‘#000000’,
    ‘weekdays_bgcolor’ => ‘#aded8a’,
    ‘weekend_bgcolor’ => ‘#c9eeb1’,
    ‘weekend_textcolor’ => ‘#333333’,
    ‘month_color’ => ‘#333333’,
    ‘month_bgcolor’ => ‘#ffffff’,
    ‘day_color’ => ‘#f4fcef’,
    ‘day_textcolor’ => ‘#333333’,
    ‘today_color’ => ‘#a8e283’,
    ‘today_textcolor’ => ‘#000000’,
    ‘event_bgcolor’ => ‘#d6f3c3’,
    ‘event_textcolor’ => ‘#000000’,
    ‘event_bgcolor2’ => ‘#f4fcef’,
    ‘event_textcolor2’ => ‘#333333’,
    ‘event_border’ => ‘#c9eeb1’,
    ‘start_day’ => ‘1’,
    );

    // gold
    $calendar_preset[gold] = array (

    ‘bgcolor’ => ‘#FFFFFF’,
    ‘shadow_color’ => ‘#cbc55b’,
    ‘weekdays_color’ => ‘#000000’,
    ‘weekdays_bgcolor’ => ‘#fff65e’,
    ‘weekend_bgcolor’ => ‘#fff99d’,
    ‘weekend_textcolor’ => ‘#333333’,
    ‘month_color’ => ‘#333333’,
    ‘month_bgcolor’ => ‘#ffffff’,
    ‘day_color’ => ‘#fffdde’,
    ‘day_textcolor’ => ‘#333333’,
    ‘today_color’ => ‘#ffee00’,
    ‘today_textcolor’ => ‘#000000’,
    ‘event_bgcolor’ => ‘#fffbb3’,
    ‘event_textcolor’ => ‘#000000’,
    ‘event_bgcolor2’ => ‘#fffeea’,
    ‘event_textcolor2’ => ‘#333333’,
    ‘event_border’ => ‘#c8bd00’,
    ‘start_day’ => ‘1’,
    );

    // multi-color
    $calendar_preset[multi] = array (

    ‘bgcolor’ => ‘#FFFFFF’,
    ‘shadow_color’ => ‘#666666’,
    ‘weekdays_color’ => ‘#ffffff’,
    ‘weekdays_bgcolor’ => ‘#2b589d’,
    ‘weekend_bgcolor’ => ‘#f6f6f6’,
    ‘weekend_textcolor’ => ‘#ff0000’,
    ‘month_color’ => ‘#333333’,
    ‘month_bgcolor’ => ‘#ffffff’,
    ‘day_color’ => ‘#f6f6f6’,
    ‘day_textcolor’ => ‘#333333’,
    ‘today_color’ => ‘#f6f6f6’,
    ‘today_textcolor’ => ‘#0060ff’,
    ‘event_bgcolor’ => ‘#f6f6f6’,
    ‘event_textcolor’ => ‘#328400’,
    ‘event_bgcolor2’ => ‘#ffffff’,
    ‘event_textcolor2’ => ‘#333333’,
    ‘event_border’ => ‘#000000’,
    ‘start_day’ => ‘1’,
    );

    // end of presets

    if (!get_settings(‘calendar_options’)) {
    update_option(‘calendar_options’,$calendar_defaults);
    }

    $calendar_options = get_settings(‘calendar_options’);
    //$calendar_options[start_day]=1;

    calendar_check_table();

    // internal function for multilang support

    function _ee($locale, $default) {

    if (__($locale) != $locale) { echo __($locale); }
    else echo $default;
    }

    function build_calendar() {
    global $calendar_options;
    $month=date(“n”)+1+$_GET[month]; $year=date(“Y”); $today=date(“j”);
    // total days of the current month
    $days=date(“j”, mktime(0,0,0,$month,0,$year));
    // month starts on:

    $starts=(date(“w”, mktime(0,0,0,($month-1),1,$year))+7);
    if (!$calendar_options[start_day]) { $starts=$starts+1; }
    $month_text=date(“F”, mktime(0,0,0,($month-1),1,$year));
    echo “

    “;
    get_events(mktime(0,0,0,($month-1),($day_count+1),$year));
    if ($starts > 7) { echo “

    n”; $starts=1; }
    $day_count++;
    }
    if ($starts < 7 && $starts > 1) {
    echo “

    “;
    }

    // close table
    echo “

    “;
    echo “

    “;
    echo “

    “;
    if ($calendar_options[start_day]) {
    echo “

    n”;
    }
    else {
    echo “

    n”;
    }

    if ($starts > 7) { $starts=$starts-7; }
    $calendar_edays=”

    “.str_repeat(“

    “, ($starts-1));

    while ($day_count<$days) {
    $starts++;
    $day_events=count_events(mktime(0,0,0,($month-1),($day_count+1),$year));
    if ($starts == 2) { echo “

    “; }
    if ($day_count < 1) { echo $calendar_edays; }
    if (($day_count+1 == $today) && !$_GET[month]) {
    if ($day_events) { echo “

    “;
    echo “

    “;
    echo “

    “;
    echo “

    “;
    echo “

    “;
    echo “

    “;
    echo “

    “;
    _e($month_text);
    if ($_GET[month] <= (date("n")*(-1))) { echo " ".date("Y", mktime(0,0,0,($month-1),1,$year)); }
    echo “

    “;
    echo “

    “;
    _ee(‘M_Monday_initial’,’M’);
    echo “
    “;
    _ee(‘T_Tuesday_initial’,’T’);
    echo “
    “;
    _ee(‘W_Wednesday_initial’,’W’);
    echo “
    “;
    _ee(‘T_Thursday_initial’,’T’);
    echo “
    “;
    _ee(‘F_Friday_initial’,’F’);
    echo “
    “;
    _ee(‘S_Saturday_initial’,’S’);
    echo “
    “;
    _ee(‘S_Sunday_initial’,’S’);
    echo “
    “;
    _ee(‘S_Sunday_initial’,’S’);
    echo “
    “;
    _ee(‘M_Monday_initial’,’M’);
    echo “
    “;
    _ee(‘T_Tuesday_initial’,’T’);
    echo “
    “;
    _ee(‘W_Wednesday_initial’,’W’);
    echo “
    “;
    _ee(‘T_Thursday_initial’,’T’);
    echo “
    “;
    _ee(‘F_Friday_initial’,’F’);
    echo “
    “;
    _ee(‘S_Saturday_initial’,’S’);
    echo “
     

    else { echo “

    }
    elseif ($calendar_options[start_day] && $starts > 6) {
    if ($day_events) { echo “

    else { echo “

    }
    elseif (!$calendar_options[start_day] && ($starts > 7 || $starts == 2)) {
    if ($day_events) { echo “

    else { echo “

    }
    else {
    if ($day_events) { echo “

    else { echo “

    }
    if ($day_events) {

    echo ” onMouseOver=”return _show(‘day_”.($day_count+1).”‘);” onMouseOut=”_close(‘day_”.($day_count+1).”‘); return false;””;
    }
    echo “>”.($day_count+1).”

    “;
    }

    function write_javascript() {
    ?>

    }
    function count_events($timestamp) {
    global $calendar_table;
    $query=mysql_query(“SELECT * FROM $calendar_table WHERE timestamp >= $timestamp AND timestamp < ($timestamp + 86400)");
    $events=mysql_num_rows($query);
    return $events;
    }

    function get_events($timestamp) {
    global $calendar_options, $calendar_table;
    $query=mysql_query(“SELECT * FROM $calendar_table WHERE timestamp >= $timestamp AND timestamp < ($timestamp + 86400)");
    $events=mysql_num_rows($query);
    if ($events > 0) {
    echo “

    “;
    }
    }

    function do_calendar() {
    write_javascript();
    build_calendar();
    }

    function calendar_check_table() {
    global $calendar_table;

    $query=mysql_query(“SHOW TABLES”);

    while ($fetch=mysql_fetch_array($query)) {
    if ($fetch[0] == $calendar_table) { return; }
    }
    // table does not exists. creating.
    mysql_query(“

    CREATE TABLE `$calendar_table` (
    `timestamp` int(11) NOT NULL default ‘0’,
    `type` varchar(255) NOT NULL default ”,
    `text` text NOT NULL,
    PRIMARY KEY (`timestamp`),
    UNIQUE KEY `timestamp` (`timestamp`)
    ) TYPE=MyISAM COMMENT=’wordpress Calendar plugin by Vanguard’
    “);

    }

    // administration panel

    function calendar_admin() {
    if (function_exists(‘add_options_page’)) {
    add_options_page(‘Calendar Options’, ‘Calendar’, 8, basename(__FILE__), ‘calendar_admin_page’);
    }
    }

    function calendar_admin_page() {
    global $calendar_options, $calendar_defaults, $calendar_table, $calendar_preset;

    if (isset($_POST)) {

    switch ($_POST[theme]) {
    case ‘1’: $update_options=$calendar_defaults; break;
    case ‘2’: $update_options=$calendar_preset[lightblue]; break;
    case ‘3’: $update_options=$calendar_preset[red]; break;
    case ‘4’: $update_options=$calendar_preset[green]; break;
    case ‘5’: $update_options=$calendar_preset[gold]; break;
    case ‘6’: $update_options=$calendar_preset[multi]; break;
    default:
    $update_options=$calendar_defaults;
    }

    update_option(‘calendar_options’,$update_options);
    $calendar_options = get_settings(‘calendar_options’);
    ?>

    _e(‘Calendar Preset applied!’,”);
    echo “

    “;
    }
    if (isset($_POST)) {
    ?>

    _e(‘Calendar settings successfully updated!’,”);

    // updating settings.
    $updated_options=array(
    ‘bgcolor’ => $_POST,
    ‘shadow_color’ => $_POST,
    ‘weekdays_color’ => $_POST,
    ‘weekdays_bgcolor’ => $_POST,
    ‘weekend_bgcolor’ => $_POST,
    ‘weekend_textcolor’ => $_POST,
    ‘month_color’ => $_POST,
    ‘month_bgcolor’ => $_POST,
    ‘day_color’ => $_POST,
    ‘day_textcolor’ => $_POST,
    ‘today_color’ => $_POST,
    ‘today_textcolor’ => $_POST,
    ‘event_bgcolor’ => $_POST,
    ‘event_textcolor’ => $_POST,
    ‘event_bgcolor2’ => $_POST,
    ‘event_textcolor2’ => $_POST,
    ‘event_border’ => $_POST,
    ‘start_day’ => $_POST,
    );
    update_option(‘calendar_options’,$updated_options);
    $calendar_options = get_settings(‘calendar_options’);
    ?>

    }
    if (isset($_POST)) {
    ?>


    $time=explode(“:”,$_POST);
    $timestamp=mktime($time[0],$time[1],0,$_POST[month], $_POST[day], $_POST[year]);
    $event_text=nl2br($_POST[text]);
    if ($_POST[updating] == 1) {
    $total=mysql_num_rows(mysql_query(“SELECT * FROM $calendar_table WHERE timestamp = ‘$timestamp'”));
    if ($total > 0) {
    mysql_query(“UPDATE $calendar_table SET text = ‘$event_text’ WHERE timestamp = ‘$timestamp'”);
    _e(‘Calendar event successfully updated!’,”);
    }
    else {
    mysql_query(“INSERT INTO $calendar_table VALUES(‘$timestamp’,’note’,’$event_text’)”);
    _e(‘Calendar event successfully added!’,”);
    }

    }
    else {
    mysql_query(“INSERT INTO $calendar_table VALUES(‘$timestamp’,’note’,’$event_text’)”);
    _e(‘Calendar event successfully added!’,”);
    }
    echo “

    “;
    }
    if (isset($_POST[remove_event])) {

    $i=0;
    $events_array=$_POST[events];
    while(list($key,$val) = each($events_array)) {
    mysql_query(“DELETE FROM $calendar_table WHERE timestamp = $val”);
    //echo “deleting: $key – $val
    “;
    $i++;
    }
    echo “

    “;
    _e(‘Calendar event(s) deleted!’,”);
    echo “

    “;
    }
    ?>

    Calendar Options

    The options listed below ARE presets. If you want to customize one of these presets first you have to ‘apply’
    it and then change its values on the Display Settings.

    grey (default) light blue red
    /wp-content/plugins/Calendar/images/previews/lightblue.gif”>

    light green gold multi color
    /wp-content/plugins/Calendar/images/previews/gold.gif”>

    Here you can customize the visual of this plugin. All colors are in hexadecimal format.

    Any questions please report to this plugin website.

    background: week days text color:

    week days background: weekend background:

    weekend text color: month text color:

    month background: day background:

    day text color: today background:

    today text color: event day background:

    event day text color: event layer background:

    event layer text color: event layer border color:

    shadow color:

    week starts on monday >

    Here you can manage all of your events. Add, Edit and Remove.

    Remove

    Add/Edit

    $query=mysql_query(“SELECT * FROM $calendar_table ORDER BY timestamp DESC”);
    $events_total=mysql_num_rows($query);
    if ($events_total > 0) {

    while ($fetch=mysql_fetch_array($query)) {

    if (!$current) { $current=date(“jS F”, $fetch[timestamp]); echo ““.date(“jS F”,$fetch[timestamp]).”

      “; }
      if ($current != date(“jS F”, $fetch[timestamp])) { echo “

    n”.date(“jS F”,$fetch[timestamp]).”

      “; $current=date(“jS F”, $fetch[timestamp]); }

      echo “edit this event $fetch[text]
      “;
      }

      }
      ?>

    Timestamp:

    ” size=”2″> ” size=”2″> ” size=”4″>
    at ” style=”width: 40px”>

    Event:


    #602079
    Fred981
    Participant
    Initié WordPress
    34 contributions

    C bon j’ai trouvé sur un autre forum.

    Résolu.

    2 sujets de 1 à 2 (sur un total de 2)
    • Vous devez être connecté pour répondre à ce sujet.
    Connexion