WordPress.org

Ready to get started?Download WordPress

Forums

Calendar
[resolved] 2 Calendars on a site (5 posts)

  1. jabbamonkey
    Member
    Posted 2 years ago #

    Is there a way to allow for 2 calendars on the site?

    I'm using the plugin:
    http://wordpress.org/extend/plugins/calendar
    ... but it seems to only allow for a single calendar. (I need a second calendar on the same site for something else).

    I'm assuming it's not as easy as creating a new folder in my plugins called 'calendar2' and adding the same calendar plugin inside there...

    I'd think that you'd need to modify some things in the script ... such as creating a second calendar "table" to store the new calendar's information. Modifying the queries to store data into this table. Creating a new admin tab (not calendar, but maybe calendar2).

    Is this something someone else has easily done? Please let me know.

  2. marcaanderson
    Member
    Posted 2 years ago #

    I'm playing with this right now as well - haven't found a plugin yet that will allow two instances. even tried making a copy and changing the files but still no joy. i think i will have to use two different plugins to achieve this unless someone else has any ideas?

  3. jabbamonkey
    Member
    Posted 2 years ago #

    I thought it could be as simple as duplicating the plugin in another folder (i.e. calendar2) and then changing some of the variables in the
    calendar.php page.... I haven't tried it yet, as I have a ton of other problems with my site now.

    Not sure if it will work...

    LINE 28

    // Enable internationalisation
    $plugin_dir = basename(dirname(__FILE__));
    load_plugin_textdomain( 'calendar2','wp-content/plugins/'.$plugin_dir, $plugin_dir);
    
    // Define the tables used in Calendar
    global $wpdb;
    define('WP_CALENDAR_TABLE', $wpdb->prefix . 'calendar2');
    define('WP_CALENDAR_CONFIG_TABLE', $wpdb->prefix . 'calendar2_config');
    define('WP_CALENDAR_CATEGORIES_TABLE', $wpdb->prefix . 'calendar2_categories');

    LINE 117

    if (function_exists('add_menu_page'))
         {
           add_menu_page(__('Calendar2','calendar'), __('Calendar2','calendar'), $allowed_group, 'calendar', 'edit_calendar');
         }
  4. rfroberg
    Member
    Posted 2 years ago #

    Hi,

    the way I solved it for our site is to make use of the calendar categories.

    You can have a calendar show only one category like this:

    {CALENDAR;2}

    Then, only events of category 2 will display in the calendar.

    Note, that you cannot have two calendars on the same page/post in wordpress, each showing two different categories. The reason for this is that the plugin makes a global search/replace on the page, replacing the tag {CALENDAR;2} with the actual calendar HTML. I made a fix for this, allowing you to have more than one calendar on the same page, each with its own category.

    The code for that is on Kieran's forum.

    Hope this helps!

  5. Kieran O'Shea
    Member
    Plugin Author

    Posted 1 year ago #

    Marking the above solution as correct. Thanks rfroberg :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags