Plugin Calendar

Dein Kalender für WordPress

Share on Facebook0Tweet about this on Twitter0Share on Google+0Share on LinkedIn0Email this to someone

Ihr wollt, dass der Termin für euer WordPress-Fanclub Treffen oder das nächste Kuchenback-Event nicht auf eurem Blog unter geht, dann braucht ihr einen Kalender. Mit dem WordPress Plugin Calendar könnt ihr ganz einfach alle Events auf eurer Seite oder in einem eurer Posts übersichtlich geordnet präsentieren. Wir haben das Plugin für euch getestet.

 

wordpress calendar

Der WP Calendar

 

WP Calendar

Wenn ihr über eure Webseite oder euren Blog immer mal wieder Treffen oder andere Aktionen organisiert oder einfach auf Events hinweisen wollt, dann ist es sinnvoll, einen Kalender einzubinden. Hier setzt das WP Plugin Calendar von Kieran O’Shea an.

Die Features in der Übersicht:

  • Monatsübersicht der Events
  • Events können eine Zeit anzeigen
  • Der Autor kann festgelegt werden
  • Events können über mehrere Tage gehen
  • Eintragen von mehreren Events an einem Tag möglich
  • Hier könnt festlegen, ob sich die Events wiederholen sollen (werden dann automatisch im Kalender angezeigt)
  • Locations können verlinkt werden
  • Kategorien können festgelegt werden
  • Kann ganz einfach auf Seiten oder in Posts eingefügt werden

 

Installation

Um das Plugin zu installieren, müsst ihr in eurer Admin Sidebar auf Plugins klicken und nach „Calendar“ suchen. Nach der Installation erscheint der Calendar in eurer Sidebar und kann benutzt werden. Ihr könnt entweder den Calendar managen (neue Termine eintragen), die Kategorien für die einzelnen Termine festlegen oder aus den Optionen auswählen.

 

Calendar managen

Bei „Manage Calendar“ könnt ihr Title, Description, Start- und Endzeitpunkt sowie Zeit für euer Event festlegen. Auch könnt ihr einen Link einfügen und festlegen, ob sich das Event wöchentlich, monatlich oder jährlich wiederholen soll.

wordpress calendar - add event

Calendar managen

 

 

Kategorien

Bei den Kategorien lassen sich Namen eintragen und die Farben festlegen.

wordpress calendar - add category

Kategorien

 

 

Optionen

Bei den Optionen könnt ihr unter anderem festlegen, ob der Name des Autors erscheinen soll und das Stylesheet konfigurieren.

wordpress calendar - calendar options

Calendar Optionen

 

 

Calendar auf Seite einbinden

Damit der Kalender auch auf einer eurer Seiten oder in einem eurer Posts erscheint, müsst ihr einfach {CALENDAR} in den Text Editor eingeben und schon könnt ihr und eure Leser den Kalender sehen.

wordpress calendar - Kalender einbinden

Seite mit Kalender

 

Den Link unter dem Kalender (Calendar developed and supported by Kieran O’Shea) könnt ihr natürlich auch entfernen, doch O‘Shea weist in den FAQ darauf hin, dass bei einem entfernten Link kein Support gewährleistet wird.

 

Fazit

Der Calendar lässt sich einfach managen und erleichtert das Ordnen von Events. Er verzichtet auf unnötig viele Features und bietet ein klares Design. Wer jedoch gerne sehr lange Event-Titel oder Kategorien-Namen eingeben möchte, wird enttäuscht, denn die Länge des Titels und der Kategorien ist auf 30 Zeichen begrenzt. Aus praktischen Gründen macht das jedoch Sinn, da sonst das mouse-over Display besonders Nutzern mit wenig CSS Kenntnissen Kopfzerbrechen bereiten würde.


Maike

Maike

Ich bin immer auf der Suche nach den brandheißen News der WordPress-Community und interessiere mich vor allem für Plugins und alles, was das Blogger-Leben leichter macht. Da es mit WordPress nie langweilig wird, mangelt es mir zum Glück nicht an Schreibstoff.
Maike
Share on Facebook0Tweet about this on Twitter0Share on Google+0Share on LinkedIn0Email this to someone
Kommentare zu "Dein Kalender für WordPress"
  1. Rainer schrieb am 10. Juli 2014, um 16:23 Uhr:

    Ich gebe diese Empfehlung gleich an meine Tochter weiter, die wird sich freuen.
    Sie ist gerade auf der Suche nach einem geeigneten Kalender Plugin. 😉

  2. Jürgen schrieb am 1. September 2014, um 00:43 Uhr:

    Hi,

    habe gerade das Calendar-Plugin getestet. Sehr nett und einfach. Ob ich die Übersetzung ins Deutsche bekommen könnte? Das wäre so schön…
    Beste Grüße
    Jürgen

  3. IcoDesign schrieb am 3. September 2014, um 16:51 Uhr:

    @Jürgen

    Copiere diesen Code bei dir unter: Plugins – Editor – dort wählst du das Kalender Plugin und fügst den Code ein, hab ihn dir kurz übersetzt:

    **************
    prefix . ‚calendar‘);
    define(‚WP_CALENDAR_CONFIG_TABLE‘, $wpdb->prefix . ‚calendar_config‘);
    define(‚WP_CALENDAR_CATEGORIES_TABLE‘, $wpdb->prefix . ‚calendar_categories‘);

    // Check ensure calendar is installed and install it if not – required for
    // the successful operation of most functions called from this point on
    check_calendar();

    // Create a master category for Calendar and its sub-pages
    add_action(‚admin_menu‘, ‚calendar_menu‘);

    // Enable the ability for the calendar to be loaded from pages
    add_filter(‚the_content‘,’calendar_insert‘);
    add_filter(‚the_content‘,’minical_insert‘);

    // Enable the ability for the lists to be loaded from pages
    add_filter(‚the_content‘,’upcoming_insert‘);
    add_filter(‚the_content‘,’todays_insert‘);

    // Add the function that puts style information in the header
    add_action(‚wp_head‘, ‚calendar_wp_head‘);

    // Add the function that deals with deleted users
    add_action(‚delete_user‘, ‚deal_with_deleted_user‘);

    // Add the widgets if we are using version 2.8
    add_action(‚widgets_init‘, ‚widget_init_calendar_today‘);
    add_action(‚widgets_init‘, ‚widget_init_calendar_upcoming‘);
    add_action(‚widgets_init‘, ‚widget_init_events_calendar‘);

    // Before we get on with the functions, we need to define the initial style used for Calendar

    // Function to
    function call_caldav()
    {

    }

    // Function to deal with events posted by a user when that user is deleted
    function deal_with_deleted_user($id)
    {
    global $wpdb;

    // Do the query
    $wpdb->get_results(„UPDATE „.WP_CALENDAR_TABLE.“ SET event_author=“.$wpdb->get_var(„SELECT MIN(ID) FROM „.$wpdb->prefix.“users“,0,0).“ WHERE event_author=“.mysql_escape_string($id));
    }

    // Function to provide time with WordPress offset, localy replaces time()
    function ctwo()
    {
    return (time()+(3600*(get_option(‚gmt_offset‘))));
    }

    // Function to add the calendar style into the header
    function calendar_wp_head()
    {
    global $wpdb;

    $style = $wpdb->get_var(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’calendar_style'“);
    if ($style != “)
    {
    echo ‚
    ‚;
    echo stripslashes($style).‘
    ‚;
    echo ‚
    ‚;
    }
    }

    // Function to deal with adding the calendar menus
    function calendar_menu()
    {
    global $wpdb;

    // Set admin as the only one who can use Calendar for security
    $allowed_group = ‚manage_options‘;

    // Use the database to *potentially* override the above if allowed
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’can_manage_events'“);
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    $allowed_group = $config->config_value;
    }
    }

    // Add the admin panel pages for Calendar. Use permissions pulled from above
    if (function_exists(‚add_menu_page‘))
    {
    add_menu_page(__(‚Calendar‘,’calendar‘), __(‚Calendar‘,’calendar‘), $allowed_group, ‚calendar‘, ‚edit_calendar‘);
    }
    if (function_exists(‚add_submenu_page‘))
    {
    $calendar_manage_menu = add_submenu_page(‚calendar‘, __(‚Manage Calendar‘,’calendar‘), __(‚Manage Calendar‘,’calendar‘), $allowed_group, ‚calendar‘, ‚edit_calendar‘);
    add_action( „admin_head-„.$calendar_manage_menu, ‚calendar_add_javascript‘ );
    // Note only admin can change calendar options
    add_submenu_page(‚calendar‘, __(‚Manage Categories‘,’calendar‘), __(‚Manage Categories‘,’calendar‘), ‚manage_options‘, ‚calendar-categories‘, ‚manage_categories‘);
    add_submenu_page(‚calendar‘, __(‚Calendar Config‘,’calendar‘), __(‚Calendar Options‘,’calendar‘), ‚manage_options‘, ‚calendar-config‘, ‚edit_calendar_config‘);
    }
    }

    // Function to add the javascript to the admin header
    function calendar_add_javascript()
    {
    echo ‚

    .bcal-container{
    background-color: #fff;
    border-radius: 4px;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    float: left;
    padding: 5px;
    border: solid 1px #ccc;
    box-shadow: 0 0 3px #C0C0C0;
    }
    .bcal-table{
    border-collapse: separate;
    border-spacing: 0;
    border: solid 1px #A2A6AF;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    font-weight: normal;
    float: left;
    margin: 1px;
    padding: 0;
    width: 200px;
    }
    .bcal-table,
    .bcal-table th,
    .bcal-table td {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    }
    .bcal-table thead tr{
    background-color: #CECED2;
    border: 1px solid #A2A6AF;
    background-image: linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
    background-image: -o-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
    background-image: -moz-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
    background-image: -webkit-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
    background-image: -ms-linear-gradient(bottom, rgb(206,206,210) 37%, rgb(241,240,242) 69%);
    background-image: -webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.37, rgb(206,206,210)),
    color-stop(0.69, rgb(241,240,242))
    );
    }
    .bcal-table thead tr:first-child{
    line-height: 23px;
    }
    .bcal-table thead th{
    font-weight: bold;
    color: #404D5D;
    height: 20px;
    text-align: center;
    }
    .bcal-table tbody td{
    color: #3B4959;
    cursor: pointer;
    font-weight: normal;
    height: 25px;
    padding: 0 0 1px 1px;
    width: 25px;
    text-align: center;
    }
    .bcal-table tbody tr:first-child td{
    border-top: solid 1px #fff;
    }
    .bcal-table tbody td:first-child{
    border-left: none;
    padding: 0 0 1px;
    }
    .bcal-table .bcal-wday,
    .bcal-table .bcal-wnum{
    font-weight: normal;
    border-right: 1px solid #A2A6AF;
    border-top: 1px solid #A2A6AF;
    border-bottom: 1px solid #A2A6AF;
    padding: 1px 1px 2px 2px;
    }
    .bcal-table .bcal-wnum{
    border-right: 1px solid #A2A6AF;
    border-bottom: 1px solid #A2A6AF;
    color: #CC6600;
    background-image: linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
    background-image: -o-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
    background-image: -moz-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
    background-image: -webkit-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
    background-image: -ms-linear-gradient(bottom, rgb(255,225,159) 23%, rgb(255,250,234) 62%);
    background-image: -webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.23, rgb(255,225,159)),
    color-stop(0.62, rgb(255,250,234))
    );
    }
    .bcal-table .bcal-wday:last-child{
    border-right: none;
    }
    .bcal-table .bcal-empty{
    background-color: #F6F6F7;
    border-right: solid 1px #fff;
    border-bottom: solid 1px #fff;
    color: #999;
    cursor: default;
    }
    .bcal-table tr:last-child .bcal-empty,
    .bcal-table tr:last-child .bcal-week,
    .bcal-table tr:last-child .bcal-date{
    border-bottom: none;
    }
    .bcal-table .bcal-date{
    border-right: solid 1px #fff;
    border-bottom: solid 1px #fff;
    background-color: #ECECEE;
    }
    .bcal-table .bcal-past{
    background-color: #e6e6e6;
    color: #999;
    cursor: default;
    }
    .bcal-table .bcal-today{
    background-color: #D6D6D1;
    color: #333;
    }
    .bcal-table .bcal-week{
    background-color: #FEF3DA;
    border-right: solid 1px #fff;
    border-bottom: solid 1px #fff;
    color: #CC6600;
    cursor: default;
    }
    .bcal-table .bcal-selected{
    background-color: #BDBDBD;
    color: #F2F2F2;
    }
    .bcal-table .bcal-over,
    .bcal-table .bcal-date:hover{
    background-color: #B2B2A9;
    color: #fff;
    }
    .bcal-table .bcal-date:last-child,
    .bcal-table .bcal-empty:last-child{
    border-right: none;
    }
    .bcal-table .bcal-past:hover{
    background-color: #e0e0e0;
    color: #666;
    }
    .bcal-table .bcal-month,
    .bcal-table .bcal-navi,
    .bcal-table .bcal-wnum,
    .bcal-table .bcal-wday,
    .bcal-table .bcal-week{
    cursor: text;
    }

    ‚;
    }

    // Function to deal with loading the calendar into pages
    function calendar_insert($content)
    {
    if (preg_match(‚/\{CALENDAR*.+\}/‘,$content))
    {
    $cat_list = preg_split(‚/\{CALENDAR\;/‘,$content);
    if (sizeof($cat_list) > 1) {
    $cat_list = preg_split(‚/\}/‘,$cat_list[1]);
    $cat_list = $cat_list[0];
    $cal_output = calendar($cat_list);
    } else {
    $cal_output = calendar();
    }
    $content = preg_replace(‚/\{CALENDAR*.+\}/‘,$cal_output,$content);
    }
    return $content;
    }

    // Function to show a mini calendar in pages
    function minical_insert($content)
    {
    if (preg_match(‚/\{MINICAL*.+\}/‘,$content))
    {
    $cat_list= preg_split(‚/\{MINICAL\;/‘,$content);
    if (sizeof($cat_list) > 1) {
    $cat_list = preg_split(‚/\}/‘,$cat_list[1]);
    $cat_list= $cat_list[0];
    $cal_output = minical($cat_list);
    } else {
    $cal_output = minical();
    }
    $content = preg_replace(‚/\{MINICAL*.+\}/‘,$cal_output,$content);
    }
    return $content;
    }

    // Functions to allow the widgets to be inserted into posts and pages
    function upcoming_insert($content)
    {
    if (preg_match(‚/\{UPCOMING_EVENTS*.+\}/‘,$content))
    {
    $cat_list= preg_split(‚/\{UPCOMING_EVENTS\;/‘,$content);
    if (sizeof($cat_list) > 1) {
    $cat_list = preg_split(‚/\}/‘,$cat_list[1]);
    $cat_list= $cat_list[0];
    $cal_output = “.upcoming_events($cat_list).“;
    } else {
    $cal_output = “.upcoming_events().“;
    }
    $content = preg_replace(‚/\{UPCOMING_EVENTS*.+\}/‘,$cal_output,$content);
    }
    return $content;
    }
    function todays_insert($content)
    {
    if (preg_match(‚/\{TODAYS_EVENTS*.+\}/‘,$content))
    {
    $cat_list= preg_split(‚/\{TODAYS_EVENTS\;/‘,$content);
    if (sizeof($cat_list) > 1) {
    $cat_list = preg_split(‚/\}/‘,$cat_list[1]);
    $cat_list= $cat_list[0];
    $cal_output = “.todays_events($cat_list).“;
    } else {
    $cal_output = “.todays_events().“;
    }
    $content = preg_replace(‚/\{TODAYS_EVENTS*.+\}/‘,$cal_output,$content);
    }
    return $content;
    }

    // Function to check what version of Calendar is installed and install if needed
    function check_calendar()
    {
    // Checks to make sure Calendar is installed, if not it adds the default
    // database tables and populates them with test data. If it is, then the
    // version is checked through various means and if it is not up to date
    // then it is upgraded.

    // Lets see if this is first run and create us a table if it is!
    global $wpdb, $initial_style;

    // All this style info will go into the database on a new install
    // This looks nice in the TwentyTen theme
    $initial_style = “ .calnk a:hover {
    background-position:0 0;
    text-decoration:none;
    color:#000000;
    border-bottom:1px dotted #000000;
    }
    .calnk a:visited {
    text-decoration:none;
    color:#000000;
    border-bottom:1px dotted #000000;
    }
    .calnk a {
    text-decoration:none;
    color:#000000;
    border-bottom:1px dotted #000000;
    }
    .calnk a span {
    display:none;
    }
    .calnk a:hover span {
    color:#333333;
    background:#F6F79B;
    display:block;
    position:absolute;
    margin-top:1px;
    padding:5px;
    width:150px;
    z-index:100;
    line-height:1.2em;
    }
    .calendar-table {
    border:0 !important;
    width:100% !important;
    border-collapse:separate !important;
    border-spacing:2px !important;
    }
    .calendar-heading {
    height:25px;
    text-align:center;
    border:1px solid #D6DED5;
    background-color:#E4EBE3;
    }
    .calendar-next {
    width:25%;
    text-align:center;
    }
    .calendar-prev {
    width:25%;
    text-align:center;
    }
    .calendar-month {
    width:50%;
    text-align:center;
    font-weight:bold;
    }
    .normal-day-heading {
    text-align:center;
    width:25px;
    height:25px;
    font-size:0.8em;
    border:1px solid #DFE6DE;
    background-color:#EBF2EA;
    }
    .weekend-heading {
    text-align:center;
    width:25px;
    height:25px;
    font-size:0.8em;
    border:1px solid #DFE6DE;
    background-color:#EBF2EA;
    color:#FF0000;
    }
    .day-with-date {
    vertical-align:text-top;
    text-align:left;
    width:60px;
    height:60px;
    border:1px solid #DFE6DE;
    }
    .no-events {

    }
    .day-without-date {
    width:60px;
    height:60px;
    border:1px solid #E9F0E8;
    }
    span.weekend {
    color:#FF0000;
    }
    .current-day {
    vertical-align:text-top;
    text-align:left;
    width:60px;
    height:60px;
    border:1px solid #BFBFBF;
    background-color:#E4EBE3;
    }
    span.event {
    font-size:0.75em;
    }
    .kjo-link {
    font-size:0.75em;
    text-align:center;
    }
    .calendar-date-switcher {
    height:25px;
    text-align:center;
    border:1px solid #D6DED5;
    background-color:#E4EBE3;
    }
    .calendar-date-switcher form {
    margin:2px;
    }
    .calendar-date-switcher input {
    border:1px #D6DED5 solid;
    margin:0;
    }
    .calendar-date-switcher select {
    border:1px #D6DED5 solid;
    margin:0;
    }
    .calnk a:hover span span.event-title {
    padding:0;
    text-align:center;
    font-weight:bold;
    font-size:1.2em;
    margin-left:0px;
    }
    .calnk a:hover span span.event-title-break {
    width:96%;
    text-align:center;
    height:1px;
    margin-top:5px;
    margin-right:2%;
    padding:0;
    background-color:#000000;
    margin-left:0px;
    }
    .calnk a:hover span span.event-content-break {
    width:96%;
    text-align:center;
    height:1px;
    margin-top:5px;
    margin-right:2%;
    padding:0;
    background-color:#000000;
    margin-left:0px;
    }
    .page-upcoming-events {
    font-size:80%;
    }
    .page-todays-events {
    font-size:80%;
    }
    .calendar-table table,tbody,tr,td {
    margin:0 !important;
    padding:0 !important;
    }
    table.calendar-table {
    margin-bottom:5px !important;
    }
    .cat-key {
    width:100%;
    margin-top:30px;
    padding:5px;
    border:0 !important;
    }
    .cal-separate {
    border:0 !important;
    margin-top:10px;
    }
    table.cat-key {
    margin-top:5px !important;
    border:1px solid #DFE6DE !important;
    border-collapse:separate !important;
    border-spacing:4px !important;
    margin-left:2px !important;
    width:99.5% !important;
    margin-bottom:5px !important;
    }
    .cat-key td {
    border:0 !important;
    }“;

    // Assume this is not a new install until we prove otherwise
    $new_install = false;
    $vone_point_one_upgrade = false;
    $vone_point_two_beta_upgrade = false;

    $wp_calendar_exists = false;
    $wp_calendar_config_exists = false;
    $wp_calendar_config_version_number_exists = false;

    // Determine the calendar version
    $tables = $wpdb->get_results(„show tables“);
    foreach ( $tables as $table )
    {
    foreach ( $table as $value )
    {
    if ( $value == WP_CALENDAR_TABLE )
    {
    $wp_calendar_exists = true;
    }
    if ( $value == WP_CALENDAR_CONFIG_TABLE )
    {
    $wp_calendar_config_exists = true;

    // We now try and find the calendar version number
    // This will be a lot easier than finding other stuff
    // in the future.
    $version_number = $wpdb->get_var(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’calendar_version'“);
    if ($version_number == „1.2“)
    {
    $wp_calendar_config_version_number_exists = true;
    }
    }
    }
    }

    if ($wp_calendar_exists == false && $wp_calendar_config_exists == false)
    {
    $new_install = true;
    }
    else if ($wp_calendar_exists == true && $wp_calendar_config_exists == false)
    {
    $vone_point_one_upgrade = true;
    }
    else if ($wp_calendar_exists == true && $wp_calendar_config_exists == true && $wp_calendar_config_version_number_exists == false)
    {
    $vone_point_two_beta_upgrade = true;
    }

    // Now we’ve determined what the current install is or isn’t
    // we perform operations according to the findings
    if ( $new_install == true )
    {
    $sql = „CREATE TABLE “ . WP_CALENDAR_TABLE . “ (
    event_id INT(11) NOT NULL AUTO_INCREMENT ,
    event_begin DATE NOT NULL ,
    event_end DATE NOT NULL ,
    event_title VARCHAR(30) NOT NULL ,
    event_desc TEXT NOT NULL ,
    event_time TIME ,
    event_recur CHAR(1) ,
    event_repeats INT(3) ,
    event_author BIGINT(20) UNSIGNED ,
    event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT 1 ,
    event_link TEXT ,
    PRIMARY KEY (event_id)
    )“;
    $wpdb->get_results($sql);
    $sql = „CREATE TABLE “ . WP_CALENDAR_CONFIG_TABLE . “ (
    config_item VARCHAR(30) NOT NULL ,
    config_value TEXT NOT NULL ,
    PRIMARY KEY (config_item)
    )“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’can_manage_events‘, config_value=’edit_posts'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’calendar_style‘, config_value='“.$initial_style.“‚“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_author‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_jump‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_todays‘, config_value=’true'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_upcoming‘, config_value=’true'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_upcoming_days‘, config_value=7″;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’calendar_version‘, config_value=’1.2′“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’enable_categories‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „CREATE TABLE “ . WP_CALENDAR_CATEGORIES_TABLE . “ (
    category_id INT(11) NOT NULL AUTO_INCREMENT,
    category_name VARCHAR(30) NOT NULL ,
    category_colour VARCHAR(30) NOT NULL ,
    PRIMARY KEY (category_id)
    )“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO “ . WP_CALENDAR_CATEGORIES_TABLE . “ SET category_id=1, category_name=’General‘, category_colour=’#F6F79B'“;
    $wpdb->get_results($sql);
    }
    else if ($vone_point_one_upgrade == true)
    {
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ ADD COLUMN event_author BIGINT(20) UNSIGNED“;
    $wpdb->get_results($sql);
    $sql = „UPDATE „.WP_CALENDAR_TABLE.“ SET event_author=“.$wpdb->get_var(„SELECT MIN(ID) FROM „.$wpdb->prefix.“users“,0,0);
    $wpdb->get_results($sql);
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ MODIFY event_desc TEXT NOT NULL“;
    $wpdb->get_results($sql);
    $sql = „CREATE TABLE “ . WP_CALENDAR_CONFIG_TABLE . “ (
    config_item VARCHAR(30) NOT NULL ,
    config_value TEXT NOT NULL ,
    PRIMARY KEY (config_item)
    )“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’can_manage_events‘, config_value=’edit_posts'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’calendar_style‘, config_value='“.$initial_style.“‚“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_author‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_jump‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_todays‘, config_value=’true'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_upcoming‘, config_value=’true'“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’display_upcoming_days‘, config_value=7″;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’calendar_version‘, config_value=’1.2′“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’enable_categories‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ ADD COLUMN event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT 1″;
    $wpdb->get_results($sql);
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ ADD COLUMN event_link TEXT“;
    $wpdb->get_results($sql);
    $sql = „CREATE TABLE “ . WP_CALENDAR_CATEGORIES_TABLE . “ (
    category_id INT(11) NOT NULL AUTO_INCREMENT,
    category_name VARCHAR(30) NOT NULL ,
    category_colour VARCHAR(30) NOT NULL ,
    PRIMARY KEY (category_id)
    )“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO “ . WP_CALENDAR_CATEGORIES_TABLE . “ SET category_id=1, category_name=’General‘, category_colour=’#F6F79B'“;
    $wpdb->get_results($sql);
    }
    else if ($vone_point_two_beta_upgrade == true)
    {
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’calendar_version‘, config_value=’1.2′“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO „.WP_CALENDAR_CONFIG_TABLE.“ SET config_item=’enable_categories‘, config_value=’false'“;
    $wpdb->get_results($sql);
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ ADD COLUMN event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT 1″;
    $wpdb->get_results($sql);
    $sql = „ALTER TABLE „.WP_CALENDAR_TABLE.“ ADD COLUMN event_link TEXT „;
    $wpdb->get_results($sql);
    $sql = „CREATE TABLE “ . WP_CALENDAR_CATEGORIES_TABLE . “ (
    category_id INT(11) NOT NULL AUTO_INCREMENT,
    category_name VARCHAR(30) NOT NULL ,
    category_colour VARCHAR(30) NOT NULL ,
    PRIMARY KEY (category_id)
    )“;
    $wpdb->get_results($sql);
    $sql = „INSERT INTO “ . WP_CALENDAR_CATEGORIES_TABLE . “ SET category_id=1, category_name=’General‘, category_colour=’#F6F79B'“;
    $wpdb->get_results($sql);
    $sql = „UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value='“.$initial_style.“‚ WHERE config_item=’calendar_style'“;
    $wpdb->get_results($sql);
    }
    }

    // Used on the manage events admin page to display a list of events
    function wp_events_display_list(){

    global $wpdb;

    $events = $wpdb->get_results(„SELECT * FROM “ . WP_CALENDAR_TABLE . “ ORDER BY event_begin DESC“);

    if ( !empty($events) )
    {
    ?>

    <tr class="“>
    event_id); ?>
    event_title); ?>
    event_begin); ?>
    event_end); ?>
    event_time == ’00:00:00‘) { echo __(‚N/A‘,’calendar‘); } else { echo stripslashes($event->event_time); } ?>

    event_recur == ‚S‘) { echo __(‚Never‘,’calendar‘); }
    else if ($event->event_recur == ‚W‘) { echo __(‚Weekly‘,’calendar‘); }
    else if ($event->event_recur == ‚M‘) { echo __(‚Monthly (date)‘,’calendar‘); }
    else if ($event->event_recur == ‚U‘) { echo __(‚Monthly (day)‘,’calendar‘); }
    else if ($event->event_recur == ‚Y‘) { echo __(‚Yearly‘,’calendar‘); }
    ?>

    event_recur == ‚S‘) { echo __(‚N/A‘,’calendar‘); }
    else if ($event->event_repeats == 0) { echo __(‚Forever‘,’calendar‘); }
    else if ($event->event_repeats > 0) { echo stripslashes($event->event_repeats).‘ ‚.__(‚Times‘,’calendar‘); }
    ?>

    event_author); echo $e->display_name; ?>
    event_category);
    $this_cat = $wpdb->get_row($sql);
    ?>
    <td style="background-color:category_colour);?>;“>category_name); ?>

    <a href="/wp-admin/admin.php?page=calendar&action=edit&event_id=event_id);?>“ class=’edit‘>
    <a href="
    event_id),’calendar-delete_‘.stripslashes($event->event_id)); ?>“ class=“delete“ onclick=“return confirm(“)“>

    <?php
    }
    }

    // The event edit form for the manage events admin page
    function wp_events_edit_form($mode='add', $event_id=false)
    {
    global $wpdb,$users_entries;
    $data = false;

    if ( $event_id !== false )
    {
    if ( intval($event_id) != $event_id )
    {
    echo "“.__(‚Bad Monkey! No banana!‘,’calendar‘).““;
    return;
    }
    else
    {
    $data = $wpdb->get_results(„SELECT * FROM “ . WP_CALENDAR_TABLE . “ WHERE event_id='“ . mysql_escape_string($event_id) . „‚ LIMIT 1“);
    if ( empty($data) )
    {
    echo „“.__(„An event with that ID couldn’t be found“,’calendar‘).““;
    return;
    }
    $data = $data[0];
    }
    // Recover users entries if they exist; in other words if editing an event went wrong
    if (!empty($users_entries))
    {
    $data = $users_entries;
    }
    }
    // Deal with possibility that form was submitted but not saved due to error – recover user’s entries here
    else
    {
    $data = $users_entries;
    }

    ?>

    <form name="quoteform" id="quoteform" class="wrap" method="post" action="/wp-admin/admin.php?page=calendar“>
    <input type="hidden" name="action" value="“>
    <input type="hidden" name="event_id" value="“>

    <input type="text" name="event_title" class="input" size="40" maxlength="30"
    value="event_title)); ?>“ />

    event_desc)); ?>

    get_results($sql);
    foreach($cats as $cat)
    {
    echo ‚category_id).'“‚;
    if (!empty($data))
    {
    if ($data->event_category == $cat->category_id)
    {
    echo ’selected=“selected“‚;
    }
    }
    echo ‚>‘.stripslashes($cat->category_name).‘
    ‚;
    }
    ?>

    <input type="text" name="event_link" class="input" size="40" value="event_link)); ?>“ />

    <input type="text" name="event_begin" id="event_begin" class="input" size="12"
    value="event_begin));
    }
    else
    {
    echo date(„Y-m-d“,ctwo());
    }
    ?>“ />

    var cal_1 = new Calendar({
    element: ‚event_begin‘,
    startDay: ,
    onSelect: function unifydates(element) {
    document.forms[‚quoteform‘].event_end.value = document.forms[‚quoteform‘].event_begin.value;
    }
    });

    <input type="text" name="event_end" id="event_end" class="input" size="12"
    value="event_end));
    }
    else
    {
    echo date(„Y-m-d“,ctwo());
    }
    ?>“ />

    var cal_2 = new Calendar({
    element: ‚event_end‘,
    startDay: ,
    minDate: new Date(parseInt(document.forms[‚quoteform‘].event_begin.value.split(‚-‚)[0]),parseInt(document.forms[‚quoteform‘].event_begin.value.split(‚-‚)[1]-1),parseInt(document.forms[‚quoteform‘].event_begin.value.split(‚-‚)[2]))
    });

    <input type="text" name="event_time" class="input" size=12
    value="event_time == „00:00:00″)
    {
    echo “;
    }
    else
    {
    echo date(„H:i“,strtotime(htmlspecialchars(stripslashes($data->event_time))));
    }
    }
    else
    {
    echo date(„H:i“,ctwo());
    }
    ?>“ />

    event_repeats != NULL)
    {
    $repeats = $data->event_repeats;
    }
    else
    {
    $repeats = 0;
    }
    }
    else
    {
    $repeats = 0;
    }

    $selected_s = “;
    $selected_w = “;
    $selected_m = “;
    $selected_y = “;
    $selected_u = “;
    if (isset($data)) {
    if ($data->event_recur == „S“)
    {
    $selected_s = ’selected=“selected“‚;
    }
    else if ($data->event_recur == „W“)
    {
    $selected_w = ’selected=“selected“‚;
    }
    else if ($data->event_recur == „M“)
    {
    $selected_m = ’selected=“selected“‚;
    }
    else if ($data->event_recur == „Y“)
    {
    $selected_y = ’selected=“selected“‚;
    }
    else if ($data->event_recur == „U“)
    {
    $selected_u = ’selected=“selected“‚;
    }
    }
    ?>

    <input type="text" name="event_repeats" class="input" size="1" value="“ />

    <option class="input" value=“S“>
    <option class="input" value=“W“>
    <option class="input" value=“M“>
    <option class="input" value=“U“>
    <option class="input" value=“Y“>

     

    <input type="submit" name="save" class="button bold" value=" »“ />

    :
    = strtotime($begin))
    {
    $start_date_ok = 1;
    $end_date_ok = 1;
    }
    else
    {
    ?>
    :

    :

    :

    :

    :

    :
    = 0) && ($recur == ‚W‘ || $recur == ‚M‘ || $recur == ‚Y‘ || $recur == ‚U‘)))
    {
    $recurring_ok = 1;
    }
    else
    {
    ?>
    :
    ID.“, event_category=“.mysql_escape_string($category).“, event_link='“.mysql_escape_string($linky).“‚“;

    $wpdb->get_results($sql);

    $sql = „SELECT event_id FROM “ . WP_CALENDAR_TABLE . “ WHERE event_title='“ . mysql_escape_string($title) . „‚“
    . “ AND event_desc='“ . mysql_escape_string($desc) . „‚ AND event_begin='“ . mysql_escape_string($begin) . „‚ AND event_end='“ . mysql_escape_string($end) . „‚ AND event_recur='“ . mysql_escape_string($recur) . „‚ AND event_repeats='“ . mysql_escape_string($repeats) . „‚ LIMIT 1“;
    $result = $wpdb->get_results($sql);

    if ( empty($result) || empty($result[0]->event_id) )
    {
    ?>
    :

    event_title = $title;
    $users_entries->event_desc = $desc;
    $users_entries->event_begin = $begin;
    $users_entries->event_end = $end;
    $users_entries->event_time = $time;
    $users_entries->event_recur = $recur;
    $users_entries->event_repeats = $repeats;
    $users_entries->event_category = $category;
    $users_entries->event_link = $linky;
    }
    }
    }
    // Permit saving of events that have been edited
    elseif ( $action == ‚edit_save‘ )
    {
    $title = !empty($_REQUEST[‚event_title‘]) ? $_REQUEST[‚event_title‘] : “;
    $desc = !empty($_REQUEST[‚event_desc‘]) ? $_REQUEST[‚event_desc‘] : “;
    $begin = !empty($_REQUEST[‚event_begin‘]) ? $_REQUEST[‚event_begin‘] : “;
    $end = !empty($_REQUEST[‚event_end‘]) ? $_REQUEST[‚event_end‘] : “;
    $time = !empty($_REQUEST[‚event_time‘]) ? $_REQUEST[‚event_time‘] : “;
    $recur = !empty($_REQUEST[‚event_recur‘]) ? $_REQUEST[‚event_recur‘] : “;
    $repeats = !empty($_REQUEST[‚event_repeats‘]) ? $_REQUEST[‚event_repeats‘] : “;
    $category = !empty($_REQUEST[‚event_category‘]) ? $_REQUEST[‚event_category‘] : “;
    $linky = !empty($_REQUEST[‚event_link‘]) ? $_REQUEST[‚event_link‘] : “;

    if ( empty($event_id) )
    {
    ?>
    :

    :
    = strtotime($begin))
    {
    $start_date_ok = 1;
    $end_date_ok = 1;
    }
    else
    {
    ?>
    :

    :

    :

    :

    :

    :
    = 0) && ($recur == ‚W‘ || $recur == ‚M‘ || $recur == ‚Y‘ || $recur == ‚U‘)))
    {
    $recurring_ok = 1;
    }
    else
    {
    ?>
    :
    ID . „, event_category=“.mysql_escape_string($category).“, event_link='“.mysql_escape_string($linky).“‚ WHERE event_id='“ . mysql_escape_string($event_id) . „‚“;

    $wpdb->get_results($sql);

    $sql = „SELECT event_id FROM “ . WP_CALENDAR_TABLE . “ WHERE event_title='“ . mysql_escape_string($title) . „‚“
    . “ AND event_desc='“ . mysql_escape_string($desc) . „‚ AND event_begin='“ . mysql_escape_string($begin) . „‚ AND event_end='“ . mysql_escape_string($end) . „‚ AND event_recur='“ . mysql_escape_string($recur) . „‚ AND event_repeats='“ . mysql_escape_string($repeats) . „‚ LIMIT 1“;
    $result = $wpdb->get_results($sql);

    if ( empty($result) || empty($result[0]->event_id) )
    {
    ?>
    :

    event_title = $title;
    $users_entries->event_desc = $desc;
    $users_entries->event_begin = $begin;
    $users_entries->event_end = $end;
    $users_entries->event_time = $time;
    $users_entries->event_recur = $recur;
    $users_entries->event_repeats = $repeats;
    $users_entries->event_category = $category;
    $users_entries->event_link = $linky;
    $error_with_saving = 1;
    }
    }
    }
    // Deal with deleting an event from the database
    elseif ( $action == ‚delete‘ )
    {
    if ( empty($event_id) )
    {
    ?>
    :

    :
    get_results($sql);

    $sql = „SELECT event_id FROM “ . WP_CALENDAR_TABLE . “ WHERE event_id='“ . mysql_escape_string($event_id) . „‚“;
    $result = $wpdb->get_results($sql);

    if ( empty($result) || empty($result[0]->event_id) )
    {
    ?>

    :

    <?php
    if ( empty($event_id) )
    {
    echo "“.__(„You must provide an event id in order to edit it“,’calendar‘).““;
    }
    else
    {
    wp_events_edit_form(‚edit_save‘, $event_id);
    }
    }
    else
    {
    ?>

    :
    get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$new_perms.“‚ WHERE config_item=’can_manage_events'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$calendar_style.“‚ WHERE config_item=’calendar_style'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$disp_author.“‚ WHERE config_item=’display_author'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$disp_jump.“‚ WHERE config_item=’display_jump'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$disp_todays.“‚ WHERE config_item=’display_todays'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$disp_upcoming.“‚ WHERE config_item=’display_upcoming'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$display_upcoming_days.“‚ WHERE config_item=’display_upcoming_days'“);
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$enable_categories.“‚ WHERE config_item=’enable_categories'“);

    // Check to see if we are replacing the original style
    if (isset($_POST[‚reset_styles‘])) {
    if (mysql_escape_string($_POST[‚reset_styles‘]) == ‚on‘)
    {
    $wpdb->get_results(„UPDATE “ . WP_CALENDAR_CONFIG_TABLE . “ SET config_value = ‚“.$initial_style.“‚ WHERE config_item=’calendar_style'“);
    }
    }

    echo „„.__(‚Settings saved‘,’calendar‘).“.„;
    }

    // Pull the values out of the database that we need for the form
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’can_manage_events'“);
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    $allowed_group = stripslashes($config->config_value);
    }
    }

    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’calendar_style'“);
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    $calendar_style = stripslashes($config->config_value);
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’display_author'“);
    $yes_disp_author = “;
    $no_disp_author = “;
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    if ($config->config_value == ‚true‘)
    {
    $yes_disp_author = ’selected=“selected“‚;
    }
    else
    {
    $no_disp_author = ’selected=“selected“‚;
    }
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’display_jump'“);
    $yes_disp_jump = “;
    $no_disp_jump = “;
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    if ($config->config_value == ‚true‘)
    {
    $yes_disp_jump = ’selected=“selected“‚;
    }
    else
    {
    $no_disp_jump = ’selected=“selected“‚;
    }
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’display_todays'“);
    $yes_disp_todays = “;
    $no_disp_todays = “;
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    if ($config->config_value == ‚true‘)
    {
    $yes_disp_todays = ’selected=“selected“‚;
    }
    else
    {
    $no_disp_todays = ’selected=“selected“‚;
    }
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’display_upcoming'“);
    $yes_disp_upcoming = “;
    $no_disp_upcoming = “;
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    if ($config->config_value == ‚true‘)
    {
    $yes_disp_upcoming = ’selected=“selected“‚;
    }
    else
    {
    $no_disp_upcoming = ’selected=“selected“‚;
    }
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’display_upcoming_days'“);
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    $upcoming_days = stripslashes($config->config_value);
    }
    }
    $configs = $wpdb->get_results(„SELECT config_value FROM “ . WP_CALENDAR_CONFIG_TABLE . “ WHERE config_item=’enable_categories'“);
    $yes_enable_categories = “;
    $no_enable_categories = “;
    if (!empty($configs))
    {
    foreach ($configs as $config)
    {
    if ($config->config_value == ‚true‘)
    {
    $yes_enable_categories = ’selected=“selected“‚;
    }
    else
    {
    $no_enable_categories = ’selected=“selected“‚;
    }
    }
    }
    $subscriber_selected = “;
    $contributor_selected = “;
    $author_selected = “;
    $editor_selected = “;
    $admin_selected = “;
    if ($allowed_group == ‚read‘) { $subscriber_selected=’selected=“selected“‚;}
    else if ($allowed_group == ‚edit_posts‘) { $contributor_selected=’selected=“selected“‚;}
    else if ($allowed_group == ‚publish_posts‘) { $author_selected=’selected=“selected“‚;}
    else if ($allowed_group == ‚moderate_comments‘) { $editor_selected=’selected=“selected“‚;}
    else if ($allowed_group == ‚manage_options‘) { $admin_selected=’selected=“selected“‚;}

    // Now we render the form
    ?>

    <form name="quoteform" id="quoteform" class="wrap" method="post" action="/wp-admin/admin.php?page=calendar-config“>

    <option value="subscriber">
    <option value="contributor" >
    <option value="author" >
    <option value="editor" >
    <option value="admin" >

    <option value="on" >
    <option value="off" >

    <option value="on" >
    <option value="off" >

    <option value="on" >
    <option value="off" >

    <option value="on" >
    <option value="off" >

    <input type="text" name="display_upcoming_days" value="“ size=“1″ maxlength=“2″ />

    <option value="on" >
    <option value="off" >

     

    <input type="submit" name="save" class="button bold" value=" »“ />

    :
    get_results($sql);
    echo „„.__(‚Category added successfully‘,’calendar‘).“„;
    }
    }
    else if (isset($_GET[‚mode‘]) && isset($_GET[‚category_id‘]) && $_GET[‚mode‘] == ‚delete‘)
    {
    if (wp_verify_nonce($_GET[‚_wpnonce‘],’calendar-category_delete_‘.mysql_escape_string($_GET[‚category_id‘])) == false) {
    ?>
    :
    get_results($sql);
    $sql = „UPDATE “ . WP_CALENDAR_TABLE . “ SET event_category=1 WHERE event_category=“.mysql_escape_string($_GET[‚category_id‘]);
    $wpdb->get_results($sql);
    echo „„.__(‚Category deleted successfully‘,’calendar‘).“„;
    }
    }
    else if (isset($_GET[‚mode‘]) && isset($_GET[‚category_id‘]) && $_GET[‚mode‘] == ‚edit‘ && !isset($_POST[‚mode‘]))
    {
    $sql = „SELECT * FROM “ . WP_CALENDAR_CATEGORIES_TABLE . “ WHERE category_id=“.intval(mysql_escape_string($_GET[‚category_id‘]));
    $cur_cat = $wpdb->get_row($sql);
    ?>

    <form name="catform" id="catform" class="wrap" method="post" action="/wp-admin/admin.php?page=calendar-categories“>

    <input type="hidden" name="category_id" value="category_id) ?>“ />
    category_id)); ?>

    :
    <input type="text" name="category_name" class="input" size="30" maxlength="30" value="category_name) ?>“ />

    :
    <input type="text" name="category_colour" class="input" size="10" maxlength="7" value="category_colour) ?>“ />

     

    <input type="submit" name="save" class="button bold" value=" »“ />

    :
    get_results($sql);
    echo „„.__(‚Category edited successfully‘,’calendar‘).“„;
    }
    }

    $get_mode = 0;
    $post_mode = 0;
    if (isset($_GET[‚mode‘])) {
    if ($_GET[‚mode‘] == ‚edit‘) {
    $get_mode = 1;
    }
    }
    if (isset($_POST[‚mode‘])) {
    if ($_POST[‚mode‘] == ‚edit‘) {
    $post_mode = 1;
    }
    }
    if ($get_mode != 1 || $post_mode == 1)
    {
    ?>

    <form name="catform" id="catform" class="wrap" method="post" action="/wp-admin/admin.php?page=calendar-categories“>

    :

    :

     

    <input type="submit" name="save" class="button bold" value=" »“ />

    get_results(„SELECT * FROM “ . WP_CALENDAR_CATEGORIES_TABLE . “ ORDER BY category_id ASC“);

    if ( !empty($categories) )
    {
    ?>

    <tr class="“>
    category_id); ?>
    category_name); ?>
    <td style="background-color:category_colour); ?>;“> 
    <a href="/wp-admin/admin.php?page=calendar-categories&mode=edit&category_id=category_id);?>“ class=’edit‘>
    category_id == 1)
    {
    echo “.__(‚N/A‘,’calendar‘).“;
    }
    else
    {
    ?>
    <a href="category_id), ‚calendar-category_delete_‘.stripslashes($category->category_id)); ?>“ class=“delete“ onclick=“return confirm(“)“>

    <?php
    }
    else
    {
    echo '‘.__(‚There are no categories in the database – something has gone wrong!‘,’calendar‘).“;
    }

    ?>

    <?php
    }
    }

    // Function to indicate the number of the day passed, eg. 1st or 2nd Sunday
    function np_of_day($date)
    {
    $instance = 0;
    $dom = date('j',strtotime($date));
    if (($dom-7) 0 && ($dom-7) 7 && ($dom-7) 14 && ($dom-7) 21 && ($dom-7) < 28) { $instance = 5; }
    return $instance;
    }

    // Function to provide date of the nth day passed (eg. 2nd Sunday)
    function dt_of_sun($date,$instance,$day)
    {
    $plan = array();
    $plan['Mon'] = 1;
    $plan['Tue'] = 2;
    $plan['Wed'] = 3;
    $plan['Thu'] = 4;
    $plan['Fri'] = 5;
    $plan['Sat'] = 6;
    $plan['Sun'] = 7;
    $proper_date = date('Y-m-d',strtotime($date));
    $begin_month = substr($proper_date,0,8).'01';
    $offset = $plan[date('D',strtotime($begin_month))];
    $result_day = 0;
    $recon = 0;
    if (($day-($offset)) ‚jan‘,’feb‘,’mar‘,’apr‘,’may‘,’jun‘,’jul‘,’aug‘,’sept‘,’oct‘,’nov‘,’dec‘);
    $next_year = $cur_year + 1;

    if ($cur_month == 12)
    {
    if ($minical) { $rlink = “; } else { $rlink = __(‚Weiter‘,’calendar‘); }
    return ‚‚.$rlink.‘ »‚;
    }
    else
    {
    $next_month = $cur_month + 1;
    $month = $mod_rewrite_months[$next_month];
    if ($minical) { $rlink = “; } else { $rlink = __(‚Weiter‘,’calendar‘); }
    return ‚‚.$rlink.‘ »‚;
    }
    }

    // Configure the „Zurück“ link in the calendar
    function prev_link($cur_year,$cur_month,$minical = false)
    {
    $mod_rewrite_months = array(1=>’jan‘,’feb‘,’mar‘,’apr‘,’may‘,’jun‘,’jul‘,’aug‘,’sept‘,’oct‘,’nov‘,’dec‘);
    $last_year = $cur_year – 1;

    if ($cur_month == 1)
    {
    if ($minical) { $llink = “; } else { $llink = __(‚Zurück‘,’calendar‘); }
    return ‚« ‚.$llink.‘‚;
    }
    else
    {
    $next_month = $cur_month – 1;
    $month = $mod_rewrite_months[$next_month];
    if ($minical) { $llink = “; } else { $llink = __(‚Zurück‘,’calendar‘); }
    return ‚« ‚.$llink.‘‚;
    }
    }

    // Print upcoming events
    function upcoming_events($cat_list = “)
    {
    global $wpdb;

    // Find out if we should be displaying upcoming events
    $display = $wpdb->get_var(„SELECT config_value FROM „.WP_CALENDAR_CONFIG_TABLE.“ WHERE config_item=’display_upcoming'“,0,0);

    if ($display == ‚true‘)
    {
    // Get number of days we should go into the future
    $future_days = $wpdb->get_var(„SELECT config_value FROM „.WP_CALENDAR_CONFIG_TABLE.“ WHERE config_item=’display_upcoming_days'“,0,0);
    $day_count = 1;

    $output = “;
    while ($day_count < $future_days+1)
    {
    list($y,$m,$d) = explode("-",date("Y-m-d",mktime($day_count*24,0,0,date("m",ctwo()),date("d",ctwo()),date("Y",ctwo()))));
    $events = grab_events($y,$m,$d,'upcoming',$cat_list);
    usort($events, "time_cmp");
    if (count($events) != 0) {
    $output .= '‘.date_i18n(get_option(‚date_format‘),mktime($day_count*24,0,0,date(„m“,ctwo()),date(„d“,ctwo()),date(„Y“,ctwo()))).“;
    }
    foreach($events as $event)
    {
    if ($event->event_time == ’00:00:00′) {
    $time_string = ‚ ‚.__(‚all day‘,’calendar‘);
    }
    else {
    $time_string = ‚ ‚.__(‚at‘,’calendar‘).‘ ‚.date(get_option(‚time_format‘), strtotime(stripslashes($event->event_time)));
    }
    $output .= “.draw_event($event).$time_string.“;
    }
    if (count($events) != 0) {
    $output .= “;
    }
    $day_count = $day_count+1;
    }

    if ($output != “)
    {
    $visual = “;
    $visual .= $output;
    $visual .= “;
    return $visual;
    }
    }
    }

    // Print todays events
    function todays_events($cat_list = “)
    {
    global $wpdb;

    // Find out if we should be displaying todays events
    $display = $wpdb->get_var(„SELECT config_value FROM „.WP_CALENDAR_CONFIG_TABLE.“ WHERE config_item=’display_todays'“,0,0);

    if ($display == ‚true‘)
    {
    $output = “;
    $events = grab_events(date(„Y“,ctwo()),date(„m“,ctwo()),date(„d“,ctwo()),’todays‘,$cat_list);
    usort($events, „time_cmp“);
    foreach($events as $event)
    {
    if ($event->event_time == ’00:00:00′) {
    $time_string = ‚ ‚.__(‚all day‘,’calendar‘);
    }
    else {
    $time_string = ‚ ‚.__(‚at‘,’calendar‘).‘ ‚.date(get_option(‚time_format‘), strtotime(stripslashes($event->event_time)));
    }
    $output .= “.draw_event($event).$time_string.“;
    }
    $output .= “;
    if (count($events) != 0)
    {
    return $output;
    }
    }
    }

    // Function to compare time in event objects
    function time_cmp($a, $b)
    {
    if ($a->event_time == $b->event_time) {
    return 0;
    }
    return ($a->event_time event_time) ? -1 : 1;
    }

    // Used to draw multiple events
    function draw_events($events)
    {
    // We need to sort arrays of objects by time
    usort($events, „time_cmp“);
    $output = “;
    // Now process the events
    foreach($events as $event)
    {
    $output .= ‚* ‚.draw_event($event).“;
    }
    return $output;
    }

    // The widget to show the mini calendar
    function widget_init_events_calendar() {
    // Check for required functions
    if (!function_exists(‚wp_register_sidebar_widget‘))
    return;

    function widget_events_calendar($args) {
    extract($args);
    $the_title = stripslashes(get_option(‚events_calendar_widget_title‘));
    $the_cats = stripslashes(get_option(‚events_calendar_widget_cats‘));
    $widget_title = empty($the_title) ? __(‚Calendar‘,’calendar‘) : $the_title;
    $the_events = minical($the_cats);
    if ($the_events != “) {
    echo $before_widget;
    echo $before_title . $widget_title . $after_title;
    echo “.$the_events;
    echo $after_widget;
    }
    }

    function widget_events_calendar_control() {
    $widget_title = stripslashes(get_option(‚events_calendar_widget_title‘));
    $widget_cats = stripslashes(get_option(‚events_calendar_widget_cats‘));
    if (isset($_POST[‚events_calendar_widget_title‘]) || isset($_POST[‚events_calendar_widget_cats‘])) {
    update_option(‚events_calendar_widget_title‘,strip_tags($_POST[‚events_calendar_widget_title‘]));
    update_option(‚events_calendar_widget_cats‘,strip_tags($_POST[‚events_calendar_widget_cats‘]));
    }
    ?>

    :
    <input class="widefat" type="text" id="events_calendar_widget_title" name="events_calendar_widget_title" value="“/>
    :
    <input class="widefat" type="text" id="events_calendar_widget_cats" name="events_calendar_widget_cats" value="“/>

    ‚A calendar of your events‘));
    wp_register_widget_control(‚events_calendar‘,’events_calendar‘,’widget_events_calendar_control‘);
    }

    // The widget to show todays events in the sidebar
    function widget_init_calendar_today() {
    // Check for required functions
    if (!function_exists(‚wp_register_sidebar_widget‘))
    return;

    function widget_calendar_today($args) {
    extract($args);
    $the_title = stripslashes(get_option(‚calendar_today_widget_title‘));
    $the_cats = stripslashes(get_option(‚calendar_today_widget_cats‘));
    $widget_title = empty($the_title) ? __(‚Today\’s Events‘,’calendar‘) : $the_title;
    $the_events = todays_events($the_cats);
    if ($the_events != “) {
    echo $before_widget;
    echo $before_title . $widget_title . $after_title;
    echo $the_events;
    echo $after_widget;
    }
    }

    function widget_calendar_today_control() {
    $widget_title = stripslashes(get_option(‚calendar_today_widget_title‘));
    $widget_cats = stripslashes(get_option(‚calendar_today_widget_cats‘));
    if (isset($_POST[‚calendar_today_widget_title‘]) || isset($_POST[‚calendar_today_widget_cats‘])) {
    update_option(‚calendar_today_widget_title‘,strip_tags($_POST[‚calendar_today_widget_title‘]));
    update_option(‚calendar_today_widget_cats‘,strip_tags($_POST[‚calendar_today_widget_cats‘]));
    }
    ?>

    :
    <input class="widefat" type="text" id="calendar_today_widget_title" name="calendar_today_widget_title" value="“/>
    :
    <input class="widefat" type="text" id="calendar_today_widget_cats" name="calendar_today_widget_cats" value="“/>

    ‚A list of your events today‘));
    wp_register_widget_control(‚todays_events_calendar‘,’todays_events_calendar‘,’widget_calendar_today_control‘);
    }

    // The widget to show todays events in the sidebar
    function widget_init_calendar_upcoming() {
    // Check for required functions
    if (!function_exists(‚wp_register_sidebar_widget‘))
    return;

    function widget_calendar_upcoming($args) {
    extract($args);
    $the_title = stripslashes(get_option(‚calendar_upcoming_widget_title‘));
    $the_cats = stripslashes(get_option(‚calendar_upcoming_widget_cats‘));
    $widget_title = empty($the_title) ? __(‚Upcoming Events‘,’calendar‘) : $the_title;
    $the_events = upcoming_events($the_cats);
    if ($the_events != “) {
    echo $before_widget;
    echo $before_title . $widget_title . $after_title;
    echo $the_events;
    echo $after_widget;
    }
    }

    function widget_calendar_upcoming_control() {
    $widget_title = stripslashes(get_option(‚calendar_upcoming_widget_title‘));
    $widget_cats = stripslashes(get_option(‚calendar_upcoming_widget_cats‘));
    if (isset($_POST[‚calendar_upcoming_widget_title‘]) || isset($_POST[‚calendar_upcoming_widget_cats‘])) {
    update_option(‚calendar_upcoming_widget_title‘,strip_tags($_POST[‚calendar_upcoming_widget_title‘]));
    update_option(‚calendar_upcoming_widget_cats‘,strip_tags($_POST[‚calendar_upcoming_widget_cats‘]));
    }
    ?>

    :
    <input class="widefat" type="text" id="calendar_upcoming_widget_title" name="calendar_upcoming_widget_title" value="“/>
    :
    <input class="widefat" type="text" id="calendar_upcoming_widget_cats" name="calendar_upcoming_widget_cats" value="“/>

    ‚A list of your upcoming events‘));
    wp_register_widget_control(‚upcoming_events_calendar‘,’upcoming_events_calendar‘,’widget_calendar_upcoming_control‘);
    }

    // Used to draw an event to the screen
    function draw_event($event)
    {
    global $wpdb;

    // Before we do anything we want to know if we
    // should display the author and/or show categories.
    // We check for this later
    $display_author = $wpdb->get_var(„SELECT config_value FROM „.WP_CALENDAR_CONFIG_TABLE.“ WHERE config_item=’display_author'“,0,0);
    $show_cat = $wpdb->get_var(„SELECT config_value FROM „.WP_CALENDAR_CONFIG_TABLE.“ WHERE config_item=’enable_categories'“,0,0);
    $style = “;
    if ($show_cat == ‚true‘)
    {
    $sql = „SELECT * FROM “ . WP_CALENDAR_CATEGORIES_TABLE . “ WHERE category_id=“.mysql_escape_string($event->event_category);
    $cat_details = $wpdb->get_row($sql);
    $style = ’style=“background-color:‘.stripslashes($cat_details->category_colour).‘;“‚;
    }

    $header_details = “.stripslashes($event->event_title).‘
    ‚;
    if ($event->event_time != „00:00:00“)
    {
    $header_details .= ‚‚.__(‚Time‘,’calendar‘).‘: ‚ . date(get_option(‚time_format‘), strtotime(stripslashes($event->event_time))) . “;
    }
    if ($display_author == ‚true‘)
    {
    $e = get_userdata(stripslashes($event->event_author));
    $header_details .= ‚‚.__(‚Posted by‘, ‚calendar‘).‘: ‚.$e->display_name.“;
    }
    if ($display_author == ‚true‘ || $event->event_time != „00:00:00″)
    {
    $header_details .= “;
    }
    if ($event->event_link != “) { $linky = stripslashes($event->event_link); }
    else { $linky = ‚#‘; }

    $details = ‚‚ . stripslashes($event->event_title) . “ . $header_details . “ . stripslashes($event->event_desc) . ‚‚;

    return $details;
    }

    // Grab all events for the requested date from calendar
    function grab_event

  4. Veranstaltungskalender – Gute WordPress Plugins für Events schrieb am 13. Oktober 2014, um 16:02 Uhr:

    […] und darauf aufmerksam machen wollt, ist ein Kalender-Plugin. Anfang dieses Jahres haben wir schon über das WordPress Plugin Calendar berichtet. Wir stellen euch heute aber drei weitere Kalender-Plugins vor, die mehrere Events gleichzeitig und […]

    1. Frank Steiner schrieb am 13. Januar 2015, um 13:23 Uhr:

      Hallo erst mal,
      habe gerade das WP Calendar Plugin installiert, soweit so gut, jetzt fehlt mir aber im Admin Bereich der entsprechende Eintrag, so daß ich den Kalender mit den beschriebenen Punkten konfigurieren kann. Was kann ich tun ?
      Vielen Dank im Vorraus, Frank

      1. Hans Jung schrieb am 14. Januar 2015, um 14:42 Uhr:

        Hallo Frank,
        auf unserem Testsystem lässt sich das Plugin nach der Aktivierung in der linken Navigation über den Punkt „Kalender“ aufrufen. Evtl. hilft es, wenn du das Plugin erneut installierst und aktivierst.
        Viele Grüße,
        Hans

  5. Patrick Odenwald schrieb am 9. Februar 2015, um 12:02 Uhr:

    Hallo

    ich kann das Plugin auf der Webseite von WordPress nicht finden.

    Grüße

    1. Hans Jung schrieb am 10. Februar 2015, um 10:13 Uhr:

      Hallo Patrick,
      das Plugin steht aktuell nicht im Repository bereit. Den Thread hierzu findest du hier: https://wordpress.org/support/topic/not-in-wporg-repository-any-longer-1
      Die Plugin-Dateien sind weiterhin verfügbar, allerdings muss jeder für sich selbst entscheiden, ob er ein Plugin außerhalb des Repositoriums verwenden möchte. Aus dem Thread geht nicht hervor, was genau das Problem ist. Für mutige hier der Download-Link: https://plugins.svn.wordpress.org/calendar/tags/1.3.3/

  6. Schwarz schrieb am 23. Mai 2016, um 12:56 Uhr:

    Hallo,

    kann ich den Kalender auch so verwenden damit die Daten wie bei https://www.runme.de/ auf der Hauptseite erscheinen?

    Danke

    1. Katharina schrieb am 2. August 2016, um 14:50 Uhr:

      Hallo,

      einfach {CALENDAR} an der Stelle einfügen, an der der Kalender angezeigt werden soll.

      Viele Grüße,
      Katharina

Schreibe einen Kommentar

Pressengers lebt von der Wordpress Community, beteilige dich mit einem Kommentar!
Deine E-Mail Adresse wird nicht veröffentlicht.

Achtung: Mit dem Absenden eines Kommentars erklärst du dich damit einverstanden, dass alle eingegebenen Daten und deine IP-Adresse zum Zweck der Spamvermeidung durch das Programm Akismet in den USA überprüft und gespeichert werden. Weitere Informationen zu Akismet und Möglichkeiten des Widerrufs..