# HG changeset patch # User hurons@caf4f556-3d62-0410-8435-a86758001935 # Date 1262685589 0 # Node ID fb7cd02b9848c72bafd924f05b7780285e6437d0 # Parent 6b96085291d77096a2e6c61e8b88bfb449e04567 clean all inactive plugin in the plugin rep diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/add-to-facebook-plugin/addtofacebook.php --- a/web/wp-content/plugins/add-to-facebook-plugin/addtofacebook.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -ID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; - break; - case "image": - $data=$data."

ID)."\" target=\"_blank\">\"Share

"; - break; - case "both": - $data=$data."

ID)."\" target=\"_blank\">\"ShareID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; - break; - } - return $data; -} - -function activate_add_to_facebook(){ - global $post; - $current_options = get_option('add_to_facebook_options'); - $insertiontype = $current_options['insertion_type']; - if ($insertiontype != 'template'){ - add_filter('the_content', 'add_to_facebook', 10); - add_filter('the_excerpt', 'add_to_facebook', 10); - } -} - -activate_add_to_facebook(); - -function addtofacebook(){ - global $post; - $current_options = get_option('add_to_facebook_options'); - $insertiontype = $current_options['insertion_type']; - if ($insertiontype != 'auto'){ - $linktype = $current_options['link_type']; - switch ($linktype) { - case "text": - echo "

ID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; - break; - case "image": - echo "

ID)."\" target=\"_blank\">\"Share

"; - break; - case "both": - echo "

ID)."\" target=\"_blank\">\"ShareID)."\" target=\"_blank\" title=\"Share on Facebook\">Share on Facebook

"; - break; - } - } -} - -// Create the options page -function add_to_facebook_options_page() { - $current_options = get_option('add_to_facebook_options'); - $link = $current_options["link_type"]; - $insert = $current_options["insertion_type"]; - if ($_POST['action']){ ?> -

Options saved.

- -
-

Add to Facebook Options

- -
"> -
- Options: - - - - - - - - - - -
-
-

- -

-
-
- - - \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/add-to-facebook-plugin/facebook.css --- a/web/wp-content/plugins/add-to-facebook-plugin/facebook.css Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -p.facebook a { - text-decoration: none; - font-style: italic; - color: #666; - font-size:12px; -} - -p.facebook a:hover { - text-decoration: underline; -} - - -p.facebook img { - margin: 1px 5px 0 0; -} \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif Binary file web/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/add-to-facebook-plugin/readme.txt --- a/web/wp-content/plugins/add-to-facebook-plugin/readme.txt Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -=== Plugin Name === -Contributors: David Goldstein -Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3396118 -Tags: facebook -Requires at least: 2.0 -Tested up to: 2.7 -Stable tag: trunk - -This plugin adds a footer link to add the current post or page to a Facebook Mini-Feed. - -== Description == -This plugin adds a footer link to add the current post or page to a Facebook Mini-Feed. While the plugin is activated a link will appear after the content of the post with the text "Share on Facebook" or the Facebook icon or both. Clicking this link will bring the user to the Facebook site. If the user isn't logged in they will be prompted to do so. Once logged into Facebook the post will be added to the Mini-Feed of the account. - -== Installation == -1. Add a directory called 'add-to-facebook-plugin' (without the quotes) to your '/wp-content/plugins/' directory. -1. Upload addtofacebook.php and facebook_share_icon.gif to the '/wp-content/plugins/add-to-facebook-plugin/' directory. -1. Activate the plugin through the 'Plugins' menu in WordPress. -1. Go to 'Options->Add to Facebook' in your admin interface to select you options. - -== CSS == -The CSS for this plugin is found in the included facebook.css file. This file may be edited to change the style of the link. - -== Options == -There are two options on the options page: Link Type and Insertion Type. - -Link Type - This option sets if you want your Facebook link to be text, image or both. - -Insertion Type - This option sets how you want to insert the link into your posts/pages. There are two choices: auto or template. - -* Auto - When insertion type is set to auto the Facebook link will automatically be inserted right after the post. -* Template - When insertion type is set to template the Facebook link will appear wherever the template tag for the plugin is added to your theme. This option requires a template tag to be added to your theme. - -== Template Tag == -The following template tag must be added to your theme in the location you want the link to appear when insertion type is set to template: - -`` \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/calendar.php --- a/web/wp-content/plugins/calendar/calendar.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2712 +0,0 @@ -get_results("UPDATE ".WP_CALENDAR_TABLE." SET event_author=".$wpdb->get_var("SELECT MIN(ID) FROM ".$wpdb->prefix."users",0,0)." WHERE event_author=".$id); -} - -// Function to add the calendar style into the header -function calendar_wp_head() -{ - global $wpdb; - - // If the calendar isn't installed or upgraded this won't work - check_calendar(); - - $styles = $wpdb->get_results("SELECT config_value FROM " . WP_CALENDAR_CONFIG_TABLE . " WHERE config_item='calendar_style'"); - if (!empty($styles)) - { - foreach ($styles as $style) - { - echo ' -'; - } - } -} - -// Function to deal with adding the calendar menus -function calendar_menu() -{ - global $wpdb; - - // We make use of the Calendar tables so we must have installed Calendar - check_calendar(); - - // 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')) - { - add_submenu_page('calendar', __('Manage Calendar','calendar'), __('Manage Calendar','calendar'), $allowed_group, 'calendar', 'edit_calendar'); - add_action( "admin_head", '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 ' - -'; -} - -// Function to deal with loading the calendar into pages -function calendar_insert($content) -{ - if (preg_match('{CALENDAR}',$content)) - { - $cal_output = calendar(); - $content = str_replace('{CALENDAR}',$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 Kubrick 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; - } - .calendar-table { - border:none; - width:100%; - } - .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; - } - .event-title { - text-align:center; - font-weight:bold; - font-size:1.2em; - } - .event-title-break { - width:96%; - margin-left:2%; - margin-right:2%; - margin-top:5px; - margin-bottom:5px; - text-align:center; - height:1px; - background-color:#000000; - } - .event-content-break { - width:96%; - margin-left:2%; - margin-right:2%; - margin-top:5px; - margin-bottom:5px; - text-align:center; - height:1px; - background-color:#000000; - } - .calendar-date-switcher { - height:25px; - text-align:center; - border:1px solid #D6DED5; - background-color:#E4EBE3; - } - .calendar-date-switcher form { - margin:0; - padding:0; - } - .calendar-date-switcher input { - border:1px #D6DED5 solid; - } - .calendar-date-switcher select { - border:1px #D6DED5 solid; - } - .cat-key { - width:100%; - margin-top:10px; - padding:5px; - border:1px solid #D6DED5; - }"; - - - // 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, - 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 = "ALTER TABLE ".WP_CALENDAR_TABLE." ADD COLUMN event_category BIGINT(20) UNSIGNED"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_category=1"; - $wpdb->get_results($sql); - $sql = "ALTER TABLE ".WP_CALENDAR_TABLE." ADD COLUMN event_link TEXT"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_link=''"; - $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"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_category=1"; - $wpdb->get_results($sql); - $sql = "ALTER TABLE ".WP_CALENDAR_TABLE." ADD COLUMN event_link TEXT"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_link=''"; - $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"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_category=1"; - $wpdb->get_results($sql); - $sql = "ALTER TABLE ".WP_CALENDAR_TABLE." ADD COLUMN event_link TEXT"; - $wpdb->get_results($sql); - $sql = "UPDATE " . WP_CALENDAR_TABLE . " SET event_link=''"; - $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) ) - { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - event_category; - $this_cat = $wpdb->get_row($sql); - ?> - - - - - - -
event_id; ?>event_title; ?>event_desc; ?>event_begin; ?>event_end; ?> - event_recur == 'S') { echo __('Never','calendar'); } - else if ($event->event_recur == 'W') { echo __('Weekly','calendar'); } - else if ($event->event_recur == 'M') { echo __('Monthly','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 $event->event_repeats.' '.__('Times','calendar'); } - ?> - event_author); echo $e->display_name; ?>category_name; ?>
- -

-

".__('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; - } - - ?> - -
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- " /> -
- " /> -
event_time))); - } - } - else - { - echo date("H:i"); - } - ?>" /> -
event_repeats != NULL) - { - $repeats = $data->event_repeats; - } - else - { - $repeats = 0; - } - - 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"'; - } - ?> - - -
- -
-
-
 
-
- -
- - - -= strtotime($begin)) - { - $start_date_ok = 1; - $end_date_ok = 1; - } - else - { - ?> -

:

- -

:

- -

:

- -

:

- -

:

- -

:

- = 0) && ($recur == 'W' || $recur == 'M' || $recur == 'Y'))) - { - $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'] : ''; - - // Deal with the fools who have left magic quotes turned on - if ( ini_get('magic_quotes_gpc') ) - { - $title = stripslashes($title); - $desc = stripslashes($desc); - $begin = stripslashes($begin); - $end = stripslashes($end); - $time = stripslashes($time); - $recur = stripslashes($recur); - $repeats = stripslashes($repeats); - $category = stripslashes($category); - $linky = stripslashes($linky); - } - - if ( empty($event_id) ) - { - ?> -

:

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

:

- -

:

- -

:

- -

:

- -

:

- -

:

- = 0) && ($recur == 'W' || $recur == 'M' || $recur == 'Y'))) - { - $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) ) - { - ?> -

- -

:

- - -
- -

-

".__("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 (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 = $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 = $config->config_value; - } - } - $configs = $wpdb->get_results("SELECT config_value FROM " . WP_CALENDAR_CONFIG_TABLE . " WHERE config_item='display_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'"); - 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'"); - 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'"); - 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 = $config->config_value; - } - } - $configs = $wpdb->get_results("SELECT config_value FROM " . WP_CALENDAR_CONFIG_TABLE . " WHERE config_item='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"'; - } - } - } - 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 - ?> - - -
-

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- -
-

-
-
-
 
-
- -
-
- - -get_results($sql); - echo "

".__('Category added successfully','calendar')."

"; - } - else if (isset($_GET['mode']) && isset($_GET['category_id']) && $_GET['mode'] == 'delete') - { - $sql = "DELETE FROM " . WP_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".mysql_escape_string($_GET['category_id']); - $wpdb->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=".mysql_escape_string($_GET['category_id']); - $cur_cat = $wpdb->get_row($sql); - ?> -
-

-
- - -
-
- - - - - - - - - -
:
:
-
-
 
-
- -
-
- get_results($sql); - echo "

".__('Category edited successfully','calendar')."

"; - } - - if ($_GET['mode'] != 'edit' || $_POST['mode'] == 'edit') - { -?> - -
-

-
- - -
-
- - - - - - - - - -
:
:
-
-
 
-
- -
-

-get_results("SELECT * FROM " . WP_CALENDAR_CATEGORIES_TABLE . " ORDER BY category_id ASC"); - - if ( !empty($categories) ) - { - ?> - - - - - - - - - - - - - - - - - category_id == 1) - { - echo ''; - } - else - { - ?> - - - - -
category_id; ?>category_name; ?> '.__('N/A','calendar').'
- '.__('There are no categories in the database - something has gone wrong!','calendar').'

'; - } - -?> -
- -'jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec'); - $next_year = $cur_year + 1; - - if ($cur_month == 12) - { - return ''.__('Next','calendar').' »'; - } - else - { - $next_month = $cur_month + 1; - $month = $mod_rewrite_months[$next_month]; - return ''.__('Next','calendar').' »'; - } -} - -// Configure the "Previous" link in the calendar -function prev_link($cur_year,$cur_month) -{ - $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) - { - return '« '.__('Prev','calendar').''; - } - else - { - $next_month = $cur_month - 1; - $month = $mod_rewrite_months[$next_month]; - return '« '.__('Prev','calendar').''; - } -} - -// Print upcoming events -function upcoming_events() -{ - global $wpdb; - - // This function cannot be called unless calendar is up to date - check_calendar(); - - // 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; - - while ($day_count < $future_days+1) - { - list($y,$m,$d) = split("-",date("Y-m-d",mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))); - $events = grab_events($y,$m,$d); - usort($events, "time_cmp"); - if (count($events) != 0) { - $output .= '
  • '.date(get_option('date_format'),mktime($day_count*24,0,0,date("m"),date("d"),date("Y"))).'
  • '; - } - $day_count = $day_count+1; - } - - if ($output != '') - { - $visual = '
  • '.__('Upcoming Events','calendar').'

  • '; - return $visual; - } - } -} - -// Print todays events -function todays_events() -{ - global $wpdb; - - // This function cannot be called unless calendar is up to date - check_calendar(); - - // 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 = '
  • '.__('Today\'s Events','calendar').'

  • '; - 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 < $b->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"); - - // Now process the events - foreach($events as $event) - { - $output .= draw_event($event); - } - return $output; -} - -// Widget todays events -function todays_events_widget() { - global $wpdb; - - // This function cannot be called unless calendar is up to date - check_calendar(); - - // 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 = ''; - if (count($events) != 0) - { - return $output; - } - } -} - -// Widget upcoming events -function upcoming_events_widget() { - global $wpdb; - - // This function cannot be called unless calendar is up to date - check_calendar(); - - // 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; - - while ($day_count < $future_days+1) - { - list($y,$m,$d) = split("-",date("Y-m-d",mktime($day_count*24,0,0,date("m"),date("d"),date("Y")))); - $events = grab_events($y,$m,$d); - usort($events, "time_cmp"); - if (count($events) != 0) { - $output .= '
  • '.date(get_option('date_format'),mktime($day_count*24,0,0,date("m"),date("d"),date("Y"))).'
  • '; - } - $day_count = $day_count+1; - } - - if ($output != '') - { - $visual = ''; - return $visual; - } - } -} - -// The widget to show todays events in the sidebar -function widget_init_calendar_today() { - // Check for required functions - if (!function_exists('register_sidebar_widget')) - return; - - function widget_calendar_today($args) { - extract($args); - $the_title = get_option('calendar_today_widget_title'); - $widget_title = empty($the_title) ? __('Today\'s Events','calendar') : $the_title; - $the_events = todays_events_widget(); - 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 = get_option('calendar_today_widget_title'); - if (isset($_POST['calendar_today_widget_title'])) { - update_option('calendar_today_widget_title',strip_tags($_POST['calendar_today_widget_title'])); - } - ?> -

    - -

    - -

    - -

    - 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); - - if ($show_cat == 'true') - { - $sql = "SELECT * FROM " . WP_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".$event->event_category; - $cat_details = $wpdb->get_row($sql); - $style = "background-color:".$cat_details->category_colour.";"; - } - - $header_details .= '
    '.$event->event_title.'
    '; - if ($event->event_time != "00:00:00") - { - $header_details .= ''.__('Time','calendar').': ' . date(get_option('time_format'), strtotime($event->event_time)) . '
    '; - } - if ($display_author == 'true') - { - $e = get_userdata($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 = $event->event_link; } - else { $linky = '#'; } - - $details = '
    -* ' . $event->event_title . '' . $header_details . '' . $event->event_desc . ''; - - return $details; -} - -// Draw an event but customise the HTML for use in the widget -function draw_widget_event($event) -{ - global $wpdb; - - // Calendar must be updated to run this function - check_calendar(); - - // 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); - - if ($show_cat == 'true') - { - $sql = "SELECT * FROM " . WP_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".$event->event_category; - $cat_details = $wpdb->get_row($sql); - $style = "background-color:".$cat_details->category_colour.";"; - } - - $header_details .= '
    '.$event->event_title.'
    '; - if ($event->event_time != "00:00:00") - { - $header_details .= ''.__('Time','calendar').': ' . date(get_option('time_format'), strtotime($event->event_time)) . '
    '; - } - if ($display_author == 'true') - { - $e = get_userdata($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 = $event->event_link; } - else { $linky = '#'; } - - $details = '' . $event->event_title . '' . $header_details . '' . $event->event_desc . ''; - - return $details; -} - -// Grab all events for the requested date from calendar -function grab_events($y,$m,$d) -{ - global $wpdb; - - $arr_events = array(); - - // Get the date format right - $date = $y . '-' . $m . '-' . $d; - - // Firstly we check for conventional events. These will form the first instance of a recurring event - // or the only instance of a one-off event - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_begin <= '$date' AND event_end >= '$date' AND event_recur = 'S' ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - array_push($arr_events, $event); - } - } - - // Even if there were results for that query, we may still have events recurring - // from the past on this day. We now methodically check the for these events - - /* - The yearly code - easy because the day and month will be the same, so we return all yearly - events that match the date part. Out of these we show those with a repeat of 0, and fast-foward - a number of years for those with a value more than 0. Those that land in the future are displayed. - */ - - - // Deal with forever recurring year events - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'Y' AND EXTRACT(YEAR FROM '$date') >= EXTRACT(YEAR FROM event_begin) AND event_repeats = 0 ORDER BY event_id"); - - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Technically we don't care about the years, but we need to find out if the - // event spans the turn of a year so we can deal with it appropriately. - $year_begin = date('Y',strtotime($event->event_begin)); - $year_end = date('Y',strtotime($event->event_end)); - - if ($year_begin == $year_end) - { - if (date('m-d',strtotime($event->event_begin)) <= date('m-d',strtotime($date)) && - date('m-d',strtotime($event->event_end)) >= date('m-d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - else if ($year_begin < $year_end) - { - if (date('m-d',strtotime($event->event_begin)) <= date('m-d',strtotime($date)) || - date('m-d',strtotime($event->event_end)) >= date('m-d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - } - } - - // Now the ones that happen a finite number of times - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'Y' AND EXTRACT(YEAR FROM '$date') >= EXTRACT(YEAR FROM event_begin) AND event_repeats != 0 AND (EXTRACT(YEAR FROM '$date')-EXTRACT(YEAR FROM event_begin)) <= event_repeats ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Technically we don't care about the years, but we need to find out if the - // event spans the turn of a year so we can deal with it appropriately. - $year_begin = date('Y',strtotime($event->event_begin)); - $year_end = date('Y',strtotime($event->event_end)); - - if ($year_begin == $year_end) - { - if (date('m-d',strtotime($event->event_begin)) <= date('m-d',strtotime($date)) && - date('m-d',strtotime($event->event_end)) >= date('m-d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - else if ($year_begin < $year_end) - { - if (date('m-d',strtotime($event->event_begin)) <= date('m-d',strtotime($date)) || - date('m-d',strtotime($event->event_end)) >= date('m-d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - } - } - - /* - The monthly code - just as easy because as long as the day of the month is correct, then we - show the event - */ - - // The monthly events that never stop recurring - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'M' AND EXTRACT(YEAR FROM '$date') >= EXTRACT(YEAR FROM event_begin) AND event_repeats = 0 ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Technically we don't care about the years or months, but we need to find out if the - // event spans the turn of a year or month so we can deal with it appropriately. - $month_begin = date('m',strtotime($event->event_begin)); - $month_end = date('m',strtotime($event->event_end)); - - if ($month_begin == $month_end) - { - if (date('d',strtotime($event->event_begin)) <= date('d',strtotime($date)) && - date('d',strtotime($event->event_end)) >= date('d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - else if ($month_begin < $month_end) - { - if ( ($event->event_begin <= date('Y-m-d',strtotime($date))) && (date('d',strtotime($event->event_begin)) <= date('d',strtotime($date)) || - date('d',strtotime($event->event_end)) >= date('d',strtotime($date))) ) - { - array_push($arr_events, $event); - } - } - } - } - - - // Now the ones that happen a finite number of times - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'M' AND EXTRACT(YEAR FROM '$date') >= EXTRACT(YEAR FROM event_begin) AND event_repeats != 0 AND (PERIOD_DIFF(EXTRACT(YEAR_MONTH FROM '$date'),EXTRACT(YEAR_MONTH FROM event_begin))) <= event_repeats ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Technically we don't care about the years or months, but we need to find out if the - // event spans the turn of a year or month so we can deal with it appropriately. - $month_begin = date('m',strtotime($event->event_begin)); - $month_end = date('m',strtotime($event->event_end)); - - if ($month_begin == $month_end) - { - if (date('d',strtotime($event->event_begin)) <= date('d',strtotime($date)) && - date('d',strtotime($event->event_end)) >= date('d',strtotime($date))) - { - array_push($arr_events, $event); - } - } - else if ($month_begin < $month_end) - { - if ( ($event->event_begin <= date('Y-m-d',strtotime($date))) && (date('d',strtotime($event->event_begin)) <= date('d',strtotime($date)) || - date('d',strtotime($event->event_end)) >= date('d',strtotime($date))) ) - { - array_push($arr_events, $event); - } - } - } - } - - - /* - Weekly - well isn't this fun! We need to scan all weekly events, find what day they fell on - and see if that matches the current day. If it does, we check to see if the repeats are 0. - If they are, display the event, if not, we fast forward from the original day in week blocks - until the number is exhausted. If the date we arrive at is in the future, display the event. - */ - - // The weekly events that never stop recurring - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'W' AND '$date' >= event_begin AND event_repeats = 0 ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Now we are going to check to see what day the original event - // fell on and see if the current date is both after it and on - // the correct day. If it is, display the event! - $day_start_event = date('D',strtotime($event->event_begin)); - $day_end_event = date('D',strtotime($event->event_end)); - $current_day = date('D',strtotime($date)); - - $plan = array(); - $plan['Mon'] = 1; - $plan['Tue'] = 2; - $plan['Wed'] = 3; - $plan['Thu'] = 4; - $plan['Fri'] = 5; - $plan['Sat'] = 6; - $plan['Sun'] = 7; - - if ($plan[$day_start_event] > $plan[$day_end_event]) - { - if (($plan[$day_start_event] <= $plan[$current_day]) || ($plan[$current_day] <= $plan[$day_end_event])) - { - array_push($arr_events, $event); - } - } - else if (($plan[$day_start_event] < $plan[$day_end_event]) || ($plan[$day_start_event]== $plan[$day_end_event])) - { - if (($plan[$day_start_event] <= $plan[$current_day]) && ($plan[$current_day] <= $plan[$day_end_event])) - { - array_push($arr_events, $event); - } - } - - } - } - - // The weekly events that have a limit on how many times they occur - $events = $wpdb->get_results("SELECT * FROM " . WP_CALENDAR_TABLE . " WHERE event_recur = 'W' AND '$date' >= event_begin AND event_repeats != 0 AND (event_repeats*7) >= (TO_DAYS('$date') - TO_DAYS(event_end)) ORDER BY event_id"); - if (!empty($events)) - { - foreach($events as $event) - { - // This is going to get complex so lets setup what we would place in for - // an event so we can drop it in with ease - - // Now we are going to check to see what day the original event - // fell on and see if the current date is both after it and on - // the correct day. If it is, display the event! - $day_start_event = date('D',strtotime($event->event_begin)); - $day_end_event = date('D',strtotime($event->event_end)); - $current_day = date('D',strtotime($date)); - - $plan = array(); - $plan['Mon'] = 1; - $plan['Tue'] = 2; - $plan['Wed'] = 3; - $plan['Thu'] = 4; - $plan['Fri'] = 5; - $plan['Sat'] = 6; - $plan['Sun'] = 7; - - if ($plan[$day_start_event] > $plan[$day_end_event]) - { - if (($plan[$day_start_event] <= $plan[$current_day]) || ($plan[$current_day] <= $plan[$day_end_event])) - { - array_push($arr_events, $event); - } - } - else if (($plan[$day_start_event] < $plan[$day_end_event]) || ($plan[$day_start_event]== $plan[$day_end_event])) - { - if (($plan[$day_start_event] <= $plan[$current_day]) && ($plan[$current_day] <= $plan[$day_end_event])) - { - array_push($arr_events, $event); - } - } - - } - } - - return $arr_events; -} - - -// Actually do the printing of the calendar -// Compared to searching for and displaying events -// this bit is really rather easy! -function calendar() -{ - global $wpdb; - - // First things first, make sure calendar is up to date - check_calendar(); - - // Deal with the week not starting on a monday - if (get_option('start_of_week') == 0) - { - $name_days = array(1=>__('Sunday','calendar'),__('Monday','calendar'),__('Tuesday','calendar'),__('Wednesday','calendar'),__('Thursday','calendar'),__('Friday','calendar'),__('Saturday','calendar')); - } - // Choose Monday if anything other than Sunday is set - else - { - $name_days = array(1=>__('Monday','calendar'),__('Tuesday','calendar'),__('Wednesday','calendar'),__('Thursday','calendar'),__('Friday','calendar'),__('Saturday','calendar'),__('Sunday','calendar')); - } - - // Carry on with the script - $name_months = array(1=>__('January','calendar'),__('February','calendar'),__('March','calendar'),__('April','calendar'),__('May','calendar'),__('June','calendar'),__('July','calendar'),__('August','calendar'),__('September','calendar'),__('October','calendar'),__('November','calendar'),__('December','calendar')); - - // If we don't pass arguments we want a calendar that is relevant to today - if (empty($_GET['month']) || empty($_GET['yr'])) - { - $c_year = date("Y"); - $c_month = date("m"); - $c_day = date("d"); - } - - // Years get funny if we exceed 3000, so we use this check - if ($_GET['yr'] <= 3000 && $_GET['yr'] >= 0) - { - // This is just plain nasty and all because of permalinks - // which are no longer used, this will be cleaned up soon - if ($_GET['month'] == 'jan' || $_GET['month'] == 'feb' || $_GET['month'] == 'mar' || $_GET['month'] == 'apr' || $_GET['month'] == 'may' || $_GET['month'] == 'jun' || $_GET['month'] == 'jul' || $_GET['month'] == 'aug' || $_GET['month'] == 'sept' || $_GET['month'] == 'oct' || $_GET['month'] == 'nov' || $_GET['month'] == 'dec') - { - - // Again nasty code to map permalinks into something - // databases can understand. This will be cleaned up - $c_year = mysql_escape_string($_GET['yr']); - if ($_GET['month'] == 'jan') { $t_month = 1; } - else if ($_GET['month'] == 'feb') { $t_month = 2; } - else if ($_GET['month'] == 'mar') { $t_month = 3; } - else if ($_GET['month'] == 'apr') { $t_month = 4; } - else if ($_GET['month'] == 'may') { $t_month = 5; } - else if ($_GET['month'] == 'jun') { $t_month = 6; } - else if ($_GET['month'] == 'jul') { $t_month = 7; } - else if ($_GET['month'] == 'aug') { $t_month = 8; } - else if ($_GET['month'] == 'sept') { $t_month = 9; } - else if ($_GET['month'] == 'oct') { $t_month = 10; } - else if ($_GET['month'] == 'nov') { $t_month = 11; } - else if ($_GET['month'] == 'dec') { $t_month = 12; } - $c_month = $t_month; - $c_day = date("d"); - } - // No valid month causes the calendar to default to today - else - { - $c_year = date("Y"); - $c_month = date("m"); - $c_day = date("d"); - } - } - // No valid year causes the calendar to default to today - else - { - $c_year = date("Y"); - $c_month = date("m"); - $c_day = date("d"); - } - - // Fix the days of the week if week start is not on a monday - if (get_option('start_of_week') == 0) - { - $first_weekday = date("w",mktime(0,0,0,$c_month,1,$c_year)); - $first_weekday = ($first_weekday==0?1:$first_weekday+1); - } - // Otherwise assume the week starts on a Monday. Anything other - // than Sunday or Monday is just plain odd - else - { - $first_weekday = date("w",mktime(0,0,0,$c_month,1,$c_year)); - $first_weekday = ($first_weekday==0?7:$first_weekday); - } - - $days_in_month = date("t", mktime (0,0,0,$c_month,1,$c_year)); - - // Start the table and add the header and naviagtion - $calendar_body .= ' - -'; - - // We want to know if we should display the date switcher - $date_switcher = $wpdb->get_var("SELECT config_value FROM ".WP_CALENDAR_CONFIG_TABLE." WHERE config_item='display_jump'",0,0); - - if ($date_switcher == 'true') - { - $calendar_body .= ' - - -'; - } - - // The header of the calendar table and the links. Note calls to link functions - $calendar_body .= ' - - -'; - - // Print the headings of the days of the week - $calendar_body .= ' -'; - for ($i=1; $i<=7; $i++) - { - // Colours need to be different if the starting day of the week is different - if (get_option('start_of_week') == 0) - { - $calendar_body .= ' -'; - } - else - { - $calendar_body .= ' -'; - } - } - $calendar_body .= ' -'; - - for ($i=1; $i<=$days_in_month;) - { - $calendar_body .= ' -'; - for ($ii=1; $ii<=7; $ii++) - { - if ($ii==$first_weekday && $i==1) - { - $go = TRUE; - } - elseif ($i > $days_in_month ) - { - $go = FALSE; - } - - if ($go) - { - // Colours again, this time for the day numbers - if (get_option('start_of_week') == 0) - { - // This bit of code is for styles believe it or not. - $grabbed_events = grab_events($c_year,$c_month,$i); - $no_events_class = ''; - if (!count($grabbed_events)) - { - $no_events_class = ' no-events'; - } - $calendar_body .= ' -'; - } - else - { - $grabbed_events = grab_events($c_year,$c_month,$i); - $no_events_class = ''; - if (!count($grabbed_events)) - { - $no_events_class = ' no-events'; - } - $calendar_body .= ' -'; - } - } - else - { - $calendar_body .= ' -'; - } - } - $calendar_body .= ' -'; - } - $show_cat = $wpdb->get_var("SELECT config_value FROM ".WP_CALENDAR_CONFIG_TABLE." WHERE config_item='enable_categories'",0,0); - - if ($show_cat == 'true') - { - $sql = "SELECT * FROM " . WP_CALENDAR_CATEGORIES_TABLE . " ORDER BY category_name ASC"; - $cat_details = $wpdb->get_results($sql); - $calendar_body .= ' -'; - } - $calendar_body .= '
    -
    -'; - $qsa = array(); - parse_str($_SERVER['QUERY_STRING'],$qsa); - foreach ($qsa as $name => $argument) - { - if ($name != 'month' && $name != 'yr') - { - $calendar_body .= ' -'; - } - } - function month_comparison($month) - { - $current_month = strtolower(date("M", time())); - if (isset($_GET['yr']) && isset($_GET['month'])) - { - if ($month == $_GET['month']) - { - return ' selected="selected"'; - } - } - elseif ($month == $current_month) - { - return ' selected="selected"'; - } - } - // We build the months in the switcher - $calendar_body .= ' - '.__('Month','calendar').': - '.__('Year','calendar').': - -
    -
    - - - - - - -
    ' . prev_link($c_year,$c_month) . ''.$name_months[(int)$c_month].' '.$c_year.'' . next_link($c_year,$c_month) . '
    -
    '.$name_days[$i].''.$name_days[$i].'
    1?'':'class="weekend"').'>'.$i++.'' . draw_events($grabbed_events) . ''.$i++.'' . draw_events($grabbed_events) . ' 
    - - -'; - foreach($cat_details as $cat_detail) - { - $calendar_body .= ''; - } - $calendar_body .= '
    '.__('Category Key','calendar').'
    '.$cat_detail->category_name.'
    -
    -'; - - // A little link to yours truely. See the README if you wish to remove this - $calendar_body .= ' -'; - - // Phew! After that bit of string building, spit it all out. - // The actual printing is done by the calling function. - return $calendar_body; -} - -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/calendar.pot --- a/web/wp-content/plugins/calendar/calendar.pot Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,505 +0,0 @@ -# Calendar translation file -# Copyright (C) 2009 Kieran O'Shea -# This file is distributed under the same license as the PACKAGE package. -# Kieran O'Shea , 2009 - -#: calendar.php:116 -msgid "Calendar" -msgstr "" - -#: calendar.php:120 -msgid "Manage Calendar" -msgstr "" - -#: calendar.php:123 calendar.php:1628 -msgid "Manage Categories" -msgstr "" - -#: calendar.php:124 -msgid "Calendar Config" -msgstr "" - -#: calendar.php:124 calendar.php:1437 -msgid "Calendar Options" -msgstr "" - -#: calendar.php:516 calendar.php:1640 -msgid "ID" -msgstr "" - -#: calendar.php:517 calendar.php:1992 calendar.php:2025 -msgid "Title" -msgstr "" - -#: calendar.php:518 -msgid "Description" -msgstr "" - -#: calendar.php:519 calendar.php:665 -msgid "Start Date" -msgstr "" - -#: calendar.php:520 calendar.php:683 -msgid "End Date" -msgstr "" - -#: calendar.php:521 -msgid "Recurs" -msgstr "" - -#: calendar.php:522 -msgid "Repeats" -msgstr "" - -#: calendar.php:523 calendar.php:1447 -msgid "Author" -msgstr "" - -#: calendar.php:524 -msgid "Category" -msgstr "" - -#: calendar.php:525 calendar.php:565 calendar.php:1643 calendar.php:1657 -msgid "Edit" -msgstr "" - -#: calendar.php:526 calendar.php:566 calendar.php:1644 calendar.php:1666 -msgid "Delete" -msgstr "" - -#: calendar.php:544 -msgid "Never" -msgstr "" - -#: calendar.php:545 -msgid "Weekly" -msgstr "" - -#: calendar.php:546 -msgid "Monthly" -msgstr "" - -#: calendar.php:547 -msgid "Yearly" -msgstr "" - -#: calendar.php:553 calendar.php:1661 -msgid "N/A" -msgstr "" - -#: calendar.php:554 -msgid "Forever" -msgstr "" - -#: calendar.php:555 -msgid "Times" -msgstr "" - -#: calendar.php:566 -msgid "Are you sure you want to delete this event?" -msgstr "" - -#: calendar.php:577 -msgid "There are no events in the database!" -msgstr "" - -#: calendar.php:593 -msgid "Bad Monkey! No banana!" -msgstr "" - -#: calendar.php:601 -msgid "An event with that ID couldn't be found" -msgstr "" - -#: calendar.php:628 -msgid "Event Title" -msgstr "" - -#: calendar.php:633 -msgid "Event Description" -msgstr "" - -#: calendar.php:637 -msgid "Event Category" -msgstr "" - -#: calendar.php:661 -msgid "Event Link (Optional)" -msgstr "" - -#: calendar.php:679 calendar.php:704 -msgid "Select Date" -msgstr "" - -#: calendar.php:708 -msgid "Time (hh:mm)" -msgstr "" - -#: calendar.php:726 -msgid "Optional, set blank if not required." -msgstr "" - -#: calendar.php:726 -msgid "Current time difference from GMT is " -msgstr "" - -#: calendar.php:726 -msgid " hour(s)" -msgstr "" - -#: calendar.php:730 -msgid "Recurring Events" -msgstr "" - -#: calendar.php:758 -msgid "Repeats for" -msgstr "" - -#: calendar.php:766 -msgid "" -"Entering 0 means forever. Where the recurrance interval is left at none, the " -"event will not reoccur." -msgstr "" - -#: calendar.php:773 calendar.php:1503 calendar.php:1590 calendar.php:1626 -msgid "Save" -msgstr "" - -#: calendar.php:878 calendar.php:885 calendar.php:892 calendar.php:905 -#: calendar.php:916 calendar.php:927 calendar.php:938 calendar.php:956 -#: calendar.php:1040 calendar.php:1047 calendar.php:1054 calendar.php:1067 -#: calendar.php:1078 calendar.php:1089 calendar.php:1100 calendar.php:1150 -#: calendar.php:1170 -msgid "Error" -msgstr "" - -#: calendar.php:878 calendar.php:1040 -msgid "" -"Your event end date must be either after or the same as your event begin date" -msgstr "" - -#: calendar.php:885 calendar.php:1047 -msgid "" -"Your date formatting is correct but one or more of your dates is invalid. " -"Check for number of days in month and leap year related errors." -msgstr "" - -#: calendar.php:892 calendar.php:1054 -msgid "" -"Both start and end dates must be entered and be in the format YYYY-MM-DD" -msgstr "" - -#: calendar.php:905 calendar.php:1067 -msgid "The time field must either be blank or be entered in the format hh:mm" -msgstr "" - -#: calendar.php:916 calendar.php:1078 -msgid "" -"The URL entered must either be prefixed with http:// or be completely blank" -msgstr "" - -#: calendar.php:927 calendar.php:1089 -msgid "" -"The event title must be between 1 and 30 characters in length and contain no " -"punctuation. Spaces are allowed but the title must not start with one." -msgstr "" - -#: calendar.php:938 calendar.php:1100 -msgid "" -"The repetition value must be 0 unless a type of recurrance is selected in " -"which case the repetition value must be 0 or higher" -msgstr "" - -#: calendar.php:956 -msgid "" -"An event with the details you submitted could not be found in the database. " -"This may indicate a problem with your database or the way in which it is " -"configured." -msgstr "" - -#: calendar.php:962 -msgid "Event added. It will now show in your calendar." -msgstr "" - -#: calendar.php:1010 calendar.php:1118 -msgid "Failure" -msgstr "" - -#: calendar.php:1010 -msgid "You can't update an event if you haven't submitted an event id" -msgstr "" - -#: calendar.php:1118 -msgid "" -"The database failed to return data to indicate the event has been updated " -"sucessfully. This may indicate a problem with your database or the way in " -"which it is configured." -msgstr "" - -#: calendar.php:1124 -msgid "Event updated successfully" -msgstr "" - -#: calendar.php:1150 -msgid "You can't delete an event if you haven't submitted an event id" -msgstr "" - -#: calendar.php:1164 -msgid "Event deleted successfully" -msgstr "" - -#: calendar.php:1170 -msgid "" -"Despite issuing a request to delete, the event still remains in the " -"database. Please investigate." -msgstr "" - -#: calendar.php:1186 -msgid "Edit Event" -msgstr "" - -#: calendar.php:1190 -msgid "You must provide an event id in order to edit it" -msgstr "" - -#: calendar.php:1200 -msgid "Add Event" -msgstr "" - -#: calendar.php:1203 -msgid "Manage Events" -msgstr "" - -#: calendar.php:1294 -msgid "Settings saved" -msgstr "" - -#: calendar.php:1443 -msgid "Choose the lowest user group that may manage events" -msgstr "" - -#: calendar.php:1445 -msgid "Subscriber" -msgstr "" - -#: calendar.php:1446 -msgid "Contributor" -msgstr "" - -#: calendar.php:1448 -msgid "Editor" -msgstr "" - -#: calendar.php:1449 -msgid "Administrator" -msgstr "" - -#: calendar.php:1454 -msgid "Do you want to display the author name on events?" -msgstr "" - -#: calendar.php:1456 calendar.php:1464 calendar.php:1472 calendar.php:1480 -#: calendar.php:1489 -msgid "Yes" -msgstr "" - -#: calendar.php:1457 calendar.php:1465 calendar.php:1473 calendar.php:1481 -#: calendar.php:1490 -msgid "No" -msgstr "" - -#: calendar.php:1462 -msgid "Display a jumpbox for changing month and year quickly?" -msgstr "" - -#: calendar.php:1470 -msgid "Display todays events?" -msgstr "" - -#: calendar.php:1478 -msgid "Display upcoming events?" -msgstr "" - -#: calendar.php:1483 -msgid "for" -msgstr "" - -#: calendar.php:1483 -msgid "days into the future" -msgstr "" - -#: calendar.php:1487 -msgid "Enable event categories?" -msgstr "" - -#: calendar.php:1495 -msgid "Configure the stylesheet for Calendar" -msgstr "" - -#: calendar.php:1497 -msgid "Tick this box if you wish to reset the Calendar style to default" -msgstr "" - -#: calendar.php:1555 -msgid "Category added successfully" -msgstr "" - -#: calendar.php:1563 -msgid "Category deleted successfully" -msgstr "" - -#: calendar.php:1571 -msgid "Edit Category" -msgstr "" - -#: calendar.php:1579 calendar.php:1615 calendar.php:1641 -msgid "Category Name" -msgstr "" - -#: calendar.php:1583 calendar.php:1619 -msgid "Category Colour (Hex format)" -msgstr "" - -#: calendar.php:1599 -msgid "Category edited successfully" -msgstr "" - -#: calendar.php:1607 -msgid "Add Category" -msgstr "" - -#: calendar.php:1642 -msgid "Category Colour" -msgstr "" - -#: calendar.php:1666 -msgid "Are you sure you want to delete this category?" -msgstr "" - -#: calendar.php:1679 -msgid "There are no categories in the database - something has gone wrong!" -msgstr "" - -#: calendar.php:1750 calendar.php:1756 -msgid "Next" -msgstr "" - -#: calendar.php:1768 calendar.php:1774 -msgid "Prev" -msgstr "" - -#: calendar.php:1806 calendar.php:1848 calendar.php:1904 calendar.php:1946 -msgid "all day" -msgstr "" - -#: calendar.php:1809 calendar.php:1851 calendar.php:1907 calendar.php:1949 -msgid "at" -msgstr "" - -#: calendar.php:1821 calendar.php:2011 calendar.php:2031 calendar.php:2032 -msgid "Upcoming Events" -msgstr "" - -#: calendar.php:1842 calendar.php:1978 calendar.php:1998 calendar.php:1999 -msgid "Today's Events" -msgstr "" - -#: calendar.php:2060 calendar.php:2104 -msgid "Time" -msgstr "" - -#: calendar.php:2065 calendar.php:2109 -msgid "Posted by" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Sunday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Monday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Tuesday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Wednesday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Thursday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Friday" -msgstr "" - -#: calendar.php:2404 calendar.php:2409 -msgid "Saturday" -msgstr "" - -#: calendar.php:2413 calendar.php:2523 -msgid "January" -msgstr "" - -#: calendar.php:2413 calendar.php:2524 -msgid "February" -msgstr "" - -#: calendar.php:2413 calendar.php:2525 -msgid "March" -msgstr "" - -#: calendar.php:2413 calendar.php:2526 -msgid "April" -msgstr "" - -#: calendar.php:2413 calendar.php:2527 -msgid "May" -msgstr "" - -#: calendar.php:2413 calendar.php:2528 -msgid "June" -msgstr "" - -#: calendar.php:2413 calendar.php:2529 -msgid "July" -msgstr "" - -#: calendar.php:2413 calendar.php:2530 -msgid "August" -msgstr "" - -#: calendar.php:2413 calendar.php:2531 -msgid "September" -msgstr "" - -#: calendar.php:2413 calendar.php:2532 -msgid "October" -msgstr "" - -#: calendar.php:2413 calendar.php:2533 -msgid "November" -msgstr "" - -#: calendar.php:2413 calendar.php:2534 -msgid "December" -msgstr "" - -#: calendar.php:2522 -msgid "Month" -msgstr "" - -#: calendar.php:2536 -msgid "Year" -msgstr "" - -#: calendar.php:2683 -msgid "Category Key" -msgstr "" - -#: calendar.php:2697 -msgid "Calendar developed and supported by " -msgstr "" diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/javascript.js --- a/web/wp-content/plugins/calendar/javascript.js Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1467 +0,0 @@ -// =================================================================== -// Author: Matt Kruse -// WWW: http://www.mattkruse.com/ -// -// NOTICE: You may use this code for any purpose, commercial or -// private, without any further permission from the author. You may -// remove this notice from your final code if you wish, however it is -// appreciated by the author if at least my web site address is kept. -// -// You may *NOT* re-distribute this code in any way except through its -// use. That means, you can include it in your product, or your web -// site, or any other form where the code is actually being used. You -// may not put the plain javascript up on your site for download or -// include it in your javascript libraries for download. -// If you wish to share this code with others, please just point them -// to the URL instead. -// Please DO NOT link directly to my .js files from your site. Copy -// the files to your server and use them there. Thank you. -// =================================================================== - - -/* SOURCE FILE: AnchorPosition.js */ - -/* -AnchorPosition.js -Author: Matt Kruse -Last modified: 10/11/02 - -DESCRIPTION: These functions find the position of an tag in a document, -so other elements can be positioned relative to it. - -COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small -positioning errors - usually with Window positioning - occur on the -Macintosh platform. - -FUNCTIONS: -getAnchorPosition(anchorname) - Returns an Object() having .x and .y properties of the pixel coordinates - of the upper-left corner of the anchor. Position is relative to the PAGE. - -getAnchorWindowPosition(anchorname) - Returns an Object() having .x and .y properties of the pixel coordinates - of the upper-left corner of the anchor, relative to the WHOLE SCREEN. - -NOTES: - -1) For popping up separate browser windows, use getAnchorWindowPosition. - Otherwise, use getAnchorPosition - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. -*/ - -// getAnchorPosition(anchorname) -// This function returns an object having .x and .y properties which are the coordinates -// of the named anchor, relative to the page. -function getAnchorPosition(anchorname) { - // This function will return an Object with x and y properties - var useWindow=false; - var coordinates=new Object(); - var x=0,y=0; - // Browser capability sniffing - var use_gebi=false, use_css=false, use_layers=false; - if (document.getElementById) { use_gebi=true; } - else if (document.all) { use_css=true; } - else if (document.layers) { use_layers=true; } - // Logic to find position - if (use_gebi && document.all) { - x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); - y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); - } - else if (use_gebi) { - var o=document.getElementById(anchorname); - x=AnchorPosition_getPageOffsetLeft(o); - y=AnchorPosition_getPageOffsetTop(o); - } - else if (use_css) { - x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); - y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); - } - else if (use_layers) { - var found=0; - for (var i=0; i9?"":"0")+x} - -// ------------------------------------------------------------------ -// isDate ( date_string, format_string ) -// Returns true if date string matches format of format string and -// is a valid date. Else returns false. -// It is recommended that you trim whitespace around the value before -// passing it to this function, as whitespace is NOT ignored! -// ------------------------------------------------------------------ -function isDate(val,format) { - var date=getDateFromFormat(val,format); - if (date==0) { return false; } - return true; - } - -// ------------------------------------------------------------------- -// compareDates(date1,date1format,date2,date2format) -// Compare two date strings to see which is greater. -// Returns: -// 1 if date1 is greater than date2 -// 0 if date2 is greater than date1 of if they are the same -// -1 if either of the dates is in an invalid format -// ------------------------------------------------------------------- -function compareDates(date1,dateformat1,date2,dateformat2) { - var d1=getDateFromFormat(date1,dateformat1); - var d2=getDateFromFormat(date2,dateformat2); - if (d1==0 || d2==0) { - return -1; - } - else if (d1 > d2) { - return 1; - } - return 0; - } - -// ------------------------------------------------------------------ -// formatDate (date_object, format) -// Returns a date in the output format specified. -// The format string uses the same abbreviations as in getDateFromFormat() -// ------------------------------------------------------------------ -function formatDate(date,format) { - format=format+""; - var result=""; - var i_format=0; - var c=""; - var token=""; - var y=date.getYear()+""; - var M=date.getMonth()+1; - var d=date.getDate(); - var E=date.getDay(); - var H=date.getHours(); - var m=date.getMinutes(); - var s=date.getSeconds(); - var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k; - // Convert real date parts into formatted versions - var value=new Object(); - if (y.length < 4) {y=""+(y-0+1900);} - value["y"]=""+y; - value["yyyy"]=y; - value["yy"]=y.substring(2,4); - value["M"]=M; - value["MM"]=LZ(M); - value["MMM"]=MONTH_NAMES[M-1]; - value["NNN"]=MONTH_NAMES[M+11]; - value["d"]=d; - value["dd"]=LZ(d); - value["E"]=DAY_NAMES[E+7]; - value["EE"]=DAY_NAMES[E]; - value["H"]=H; - value["HH"]=LZ(H); - if (H==0){value["h"]=12;} - else if (H>12){value["h"]=H-12;} - else {value["h"]=H;} - value["hh"]=LZ(value["h"]); - if (H>11){value["K"]=H-12;} else {value["K"]=H;} - value["k"]=H+1; - value["KK"]=LZ(value["K"]); - value["kk"]=LZ(value["k"]); - if (H > 11) { value["a"]="PM"; } - else { value["a"]="AM"; } - value["m"]=m; - value["mm"]=LZ(m); - value["s"]=s; - value["ss"]=LZ(s); - while (i_format < format.length) { - c=format.charAt(i_format); - token=""; - while ((format.charAt(i_format)==c) && (i_format < format.length)) { - token += format.charAt(i_format++); - } - if (value[token] != null) { result=result + value[token]; } - else { result=result + token; } - } - return result; - } - -// ------------------------------------------------------------------ -// Utility functions for parsing in getDateFromFormat() -// ------------------------------------------------------------------ -function _isInteger(val) { - var digits="1234567890"; - for (var i=0; i < val.length; i++) { - if (digits.indexOf(val.charAt(i))==-1) { return false; } - } - return true; - } -function _getInt(str,i,minlength,maxlength) { - for (var x=maxlength; x>=minlength; x--) { - var token=str.substring(i,i+x); - if (token.length < minlength) { return null; } - if (_isInteger(token)) { return token; } - } - return null; - } - -// ------------------------------------------------------------------ -// getDateFromFormat( date_string , format_string ) -// -// This function takes a date string and a format string. It matches -// If the date string matches the format string, it returns the -// getTime() of the date. If it does not match, it returns 0. -// ------------------------------------------------------------------ -function getDateFromFormat(val,format) { - val=val+""; - format=format+""; - var i_val=0; - var i_format=0; - var c=""; - var token=""; - var token2=""; - var x,y; - var now=new Date(); - var year=now.getYear(); - var month=now.getMonth()+1; - var date=1; - var hh=now.getHours(); - var mm=now.getMinutes(); - var ss=now.getSeconds(); - var ampm=""; - - while (i_format < format.length) { - // Get next token from format string - c=format.charAt(i_format); - token=""; - while ((format.charAt(i_format)==c) && (i_format < format.length)) { - token += format.charAt(i_format++); - } - // Extract contents of value based on format token - if (token=="yyyy" || token=="yy" || token=="y") { - if (token=="yyyy") { x=4;y=4; } - if (token=="yy") { x=2;y=2; } - if (token=="y") { x=2;y=4; } - year=_getInt(val,i_val,x,y); - if (year==null) { return 0; } - i_val += year.length; - if (year.length==2) { - if (year > 70) { year=1900+(year-0); } - else { year=2000+(year-0); } - } - } - else if (token=="MMM"||token=="NNN"){ - month=0; - for (var i=0; i11)) { - month=i+1; - if (month>12) { month -= 12; } - i_val += month_name.length; - break; - } - } - } - if ((month < 1)||(month>12)){return 0;} - } - else if (token=="EE"||token=="E"){ - for (var i=0; i12)){return 0;} - i_val+=month.length;} - else if (token=="dd"||token=="d") { - date=_getInt(val,i_val,token.length,2); - if(date==null||(date<1)||(date>31)){return 0;} - i_val+=date.length;} - else if (token=="hh"||token=="h") { - hh=_getInt(val,i_val,token.length,2); - if(hh==null||(hh<1)||(hh>12)){return 0;} - i_val+=hh.length;} - else if (token=="HH"||token=="H") { - hh=_getInt(val,i_val,token.length,2); - if(hh==null||(hh<0)||(hh>23)){return 0;} - i_val+=hh.length;} - else if (token=="KK"||token=="K") { - hh=_getInt(val,i_val,token.length,2); - if(hh==null||(hh<0)||(hh>11)){return 0;} - i_val+=hh.length;} - else if (token=="kk"||token=="k") { - hh=_getInt(val,i_val,token.length,2); - if(hh==null||(hh<1)||(hh>24)){return 0;} - i_val+=hh.length;hh--;} - else if (token=="mm"||token=="m") { - mm=_getInt(val,i_val,token.length,2); - if(mm==null||(mm<0)||(mm>59)){return 0;} - i_val+=mm.length;} - else if (token=="ss"||token=="s") { - ss=_getInt(val,i_val,token.length,2); - if(ss==null||(ss<0)||(ss>59)){return 0;} - i_val+=ss.length;} - else if (token=="a") { - if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";} - else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";} - else {return 0;} - i_val+=2;} - else { - if (val.substring(i_val,i_val+token.length)!=token) {return 0;} - else {i_val+=token.length;} - } - } - // If there are any trailing characters left in the value, it doesn't match - if (i_val != val.length) { return 0; } - // Is date valid for month? - if (month==2) { - // Check for leap year - if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year - if (date > 29){ return 0; } - } - else { if (date > 28) { return 0; } } - } - if ((month==4)||(month==6)||(month==9)||(month==11)) { - if (date > 30) { return 0; } - } - // Correct hours value - if (hh<12 && ampm=="PM") { hh=hh-0+12; } - else if (hh>11 && ampm=="AM") { hh-=12; } - var newdate=new Date(year,month-1,date,hh,mm,ss); - return newdate.getTime(); - } - -// ------------------------------------------------------------------ -// parseDate( date_string [, prefer_euro_format] ) -// -// This function takes a date string and tries to match it to a -// number of possible date formats to get the value. It will try to -// match against the following international formats, in this order: -// y-M-d MMM d, y MMM d,y y-MMM-d d-MMM-y MMM d -// M/d/y M-d-y M.d.y MMM-d M/d M-d -// d/M/y d-M-y d.M.y d-MMM d/M d-M -// A second argument may be passed to instruct the method to search -// for formats like d/M/y (european format) before M/d/y (American). -// Returns a Date object or null if no patterns match. -// ------------------------------------------------------------------ -function parseDate(val) { - var preferEuro=(arguments.length==2)?arguments[1]:false; - generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d'); - monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d'); - dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M'); - var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst'); - var d=null; - for (var i=0; i tags may cause errors. - -USAGE: -// Create an object for a WINDOW popup -var win = new PopupWindow(); - -// Create an object for a DIV window using the DIV named 'mydiv' -var win = new PopupWindow('mydiv'); - -// Set the window to automatically hide itself when the user clicks -// anywhere else on the page except the popup -win.autoHide(); - -// Show the window relative to the anchor name passed in -win.showPopup(anchorname); - -// Hide the popup -win.hidePopup(); - -// Set the size of the popup window (only applies to WINDOW popups -win.setSize(width,height); - -// Populate the contents of the popup window that will be shown. If you -// change the contents while it is displayed, you will need to refresh() -win.populate(string); - -// set the URL of the window, rather than populating its contents -// manually -win.setUrl("http://www.site.com/"); - -// Refresh the contents of the popup -win.refresh(); - -// Specify how many pixels to the right of the anchor the popup will appear -win.offsetX = 50; - -// Specify how many pixels below the anchor the popup will appear -win.offsetY = 100; - -NOTES: -1) Requires the functions in AnchorPosition.js - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. - -4) When a PopupWindow object is created, a handler for 'onmouseup' is - attached to any event handler you may have already defined. Do NOT define - an event handler for 'onmouseup' after you define a PopupWindow object or - the autoHide() will not work correctly. -*/ - -// Set the position of the popup window based on the anchor -function PopupWindow_getXYPosition(anchorname) { - var coordinates; - if (this.type == "WINDOW") { - coordinates = getAnchorWindowPosition(anchorname); - } - else { - coordinates = getAnchorPosition(anchorname); - } - this.x = coordinates.x; - this.y = coordinates.y; - } -// Set width/height of DIV/popup window -function PopupWindow_setSize(width,height) { - this.width = width; - this.height = height; - } -// Fill the window with contents -function PopupWindow_populate(contents) { - this.contents = contents; - this.populated = false; - } -// Set the URL to go to -function PopupWindow_setUrl(url) { - this.url = url; - } -// Set the window popup properties -function PopupWindow_setWindowProperties(props) { - this.windowProperties = props; - } -// Refresh the displayed contents of the popup -function PopupWindow_refresh() { - if (this.divName != null) { - // refresh the DIV object - if (this.use_gebi) { - document.getElementById(this.divName).innerHTML = this.contents; - } - else if (this.use_css) { - document.all[this.divName].innerHTML = this.contents; - } - else if (this.use_layers) { - var d = document.layers[this.divName]; - d.document.open(); - d.document.writeln(this.contents); - d.document.close(); - } - } - else { - if (this.popupWindow != null && !this.popupWindow.closed) { - if (this.url!="") { - this.popupWindow.location.href=this.url; - } - else { - this.popupWindow.document.open(); - this.popupWindow.document.writeln(this.contents); - this.popupWindow.document.close(); - } - this.popupWindow.focus(); - } - } - } -// Position and show the popup, relative to an anchor object -function PopupWindow_showPopup(anchorname) { - this.getXYPosition(anchorname); - this.x += this.offsetX; - this.y += this.offsetY; - if (!this.populated && (this.contents != "")) { - this.populated = true; - this.refresh(); - } - if (this.divName != null) { - // Show the DIV object - if (this.use_gebi) { - document.getElementById(this.divName).style.left = this.x + "px"; - document.getElementById(this.divName).style.top = this.y + "px"; - document.getElementById(this.divName).style.visibility = "visible"; - } - else if (this.use_css) { - document.all[this.divName].style.left = this.x; - document.all[this.divName].style.top = this.y; - document.all[this.divName].style.visibility = "visible"; - } - else if (this.use_layers) { - document.layers[this.divName].left = this.x; - document.layers[this.divName].top = this.y; - document.layers[this.divName].visibility = "visible"; - } - } - else { - if (this.popupWindow == null || this.popupWindow.closed) { - // If the popup window will go off-screen, move it so it doesn't - if (this.x<0) { this.x=0; } - if (this.y<0) { this.y=0; } - if (screen && screen.availHeight) { - if ((this.y + this.height) > screen.availHeight) { - this.y = screen.availHeight - this.height; - } - } - if (screen && screen.availWidth) { - if ((this.x + this.width) > screen.availWidth) { - this.x = screen.availWidth - this.width; - } - } - var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ); - this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+""); - } - this.refresh(); - } - } -// Hide the popup -function PopupWindow_hidePopup() { - if (this.divName != null) { - if (this.use_gebi) { - document.getElementById(this.divName).style.visibility = "hidden"; - } - else if (this.use_css) { - document.all[this.divName].style.visibility = "hidden"; - } - else if (this.use_layers) { - document.layers[this.divName].visibility = "hidden"; - } - } - else { - if (this.popupWindow && !this.popupWindow.closed) { - this.popupWindow.close(); - this.popupWindow = null; - } - } - } -// Pass an event and return whether or not it was the popup DIV that was clicked -function PopupWindow_isClicked(e) { - if (this.divName != null) { - if (this.use_layers) { - var clickX = e.pageX; - var clickY = e.pageY; - var t = document.layers[this.divName]; - if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) { - return true; - } - else { return false; } - } - else if (document.all) { // Need to hard-code this to trap IE for error-handling - var t = window.event.srcElement; - while (t.parentElement != null) { - if (t.id==this.divName) { - return true; - } - t = t.parentElement; - } - return false; - } - else if (this.use_gebi && e) { - var t = e.originalTarget; - while (t.parentNode != null) { - if (t.id==this.divName) { - return true; - } - t = t.parentNode; - } - return false; - } - return false; - } - return false; - } - -// Check an onMouseDown event to see if we should hide -function PopupWindow_hideIfNotClicked(e) { - if (this.autoHideEnabled && !this.isClicked(e)) { - this.hidePopup(); - } - } -// Call this to make the DIV disable automatically when mouse is clicked outside it -function PopupWindow_autoHide() { - this.autoHideEnabled = true; - } -// This global function checks all PopupWindow objects onmouseup to see if they should be hidden -function PopupWindow_hidePopupWindows(e) { - for (var i=0; i0) { - this.type="DIV"; - this.divName = arguments[0]; - } - else { - this.type="WINDOW"; - } - this.use_gebi = false; - this.use_css = false; - this.use_layers = false; - if (document.getElementById) { this.use_gebi = true; } - else if (document.all) { this.use_css = true; } - else if (document.layers) { this.use_layers = true; } - else { this.type = "WINDOW"; } - this.offsetX = 0; - this.offsetY = 0; - // Method mappings - this.getXYPosition = PopupWindow_getXYPosition; - this.populate = PopupWindow_populate; - this.setUrl = PopupWindow_setUrl; - this.setWindowProperties = PopupWindow_setWindowProperties; - this.refresh = PopupWindow_refresh; - this.showPopup = PopupWindow_showPopup; - this.hidePopup = PopupWindow_hidePopup; - this.setSize = PopupWindow_setSize; - this.isClicked = PopupWindow_isClicked; - this.autoHide = PopupWindow_autoHide; - this.hideIfNotClicked = PopupWindow_hideIfNotClicked; - } - -/* SOURCE FILE: CalendarPopup.js */ - -// HISTORY -// ------------------------------------------------------------------ -// Feb 7, 2005: Fixed a CSS styles to use px unit -// March 29, 2004: Added check in select() method for the form field -// being disabled. If it is, just return and don't do anything. -// March 24, 2004: Fixed bug - when month name and abbreviations were -// changed, date format still used original values. -// January 26, 2004: Added support for drop-down month and year -// navigation (Thanks to Chris Reid for the idea) -// September 22, 2003: Fixed a minor problem in YEAR calendar with -// CSS prefix. -// August 19, 2003: Renamed the function to get styles, and made it -// work correctly without an object reference -// August 18, 2003: Changed showYearNavigation and -// showYearNavigationInput to optionally take an argument of -// true or false -// July 31, 2003: Added text input option for year navigation. -// Added a per-calendar CSS prefix option to optionally use -// different styles for different calendars. -// July 29, 2003: Fixed bug causing the Today link to be clickable -// even though today falls in a disabled date range. -// Changed formatting to use pure CSS, allowing greater control -// over look-and-feel options. -// June 11, 2003: Fixed bug causing the Today link to be unselectable -// under certain cases when some days of week are disabled -// March 14, 2003: Added ability to disable individual dates or date -// ranges, display as light gray and strike-through -// March 14, 2003: Removed dependency on graypixel.gif and instead -/// use table border coloring -// March 12, 2003: Modified showCalendar() function to allow optional -// start-date parameter -// March 11, 2003: Modified select() function to allow optional -// start-date parameter -/* -DESCRIPTION: This object implements a popup calendar to allow the user to -select a date, month, quarter, or year. - -COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small -positioning errors - usually with Window positioning - occur on the -Macintosh platform. -The calendar can be modified to work for any location in the world by -changing which weekday is displayed as the first column, changing the month -names, and changing the column headers for each day. - -USAGE: -// Create a new CalendarPopup object of type WINDOW -var cal = new CalendarPopup(); - -// Create a new CalendarPopup object of type DIV using the DIV named 'mydiv' -var cal = new CalendarPopup('mydiv'); - -// Easy method to link the popup calendar with an input box. -cal.select(inputObject, anchorname, dateFormat); -// Same method, but passing a default date other than the field's current value -cal.select(inputObject, anchorname, dateFormat, '01/02/2000'); -// This is an example call to the popup calendar from a link to populate an -// input box. Note that to use this, date.js must also be included!! -Select - -// Set the type of date select to be used. By default it is 'date'. -cal.setDisplayType(type); - -// When a date, month, quarter, or year is clicked, a function is called and -// passed the details. You must write this function, and tell the calendar -// popup what the function name is. -// Function to be called for 'date' select receives y, m, d -cal.setReturnFunction(functionname); -// Function to be called for 'month' select receives y, m -cal.setReturnMonthFunction(functionname); -// Function to be called for 'quarter' select receives y, q -cal.setReturnQuarterFunction(functionname); -// Function to be called for 'year' select receives y -cal.setReturnYearFunction(functionname); - -// Show the calendar relative to a given anchor -cal.showCalendar(anchorname); - -// Hide the calendar. The calendar is set to autoHide automatically -cal.hideCalendar(); - -// Set the month names to be used. Default are English month names -cal.setMonthNames("January","February","March",...); - -// Set the month abbreviations to be used. Default are English month abbreviations -cal.setMonthAbbreviations("Jan","Feb","Mar",...); - -// Show navigation for changing by the year, not just one month at a time -cal.showYearNavigation(); - -// Show month and year dropdowns, for quicker selection of month of dates -cal.showNavigationDropdowns(); - -// Set the text to be used above each day column. The days start with -// sunday regardless of the value of WeekStartDay -cal.setDayHeaders("S","M","T",...); - -// Set the day for the first column in the calendar grid. By default this -// is Sunday (0) but it may be changed to fit the conventions of other -// countries. -cal.setWeekStartDay(1); // week is Monday - Sunday - -// Set the weekdays which should be disabled in the 'date' select popup. You can -// then allow someone to only select week end dates, or Tuedays, for example -cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week - -// Selectively disable individual days or date ranges. Disabled days will not -// be clickable, and show as strike-through text on current browsers. -// Date format is any format recognized by parseDate() in date.js -// Pass a single date to disable: -cal.addDisabledDates("2003-01-01"); -// Pass null as the first parameter to mean "anything up to and including" the -// passed date: -cal.addDisabledDates(null, "01/02/03"); -// Pass null as the second parameter to mean "including the passed date and -// anything after it: -cal.addDisabledDates("Jan 01, 2003", null); -// Pass two dates to disable all dates inbetween and including the two -cal.addDisabledDates("January 01, 2003", "Dec 31, 2003"); - -// When the 'year' select is displayed, set the number of years back from the -// current year to start listing years. Default is 2. -// This is also used for year drop-down, to decide how many years +/- to display -cal.setYearSelectStartOffset(2); - -// Text for the word "Today" appearing on the calendar -cal.setTodayText("Today"); - -// The calendar uses CSS classes for formatting. If you want your calendar to -// have unique styles, you can set the prefix that will be added to all the -// classes in the output. -// For example, normal output may have this: -// Today -// But if you set the prefix like this: -cal.setCssPrefix("Test"); -// The output will then look like: -// Today -// And you can define that style somewhere in your page. - -// When using Year navigation, you can make the year be an input box, so -// the user can manually change it and jump to any year -cal.showYearNavigationInput(); - -// Set the calendar offset to be different than the default. By default it -// will appear just below and to the right of the anchorname. So if you have -// a text box where the date will go and and anchor immediately after the -// text box, the calendar will display immediately under the text box. -cal.offsetX = 20; -cal.offsetY = 20; - -NOTES: -1) Requires the functions in AnchorPosition.js and PopupWindow.js - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. - -4) When a CalendarPopup object is created, a handler for 'onmouseup' is - attached to any event handler you may have already defined. Do NOT define - an event handler for 'onmouseup' after you define a CalendarPopup object - or the autoHide() will not work correctly. - -5) The calendar popup display uses style sheets to make it look nice. - -*/ - -// CONSTRUCTOR for the CalendarPopup Object -function CalendarPopup() { - var c; - if (arguments.length>0) { - c = new PopupWindow(arguments[0]); - } - else { - c = new PopupWindow(); - c.setSize(150,175); - } - c.offsetX = -152; - c.offsetY = 25; - c.autoHide(); - // Calendar-specific properties - c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); - c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); - c.dayHeaders = new Array("S","M","T","W","T","F","S"); - c.returnFunction = "CP_tmpReturnFunction"; - c.returnMonthFunction = "CP_tmpReturnMonthFunction"; - c.returnQuarterFunction = "CP_tmpReturnQuarterFunction"; - c.returnYearFunction = "CP_tmpReturnYearFunction"; - c.weekStartDay = 0; - c.isShowYearNavigation = false; - c.displayType = "date"; - c.disabledWeekDays = new Object(); - c.disabledDatesExpression = ""; - c.yearSelectStartOffset = 2; - c.currentDate = null; - c.todayText="Today"; - c.cssPrefix=""; - c.isShowNavigationDropdowns=false; - c.isShowYearNavigationInput=false; - window.CP_calendarObject = null; - window.CP_targetInput = null; - window.CP_dateFormat = "MM/dd/yyyy"; - // Method mappings - c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow; - c.setReturnFunction = CP_setReturnFunction; - c.setReturnMonthFunction = CP_setReturnMonthFunction; - c.setReturnQuarterFunction = CP_setReturnQuarterFunction; - c.setReturnYearFunction = CP_setReturnYearFunction; - c.setMonthNames = CP_setMonthNames; - c.setMonthAbbreviations = CP_setMonthAbbreviations; - c.setDayHeaders = CP_setDayHeaders; - c.setWeekStartDay = CP_setWeekStartDay; - c.setDisplayType = CP_setDisplayType; - c.setDisabledWeekDays = CP_setDisabledWeekDays; - c.addDisabledDates = CP_addDisabledDates; - c.setYearSelectStartOffset = CP_setYearSelectStartOffset; - c.setTodayText = CP_setTodayText; - c.showYearNavigation = CP_showYearNavigation; - c.showCalendar = CP_showCalendar; - c.hideCalendar = CP_hideCalendar; - c.getStyles = getCalendarStyles; - c.refreshCalendar = CP_refreshCalendar; - c.getCalendar = CP_getCalendar; - c.select = CP_select; - c.setCssPrefix = CP_setCssPrefix; - c.showNavigationDropdowns = CP_showNavigationDropdowns; - c.showYearNavigationInput = CP_showYearNavigationInput; - c.copyMonthNamesToWindow(); - // Return the object - return c; - } -function CP_copyMonthNamesToWindow() { - // Copy these values over to the date.js - if (typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null) { - window.MONTH_NAMES = new Array(); - for (var i=0; i\n"; - result += '
    \n'; - } - else { - result += '
    \n'; - result += '
    \n'; - result += '
    \n'; - } - // Code for DATE display (default) - // ------------------------------- - if (this.displayType=="date" || this.displayType=="week-end") { - if (this.currentDate==null) { this.currentDate = now; } - if (arguments.length > 0) { var month = arguments[0]; } - else { var month = this.currentDate.getMonth()+1; } - if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; } - else { var year = this.currentDate.getFullYear(); } - var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31); - if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { - daysinmonth[2] = 29; - } - var current_month = new Date(year,month-1,1); - var display_year = year; - var display_month = month; - var display_date = 1; - var weekday= current_month.getDay(); - var offset = 0; - - offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ; - if (offset > 0) { - display_month--; - if (display_month < 1) { display_month = 12; display_year--; } - display_date = daysinmonth[display_month]-offset+1; - } - var next_month = month+1; - var next_month_year = year; - if (next_month > 12) { next_month=1; next_month_year++; } - var last_month = month-1; - var last_month_year = year; - if (last_month < 1) { last_month=12; last_month_year--; } - var date_class; - if (this.type!="WINDOW") { - result += ""; - } - result += '\n'; - var refresh = windowref+'CP_refreshCalendar'; - var refreshLink = 'javascript:' + refresh; - if (this.isShowNavigationDropdowns) { - result += ''; - result += ''; - - result += ''; - } - else { - if (this.isShowYearNavigation) { - result += ''; - result += ''; - result += ''; - result += ''; - - result += ''; - if (this.isShowYearNavigationInput) { - result += ''; - } - else { - result += ''; - } - result += ''; - } - else { - result += '\n'; - result += '\n'; - result += '\n'; - } - } - result += '
     <'+this.monthNames[month-1]+'> <'+year+'><<'+this.monthNames[month-1]+' '+year+'>>
    \n'; - result += '\n'; - result += '\n'; - for (var j=0; j<7; j++) { - - result += '\n'; - } - result += '\n'; - for (var row=1; row<=6; row++) { - result += '\n'; - for (var col=1; col<=7; col++) { - var disabled=false; - if (this.disabledDatesExpression!="") { - var ds=""+display_year+LZ(display_month)+LZ(display_date); - eval("disabled=("+this.disabledDatesExpression+")"); - } - var dateClass = ""; - if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) { - dateClass = "cpCurrentDate"; - } - else if (display_month == month) { - dateClass = "cpCurrentMonthDate"; - } - else { - dateClass = "cpOtherMonthDate"; - } - if (disabled || this.disabledWeekDays[col-1]) { - result += ' \n'; - } - else { - var selected_date = display_date; - var selected_month = display_month; - var selected_year = display_year; - if (this.displayType=="week-end") { - var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0); - d.setDate(d.getDate() + (7-col)); - selected_year = d.getYear(); - if (selected_year < 1000) { selected_year += 1900; } - selected_month = d.getMonth()+1; - selected_date = d.getDate(); - } - result += ' \n'; - } - display_date++; - if (display_date > daysinmonth[display_month]) { - display_date=1; - display_month++; - } - if (display_month > 12) { - display_month=1; - display_year++; - } - } - result += ''; - } - var current_weekday = now.getDay() - this.weekStartDay; - if (current_weekday < 0) { - current_weekday += 7; - } - result += '\n'; - result += '
    '+this.dayHeaders[(this.weekStartDay+j)%7]+'
    '+display_date+''+display_date+'
    \n'; - if (this.disabledDatesExpression!="") { - var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate()); - eval("disabled=("+this.disabledDatesExpression+")"); - } - if (disabled || this.disabledWeekDays[current_weekday+1]) { - result += ' '+this.todayText+'\n'; - } - else { - result += ' '+this.todayText+'\n'; - } - result += '
    \n'; - result += '
    \n'; - } - - // Code common for MONTH, QUARTER, YEAR - // ------------------------------------ - if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") { - if (arguments.length > 0) { var year = arguments[0]; } - else { - if (this.displayType=="year") { var year = now.getFullYear()-this.yearSelectStartOffset; } - else { var year = now.getFullYear(); } - } - if (this.displayType!="year" && this.isShowYearNavigation) { - result += ""; - result += '\n'; - result += ' \n'; - result += ' \n'; - result += ' \n'; - result += '
    <<'+year+'>>
    \n'; - } - } - - // Code for MONTH display - // ---------------------- - if (this.displayType=="month") { - // If POPUP, write entire HTML document - result += '\n'; - for (var i=0; i<4; i++) { - result += ''; - for (var j=0; j<3; j++) { - var monthindex = ((i*3)+j); - result += ''; - } - result += ''; - } - result += '
    '+this.monthAbbreviations[monthindex]+'
    \n'; - } - - // Code for QUARTER display - // ------------------------ - if (this.displayType=="quarter") { - result += '
    \n'; - for (var i=0; i<2; i++) { - result += ''; - for (var j=0; j<2; j++) { - var quarter = ((i*2)+j+1); - result += ''; - } - result += ''; - } - result += '

    Q'+quarter+'

    \n'; - } - - // Code for YEAR display - // --------------------- - if (this.displayType=="year") { - var yearColumnSize = 4; - result += ""; - result += '\n'; - result += ' \n'; - result += ' \n'; - result += '
    <<>>
    \n'; - result += '\n'; - for (var i=0; i'+currentyear+''; - } - result += ''; - } - result += '
    \n'; - } - // Common - if (this.type == "WINDOW") { - result += "\n"; - } - return result; - } - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/readme.txt --- a/web/wp-content/plugins/calendar/readme.txt Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -=== Calendar === -Contributors: KieranOShea -Donate link: http://www.kieranoshea.com -Tags: calendar, dates, times, events -Requires at least: 2.0 -Tested up to: 2.8 -Stable tag: 1.2.2 - -A simple but effective Calendar plugin for WordPress that allows you to -manage your events and appointments and display them to the world. - -== Description == - -A simple but effective Calendar plugin for WordPress that allows you to -manage your events and appointments and display them to the world on your -website. - -Features: - -* Monthly view of events -* Mouse-over details for each event -* Events can have a timestamp (optional) -* Events can display their author (optional) -* Events can span more than one day -* Multiple events per day possible -* Events can repeat on a weekly, monthly or yearly basis -* Repeats can occur indefinitely or a limited number of times -* Easy to use events manager in admin dashboard -* Sidebar function/Widget to show todays events -* Sidebar function/Widget to show upcoming events -* Lists of todays events can be displayed in posts or pages -* Lists of upcoming events can be displayed in posts or pages -* Comprehensive options panel for admin -* Modifiable CSS using the options panel -* Optional drop down boxes to quickly change month and year -* User groups other than admin can be permitted to manage events -* Events can be placed into categories -* A calendar of events for just one of more categories can be displayed -* Categories system can be switched on or off -* Pop up javascript calendars help the choosing of dates -* Events can be links pointing to a location of your choice -* Full internationalisation is possible -* Comaptible with WordPress MU - -== Installation == - -The installation is extremely simple and straightforward. It only takes a second. - -Installing: - -1. Upload the whole calendar directory into your WordPress plugins directory. - -2. Activate the plugin on your WordPress plugins page - -3. Configure Calendar using the following pages in the admin panel: - - Calendar -> Manage Events - - Calendar -> Manage Categories - - Calendar -> Calendar Options - -4. Edit or create a page on your blog which includes the text {CALENDAR} and visit - the page you have edited or created. You should see your calendar in action. - -Upgrading from 1.2 or later: - -1. Deactivate the plugin (you will not lose any events) - -2. Remove your current calendar directory from the WordPress plugins directory - -2. Upload the whole calendar directory into your WordPress plugins directory. - -3. Activate the plugin on your WordPress plugins page - -4. Configure Calendar using the following pages in the admin panel: - - Calendar -> Manage Events - - Calendar -> Manage Categories - - Calendar -> Calendar Options - -5. Edit or create a page on your blog which includes the text {CALENDAR} and visit - the page you have edited or created page. You should see your calendar in action. - -Upgrading from 1.1: - -1. Deactivate the plugin (you will not lose any events) - -2. Remove the Rewrite rules from your .htaccess file that you added - when you first installed Calendar. - -3. Delete plugins/calendar.php, wp-admin/edit-calendar.php, wp-calendar.php - -4. Upload the whole calendar directory into your WordPress plugins directory. - -5. Activate the plugin on your WordPress plugins page - -6. Configure Calendar using the following pages in the admin panel: - - Calendar -> Manage Events - - Calendar -> Manage Categories - - Calendar -> Calendar Options - -7. Edit or create a page on your blog which includes the text {CALENDAR} and visit - the page you have edited or created page. You should see your calendar in action. - -Uninstalling: - -1. Deactivate the plugin on the plugins page of your blog dashboard - -2. Delete the uploaded files for the plugin - -3. Remove the text {CALENDAR} from the page you were using to show calendar, or delete that page - -== Frequently Asked Questions == - -= Where are the frequently asked questions for Calendar? = - - They are located on [Kieran O'Shea's forum](http://www.kieranoshea.com/forum/viewtopic.php?f=13&t=10 "Kieran O'Shea's forum"). - Please note that you should check these before asking any support questions or thinking your calendar install isn't working - properly. - -= Where can I get support for the plugin? = - - Support is only available on [Kieran O'Shea's forum](http://www.kieranoshea.com/forum/viewtopic.php?f=13&t=10 "Kieran O'Shea's forum"). - Regrettably e-mail support became too cumberome to manage and so now all support and bug report e-mails for calendar will be ignored. All - such queries will be answered promptly on the forums, although please make sure you search first before asking your question. - -= Can I remove the link to your site? = - - Yes, you may do this, but please be aware that support will not be provided - to those who choose to remove the link. When you ask your support question - you will be asked for the URL to your blog and the presence of the link will - be checked before support will be provided. - -== Screenshots == - -1. Calendar being used on a blog page - -2. Widgets showing in the sidebar - -3. The event management screen of calendar - -4. The category management screen of calendar - -5. The options screen of Calendar diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/screenshot-1.png Binary file web/wp-content/plugins/calendar/screenshot-1.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/screenshot-2.png Binary file web/wp-content/plugins/calendar/screenshot-2.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/screenshot-3.png Binary file web/wp-content/plugins/calendar/screenshot-3.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/screenshot-4.png Binary file web/wp-content/plugins/calendar/screenshot-4.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/calendar/screenshot-5.png Binary file web/wp-content/plugins/calendar/screenshot-5.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/future-posts-calendar/future_calendar.php --- a/web/wp-content/plugins/future-posts-calendar/future_calendar.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ - -
    - - -
    - 'Future Posts'); - $options = (array) get_option('widget_fut_posts'); - - foreach ( $defaults as $key => $value ) - if ( !isset($options[$key]) ) - $options[$key] = $defaults[$key]; - - echo $before_widget . $before_title . $title . $after_title; - fcal_get_future_posts(0); - echo $after_widget; - } - - - register_sidebar_widget('Future Posts', 'widget_fut_posts'); - register_widget_control('Future Posts', 'widget_fut_posts_control'); -} - -// Delay plugin execution to ensure Dynamic Sidebar has a chance to load first -add_action('widgets_init', 'widget_fut_posts_init'); - - -function future_post_sidebar(){ - $title = __('Future Post','fcal'); - echo '
    ' . '

    ' . $title . '

    '; - fcal_get_future_posts(); - echo '
    '; -} - -function fcal_javascript(){ - echo ' - - '; -} - - -function get_future_calendar_html(){ -global $wp_version; - - if($wp_version < 2.5){ - echo '
    '; - echo '

    '.__('Future Post Dates','fcal').'

    '; - echo '
    '; - fcal_get_future_posts(); - echo '
    '; - }else{ - echo '
    '; - echo '

    '.__('Future Post Dates','fcal').'

    '; - fcal_get_future_posts(); - echo '
    '; - - } - -} - -function fcal_get_future_posts($onclick = 1){ -global $wpdb, $wp_locale; - - $thisyear = gmdate('Y', current_time('timestamp')); - $thismonth = gmdate('m', current_time('timestamp')); - - // Quick check. If we have no posts at all, abort! - if ( !$posts ) { - $gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'future' ORDER BY post_date DESC LIMIT 1"); - if ( !$gotsome ){ - get_future_calendar($thismonth,$thisyear,$onclick); - return; - } - } - - get_future_calendar($thismonth,$thisyear,$onclick); - - //Technically thismonth is really nextmonth, but no reason to be technical about it - //But if thismonth is 12 then we need to reset it, and add a year otherwise we will be checking - // out the 13th month of this year. - if($thismonth == 12){ - $thismonth = 0; - $thisyear +=1; - } - // Get months this year and next with at least one post - $future = $wpdb->get_results("SELECT - DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year - FROM $wpdb->posts - WHERE post_date >'$thisyear-".($thismonth+1)."-01' - AND post_type = 'post' AND post_status = 'future' - ORDER BY post_date ASC"); - - foreach($future as $now){ - get_future_calendar($now->month,$now->year); - } -} - - -// Calendar Output... -function get_future_calendar( $thismonth ='', $thisyear='', $onclick=1, $initial=true ) { - global $wpdb, $timedifference, $wp_locale; - $unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear); - - // week_begins = 0 stands for Sunday - $week_begins = intval(get_option('start_of_week')); - $add_hours = intval(get_option('gmt_offset')); - $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours)); - - echo ' - - - '; - - $myweek = array(); - - for ( $wdcount=0; $wdcount<=6; $wdcount++ ) { - $myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7); - } - - foreach ( $myweek as $wd ) { - $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd); - echo "\n\t\t"; - } - - echo ' - - - - '; - - // Get days with posts - $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) - FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth' - AND YEAR(post_date) = '$thisyear' - AND post_type = 'post' AND post_status = 'future' - AND post_date > '" . current_time('mysql') . '\'', ARRAY_N); - if ( $dayswithposts ) { - foreach ( $dayswithposts as $daywith ) { - $daywithpost[] = $daywith[0]; - } - } else { - $daywithpost = array(); - } - - - - if ( strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') ) - $ak_title_separator = "\n"; - else - $ak_title_separator = ', '; - - $ak_titles_for_day = array(); - //sets the Density Thermometer - $ak_posts_for_day = array(); - - $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " - ."FROM $wpdb->posts " - ."WHERE YEAR(post_date) = '$thisyear' " - ."AND MONTH(post_date) = '$thismonth' " - ."AND post_date > '".current_time('mysql')."' " - ."AND post_type = 'post' AND post_status = 'future'" - ); - if ( $ak_post_titles ) { - foreach ( $ak_post_titles as $ak_post_title ) { - if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) - $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; - if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one - $ak_titles_for_day["$ak_post_title->dom"] = str_replace('"', '"', wptexturize($ak_post_title->post_title)); - else - $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . str_replace('"', '"', wptexturize($ak_post_title->post_title)); - - $ak_posts_for_day["$ak_post_title->dom"] +=1; - - } - } - - - // See how much we should pad in the beginning - $pad = calendar_week_mod(date('w', $unixmonth)-$week_begins); - if ( 0 != $pad ) { echo "\n\t\t".''; } - - //Determines the Density Thermometer colors - $thermo = Array( "#BDFFBE", "#7AFFDE", "#2FEEFF", "#108BFF", "#0E72FF" ); - - - $daysinmonth = intval(date('t', $unixmonth)); - for ( $day = 1; $day <= $daysinmonth; ++$day ) { - if ( isset($newrow) && $newrow ) - echo "\n\t\n\t\n\t\t"; - $newrow = false; - - if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) ) - echo ''; - - echo "\n\t\n\t\n\t
    ' . $wp_locale->get_month($thismonth) . ' ' . $thisyear . '
    $day_name
     
    '; - else - echo ''; - - if($onclick == 1){ - $onclick1 = 'onclick="fcal_set_date('.$day.','.($thismonth-1).','.$thisyear.')"'; - } - - // any posts on that day? - if ( in_array($day, $daywithpost) ) { - //Outputs the Density Thermometer along with the day... - echo ' 
    "; -} -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/future-posts-calendar/readme.txt --- a/web/wp-content/plugins/future-posts-calendar/readme.txt Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -=== Future Posts Calendar Plugin === -Contributors: Aaron Harun -Donate link: http://anthologyoi.com/about/donate/ -Tags: calendar, future posts, edit, post, date, admin,widget,stats -Requires at least: 2.1 -Tested up to: 2.5 (Trunk) -Stable tag: 1.0 - -This plugin adds a monthly calendar that shows all the dates you have future posts. - -== Description == -It adds a simple month-by-month calendar that shows all the months you have future posts for (and the current month no matter what), it highlights the days you have posts for, and as an added bonus if you click a day, the Post Timestamp boxes change to that day, month and year (although it doesn’t check the edit timestamp box to avoid accidental changes). - -== Installation == -1. Download the zip file -1. Unzip and upload future_posts.php to your *wp-content/plugins/* folder. -1. The new box will automatically appear on edit/write post pages. -1. Optionally you can add it as a sidebar widget or uncomment the line "//add_action('activity_box_end', 'get_future_calendar_html');" to have it appear on your dashboard, or use the Dashboard Editor plugin to add it as a widget. diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/ggis-subscribe/ggis-subscribe.php --- a/web/wp-content/plugins/ggis-subscribe/ggis-subscribe.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,558 +0,0 @@ -formAction = 'http://dvector.com/ggis_wp-subscribe.php'; -// $this->formAction = WP_PLUGIN_URL . '/ggis_wp-subscribe.php'; - } - function addHeaderCode(){ - echo ''; - } - - // OUTPUT FUNCTIONS - var $processing_unit_tag; - var $processing_within; - var $unit_count; - var $widget_count; - var $regex; - function the_content_filter($content) { - $this->processing_within = 'p' . get_the_ID(); - $this->unit_count = 0; - - - $regex = '/\[-\s*ggis-subscribe\s*(\d+)?\s*(".*")?\s*-\]/'; -// $regex = '/\[-\s*ggis-subscribe\s+(\d+)(?:\s+.*?)?\s*-\]/'; // [-ggis-subscribe 1 -] -// $regex = '//'; - return preg_replace_callback($regex, array(&$this, 'the_content_filter_callback'), $content); - - $this->processing_within = null; - } - - function widget_text_filter($content) { - $this->widget_count += 1; - $this->processing_within = 'w' . $this->widget_count; - $this->unit_count = 0; - - $regex = '/\[-\s*ggis-subscribe\s*(\d+)?\s*(".*")?\s*-\]/'; - return preg_replace_callback($regex, array(&$this, 'the_content_filter_callback'), $content); - - $this->processing_within = null; - } - - function the_content_filter_callback($matches) { - - // GET AND SET VARIABLES - $list_select = ''; - $listonly = NULL; - $options = unserialize( get_option( 'ggis-Subscribe')); - $options['maillists'] = explode( ',', $options['maillists'] ); - $id = (int) $matches[1]; - - // DETERMINE FORM TYPE - if ( $id == 1 ){ - $listonly = str_replace( '"', '', $matches[2]); - if ( !is_email( $listonly) ){ - $id = 0; - } - }else { - $id = 0; - } - - // FORM HEADERS - $this->unit_count += 1; - $unit_tag = 'ggis-subscribe-f' . $id . '-' . $this->processing_within . '-o' . $this->unit_count; - $this->processing_unit_tag = $unit_tag; - - $form = '
    '; - $form .= '
    '; - $form .= ''; - $form .= ''; - $form .= ''; - - // CREATE EITHER A HIDDEN FIELD OR SELECT BOX FOR MAILING LIST - if ( $id == 1 ){ - $list_select .= ''; - }else{ - if ( count( $options['maillists']) == 1 ){ - $list_select .= ''; - } else{ - $list_select .= 'Which list?
    - '; - foreach( $this->managertypes as $manager ){ - $list_select .= '
    - - - date = $_POST['date']; - $g->notes = $_POST['notes']; - $g->setTags($_POST['tags']); - $g->eventName = $_POST['eventName']; - - if ( isset($_POST['performanceID']) ) { - foreach ( $_POST['performanceID'] as $key => $pid ) { - $p = new performance((empty($pid) ? null : $pid)); - $p->gigID = $g->id; - $p->link = $_POST['link'][$key]; - $p->shortNotes = $_POST['shortNotes'][$key]; - $p->ages = (empty($_POST['ages-custom'][$key]) ? $_POST['ages'][$key] : $_POST['ages-custom'][$key]); - $p->time = date("H:i:s", strtotime($_POST['hour'][$key] . ':' . $_POST['minute'][$key] . ' ' . $_POST['meridiem'][$key])); - $p->save(); - } - } - - $p = new performance(); - if ( isset($_POST['delete']) ) { - foreach ( $_POST['delete'] as $pid ) { - $p->get($pid); - $p->delete(); - } - } - - $g->save(); - - foreach ( $_POST['deletecustom'] as $key => $delete ) { - if ( $delete ) { - delete_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['old-custom-value'][$key]); - } - } - - foreach ( $_POST['custom-key'] as $key => $field ) { - if ( is_array($_POST['custom-value'][$key]) ) { - foreach ( $_POST['custom-value'][$key] as $k => $v ) { - if ( $v === "" ) { - unset($_POST['custom-value'][$key][$k]); - } - } - } - if ( empty($_POST['custom-value'][$key]) && empty($_POST['old-custom-value'][$key]) ) { - // If both value fields are empty, just ignore this field. - continue; - } elseif ( $_POST['custom-value'][$key] === "" ) { - // If the old value is not empty, but the new one is, delete this sucker. - delete_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['old-custom-value'][$key]); - } elseif ( $_POST['old-custom-value'][$key] === "" ) { - // If the old value is empty, but the new one is not, create a new custom field. - add_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['custom-value'][$key]); - } elseif ( $_POST['old-custom-value'][$key] != $_POST['custom-value'][$key] && $_POST['old-custom-value'][$key] != serialize($_POST['custom-value'][$key]) ) { - // If the old and new values are not equal, update the custom field. - update_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['custom-value'][$key], unserialize($_POST['old-custom-value'][$key])); - } - } - - echo '{success:true, gig:' . $g->toJSON() . '}'; - break; - - case 'performance-form': - if ( isset($_POST['id']) ) { - pForm($_POST['id'], false); - } else { - pForm((int) $_POST['count'], true); - } - break; -} - - -function pForm($id, $new = true, $remove = true) { - global $folder, $gcd, $options; - $p = new performance(); - if ( $new ) { - $count = 'c' . $id; - } else { - $p->get($id); - $count = 'id' . $id; - } - - $ages = $options['ages-list']; - - $time = explode(":", $p->time); - $minutes = $time[1]; - - if ( $options['time-12h'] ) { - if ( $time[0] == 0 ) { - $hour = "12"; - $meridiem = "AM"; - } elseif ( $time[0] == 12 ) { - $hour = "12"; - $meridiem = "PM"; - } elseif ( $time[0] < 12 ) { - $hour = $time[0]; - $meridiem = "AM"; - } else { - $hour = $time[0] - 12; - $meridiem = "PM"; - } - } else { - $hour = $time[0]; - } - ?> - - - - - - - - - - -
    - - -
    - - - - - - - - -
    <?php _e('Remove Performance', $gcd) ?>
    - -
    -
    - - - -
    - - - -
    - - - - - -
    - - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/credits.ajax.php --- a/web/wp-content/plugins/gigs-calendar/credits.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - -

    - Dan Coulter. If you need some custom PHP development (for WordPress or not), I am available for hire (you can get in touch with me through this plugin). To find other free plugins and useful tips for bands and musicians, visit my new site, Blogs for Bands.', $gcd) ?> -

    -

    - support the development of this free plugin through Paypal. If you have specific features that you need, you can request them through the feedback form or hire me to develop them for you.', $gcd) ?> -

    -

    - Silk icons were created by Mark James. They are licensed under the Creative Commons.', $gcd) ?> -

    - - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/feedback.ajax.php --- a/web/wp-content/plugins/gigs-calendar/feedback.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ - -

    - - - $value ) { - if ( $key != 'nonce' && $key != 'message' && $key != 'action' ) { - $msg .= $key . ': ' . $value . "\n"; - } - } - - $msg .= 'Plugin Version: ' . DTC_GIGS_PLUGIN_VERSION . "\n"; - $msg .= 'Database Version: ' . DTC_GIGS_DB_VERSION . "\n"; - - $msg .= "\nMessage:\n" . $_POST['message']; - - if ( $_POST['settings'] == '1' ) { - $msg .= "\n\n\nSettings:\n" . print_r($options, true); - } - if ( wp_mail($feedbackEmail, 'Gigs Calendar - ' . $_POST['type'], $msg, 'Reply-To: ' . str_replace(array("\r", "\n"), '', $_POST['email'])) ) { - echo '{success: true}'; - } else { - echo '{success: false}'; - } -} - -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs-calendar-admin-wp2.5.css --- a/web/wp-content/plugins/gigs-calendar/gigs-calendar-admin-wp2.5.css Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -ul#gigs-menu { - margin: .5em 0px; -} - -div.instructions { - background-color: #E4F2FD; -} - -table#gig-list.widefat table td { - border: 0px; -} - -div#postcustomstuff-new table td { - vertical-align: top; -} - -div#postcustomstuff-new table th { - line-height:1.3em; - padding:9px 15px 6px 10px; - text-align:left; - color:#D7D7D7; - background-color: #464646; -} \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs-calendar-admin.css --- a/web/wp-content/plugins/gigs-calendar/gigs-calendar-admin.css Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -.todo { - display: none; -} - -a img { - border: 0px; -} - -#loading, .loading {text-align: center} - -ul#gigs-menu { - margin: 0px 5%; - padding: 0px; -} - -li.selected {font-weight: bold} - -img.inline-icon { - position: relative; - top: 3px; -} - -.inside { - display: none; -} - -ul#gigs-menu li { - display:inline; - list-style-image:none; - list-style-position:outside; - list-style-type:none; - text-align:center; - white-space:nowrap; - padding-right: 1em; - cursor: pointer; -} - -div#gigs-wrapper.wrap { - margin-top: 0px; -} - -div.gigs-page { - display: none; -} - -.drag { - cursor: move; -} - -.icon { - position: relative; - top: 3px; -} - -.clickable { - cursor: pointer; -} - -.no-margin { - margin: 0px; -} - -.done { - text-decoration: line-through; -} - -input.price { - width: 50px; -} - -form table, form td { - border: 0px; - border-collapse: collapse; - padding: 0px; -} - -form .wide { - width: 300px; -} - -form.new-item div, form.new-item td { - padding-bottom: 7px; -} - -tr.panel { - display: none; -} - -a img, td.actions a { - text-decoration: none; - border: 0px; -} - -span.link { - text-decoration: underline; - color: #6699CC; - cursor: pointer; -} - -div.instructions { - border: 1px solid #AAAAAA; - padding: 4px; - text-align: center; - font-size: .9em; -} - -.alternate input, .alternate select, .alternate textarea { - background-color: #fff; -} - -/**** Styles for Feedback page ****/ - #feedback form { - padding-left: 2em; - } - - #feedback textarea { - width: 500px; - height: 300px; - } - - #feedback form div { - margin-bottom: 7px; - } - -/**** Styles for Gigs page ****/ - table.performance { - border: 1px dotted #777777; - border-collapse: collapse; - } - - table.performance td { - padding: 3px; - } - - table.performance td div { - position: relative; - } - - table.performance div.delete-performance { - position: absolute; - top: 0px; - right: 0px; - } - -/**** Styles for Settings page ****/ - ul#gigs-table, ul#gig-title, ul.sortable { - list-style-image:none; - list-style-position:outside; - list-style-type:none; - padding-left: 1em; - } - - form div { - line-height: 2em; - } - - .sortable .handle { - cursor: move; - } - \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs-calendar.php --- a/web/wp-content/plugins/gigs-calendar/gigs-calendar.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,917 +0,0 @@ - - - - - = 2.5 ) { - ?> - - - - - - __('Gigs', $gcd), - 'archive' => __('Archive', $gcd), - 'venues' => __('Venues', $gcd), - 'tours' => __('Tours', $gcd), - 'settings' => __('Settings', $gcd), - 'feedback' => __('Feedback/Bugs', $gcd), - 'credits' => __('Credits', $gcd), - ); - - foreach ( $pages as $key => $name ) { - $pages[$key] = array('name'=>$name, 'key'=>$key, 'url'=>$folder . $key . '.ajax.php'); - } - - if ( $options['admin-only-settings'] && !current_user_can('administrator') ) { - unset($pages['settings']); - } - - $pages = apply_filters('gigCal_pages', $pages); - ?> - -
    -

    -
      - -
    • -
    • -
    • - - -
    • - - -
    -
    -
    -
    - -
    - -
    - -
    -
    - - sortTours(); - foreach ( $tours as $tour ) { - dtc_gigs::generateList(array( - 'caption'=> $is_archive ? __('Upcoming shows', $gcd) : '', - 'dateFormat' => 'short', - 'tour' => $tour, - )); - } - dtc_gigs::generateList(array( - 'caption'=> '
    ' . __('Other shows', $gcd) . '
    ', - 'dateFormat' => 'short', - 'tour' => -1, - )); - } else { - dtc_gigs::generateList(array( - 'caption'=> $is_archive ? __('Upcoming shows', $gcd) : '', - 'dateFormat' => 'short', - )); - } - } - if ( !empty($options['archive']) && is_page($options['archive']) ) { - if ( $options['tours-display'] ) { - $t = new tour(); - $tours = $t->sortTours(); - foreach ( $tours as $tour ) { - dtc_gigs::generateList(array( - 'upcoming'=>false, - 'caption'=> $is_archive ? __('Upcoming shows', $gcd) : '', - 'dateFormat' => 'short', - 'tour' => $tour, - )); - } - dtc_gigs::generateList(array( - 'upcoming'=>false, - 'caption'=> '
    ' . __('Other shows', $gcd) . '
    ', - 'dateFormat' => 'short', - 'tour' => -1, - )); - } else { - dtc_gigs::generateList(array( - 'upcoming'=>false, - 'caption'=> $is_parent ? __('Past show archive', $gcd) : '', - 'dateFormat' => 'archive', - )); - } - } - - dtcGigs::loadTemplate('rss'); - dtcGigs::loadTemplate('attribution'); - $out = ob_get_clean(); - if ( $options['calendar-position'] == 'bottom' ) { - $out = '
    ' . $in . '
    ' . $out; - } else { - $out .= '
    ' . $in . '
    '; - } - } else { - $g = new gig(); - if ( $g->getByPostID($post->ID) ) { - $data = array( - 'g' => $g, - 'v' => $g->getVenue(), - 'p' => $g->getPerformances(), - 'image_folder' => dtc_gigs::get_url() . 'images/', - 'tags' => $g->getTags(), - 'tags_slugs' => $g->getTags(true), - 'custom' => $g->getCustom(), - ); - ob_start(); - dtcGigs::loadTemplate('gig-post', null, $data); - $out = ob_get_clean(); - - $out = '
    ' . $in . '
    ' . $out; - } else { - $out = $in; - } - } - if ( preg_match_all('~\[gig-cal ?(.*?)\]~', $out, $matches) ) { - $matches[0] = array_unique($matches[0]); - foreach ( $matches[0] as $key => $match ) { - $args = array(); - parse_str(str_replace(' ', '&', $matches[1][$key]), $args); - $args['upcoming'] = (strpos($matches[1][$key], 'archive') !== FALSE) ? false : true; - $args['return'] = true; - $out = str_replace($match, dtc_gigs::generateList($args), $out); - } - } - return $out; - } - - function upgrade() { - global $wpdb; - - if ( isset($wpdb->charset) && !empty($wpdb->charset) ) { - $charset = ' DEFAULT CHARSET=' . $wpdb->charset; - } elseif ( defined(DB_CHARSET) && DB_CHARSET != '' ) { - $charset = ' DEFAULT CHARSET=' . DB_CHARSET; - } else { - $charset = ''; - } - - $queries = array( - array( // 1 - ' - CREATE TABLE IF NOT EXISTS `' . TABLE_VENUES . '` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `name` VARCHAR( 255 ) NOT NULL , - `address` TEXT NOT NULL , - `city` VARCHAR( 255 ) NOT NULL , - `state` VARCHAR( 255 ) NOT NULL , - `country` VARCHAR( 255 ) NOT NULL , - `postalCode` VARCHAR( 255 ) NOT NULL , - `contact` VARCHAR( 255 ) NOT NULL , - `phone` VARCHAR( 255 ) NOT NULL , - `email` VARCHAR( 255 ) NOT NULL , - `link` VARCHAR( 255 ) NOT NULL , - `notes` TEXT NOT NULL , - `private` TINYINT NOT NULL , - `apiID` INT UNSIGNED NOT NULL , - `deleted` TINYINT NOT NULL - ) ' . $charset . ' - ', ' - CREATE TABLE IF NOT EXISTS `' . TABLE_GIGS . '` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `venueID` INT UNSIGNED NOT NULL , - `date` DATE NOT NULL , - `notes` TEXT NOT NULL, - `postID` BIGINT UNSIGNED NOT NULL - ) ' . $charset . ' - ', ' - CREATE TABLE IF NOT EXISTS `' . TABLE_PERFORMANCES . '` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `gigID` INT UNSIGNED NOT NULL , - `time` TIME NULL , - `link` VARCHAR( 255 ) NOT NULL , - `shortNotes` VARCHAR( 255 ) NOT NULL , - `ages` VARCHAR( 255 ) NOT NULL - ) ' . $charset . ' - ' - ), array( // 2 - 'ALTER TABLE `' . TABLE_VENUES . '` ADD `customMap` VARCHAR( 255 ) NOT NULL', - 'ALTER TABLE `' . TABLE_GIGS . '` ADD `eventName` VARCHAR( 255 ) NOT NULL', - ), array( // 3 - ' - CREATE TABLE `' . TABLE_TOURS . '` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `name` VARCHAR( 255 ) NOT NULL , - `notes` MEDIUMTEXT NOT NULL , - `pos` INT UNSIGNED NOT NULL - ) ' . $charset . ' - ', ' - ALTER TABLE `' . TABLE_GIGS . '` ADD `tour_id` INT UNSIGNED NULL - ', - ), - - - - ); - for ( $i = (int) get_option('gig_db_version'); $i < (int) DTC_GIGS_DB_VERSION; $i++) { - if ( isset($queries[$i]) ) { - foreach ( $queries[$i] as $q ) { - $wpdb->query($q); - } - } - } - - if ( count($wpdb->get_results('show tables like "' . GIGS_DB_PREFIX . 'gigs_%"')) != 4 ) { - update_option("gig_db_version", -1); - } else { - update_option("gig_db_version", (int) DTC_GIGS_DB_VERSION); - } - } - - - function hide_posts($where) { - $o = get_option('gigs-calendar'); - if ( 0 < (int) get_option('gig_db_version') && $o['post-filtering'] ) { - global $wp_the_query; - global $wp_query; - global $wp_actions; - global $wpdb; - if ( in_array('get_sidebar', $wp_actions) ) { - $where .= ' AND ID NOT IN (SELECT postID FROM ' . TABLE_GIGS . ')'; - } elseif ( (is_single() || (function_exists('is_tag') && is_tag())) ) { - return $where; - } elseif ( (!is_category() || $wp_the_query->query_vars['cat'] != $o['category']) || defined('gigs-query-mod')) { - $where .= ' AND ID NOT IN (SELECT postID FROM ' . TABLE_GIGS . ')'; - } - } - return $where; - } - - function hide_archives($where) { - $o = get_option('gigs-calendar'); - if ( $o['post-filtering'] ) { - global $wpdb; - return $where . ' AND ID NOT IN (SELECT postID FROM ' . TABLE_GIGS . ')'; - } - } - - - function post_nav($where) { - $o = get_option('gigs-calendar'); - if ( 0 < (int) get_option('gig_db_version') && $o['post-filtering'] ) { - global $wp_the_query, $include_folder, $wpdb, $wp_version; - - include_once 'gigs-classes.php'; - - $wtq = $wp_the_query; - $g = new gig(); - - $table = ''; // This will let me support versions < 2.3 - if ( (float) $wp_version >= 2.3 ) { - $table = 'p.'; - } - - if ( $wtq->is_single && $wpdb->get_var('SELECT COUNT(*) FROM ' . TABLE_GIGS . ' WHERE postID = ' . $wtq->post->ID) ) { // Is a gig - $where .= ' AND ' . $table . 'ID IN (SELECT postID FROM ' . TABLE_GIGS . ')'; - } else { - $where .= ' AND ' . $table . 'ID NOT IN (SELECT postID FROM ' . TABLE_GIGS . ')'; - } - } - return $where; - } - - function widget_upcoming($args) { - extract($args); - $o = get_option('gigs-calendar'); - if ( !isset($o['widget']['upcoming']) ) $o['widget']['upcoming'] = array(); - ?> - - - true, - 'limit'=>$o['widget']['upcoming']['length'], - 'template'=>'upcoming-widget', - ), - $o['widget']['upcoming'] - )); - ?> - - 'City', - 'country' => 'Country', - 'venue' => 'Venue', - 'eventName' => 'Event Name', - ); - - ?> -

    - -

    -

    - -

    -

    - date() function syntax', $gcd) ?> -

    -

    - -

    -

    - -

    -

    - -

    -

    - -

    - __('Next Gig', $gcd)); - ?> - - - true, - 'limit'=>1, - 'template'=>'next-widget', - )); - ?> - - __('Next Gig', $gcd), - ); - - if ( !isset($o['widget']['next']) ) { - $o['widget']['next'] = array(); - } - - $o['widget']['next'] = array_merge($defaults, $o['widget']['next']); - - if ( isset($_POST['gigs_next_title']) ) { - $o['widget']['next']['title'] = !empty($_POST['gigs_next_title']) ? $_POST['gigs_next_title'] : $defaults['title']; - print_r($o['widget']); - update_option('gigs-calendar', $o); - } - - ?> -

    - -

    - true, - 'limit' => false, - 'tour' => false, - 'template' => 'gigs-list', - 'dateFormat' => ($args['upcoming'] === false ? 'archive' : 'short'), - 'force' => false, - 'year' => null, - 'month' => null, - 'caption' => null, - ); - - - $args = is_array($args) ? array_merge($defaults, $args) : $defaults; - extract($args); - - $listFields = array( - 'city' => __('City', $gcd), - 'country' => __('Country', $gcd), - 'venue' => __('Venue', $gcd), - 'eventName' => __('Event', $gcd), - 'date' => __('Date', $gcd), - 'time' => __('Time', $gcd), - 'shortNotes' => __('Notes', $gcd), - 'tickets' => __('Tickets', $gcd), - 'map' => __('Map', $gcd), - ); - - $show_fields = $options['gigs-table-show']; - if ( !$upcoming && in_array( 'tickets', $show_fields ) ) { - unset( $show_fields[array_search('tickets', $show_fields)] ); - } - - $gig_ids = array(); - if ( is_null($year) && is_null($month) ) { - $gigs = $wpdb->get_results(' - SELECT - *, - g.notes as gigNotes, - v.notes as venueNotes, - g.id as gigID, - v.link as venueLink - FROM - `' . TABLE_GIGS . '` AS g - LEFT JOIN - `' . TABLE_VENUES . '` AS v ON ( g.venueID = v.id ) - WHERE - `date` ' . ($upcoming ? '>=' : '<=') . ' CURDATE() - ' . (($tour && $tour != -1) ? ' AND tour_id = ' . (int) $tour : '') . ' - ' . ($tour == -1 ? ' AND tour_id is null' : '') . ' - ORDER BY - `date` ' . ($upcoming ? 'ASC' : 'DESC') . ' - ' . ( !empty($limit) ? ' LIMIT ' . $limit : '' ) . ' - - '); - } else { - $gigs = $wpdb->get_results(' - SELECT - *, - g.notes as gigNotes, - v.notes as venueNotes, - g.id as gigID, - v.link as venueLink - FROM - `' . TABLE_GIGS . '` AS g - LEFT JOIN - `' . TABLE_VENUES . '` AS v ON ( g.venueID = v.id ) - WHERE - 1=1 - ' . ( !is_null($year) ? 'AND YEAR(`date`) = ' . (int) $year : '' ) . ' - ' . ( !is_null($month) ? 'AND MONTH(`date`) = ' . (int) $month : '' ) . ' - ' . (($tour && $tour != -1) ? ' AND tour_id = ' . (int) $tour : '') . ' - ' . ($tour == -1 ? ' AND tour_id is null' : '') . ' - ORDER BY - `date` ' . ($upcoming ? 'ASC' : 'DESC') . ' - ' . ( !empty($limit) ? ' LIMIT ' . $limit : '' ) . ' - - '); - } - - if ( $tour !== false && $tour !== "false" ) { - if ( !count($gigs) && !$options['tours-empty'] && !$force ) { - return ''; - } - if ( $t != -1 && empty($caption) ) { - $t = new tour($tour); - $caption = '
    ' . $t->name . '
    ' . $t->notes . '
    '; - } - } - - - $performances = $wpdb->get_results(' - SELECT - p.* - FROM - `' . TABLE_GIGS . '` AS g - LEFT JOIN - `' . TABLE_PERFORMANCES . '` AS p ON ( g.id = p.gigID ) - ORDER BY - `time` ASC - '); - - foreach ( $gigs as $key => $g ) { - if ( empty($g->venueID) ) { - $g->mapLink = false; - } else { - $g->mapLink = dtcGigs::mapLink($g); - } - $g->cityState = $g->city . ( empty($g->state) ? '' : ', ' . $g->state ); - $g->cityStateCountry = $g->city . ( empty($g->state) ? '' : ', ' . $g->state ) . ( empty($g->country) ? '' : ', ' . $g->country ); - $g->cityCountry = $g->city . ( empty($g->country) ? '' : ', ' . $g->country ); - $g->permalink = get_permalink($g->postID); - $g->shortDate = dtcGigs::dateFormat($g->date, 'short'); - $g->longDate = dtcGigs::dateFormat($g->date, 'long'); - $g->archiveDate = dtcGigs::dateFormat($g->date, 'archive'); - $g->mysqlDate = $g->date; - $g->date = dtcGigs::dateFormat($g->date, $dateFormat); - $g->id = $g->gigID; - $g->id = $g->gigID; - $g->performances = array(); - $g->tags_slugs = array(); - $g->tags = function_exists('wp_get_post_tags') ? wp_get_post_tags($g->postID) : array(); - $gig_ids[$g->gigID] = $key; - foreach ( $g->tags as $tagkey => $tag ) { - $g->tags[$tagkey] = $tag->name; - $g->tags_slugs[$tagkey] = 'gc-' . $tag->slug; - } - $g->custom = get_post_custom($g->postID); - $gigs[$key] = $g; - } - - foreach ( $performances as $p ) { - $p->time_12h = dtcGigs::timeFormat($p->time, '12h'); - $p->time_24h = dtcGigs::timeFormat($p->time, '24h'); - $p->time = dtcGigs::timeFormat($p->time); - - if ( isset($gigs[$gig_ids[$p->gigID]]) ) { - $gigs[$gig_ids[$p->gigID]]->performances[] = $p; - } - } - - if ( is_file(dirname(__FILE__) . '/templates/' . $options['template'] . '/' . $template . '.php') ) { - include(dirname(__FILE__) . '/templates/' . $options['template'] . '/' . $template . '.php'); - } elseif ( is_file(ABSPATH . 'wp-content/gigs-templates/' . $options['template'] . '/' . $template . '.php') ) { - include(ABSPATH . 'wp-content/gigs-templates/' . $options['template'] . '/' . $template . '.php'); - } else { - include(dirname(__FILE__) . '/templates/' . 'basic/' . $template . '.php'); - } - $result = ob_get_clean(); - if ( $return ) return $result; - else echo $result; - } - - function upcomingList($args = array()) { - // This method has been depriciated. Stop using it! - global $include_folder; - $o = get_option('gigs-calendar'); - $defaults = array( - "length" => 5, - "dateFormat" => 'M j', - 'dateFormatYear' => 'M j, Y', - 'link' => array('city'), - 'return' => false, - ); - - - $args = array_merge($defaults, $args); - - include_once 'gigs-classes.php'; - $g = new gig(); - $g->search('`date` >= CURDATE()', '`date` ASC'); - - $count = 0; - if ( $g->_count ) : - - ?> -
      - fetch() ) : - $v = $g->getVenue(); - $p = $g->getPerformances(); - $link = array(); - foreach ( $args['link'] as $f ) { - switch ( $f ) { - case 'city': - $link[] = $v->getCity(); - break; - case 'venue': - $link[] = $v->name; - break; - case 'eventName': - $link[] = $g->eventName; - break; - } - } - $link = array_unique($link); - foreach ( $link as $key => $value ) { - if ( empty($value) ) unset($link[$key]); - } - ?> - -
    • date))) ? $args['dateFormat'] : $args['dateFormatYear'], strtotime($g->date . ' ' . $p->time)) ?>: - -
    • - = $args['length'] ) break; endwhile; ?> -
    - -
    - get_var('SELECT COUNT(*) FROM ' . TABLE_GIGS . ' WHERE postID = ' . (int) $id ) ) { - wp_publish_post($id); - } else { - _future_post_hook($id, $post); - } - } - } - - - - add_action('init', array('dtc_gigs', 'setup_future_hook')); - add_action('admin_menu', array('dtc_gigs', 'add_admin_page')); - - //add_filter('the_posts', array('dtc_gigs', 'test')); - - if ( 4.1 <= mysql_get_server_info() ) { - add_filter('posts_where', array('dtc_gigs', 'hide_posts')); - add_filter('get_next_post_where', array('dtc_gigs', 'post_nav')); - add_filter('get_previous_post_where', array('dtc_gigs', 'post_nav')); - add_filter('getarchives_where', array('dtc_gigs', 'hide_archives')); - } else { - - } - - add_filter('the_content', array('dtc_gigs', 'display')); - - add_action('plugins_loaded', array('dtc_gigs', 'init')); - - - if ( $_GET['page'] == 'gigs' ) : - // If not WP > 2.6, we'll need to include some custom scripts. - $folder = dtc_gigs::get_url(); - if ( (float) $wp_version < 2.6 ) { - wp_deregister_script('jquery'); - wp_deregister_script('interface'); - wp_deregister_script('jquery-form'); - wp_enqueue_script('jquery', $folder . 'js/jquery.js', array(), '1.2.6'); - wp_enqueue_script('jquery-form', $folder . 'js/jquery.form.js', array(), '2.02'); - wp_enqueue_script('jquery-ui-core', $folder . 'js/ui.core.js', array(), '1.5'); - wp_enqueue_script('jquery-ui-sortable', $folder . 'js/ui.sortable.js', array(), '1.5'); - } else { - wp_enqueue_script('jquery'); - wp_enqueue_script('jquery-form'); - wp_enqueue_script('jquery-ui-core'); - wp_enqueue_script('jquery-ui-sortable'); - } - wp_enqueue_script('jquery-ui-datepicker', $folder . 'js/ui.datepicker.min.js', array(), '1.5'); - wp_enqueue_script('jquery-tooltip', $folder . 'js/jquery.tooltip.min.js', array(), '1.2'); - - add_action('admin_head', array('dtc_gigs', 'admin_css')); - - if ( get_option('gig_db_version') != DTC_GIGS_DB_VERSION ) { - dtc_gigs::upgrade(); - } - - endif; - - add_action('wp_head', array('dtc_gigs', 'display_css')); -else: - require_once $include_folder . '/ajaxSetup.php'; -endif; - -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs-calendar.pot --- a/web/wp-content/plugins/gigs-calendar/gigs-calendar.pot Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,987 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Gigs Calendar\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-07-08 16:10-0600\n" -"PO-Revision-Date: 2008-07-08 16:10-0600\n" -"Last-Translator: Dan Coulter \n" -"Language-Team: Blogs for Bands \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Language: English\n" -"X-Poedit-Country: UNITED STATES\n" -"X-Poedit-SourceCharset: utf-8\n" -"X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: .\n" - -#: archive.ajax.php:16 -#: gigs.ajax.php:140 -#: tours.ajax.php:45 -#: venues.ajax.php:51 -msgid "ID" -msgstr "" - -#: archive.ajax.php:17 -#: gigs-calendar.php:620 -#: gigs.ajax.php:142 -#: settings.ajax.php:16 -#: settings.ajax.php:27 -msgid "Venue" -msgstr "" - -#: archive.ajax.php:18 -#: gigs-calendar.php:618 -#: gigs.ajax.php:143 -#: settings.ajax.php:14 -#: settings.ajax.php:26 -#: venues.ajax.php:53 -msgid "City" -msgstr "" - -#: archive.ajax.php:19 -#: gigs-calendar.php:622 -#: gigs.ajax.php:144 -#: settings.ajax.php:18 -#: settings.ajax.php:30 -msgid "Date" -msgstr "" - -#: archive.ajax.php:20 -#: gigs-calendar.php:623 -#: gigs.ajax.php:145 -#: settings.ajax.php:19 -msgid "Time" -msgstr "" - -#: archive.ajax.php:21 -#: gigs.ajax.php:146 -#: tours.ajax.php:48 -#: venues.ajax.php:56 -msgid "Actions" -msgstr "" - -#: archive.ajax.php:38 -#: gigs.ajax.php:164 -#: gigs.ajax.php:409 -msgid "View Gig" -msgstr "" - -#: archive.ajax.php:39 -#: gigs.ajax.php:165 -#: gigs.ajax.php:410 -#: tours.ajax.php:65 -#: tours.ajax.php:219 -#: venues.ajax.php:69 -#: venues.ajax.php:199 -msgid "Edit" -msgstr "" - -#: archive.ajax.php:41 -#: gigs-calendar.php:626 -#: gigs.ajax.php:167 -#: gigs.ajax.php:412 -#: tours.ajax.php:67 -#: tours.ajax.php:221 -#: venues.ajax.php:70 -#: venues.ajax.php:200 -#: templates/basic/gigs-list.php:28 -msgid "Map" -msgstr "" - -#: archive.ajax.php:44 -#: gigs.ajax.php:170 -#: gigs.ajax.php:415 -msgid "Edit WordPress Post" -msgstr "" - -#: archive.ajax.php:46 -#: gigs.ajax.php:172 -#: gigs.ajax.php:417 -#: settings.ajax.php:177 -#: tours.ajax.php:69 -#: tours.ajax.php:223 -#: venues.ajax.php:74 -#: venues.ajax.php:204 -msgid "Delete" -msgstr "" - -#: archive.ajax.php:122 -#: gigs.ajax.php:278 -msgid "Are you sure you want to remove this performance?" -msgstr "" - -#: archive.ajax.php:195 -#: gigs.ajax.php:22 -#: gigs.ajax.php:441 -msgid "Gig Information" -msgstr "" - -#: archive.ajax.php:196 -#: gigs.ajax.php:23 -#: gigs.ajax.php:442 -msgid "A \"gig\" is unique to a date at a venue." -msgstr "" - -#: archive.ajax.php:199 -#: gigs.ajax.php:26 -#: gigs.ajax.php:445 -msgid "Venue:" -msgstr "" - -#: archive.ajax.php:205 -#: gigs.ajax.php:41 -#: gigs.ajax.php:451 -msgid "Date:" -msgstr "" - -#: archive.ajax.php:209 -#: gigs.ajax.php:45 -#: gigs.ajax.php:455 -msgid "Event Name:" -msgstr "" - -#: archive.ajax.php:213 -#: gigs.ajax.php:49 -#: gigs.ajax.php:459 -msgid "Tour:" -msgstr "" - -#: archive.ajax.php:216 -#: gigs.ajax.php:52 -#: gigs.ajax.php:462 -#: settings.ajax.php:109 -#: settings.ajax.php:114 -msgid "--None--" -msgstr "" - -#: archive.ajax.php:226 -#: gigs.ajax.php:62 -#: gigs.ajax.php:472 -msgid "Post Tags:" -msgstr "" - -#: archive.ajax.php:231 -#: gigs.ajax.php:69 -#: gigs.ajax.php:478 -#: tours.ajax.php:28 -#: tours.ajax.php:252 -#: venues.ajax.php:36 -#: venues.ajax.php:243 -msgid "Description/Other notes:" -msgstr "" - -#: archive.ajax.php:242 -#: gigs.ajax.php:80 -#: gigs.ajax.php:489 -msgid "Click to expand" -msgstr "" - -#: archive.ajax.php:242 -#: gigs.ajax.php:80 -#: gigs.ajax.php:489 -msgid "Custom Fields" -msgstr "" - -#: archive.ajax.php:242 -#: gigs.ajax.php:80 -#: gigs.ajax.php:489 -msgid "Expand" -msgstr "" - -#: archive.ajax.php:242 -#: gigs.ajax.php:80 -#: gigs.ajax.php:489 -msgid "Collapse" -msgstr "" - -#: archive.ajax.php:248 -#: gigs.ajax.php:86 -#: gigs.ajax.php:495 -msgid "Key" -msgstr "" - -#: archive.ajax.php:249 -#: gigs.ajax.php:87 -#: gigs.ajax.php:496 -msgid "Value" -msgstr "" - -#: archive.ajax.php:266 -#: archive.ajax.php:315 -#: gigs.ajax.php:97 -#: gigs.ajax.php:189 -#: gigs.ajax.php:513 -#: gigs.ajax.php:562 -msgid "Remove Custom Field" -msgstr "" - -#: archive.ajax.php:279 -#: gigs.ajax.php:106 -#: gigs.ajax.php:526 -msgid "Add a new custom field" -msgstr "" - -#: archive.ajax.php:282 -#: gigs.ajax.php:109 -#: gigs.ajax.php:529 -msgid "Custom fields can be used to add extra metadata to a gig that you can use in a special template." -msgstr "" - -#: archive.ajax.php:289 -#: gigs.ajax.php:116 -#: gigs.ajax.php:536 -#: settings.ajax.php:171 -msgid "Performances" -msgstr "" - -#: archive.ajax.php:290 -#: gigs.ajax.php:117 -#: gigs.ajax.php:537 -msgid "You can add as many performances as
    you are giving at a venue on the given date." -msgstr "" - -#: archive.ajax.php:298 -#: gigs.ajax.php:123 -#: gigs.ajax.php:545 -msgid "Add another performance" -msgstr "" - -#: archive.ajax.php:304 -#: gigs.ajax.php:551 -msgid "Save Gig" -msgstr "" - -#: archive.ajax.php:305 -#: feedback.ajax.php:46 -#: gigs.ajax.php:130 -#: gigs.ajax.php:552 -#: tours.ajax.php:35 -#: venues.ajax.php:41 -#: venues.ajax.php:248 -msgid "Cancel" -msgstr "" - -#: archive.ajax.php:487 -#: gigs.ajax.php:745 -msgid "Performance Time:" -msgstr "" - -#: archive.ajax.php:508 -#: gigs.ajax.php:766 -msgid "AM" -msgstr "" - -#: archive.ajax.php:509 -#: gigs.ajax.php:767 -msgid "PM" -msgstr "" - -#: archive.ajax.php:515 -#: gigs.ajax.php:774 -msgid "Remove Performance" -msgstr "" - -#: archive.ajax.php:521 -#: gigs.ajax.php:780 -msgid "External Link (for tickets):" -msgstr "" - -#: archive.ajax.php:527 -#: gigs.ajax.php:786 -msgid "Short Notes:" -msgstr "" - -#: archive.ajax.php:533 -#: gigs.ajax.php:792 -msgid "Ages:" -msgstr "" - -#: archive.ajax.php:540 -#: gigs.ajax.php:799 -msgid "Or..." -msgstr "" - -#: credits.ajax.php:4 -msgid "The Gigs Calendar plugin for WordPress was developed by me, Dan Coulter. If you need some custom PHP development (for WordPress or not), I am available for hire (you can get in touch with me through this plugin). To find other free plugins and useful tips for bands and musicians, visit my new site, Blogs for Bands." -msgstr "" - -#: credits.ajax.php:7 -msgid "You can help support the development of this free plugin through Paypal. If you have specific features that you need, you can request them through the feedback form or hire me to develop them for you." -msgstr "" - -#: credits.ajax.php:10 -msgid "The lovely Silk icons were created by Mark James. They are licensed under the Creative Commons." -msgstr "" - -#: feedback.ajax.php:9 -msgid "Want to tell me what a great/horrible job I did?" -msgstr "" - -#: feedback.ajax.php:14 -msgid "Your name:" -msgstr "" - -#: feedback.ajax.php:26 -msgid "Email Address:" -msgstr "" - -#: feedback.ajax.php:28 -msgid "Type of feedback:" -msgstr "" - -#: feedback.ajax.php:30 -msgid "Bug Report" -msgstr "" - -#: feedback.ajax.php:31 -msgid "Feedback/Comments" -msgstr "" - -#: feedback.ajax.php:32 -msgid "Feature Request" -msgstr "" - -#: feedback.ajax.php:35 -msgid "If you're reporting a bug, please be as specific as possible. Also, please use English if you can." -msgstr "" - -#: feedback.ajax.php:36 -msgid "Additional information that might help (deselect anything you don't want to send, but I might ask you for it anyway)" -msgstr "" - -#: feedback.ajax.php:38 -msgid "Blog URL" -msgstr "" - -#: feedback.ajax.php:39 -msgid "WordPress Version" -msgstr "" - -#: feedback.ajax.php:40 -msgid "PHP Version" -msgstr "" - -#: feedback.ajax.php:41 -msgid "MySQL Info" -msgstr "" - -#: feedback.ajax.php:42 -msgid "Broswer Info" -msgstr "" - -#: feedback.ajax.php:44 -msgid "Include your plugin settings" -msgstr "" - -#: feedback.ajax.php:45 -msgid "Send Feedback" -msgstr "" - -#: feedback.ajax.php:60 -msgid "Thanks for your feedback! I’ll try to get back to you as soon as I can." -msgstr "" - -#: gigs-calendar.php:39 -#: gigs-calendar.php:122 -msgid "Gigs Calendar" -msgstr "" - -#: gigs-calendar.php:88 -msgid "Gigs" -msgstr "" - -#: gigs-calendar.php:89 -msgid "Archive" -msgstr "" - -#: gigs-calendar.php:90 -msgid "Venues" -msgstr "" - -#: gigs-calendar.php:91 -msgid "Tours" -msgstr "" - -#: gigs-calendar.php:92 -#: gigs-calendar.php:125 -msgid "Settings" -msgstr "" - -#: gigs-calendar.php:93 -#: gigs-calendar.php:126 -msgid "Feedback/Bugs" -msgstr "" - -#: gigs-calendar.php:94 -#: gigs-calendar.php:127 -#: settings.ajax.php:351 -msgid "Credits" -msgstr "" - -#: gigs-calendar.php:136 -msgid "Loading..." -msgstr "" - -#: gigs-calendar.php:208 -#: gigs-calendar.php:220 -#: gigs-calendar.php:232 -msgid "Upcoming shows" -msgstr "" - -#: gigs-calendar.php:214 -#: gigs-calendar.php:239 -msgid "Other shows" -msgstr "" - -#: gigs-calendar.php:246 -msgid "Past show archive" -msgstr "" - -#: gigs-calendar.php:455 -msgid "Upcoming Gigs" -msgstr "" - -#: gigs-calendar.php:485 -#: gigs-calendar.php:575 -msgid "Widget title:" -msgstr "" - -#: gigs-calendar.php:491 -msgid "Number of gigs to show on the sidebar:" -msgstr "" - -#: gigs-calendar.php:496 -msgid "Note: All date formats use the PHP date() function syntax" -msgstr "" - -#: gigs-calendar.php:500 -msgid "Date format for dates in the current year:" -msgstr "" - -#: gigs-calendar.php:506 -msgid "Date format for dates in a future year:" -msgstr "" - -#: gigs-calendar.php:512 -msgid "First piece of data in the link:" -msgstr "" - -#: gigs-calendar.php:522 -msgid "Second piece of data in the link:" -msgstr "" - -#: gigs-calendar.php:524 -msgid "None" -msgstr "" - -#: gigs-calendar.php:537 -#: gigs-calendar.php:557 -msgid "Next Gig" -msgstr "" - -#: gigs-calendar.php:619 -#: settings.ajax.php:15 -#: settings.ajax.php:28 -msgid "Country" -msgstr "" - -#: gigs-calendar.php:621 -msgid "Event" -msgstr "" - -#: gigs-calendar.php:624 -#: tours.ajax.php:47 -msgid "Notes" -msgstr "" - -#: gigs-calendar.php:625 -msgid "Tickets" -msgstr "" - -#: gigs.ajax.php:15 -msgid "Add a new gig" -msgstr "" - -#: gigs.ajax.php:30 -msgid "Select a venue" -msgstr "" - -#: gigs.ajax.php:36 -msgid "No venues found. You’ll need to add one" -msgstr "" - -#: gigs.ajax.php:45 -#: gigs.ajax.php:455 -msgid "Some artists perform under several names. Ignore the event name field if you don’t need to specify what this event is called or what band name you are playing under." -msgstr "" - -#: gigs.ajax.php:129 -msgid "Add Gig" -msgstr "" - -#: gigs.ajax.php:141 -#: settings.ajax.php:17 -#: settings.ajax.php:29 -msgid "Event Name" -msgstr "" - -#: rss.php:25 -msgid "Upcoming Gigs feed" -msgstr "" - -#: settings.ajax.php:20 -msgid "Short Notes" -msgstr "" - -#: settings.ajax.php:21 -msgid "Ticket Link" -msgstr "" - -#: settings.ajax.php:22 -msgid "Map Link" -msgstr "" - -#: settings.ajax.php:36 -msgid "Sorry, there aren’t any upcoming gigs right now. Check back soon!" -msgstr "" - -#: settings.ajax.php:37 -msgid "There aren’t any gigs here right now. Check back soon!" -msgstr "" - -#: settings.ajax.php:43 -msgid "Who" -msgstr "" - -#: settings.ajax.php:44 -msgid "All Ages" -msgstr "" - -#: settings.ajax.php:44 -msgid "21+" -msgstr "" - -#: settings.ajax.php:44 -msgid "16+" -msgstr "" - -#: settings.ajax.php:50 -msgid "TBD" -msgstr "" - -#: settings.ajax.php:74 -msgid "Oops! It looks like you’re missing some or all of the tables required for this plugin. They should have been created automatically, but you can create them with the tables.sql file in the same folder as this plugin. If you have any questions, you can use the feedback form in the next tab." -msgstr "" - -#: settings.ajax.php:78 -msgid "You need to select a page to list your calendar. You may need to go create a new page first." -msgstr "" - -#: settings.ajax.php:82 -msgid "Warning: You are running MySQL server version . This plugin requires version 4.1 or higher to hide the future gig posts from your homepage. Your best option is to use a plugin like Advanced Category Excluder to hide the gigs using the category option below." -msgstr "" - -#: settings.ajax.php:88 -msgid "General Options" -msgstr "" - -#: settings.ajax.php:90 -msgid "Select a location for the calendars on the page:" -msgstr "" - -#: settings.ajax.php:92 -msgid "Top" -msgstr "" - -#: settings.ajax.php:93 -msgid "Bottom" -msgstr "" - -#: settings.ajax.php:94 -#: settings.ajax.php:346 -msgid "Custom" -msgstr "" - -#: settings.ajax.php:99 -msgid "Display gigs as normal blog posts (turns off filtering):" -msgstr "" - -#: settings.ajax.php:101 -#: settings.ajax.php:165 -#: settings.ajax.php:276 -#: settings.ajax.php:284 -#: settings.ajax.php:292 -#: settings.ajax.php:328 -#: settings.ajax.php:336 -#: settings.ajax.php:355 -#: settings.ajax.php:366 -msgid "Yes" -msgstr "" - -#: settings.ajax.php:102 -#: settings.ajax.php:166 -#: settings.ajax.php:277 -#: settings.ajax.php:285 -#: settings.ajax.php:293 -#: settings.ajax.php:329 -#: settings.ajax.php:337 -#: settings.ajax.php:356 -#: settings.ajax.php:367 -#: settings.ajax.php:378 -msgid "No" -msgstr "" - -#: settings.ajax.php:106 -msgid "Note: If you select the custom location option, you don’t have to select a page, but you won’t get a link back to the calendar" -msgstr "" - -#: settings.ajax.php:108 -msgid "Select a page to house your calendar:" -msgstr "" - -#: settings.ajax.php:113 -msgid "Select a page to house your gigs archive:" -msgstr "" - -#: settings.ajax.php:118 -msgid "Select a category that gigs should be created under:" -msgstr "" - -#: settings.ajax.php:131 -msgid "Display this message if there are no upcoming gigs:" -msgstr "" - -#: settings.ajax.php:136 -msgid "Display this message if there are no past gigs:" -msgstr "" - -#: settings.ajax.php:140 -msgid "Administration Options" -msgstr "" - -#: settings.ajax.php:143 -msgid "Minimum permission level to administer the calendar: " -msgstr "" - -#: settings.ajax.php:147 -msgid "Subscriber" -msgstr "" - -#: settings.ajax.php:148 -msgid "Contributor" -msgstr "" - -#: settings.ajax.php:149 -msgid "Author" -msgstr "" - -#: settings.ajax.php:150 -msgid "Editor" -msgstr "" - -#: settings.ajax.php:151 -msgid "Administrator" -msgstr "" - -#: settings.ajax.php:163 -msgid "Only allow blog administrators to change calendar settings:" -msgstr "" - -#: settings.ajax.php:172 -msgid "Options you want in the \"ages\" dropdown." -msgstr "" - -#: settings.ajax.php:182 -msgid "Add" -msgstr "" - -#: settings.ajax.php:184 -msgid "Display Options" -msgstr "" - -#: settings.ajax.php:186 -msgid "Display template: " -msgstr "" - -#: settings.ajax.php:215 -msgid "Short date format:" -msgstr "" - -#: settings.ajax.php:217 -#: settings.ajax.php:221 -#: settings.ajax.php:226 -msgid "(uses PHP’s date() function format)" -msgstr "" - -#: settings.ajax.php:219 -msgid "Archives date format:" -msgstr "" - -#: settings.ajax.php:224 -msgid "Long date format:" -msgstr "" - -#: settings.ajax.php:229 -msgid "Time format:" -msgstr "" - -#: settings.ajax.php:231 -msgid "12 Hour" -msgstr "" - -#: settings.ajax.php:232 -msgid "24 Hour" -msgstr "" - -#: settings.ajax.php:237 -msgid "Text to display when the time is \"To be determined\":" -msgstr "" - -#: settings.ajax.php:242 -msgid "Gigs page table" -msgstr "" - -#: settings.ajax.php:243 -msgid "You can sort the fields by clicking on the names and dragging." -msgstr "" - -#: settings.ajax.php:263 -msgid "Field to use for the link to the gig:" -msgstr "" - -#: settings.ajax.php:274 -msgid "Link to the venue’s website from the gig list?" -msgstr "" - -#: settings.ajax.php:282 -msgid "Display column headers?" -msgstr "" - -#: settings.ajax.php:290 -msgid "Link to Gigs RSS feed?" -msgstr "" - -#: settings.ajax.php:297 -msgid "Single Gig Page" -msgstr "" - -#: settings.ajax.php:299 -msgid "Select and drag the fields for the gig post title." -msgstr "" - -#: settings.ajax.php:320 -msgid "Label next to the event name:" -msgstr "" - -#: settings.ajax.php:324 -msgid "Tours Options" -msgstr "" - -#: settings.ajax.php:326 -msgid "Do you want to split gigs by tour on your calendar page?" -msgstr "" - -#: settings.ajax.php:334 -msgid "Do you want to display empty tours?" -msgstr "" - -#: settings.ajax.php:342 -msgid "How should the tours be ordered?" -msgstr "" - -#: settings.ajax.php:344 -msgid "Date of the earliest gig" -msgstr "" - -#: settings.ajax.php:345 -msgid "Alphabetical" -msgstr "" - -#: settings.ajax.php:353 -msgid "Do you want to link back to me for building this plugin?" -msgstr "" - -#: settings.ajax.php:360 -msgid "Note: It’s ok to say \"no\". I’ve offered this freely with no expectations, but I’d be very grateful if you said \"yes\"" -msgstr "" - -#: settings.ajax.php:364 -msgid "Do you want to link back to Mark James for the Silk icons?" -msgstr "" - -#: settings.ajax.php:371 -msgid "Note: The Silk Icons that I used in this plugin are licensed under the Creative Commons. You must link back to him somewhere on your site. If you link to him on another page, giving him credit, or you have replaced the icons, or you do not display any of them publicly on your site, you may turn off this link." -msgstr "" - -#: settings.ajax.php:375 -msgid "Save Options" -msgstr "" - -#: settings.ajax.php:376 -msgid "If you made changes that would affect posts, do you want changes applied to existing gigs (possibly breaking existing links)?" -msgstr "" - -#: settings.ajax.php:379 -msgid "Yes, future gigs only" -msgstr "" - -#: settings.ajax.php:380 -msgid "Yes, all gigs, please" -msgstr "" - -#: tours.ajax.php:12 -msgid "Add a new tour" -msgstr "" - -#: tours.ajax.php:20 -#: tours.ajax.php:245 -msgid "Tour Information" -msgstr "" - -#: tours.ajax.php:24 -#: tours.ajax.php:248 -msgid "Tour Name:" -msgstr "" - -#: tours.ajax.php:34 -msgid "Add tour" -msgstr "" - -#: tours.ajax.php:46 -#: venues.ajax.php:52 -msgid "Name" -msgstr "" - -#: venues.ajax.php:13 -msgid "Add a new venue" -msgstr "" - -#: venues.ajax.php:19 -#: venues.ajax.php:226 -msgid "Name:" -msgstr "" - -#: venues.ajax.php:20 -#: venues.ajax.php:227 -msgid "Address:" -msgstr "" - -#: venues.ajax.php:21 -#: venues.ajax.php:228 -msgid "City:" -msgstr "" - -#: venues.ajax.php:22 -#: venues.ajax.php:229 -msgid "State/Province:" -msgstr "" - -#: venues.ajax.php:23 -#: venues.ajax.php:230 -msgid "Country:" -msgstr "" - -#: venues.ajax.php:24 -#: venues.ajax.php:231 -msgid "Postal Code:" -msgstr "" - -#: venues.ajax.php:25 -#: venues.ajax.php:232 -msgid "Custom location for Google Maps (?)" -msgstr "" - -#: venues.ajax.php:26 -#: venues.ajax.php:233 -msgid "Primary Contact:" -msgstr "" - -#: venues.ajax.php:27 -#: venues.ajax.php:234 -msgid "Phone:" -msgstr "" - -#: venues.ajax.php:28 -#: venues.ajax.php:235 -msgid "Email:" -msgstr "" - -#: venues.ajax.php:29 -#: venues.ajax.php:236 -msgid "Homepage:" -msgstr "" - -#: venues.ajax.php:33 -#: venues.ajax.php:240 -msgid "Hide information about this venue from the public:" -msgstr "" - -#: venues.ajax.php:40 -msgid "Add Venue" -msgstr "" - -#: venues.ajax.php:54 -msgid "Phone" -msgstr "" - -#: venues.ajax.php:55 -msgid "Email" -msgstr "" - -#: venues.ajax.php:72 -#: venues.ajax.php:202 -msgid "Homepage" -msgstr "" - -#: venues.ajax.php:247 -msgid "Save Changes" -msgstr "" - -#: templates/basic/attribution.php:4 -msgid "Powered by Blogs for Bands" -msgstr "" - -#: templates/basic/attribution.php:7 -msgid "Silk icons by Mark James" -msgstr "" - -#: templates/basic/gig-post.php:11 -msgid "When" -msgstr "" - -#: templates/basic/gig-post.php:24 -#: templates/basic/gigs-list.php:27 -#: templates/basic/gigs-list.php:39 -msgid "Buy Tickets" -msgstr "" - -#: templates/basic/gig-post.php:31 -msgid "Where" -msgstr "" - -#: templates/basic/gig-post.php:34 -msgid "Private Venue" -msgstr "" - -#: templates/basic/gig-post.php:42 -msgid "map" -msgstr "" - -#: templates/basic/gig-post.php:52 -msgid "Other Info" -msgstr "" - -#: templates/basic/gig-post.php:57 -msgid "Back to the calendar" -msgstr "" - -#: templates/basic/next-widget.php:11 -msgid "More Info..." -msgstr "" - -#: templates/basic/rss.php:2 -msgid "Subscribe to RSS calendar feed" -msgstr "" - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs-classes.php --- a/web/wp-content/plugins/gigs-calendar/gigs-classes.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,794 +0,0 @@ -prefix)); -define('TABLE_VENUES', GIGS_DB_PREFIX . 'gigs_venue'); -define('TABLE_GIGS', GIGS_DB_PREFIX . 'gigs_gig'); -define('TABLE_PERFORMANCES', GIGS_DB_PREFIX . 'gigs_performance'); -define('TABLE_TOURS', GIGS_DB_PREFIX . 'gigs_tour'); - -class dtcGigs { - - function generateSlug($x) { - $x = strtolower($x); - $x = str_replace(' ', '-', $x); - $x = preg_replace('#[^a-z\-0-9]#', '', $x); - return $x; - } - - function escapeForInput($x) { - if ( '0000-00-00' == $x ) { - $x = ''; - } - echo htmlspecialchars($x); - } - - function dateFormat($date, $type = 'short') { - if ( is_null($date) || $date == '0000-00-00' ) return null; - $options = get_option('gigs-calendar'); - if ( isset($options['date'][$type]) ) { - return mysql2date($options['date'][$type], $date); - } else { - return mysql2date($type, $date); - } - } - - function selectFields($fields, $g) { - $options = get_option('gigs-calendar'); - - $result = ''; - foreach ( $options['gigs-table-show'] as $f ) { - if ( isset($fields[$f]) ) { - $tmp = $fields[$f]; - if ( $f == 'venue' && $options['list-venue-link'] && !empty($g->venueLink) ) { - $tmp = preg_replace("~\{(.*?)\}~", '\1', $tmp); - } elseif ( $f == $options['gig-link-field'] ) { - $tmp = preg_replace("~\{(.*?)\}~", '\1', $tmp); - } else { - $tmp = preg_replace("~\{(.*?)\}~", '\1', $tmp); - } - - $result .= $tmp; - } - } - - return $result; - } - - function timeFormat($time, $format = false) { - $options = get_option('gigs-calendar'); - if ( is_null($time) ) { - return $options['tbd-text']; - } - if ( $options['time-12h'] || $format === "12h" ) { - return mysql2date("g:ia", '2008-01-01 ' . $time); - } else { - return mysql2date("H:i", '2000-01-01 ' . $time); - } - } - - function mapLink($gig) { - global $options; - if ( empty($gig->customMap) ) { - $a = array(); - - if ( empty($gig->address) ) - $a[] = $gig->name . ' near:'; - else {} - $a[] = str_replace("\n", ", ", $gig->address); - if ( !empty($gig->city) ) $a[] = $gig->city; - if ( !empty($gig->state) ) $a[] = $gig->state; - if ( !empty($gig->country) ) $a[] = $gig->country; - if ( !empty($gig->postalCode) ) $a[] = $gig->postalCode; - return 'http://maps.google.com/?q=' . urlencode(str_replace('near:,', 'near:', implode(', ', $a))); - } else { - if ( preg_match("/^https?:\/\//", $gig->customMap) ) { - return $gig->customMap; - } else { - return 'http://maps.google.com/?q=' . urlencode($gig->customMap); - } - } - } - - function getAttribution() { - $options = get_option('gigs-calendar'); - ?> -
    - - Powered by Blogs for Bands - - - Silk icons by Mark James - -
    - $field ) { - if ( isset($data[$field['name']]) ) { - $value = array_pop($data[$field['name']]); - if ( empty($data[$field['name']]) ) unset($data[$field['name']]); - } else { - $value = $field['default']; - } - ?> - - - - - - - - - - - - - - - - - - $oValue ) : ?> - /> - -
    - - - - $oValue ) : ?> - /> - - -
    - - - - - id) ) { - $gig = $gig->id; - } elseif ( is_array($gig) && isset($gig['id']) ) { - $gig = $gig['id']; - } - - $g = new gig(); - if ( !$g->get($gig) ) { - return false; - } - - $classes = array( - 'gig', - mysql2date('\yY', $g->date), - mysql2date('\mm', $g->date), - ( $g->date >= date('Y-m-d') ? 'upcoming' : 'archive' ), - ); - - $classes = array_merge($classes, $g->getTags(true, 'gc-')); - - return implode(' ', apply_filters('gigCal_gigs_css_classes', $classes, $g)); - } -} - -class dtc_gigs_baseAR { - var $wpdb, $_rows, $_row, $_new = true, $_table, $_count; - - function dtc_gigs_baseAR($id = null){ - global $wpdb; - $this->wpdb = $wpdb; - if ( $id !== null ) { - $this->get($id); - } - } - - function fetch() { - if ( count($this->_rows) ) { - $this->_row = each($this->_rows); - if ( $this->_row ) { - $this->load(); - return true; - } else { - return false; - } - } else { - return false; - } - } - - function generate_slug() { - if ( isset($this->slug) ) { - $first = true; - $name = $this->_name; - do { - if ( $first ) { - $this->slug = dtcGigs::generateSlug($this->$name); - $first = false; - } else { - ereg('[0-9]*$', $this->slug, $match); - $match = ((int) $match[0]) + 1; - if ( 1 == $match ) $match++; - $this->slug = preg_replace('/[0-9]*$/', '', $this->slug); - $this->slug .= $match; - } - - } while ( $this->wpdb->get_var('SELECT COUNT(*) FROM `' . $this->_table . '` WHERE slug = "' . $this->slug . '"') ); - } - } - - - function get($id) { - $this->search('`id` = ' . (int) $id); - return $this->fetch(); - } - - function getRow() { - $row = array(); - foreach ( $this->_fields as $f ) { - $row[$f] = $this->$f; - } - return $row; - } - - function getTags($slugs = false, $prefix = '') { - if ( function_exists('wp_get_post_tags') ) { - $tags = wp_get_post_tags($this->postID); - foreach ( $tags as $key => $tag ) { - $tags[$key] = $prefix . ($slugs ? $tag->slug : $tag->name); - } - return $tags; - } else { - return array(); - } - } - - function getCustom() { - if ( !empty($this->postID) ) { - return get_post_custom($this->postID); - } - } - - function setTags($tags) { - if ( function_exists('wp_set_post_tags') ) - wp_set_post_tags($this->postID, $tags, false); - } - - - - - - function load() { - foreach ( $this->_fields as $f ) { - if ( is_null($this->_row['value']->$f) ) { - $this->$f = null; - } else { - $this->$f = stripslashes($this->_row['value']->$f); - } - } - } - - function search($where = null, $order = null) { - $this->_new = false; - $this->_rows = $this->wpdb->get_results('SELECT * FROM `' . $this->_table . '` ' . ($where !== null ? 'WHERE ' . $where : '') . ($order !== null ? ' ORDER BY ' . $order : '')); - $this->_count = count($this->_rows); - return count($this->_rows); - } - - function save($get_after = true) { - $first = true; - $name = $this->_name; - $this->generate_slug(); - if ( $this->_new ) { - $fields = $this->_fields; - $values = array(); - unset($fields[0]); - - $this->pre_insert(); - - foreach ( $fields as $f ) { - if ( is_null($this->$f) ) { - $values[$f] = 'null'; - } else { - $values[$f] = '"' . $this->wpdb->escape(stripslashes($this->$f)) . '"'; - } - } - - if ( !$this->wpdb->query('INSERT INTO `' . $this->_table . '` (`' . implode('`, `', $fields) . '`) VALUES (' . implode(', ', $values) . ')') ) { - return false; - } - $this->id = $this->wpdb->insert_id; - - $this->post_insert(); - if ( $get_after ) - $this->get((int) $this->id); - - return true; - } else { - $fields = $this->_fields; - $values = array(); - unset($fields[0]); - - $this->pre_update(); - - foreach ( $fields as $f ) { - if ( is_null($this->$f) ) { - $values[$f] = '`' . $f . '` = null'; - } else { - $values[$f] = '`' . $f . '` = "' . $this->wpdb->escape(stripslashes($this->$f)) . '"'; - } - } - - $result = (bool) $this->wpdb->query('UPDATE `' . $this->_table . '` SET ' . implode(', ', $values) . ' WHERE `id` = ' . (int) $this->id); - - if ( $result ) $this->post_update(); - - if ( $get_after ) - $this->get((int) $this->id); - - return $result; - } - } - - function pre_insert(){} - function post_insert(){} - function pre_update(){} - function post_update(){} - function extraJSON() {return array();} - - function delete() { - if ( !empty($this->id) ) { - return (bool) $this->wpdb->query('DELETE FROM `' . $this->_table . '` WHERE `id` = ' . (int) $this->id); - } - } - - function toJSON($single = true) { - if ( $single ) { - $fields = array(); - if ( function_exists("json_encode") ) { - foreach ( $this->_fields as $f ) { - $fields[$f] = $this->$f; - } - - $extra = $this->extraJSON(); - $fields = array_merge($fields, $extra); - return json_encode($fields); - } else { - foreach ( $this->_fields as $f ) { - $fields[] = '"' . $f . '":"' . str_replace("\n", '\n', addslashes($this->$f)) . '"'; - } - - $extra = $this->extraJSON(); - $fields = array_merge($fields, $extra); - - return '{' . implode(', ', $fields) . '}'; - } - } - } - - function getError() { - return $this->wpdb->last_error; - } -} - -class venue extends dtc_gigs_baseAR { - var $_table = TABLE_VENUES, $_name = 'name'; - var $id, $name, $address, $city, $state, $country, $postalCode, $contact, - $phone, $email, $link, $notes, $private = 0, $apiID = 0, $deleted = 0, $customMap; - var $_fields = array( - 'id', - 'name', - 'address', - 'city', - 'state', - 'country', - 'postalCode', - 'contact', - 'phone', - 'email', - 'link', - 'notes', - 'private', - 'apiID', - 'deleted', - 'customMap', - ); - - function delete($forReal = false) { - if ( $forReal ) { - return parent::delete(); - } else { - $this->deleted = 1; - return $this->save(); - - } - } - - function getAddress($oneLine = false) { - $a = array(); - $city = ""; - if ( $oneLine ) { - if ( !empty($this->address) ) $a[] = str_replace("\n", ', ', $this->address); - if ( !empty($this->city) ) $a[] = $this->city; - if ( !empty($this->state) ) $a[] = $this->state; - if ( !empty($this->postalCode) ) $a[] = $this->postalCode; - if ( !empty($this->country) ) $a[] = $this->country; - return implode(', ', $a); - } else { - if ( !empty($this->address) ) $a[] = $this->address; - if ( !empty($this->city) ) $temp .= $this->city; - if ( !empty($this->state) ) $temp .= (!empty($temp) ? ', ' : '' ) . $this->state; - if ( !empty($this->country) ) $temp .= (!empty($temp) ? ', ' : '' ) . $this->country; - if ( !empty($this->postalCode) ) $temp .= (!empty($temp) ? ' ' : '' ) . $this->postalCode; - if ( !empty($temp) ) $a[] = $temp; - return implode("\n", $a); - } - } - - function getCity() { - $c = array(); - if ( !empty($this->city) ) $c[] = $this->city; - if ( !empty($this->state) ) $c[] = $this->state; - //if ( !empty($this->country) ) $c[] = $this->country; - return implode(', ', $c); - } - - function getMapLink() { - global $options; - if ( empty($this->customMap) ) { - $a = array(); - - if ( empty($this->address) ) - $a[] = $this->name . ' near:'; - else {} - $a[] = str_replace("\n", ", ", $this->address); - if ( !empty($this->city) ) $a[] = $this->city; - if ( !empty($this->state) ) $a[] = $this->state; - if ( !empty($this->country) ) $a[] = $this->country; - if ( !empty($this->postalCode) ) $a[] = $this->postalCode; - return 'http://maps.google.com/?q=' . urlencode(str_replace('near:,', 'near:', implode(', ', $a))); - } else { - if ( preg_match("/^https?:\/\//", $this->customMap) ) { - return $this->customMap; - } else { - return 'http://maps.google.com/?q=' . urlencode($this->customMap); - } - } - } - - function extraJSON() { - if ( function_exists("json_encode") ) { - $fields['mapLink'] = $this->getMapLink(); - } else { - $fields[] = '"mapLink":"' . str_replace("\n", '\n', addslashes($this->getMapLink())) . '"'; - } - return $fields; - } -} - -class gig extends dtc_gigs_baseAR { - var $_table = TABLE_GIGS, $_name = 'id'; - var $id, $venueID = 0, $date, $notes, $postID = 0, $eventName, $tour_id = 0; - var $_fields = array( - 'id', - 'venueID', - 'date', - 'notes', - 'postID', - 'eventName', - 'tour_id', - ); - - function delete() { - $p = $this->getPerformances(); - while ( $p->fetch() ) { - $p->delete(); - } - wp_delete_post($this->postID); - return parent::delete(); - } - - function getByPostID($postID) { - $this->search("postID = " . (int) $postID); - return $this->fetch(); - } - - function getPermalink() { - $post = get_permalink($this->postID); - return $post; - } - - function getPerformances() { - $p = new performance(); - if ( $this->id ) { - $p->search("`gigID` = " . (int) $this->id, "`time`"); - } - return $p; - } - - function getVenue() { - $v = new venue(); - if ( $this->venueID ) { - $v->get($this->venueID); - } - return $v; - } - - function pre_insert() { - global $options, $wpdb; - $user = wp_get_current_user(); - $v = $this->getVenue(); - $p = $this->getPerformances(); - $p->fetch(); - - if ( $this->tour_id == -1 ) $this->tour_id = null; - - $title = array(); - foreach ( $options['gig-title-show'] as $f ) { - switch ( $f ) { - case 'city' : - $title[] = $v->getCity(); - break; - case 'eventName' : - $title[] = $this->eventName; - break; - case 'venue' : - $title[] = $v->name; - break; - case 'date' : - $title[] = dtcGigs::dateFormat($this->date); - break; - case 'country' : - $title[] = $v->country; - break; - } - } - - foreach ( $title as $key => $value ) { - if ( empty($value) ) unset($title[$key]); - } - - $post_data = array( - 'post_author' => $user->ID, - 'post_title' => $wpdb->escape(implode(' - ', $title)), - 'post_status' => 'publish', - 'post_type' => 'post', - 'post_category' => array($options['category']), - 'post_content' => '', - ); - - if ( $options['post-filtering'] ) { - $post_data = array_merge($post_data, array( - 'post_date' => $wpdb->escape($this->date . ' ' . $p->time), - 'post_modified' => $wpdb->escape($this->date . ' ' . $p->time), - 'post_date_gmt' => date('Y-m-d H:i:s', strtotime($this->date . ' ' . $p->time) - (60 * 60 * get_option('gmt_offset'))), - 'post_modified_gmt' => date('Y-m-d H:i:s', strtotime($this->date . ' ' . $p->time) - (60 * 60 * get_option('gmt_offset'))), - )); - } - $id = wp_insert_post($post_data); - $this->postID = $id; - } - - function pre_update() { - global $options, $wpdb, $wp_version; - $v = $this->getVenue(); - $p = $this->getPerformances(); - $p->fetch(); - - if ( $this->tour_id == -1 ) $this->tour_id = null; - - $title = array(); - foreach ( $options['gig-title-show'] as $f ) { - switch ( $f ) { - case 'city' : - $title[] = $v->getCity(); - break; - case 'eventName' : - $title[] = $this->eventName; - break; - case 'venue' : - $title[] = $v->name; - break; - case 'date' : - $title[] = dtcGigs::dateFormat($this->date); - break; - case 'country' : - $title[] = $v->country; - break; - } - } - - foreach ( $title as $key => $value ) { - if ( empty($value) ) unset($title[$key]); - } - - - $post = get_post($this->postID); - - if ( $options['post-filtering'] ) { - $post->post_date = $wpdb->escape($this->date . ' ' . $p->time); - $post->post_modified = $wpdb->escape($this->date . ' ' . $p->time); - $post->post_date_gmt = date('Y-m-d H:i:s', strtotime($this->date . ' ' . $p->time) - (60 * 60 * get_option('gmt_offset'))); - $post->post_modified_gmt = date('Y-m-d H:i:s', strtotime($this->date . ' ' . $p->time) - (60 * 60 * get_option('gmt_offset'))); - } - - $post->post_title = $wpdb->escape(implode(' - ', $title)); - $post->post_name = ""; - $post->post_status = "publish"; // Do this to trick WordPress into resetting the GUID. - $post->post_category = array($options['category']); - - wp_update_post($post); - if ( (float) $wp_version < 2.3 ) { // Hack to make it compatible with WP 2.2 - global $wpdb; - $wpdb->query('UPDATE ' . $wpdb->prefix . 'posts SET post_status = "publish" WHERE ID = ' . (int) $this->postID); - } - } - - function post_insert() { - global $wp_version; - if ( (float) $wp_version < 2.3 ) { // Hack to make it compatible with WP 2.2 - global $wpdb; - $wpdb->query('UPDATE ' . $wpdb->prefix . 'posts SET post_status = "publish" WHERE ID = ' . (int) $this->postID); - } else { - $post = get_post($this->postID); - $post->post_status = "publish"; - wp_update_post($post); - } - } - - function extraJSON() { - $post = get_post($this->postID); - $v = $this->getVenue(); - $p = $this->getPerformances(); - if ( function_exists("json_encode") ) { - $fields['permalink'] = $this->getPermalink(); - $fields['venue'] = $v->getRow(); - while ( $p->fetch() ) { - $fields['performances'][] = $p->getRow(); - } - } else { - $fields[] = '"permalink":"' . str_replace("\n", '\n', addslashes($this->getPermalink())) . '"'; - $ps = array(); - $fields[] = '"venue":' . $v->toJSON(); - while ( $p && $p->fetch() ) { - $ps[] = $p->toJSON(); - } - $fields[] = '"performances":[' . implode(', ', $ps) . ']'; - } - return $fields; - } -} - -class performance extends dtc_gigs_baseAR { - var $_table = TABLE_PERFORMANCES, $_name = 'id'; - var $id, $gigID = 0, $time = '20:00', $link, $shortNotes, $ages; - - var $_fields = array( - 'id', - 'gigID', - 'time', - 'link', - 'shortNotes', - 'ages', - ); -} - -class tour extends dtc_gigs_baseAR { - var $_table = TABLE_TOURS, $_name = 'id'; - var $id, $name, $notes, $pos = 0; - var $_fields = array( - 'id', - 'name', - 'notes', - 'pos', - ); - - function post_insert() { - $max = $this->wpdb->get_var('SELECT MAX(`pos`) FROM `' . $this->_table . '`') + 1; - $this->wpdb->query('UPDATE `' . $this->_table . '` SET `pos` = ' . $max . ' WHERE `id` = ' . (int) $this->id); - } - - function delete() { - $g = $this->getGigs(); - while ( $g->fetch() ) { - $g->tour_id = null; - $g->save(); - } - return parent::delete(); - } - - function sortTours($type = null) { - $options = get_option('gigs-calendar'); - $type = is_null($type) ? $options['tours-sort'] : $type; - switch ($type) { - case 'date' : - return $this->wpdb->get_col(' - SELECT DISTINCT - t.id - FROM - ' . TABLE_TOURS . ' t - LEFT JOIN - ' . TABLE_GIGS . ' g - ON - t.`id` = g.`tour_id` - WHERE - `date` is null OR `date` >= CURDATE() - ORDER BY - g.`date`, `name` - '); - break; - case 'alpha' : - return $this->wpdb->get_col(' - SELECT DISTINCT - t.id - FROM - ' . TABLE_TOURS . ' t - ORDER BY - `name` - '); - break; - } - } - - function getGigs($slice = 'all') { - $g = new gig(); - if ( $slice == 'past' ) { - $g->search('`date` <= CURDATE() AND `tour_id` = ' . (int) $this->id, '`date`'); - } elseif ( $slice == 'future' ) { - $g->search('`date` >= CURDATE() AND `tour_id` = ' . (int) $this->id, '`date`'); - } else { - $g->search('`tour_id` = ' . (int) $this->id, '`date`'); - } - return $g; - } - - function extraJSON(){ - $fields = array(); - $g = $this->getGigs(); - $gs = array(); - if ( function_exists("json_encode") ) { - while ( $g->fetch() ) { - $gs[] = $g->getRow(); - } - $fields['gigs'] = $gs; - } else { - while ( $g->fetch() ) { - $gs[] = $g->toJSON(); - } - $fields[] = '"gigs":[' . implode(',', $gs) . ']'; - } - return $fields; - } -} - -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/gigs.ajax.php --- a/web/wp-content/plugins/gigs-calendar/gigs.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,845 +0,0 @@ -search("date >= CURDATE()", 'date'); - $v->search('deleted = 0', 'name'); - ?> -
    - -
    - - - - - - - - - - - - - - - - fetch() ) : $v = $g->getVenue(); $p = $g->getPerformances(); $post = get_post($g->postID);?> - "> - - - - - - - - - "> - - - - - -
    id; ?>eventName; ?>name; ?>city . (!empty($v->state) ? ', ' . $v->state : '') ?>date ?> - fetch() ) : ?> - time) ?> - - -
    - <?php _e('View Gig', $gcd) ?> - <?php _e('Edit', $gcd) ?> - - <?php _e('Map', $gcd) ?> - - - <?php _e('Edit WordPress Post', $gcd) ?> - - <?php _e('Delete', $gcd) ?> - -
    -
    - - - venueID = $_POST['venueID']; - $g->date = $_POST['date']; - $g->notes = $_POST['notes']; - $g->eventName = $_POST['eventName']; - $g->tour_id = ( $_POST['tour_id'] == -1 ? null : $_POST['tour_id'] ); - - if ( $g->save() ) { - $g->setTags($_POST['tags']); - if ( isset($_POST['performanceID']) ) { - foreach ( $_POST['performanceID'] as $key => $pid ) { - $p = new performance((empty($pid) ? null : $pid)); - $p->gigID = $g->id; - $p->link = ($_POST['link'][$key] == 'http://') ? '' : $_POST['link'][$key]; - $p->shortNotes = $_POST['shortNotes'][$key]; - $p->ages = (empty($_POST['ages-custom'][$key]) ? $_POST['ages'][$key] : $_POST['ages-custom'][$key]); - $p->time = ($_POST['tbd'][$key] == "1") ? null : date("H:i:s", strtotime($_POST['hour'][$key] . ':' . $_POST['minute'][$key] . ' ' . $_POST['meridiem'][$key])); - $p->save(); - } - } - - foreach ( $_POST['custom-key'] as $key => $field ) { - if ( $_POST['custom-value'][$key] === "" ) { - // If the value is empty, just ignore this field. - continue; - } else { - if ( is_array($_POST['custom-value'][$key]) ) { - foreach ( $_POST['custom-value'][$key] as $k => $v ) { - if ( $v === "" ) { - unset($_POST['custom-value'][$key][$k]); - } - } - } - add_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['custom-value'][$key]); - } - } - - - echo '{success:true, gig:' . $g->toJSON() . '}'; - } else { - echo '{success:false,error:"' . ($g->getError() == '' ? 'An unknown error has occurred' : 'DB Error: ' . addslashes($g->getError())) . '"}'; - } - break; - case 'getRow': - $g = new gig($_POST['id']); - $v = $g->getVenue(); - $p = $g->getPerformances(); - $post = get_post($g->postID); - ?> - "> - id; ?> - eventName; ?> - name; ?> - city . (!empty($v->state) ? ', ' . $v->state : '') ?> - date ?> - - fetch() ) : ?> - time) ?> - - - -
    - <?php _e('View Gig', $gcd) ?> - <?php _e('Edit', $gcd) ?> - - <?php _e('Map', $gcd) ?> - - - <?php _e('Edit WordPress Post', $gcd) ?> - - <?php _e('Delete', $gcd) ?> -
    - - - "> - - - - delete(); - echo '{"success": ' . ($result ? 'true' : 'false') . ',"action":"delete"' . ($result ? '' : ',"error":"db"') . '}'; - break; - case 'edit': - $g = new gig($_POST['id']); - $p = $g->getPerformances(); - $v = $g->getVenue(); - ?> -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = 2.5 ) : ?> - postID); - dtcGigs::extraFields(apply_filters('gigCal_gigs_extraFields', array()), $metadata, $g->id); - ?> - - - - - fetch() ) : ?> - - - - - -
    -

    -
    -
    - name . ' - ' . $v->getCity() ?> -
    - -
    -
    - -
    -
    -

    <?php _e('Expand', $gcd); ?>

    -
    -
    - - - - - - - - - - $values ) { - foreach ( $values as $index => $value ) { - if ( substr($key, 0, 1) != '_' ) { - ?> - - - - - -
    - - - - <?php _e('Remove Custom Field', $gcd) ?>
    -
    -
    -

    - - - - -

    -

    -
    -
    -
    -

    -
    you are giving at a venue on the given date.', $gcd) ?>
    -
    - id, false) ?> -
    -
    -
    -
    - - - - - -
    -
    - - - setTags($_POST['tags']); - - $g->date = $_POST['date']; - $g->notes = $_POST['notes']; - $g->eventName = $_POST['eventName']; - $g->tour_id = ( $_POST['tour_id'] == -1 ? null : $_POST['tour_id'] ); - - if ( isset($_POST['performanceID']) ) { - foreach ( $_POST['performanceID'] as $key => $pid ) { - $p = new performance((empty($pid) ? null : $pid)); - $p->gigID = $g->id; - $p->link = ($_POST['link'][$key] == 'http://') ? '' : $_POST['link'][$key]; - $p->shortNotes = $_POST['shortNotes'][$key]; - $p->ages = (empty($_POST['ages-custom'][$key]) ? $_POST['ages'][$key] : $_POST['ages-custom'][$key]); - $p->time = ($_POST['tbd'][$key] == "1") ? null : date("H:i:s", strtotime($_POST['hour'][$key] . ':' . $_POST['minute'][$key] . ' ' . $_POST['meridiem'][$key])); - $p->save(); - } - } - - $p = new performance(); - if ( isset($_POST['delete']) ) { - foreach ( $_POST['delete'] as $pid ) { - $p->get($pid); - $p->delete(); - } - } - - $g->save(); - - if ( isset($_POST['deletecustom']) && is_array($_POST['deletecustom']) ) { - foreach ( $_POST['deletecustom'] as $key => $delete ) { - if ( $delete ) { - delete_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['old-custom-value'][$key]); - } - } - } - - if ( isset($_POST['custom-key']) && is_array($_POST['custom-key']) ) { - - foreach ( $_POST['custom-key'] as $key => $field ) { - if ( is_array($_POST['custom-value'][$key]) ) { - foreach ( $_POST['custom-value'][$key] as $k => $v ) { - if ( $v === "" ) { - unset($_POST['custom-value'][$key][$k]); - } - } - } - if ( empty($_POST['custom-value'][$key]) && empty($_POST['old-custom-value'][$key]) ) { - // If both value fields are empty, just ignore this field. - continue; - } elseif ( $_POST['custom-value'][$key] === "" ) { - // If the old value is not empty, but the new one is, delete this sucker. - delete_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['old-custom-value'][$key]); - } elseif ( $_POST['old-custom-value'][$key] === "" ) { - // If the old value is empty, but the new one is not, create a new custom field. - add_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['custom-value'][$key]); - } elseif ( $_POST['old-custom-value'][$key] != $_POST['custom-value'][$key] && $_POST['old-custom-value'][$key] != serialize($_POST['custom-value'][$key]) ) { - // If the old and new values are not equal, update the custom field. - update_post_meta($g->postID, $_POST['custom-key'][$key], $_POST['custom-value'][$key], unserialize($_POST['old-custom-value'][$key])); - } - } - } - - echo '{success:true, gig:' . $g->toJSON() . '}'; - break; - - case 'performance-form': - if ( isset($_POST['id']) ) { - pForm($_POST['id'], false); - } else { - pForm((int) $_POST['count'], true); - } - break; -} - - -function pForm($id, $new = true, $remove = true) { - global $folder, $gcd, $options; - $p = new performance(); - if ( $new ) { - $count = 'c' . $id; - } else { - $p->get($id); - $count = 'id' . $id; - } - - $ages = $options['ages-list']; - - $time = explode(":", $p->time); - $minutes = $time[1]; - - if ( $options['time-12h'] ) { - if ( $time[0] == 0 ) { - $hour = "12"; - $meridiem = "AM"; - } elseif ( $time[0] == 12 ) { - $hour = "12"; - $meridiem = "PM"; - } elseif ( $time[0] < 12 ) { - $hour = $time[0]; - $meridiem = "AM"; - } else { - $hour = $time[0] - 12; - $meridiem = "PM"; - } - } else { - $hour = $time[0]; - } - ?> - - - - - - - - - - -
    - - -
    - - - - - - - - time) ) echo 'checked="checked"'; ?> type="checkbox" value="1" class="tbd" name="tbd[]" id="performance-tbd-"> - -
    <?php _e('Remove Performance', $gcd) ?>
    - -
    -
    - - - -
    - - - -
    - - - - - -
    - - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-de_DE.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-de_DE.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-es_ES.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-es_ES.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-fi_FI.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-fi_FI.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-fr_FR.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-fr_FR.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-it_IT.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-it_IT.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-nl_NL.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-nl_NL.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-zh_CN.mo Binary file web/wp-content/plugins/gigs-calendar/i18n/gigs-calendar-zh_CN.mo has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/add.png Binary file web/wp-content/plugins/gigs-calendar/images/add.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/ajax-loader.gif Binary file web/wp-content/plugins/gigs-calendar/images/ajax-loader.gif has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/cancel.png Binary file web/wp-content/plugins/gigs-calendar/images/cancel.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/delete.png Binary file web/wp-content/plugins/gigs-calendar/images/delete.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/disk.png Binary file web/wp-content/plugins/gigs-calendar/images/disk.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/feed-icon.png Binary file web/wp-content/plugins/gigs-calendar/images/feed-icon.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/help.png Binary file web/wp-content/plugins/gigs-calendar/images/help.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/link.png Binary file web/wp-content/plugins/gigs-calendar/images/link.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/minus.gif Binary file web/wp-content/plugins/gigs-calendar/images/minus.gif has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/money_dollar.png Binary file web/wp-content/plugins/gigs-calendar/images/money_dollar.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/page_edit.png Binary file web/wp-content/plugins/gigs-calendar/images/page_edit.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/page_white_edit.png Binary file web/wp-content/plugins/gigs-calendar/images/page_white_edit.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/page_white_magnify.png Binary file web/wp-content/plugins/gigs-calendar/images/page_white_magnify.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/plus.gif Binary file web/wp-content/plugins/gigs-calendar/images/plus.gif has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/shape_square.png Binary file web/wp-content/plugins/gigs-calendar/images/shape_square.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/small-ajax-indicator.gif diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/images/world.png Binary file web/wp-content/plugins/gigs-calendar/images/world.png has changed diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/js/jquery.form.js --- a/web/wp-content/plugins/gigs-calendar/js/jquery.form.js Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,872 +0,0 @@ -/* - * jQuery Form Plugin - * version: 2.02 (12/16/2007) - * @requires jQuery v1.1 or later - * - * Examples at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id$ - */ - (function($) { -/** - * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX. - * - * ajaxSubmit accepts a single argument which can be either a success callback function - * or an options Object. If a function is provided it will be invoked upon successful - * completion of the submit and will be passed the response from the server. - * If an options Object is provided, the following attributes are supported: - * - * target: Identifies the element(s) in the page to be updated with the server response. - * This value may be specified as a jQuery selection string, a jQuery object, - * or a DOM element. - * default value: null - * - * url: URL to which the form data will be submitted. - * default value: value of form's 'action' attribute - * - * type: The method in which the form data should be submitted, 'GET' or 'POST'. - * default value: value of form's 'method' attribute (or 'GET' if none found) - * - * data: Additional data to add to the request, specified as key/value pairs (see $.ajax). - * - * beforeSubmit: Callback method to be invoked before the form is submitted. - * default value: null - * - * success: Callback method to be invoked after the form has been successfully submitted - * and the response has been returned from the server - * default value: null - * - * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json' - * default value: null - * - * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower). - * default value: false - * - * resetForm: Boolean flag indicating whether the form should be reset if the submit is successful - * - * clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful - * - * - * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for - * validating the form data. If the 'beforeSubmit' callback returns false then the form will - * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data - * in array format, the jQuery object, and the options object passed into ajaxSubmit. - * The form data array takes the following form: - * - * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] - * - * If a 'success' callback method is provided it is invoked after the response has been returned - * from the server. It is passed the responseText or responseXML value (depending on dataType). - * See jQuery.ajax for further details. - * - * - * The dataType option provides a means for specifying how the server response should be handled. - * This maps directly to the jQuery.httpData method. The following values are supported: - * - * 'xml': if dataType == 'xml' the server response is treated as XML and the 'success' - * callback method, if specified, will be passed the responseXML value - * 'json': if dataType == 'json' the server response will be evaluted and passed to - * the 'success' callback, if specified - * 'script': if dataType == 'script' the server response is evaluated in the global context - * - * - * Note that it does not make sense to use both the 'target' and 'dataType' options. If both - * are provided the target will be ignored. - * - * The semantic argument can be used to force form serialization in semantic order. - * This is normally true anyway, unless the form contains input elements of type='image'. - * If your form must be submitted with name/value pairs in semantic order and your form - * contains an input of type='image" then pass true for this arg, otherwise pass false - * (or nothing) to avoid the overhead for this logic. - * - * - * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this: - * - * $("#form-id").submit(function() { - * $(this).ajaxSubmit(options); - * return false; // cancel conventional submit - * }); - * - * When using ajaxForm(), however, this is done for you. - * - * @example - * $('#myForm').ajaxSubmit(function(data) { - * alert('Form submit succeeded! Server returned: ' + data); - * }); - * @desc Submit form and alert server response - * - * - * @example - * var options = { - * target: '#myTargetDiv' - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Submit form and update page element with server response - * - * - * @example - * var options = { - * success: function(responseText) { - * alert(responseText); - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Submit form and alert the server response - * - * - * @example - * var options = { - * beforeSubmit: function(formArray, jqForm) { - * if (formArray.length == 0) { - * alert('Please enter data.'); - * return false; - * } - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Pre-submit validation which aborts the submit operation if form data is empty - * - * - * @example - * var options = { - * url: myJsonUrl.php, - * dataType: 'json', - * success: function(data) { - * // 'data' is an object representing the the evaluated json data - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc json data returned and evaluated - * - * - * @example - * var options = { - * url: myXmlUrl.php, - * dataType: 'xml', - * success: function(responseXML) { - * // responseXML is XML document object - * var data = $('myElement', responseXML).text(); - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc XML data returned from server - * - * - * @example - * var options = { - * resetForm: true - * }; - * $('#myForm').ajaxSubmit(options); - * @desc submit form and reset it if successful - * - * @example - * $('#myForm).submit(function() { - * $(this).ajaxSubmit(); - * return false; - * }); - * @desc Bind form's submit event to use ajaxSubmit - * - * - * @name ajaxSubmit - * @type jQuery - * @param options object literal containing options which control the form submission process - * @cat Plugins/Form - * @return jQuery - */ -$.fn.ajaxSubmit = function(options) { - if (typeof options == 'function') - options = { success: options }; - - options = $.extend({ - url: this.attr('action') || window.location.toString(), - type: this.attr('method') || 'GET' - }, options || {}); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - $.event.trigger('form.pre.serialize', [this, options, veto]); - if (veto.veto) return this; - - var a = this.formToArray(options.semantic); - if (options.data) { - for (var n in options.data) - a.push( { name: n, value: options.data[n] } ); - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this; - - // fire vetoable 'validate' event - $.event.trigger('form.submit.validate', [a, this, options, veto]); - if (veto.veto) return this; - - var q = $.param(a);//.replace(/%20/g,'+'); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else - options.data = q; // data is the query string for 'post' - - var $form = this, callbacks = []; - if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); - if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - if (this.evalScripts) - $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments); - else // jQuery v1.1.4 - $(options.target).html(data).each(oldSuccess, arguments); - }); - } - else if (options.success) - callbacks.push(options.success); - - options.success = function(data, status) { - for (var i=0, max=callbacks.length; i < max; i++) - callbacks[i](data, status, $form); - }; - - // are there files to upload? - var files = $('input:file', this).fieldValue(); - var found = false; - for (var j=0; j < files.length; j++) - if (files[j]) - found = true; - - // options.iframe allows user to force iframe mode - if (options.iframe || found) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if ($.browser.safari && options.closeKeepAlive) - $.get(options.closeKeepAlive, fileUpload); - else - fileUpload(); - } - else - $.ajax(options); - - // fire 'notify' event - $.event.trigger('form.submit.notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - var opts = $.extend({}, $.ajaxSettings, options); - - var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++; - var $io = $('':"");return html},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='"}}html+=""}if(secondary||!this._get("changeYear")){html+=drawYear}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=new Date().getFullYear()+parseInt(years[0],10);endYear=new Date().getFullYear()+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}html+="
    ";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');\""},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&datemaxDate?maxDate:date);this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear()},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return date||(checkRange?this._rangeStart:null)},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig())}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery) \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/js/ui.sortable.js --- a/web/wp-content/plugins/gigs-calendar/js/ui.sortable.js Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b(B){b A(E,D){9 C=B.2Q.3T&&B.2Q.3S<3R;5(E.2P&&!C){c E.2P(D)}5(E.2O){c!!(E.2O(D)&16)}1O(D=D.1g){5(D==E){c W}}c w}B.3Q("k.o",B.2f(B.k.3P,{3O:b(){9 C=4.6;4.O={};4.g.24("k-o");4.25();4.13=4.f.z?(/7|23/).17(4.f[0].v.e("3N")):w;5(!(/(2N|1s|3M)/).17(4.g.e("Y"))){4.g.e("Y","2N")}4.a=4.g.a();4.3L()},3K:{},k:b(C){c{l:(C||4)["l"],q:(C||4)["q"]||B([]),Y:(C||4)["Y"],3J:(C||4)["1b"],6:4.6,g:4.g,v:(C||4)["j"],3I:C?C.g:X}},t:b(F,E,C,D){B.k.1o.14(4,F,[E,4.k(C)]);5(!D){4.g.3H(F=="1z"?F:"1z"+F,[E,4.k(C)],4.6[F])}},2e:b(E){9 C=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 D=[];E=E||{};C.1v(b(){9 F=(B(4).2L(E.3G||"2K")||"").3F(E.3E||(/(.+)[-=3D](.+)/));5(F){D.1w((E.2M||F[1])+"[]="+(E.2M?F[1]:F[2]))}});c D.3C("&")},2d:b(C){9 D=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 E=[];D.1v(b(){E.1w(B(4).2L(C||"2K"))});c E},2F:b(J){9 E=4.1b.7,D=E+4.r.m,I=4.1b.8,H=I+4.r.n;9 F=J.7,C=F+J.m,K=J.8,G=K+J.n;5(4.6.1r=="2J"||(4.6.1r=="1S"&&4.r[4.13?"m":"n"]>J[4.13?"m":"n"])){c(I+4.a.p.8>K&&I+4.a.p.8F&&E+4.a.p.7J[4.13?"m":"n"])){5(!(I+4.a.p.8>K&&I+4.a.p.8F&&E+4.a.p.7F&&E+4.a.p.7F+J.m/2&&E+4.a.p.7K&&I+4.a.p.8K+J.n/2&&I+4.a.p.8F&&EC){c 1}}Z{5(H>K&&IG){c 2}}}c w},25:b(){4.2I();4.1T()},2I:b(){4.f=[];4.d=[4];9 C=4.f;9 E=[B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)];5(4.6.28){P(9 F=4.6.28.z-1;F>=0;F--){9 H=B(4.6.28[F]);P(9 D=H.z-1;D>=0;D--){9 G=B.1f(H[D],"o");5(G&&!G.6.27){E.1w(B.1L(G.6.f)?G.6.f.14(G.g):B(G.6.f,G.g));4.d.1w(G)}}}}P(9 F=E.z-1;F>=0;F--){E[F].1v(b(){B.1f(4,"o-v",W);C.1w({v:B(4),m:0,n:0,7:0,8:0})})}},1T:b(C){P(9 E=4.f.z-1;E>=0;E--){9 D=4.f[E].v;5(!C){4.f[E].m=(4.6.1l?B(4.6.1l,D):D).1u()}5(!C){4.f[E].n=(4.6.1l?B(4.6.1l,D):D).1t()}9 F=(4.6.1l?B(4.6.1l,D):D).a();4.f[E].7=F.7;4.f[E].8=F.8}P(9 E=4.d.z-1;E>=0;E--){9 F=4.d[E].g.a();4.d[E].O.7=F.7;4.d[E].O.8=F.8;4.d[E].O.m=4.d[E].g.1u();4.d[E].O.n=4.d[E].g.1t()}},3B:b(){4.g.3A("k-o k-o-27").2H("o").3z(".o");4.3y();P(9 C=4.f.z-1;C>=0;C--){4.f[C].v.2H("o-v")}},1Z:b(E){9 C=E||4,F=C.6;5(F.q.3x==3w){9 D=F.q;F.q={g:b(){c B("<2G>").24(D)[0]},1i:b(G,H){H.e(G.a()).e({m:G.1u(),n:G.1t()})}}}C.q=B(F.q.g.14(C.g,C.j)).1q("S").e({Y:"1s"});F.q.1i.14(C.g,C.j,C.q)},2q:b(F){P(9 D=4.d.z-1;D>=0;D--){5(4.2F(4.d[D].O)){5(!4.d[D].O.1a){5(4.26!=4.d[D]){9 I=3v;9 H=X;9 E=4.1b[4.d[D].13?"7":"8"];P(9 C=4.f.z-1;C>=0;C--){5(!A(4.d[D].g[0],4.f[C].v[0])){1X}9 G=4.f[C][4.d[D].13?"7":"8"];5(1k.2E(G-E)=0;E--){4.d[E].t("3i",H,4)}}5(B.k.15){B.k.15.3h=4}5(B.k.15&&!J.2n){B.k.15.3g(4,H)}4.2j=W;4.2u(H);c W},2t:b(D,E){5(!E){E=4.Y}9 C=D=="1s"?1:-1;c{8:(E.8+4.a.s.8*C-(4.u[0]==h.S?0:4.u[0].N)*C+4.T.8*C),7:(E.7+4.a.s.7*C-(4.u[0]==h.S?0:4.u[0].M)*C+4.T.7*C)}},1Y:b(F){9 G=4.6;9 C={8:(F.1e-4.a.p.8-4.a.s.8+(4.u[0]==h.S?0:4.u[0].N)),7:(F.1c-4.a.p.7-4.a.s.7+(4.u[0]==h.S?0:4.u[0].M))};5(!4.1j){c C}5(4.i){5(C.7<4.i[0]){C.7=4.i[0]}5(C.8<4.i[1]){C.8=4.i[1]}5(C.7>4.i[2]){C.7=4.i[2]}5(C.8>4.i[3]){C.8=4.i[3]}}5(G.11){9 E=4.1j.8+1k.2v((C.8-4.1j.8)/G.11[1])*G.11[1];C.8=4.i?(!(E<4.i[1]||E>4.i[3])?E:(!(E<4.i[1])?E-G.11[1]:E+G.11[1])):E;9 D=4.1j.7+1k.2v((C.7-4.1j.7)/G.11[0])*G.11[0];C.7=4.i?(!(D<4.i[0]||D>4.i[2])?D:(!(D<4.i[0])?D-G.11[0]:D+G.11[0])):D}c C},2u:b(D){4.Y=4.1Y(D);4.1b=4.2t("1s");P(9 C=4.f.z-1;C>=0;C--){9 E=4.2s(4.f[C]);5(!E){1X}5(4.f[C].v[0]!=4.j[0]&&4.j[E==1?"3f":"1G"]()[0]!=4.f[C].v[0]&&!A(4.j[0],4.f[C].v[0])&&(4.6.2r=="3e-3d"?!A(4.g[0],4.f[C].v[0]):W)){4.2h=E==1?"2g":"3c";4.1D(D,4.f[C]);4.t("1W",D);3b}}4.2q(D);4.t("1z",D);5(!4.6.1I||4.6.1I=="x"){4.l[0].2p.7=4.Y.7+"2o"}5(!4.6.1I||4.6.1I=="y"){4.l[0].2p.8=4.Y.8+"2o"}5(B.k.15){B.k.15.3a(4,D)}c w},39:b(E,D){5(B.k.15&&!4.6.2n){B.k.15.38(4,E)}5(4.6.1V){9 C=4;9 F=C.j.a();5(C.q){C.q.2m({18:"37"},(L(4.6.1V,10)||2l)-36)}B(4.l).2m({7:F.7-4.a.s.7-C.T.7+(4.u[0]==h.S?0:4.u[0].M),8:F.8-4.a.s.8-C.T.8+(4.u[0]==h.S?0:4.u[0].N)},L(4.6.1V,10)||2l,b(){C.t("1p",E,X,D);C.1H(E)})}Z{4.t("1p",E,X,D);4.1H(E,D)}c w},1H:b(E,D){5(4.1U!=4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}5(!A(4.g[0],4.j[0])){5(4.1U==4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}4.t("1E",E,X,D);P(9 C=4.d.z-1;C>=0;C--){5(A(4.d[C].g[0],4.j[0])){4.d[C].t("1i",E,4,D);4.d[C].t("35",E,4,D)}}}P(9 C=4.d.z-1;C>=0;C--){4.d[C].t("34",E,4,D);5(4.d[C].O.1a){4.d[C].t("2k",E,4);4.d[C].O.1a=0}}4.2j=w;5(4.33){c w}B(4.j).e("2i","");5(4.q){4.q.1E()}4.l.1E();c W},1D:b(E,D,C){C?C.32(4.j):D.v[4.2h=="2g"?"31":"30"](4.j);4.1T(W);5(4.6.q){4.6.q.1i.14(4.g,4.j,4.q)}}}));B.2f(B.k.o,{2Z:"2e 2d",2Y:{1r:"1S",2X:0,2W:0,2V:":2U,2T",f:"> *",19:2S,2c:W,1q:"s"}});B.k.1o.1C("o","1h",{1n:b(E,D){9 C=B("S");5(C.e("1h")){D.6.1R=C.e("1h")}C.e("1h",D.6.1h)},1p:b(D,C){5(C.6.1R){B("S").e("1h",C.6.1R)}}});B.k.1o.1C("o","19",{1n:b(E,D){9 C=D.l;5(C.e("19")){D.6.1Q=C.e("19")}C.e("19",D.6.19)},1p:b(D,C){5(C.6.1Q){B(C.l).e("19",C.6.1Q)}}});B.k.1o.1C("o","18",{1n:b(E,D){9 C=D.l;5(C.e("18")){D.6.1P=C.e("18")}C.e("18",D.6.18)},1p:b(D,C){5(C.6.1P){B(C.l).e("18",C.6.1P)}}});B.k.1o.1C("o","1m",{1n:b(E,D){9 F=D.6;9 C=B(4).1f("o");F.V=F.V||20;F.U=F.U||20;C.R=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-y"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);C.Q=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-x"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);5(C.R[0]!=h&&C.R[0].1y!="1x"){C.1N=C.R.a()}5(C.Q[0]!=h&&C.Q[0].1y!="1x"){C.1M=C.Q.a()}},1z:b(E,D){9 F=D.6;9 C=B(4).1f("o");5(C.R[0]!=h&&C.R[0].1y!="1x"){5((C.1N.8+C.R[0].2a)-E.1e Gigs Calendar in your WordPress -admin panel. You'll probably want to set which WordPress page you want your -calendar to appear on. Once you've saved that, you are ready to get started. - -== Compatibility notes == -= Browser = -This plugin's administration pages are currently only supported fully by the -Firefox and Safari browsers. When I am approaching version 1.0, I plan to -develop full support for IE7 and Opera. If you would like to know more about -my decision to focus on Firefox and Safari, feel free to get in touch with me. - -= WordPress = -If you are using a WordPress version less than 2.3, you may need to create the -database tables manually. You can find the SQL in tables.sql. Get in touch with -me if you need help doing that. You might also want to consider updating to the -most recent version of WordPress. - -= MySQL = -If you are using a MySQL version less than 4.1, filtering the gig posts from -your normal blog entries will be disabled. You will need to filter those based -on the category you select in the settings page using another plugin. I suggest -the Advanced Category Excluder (http://wordpress.org/extend/plugins/advanced-category-excluder/) plugin. diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/rss.php --- a/web/wp-content/plugins/gigs-calendar/rss.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -posts . ' p, - ' . TABLE_GIGS . ' g - WHERE - p.ID = g.postID AND - g.date >= CURDATE() - - ORDER BY g.date -'; - -$posts = $wpdb->get_results($query); -echo ''; -?> - - - <?php bloginfo('name') ?> - <?php _e('Upcoming Gigs feed', $gcd); ?> - - - - - - - Gigs Calendar v - - - - - getByPostID($post->ID); $p = $g->getPerformances(); $p->fetch(); ?> - - <?php echo the_title() ?> - - date . ' ' . $p->time)); ?> - - - - ]]> - - - - - - - - - - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/settings.ajax.php --- a/web/wp-content/plugins/gigs-calendar/settings.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,488 +0,0 @@ - 'm/d/y', - 'archive' => 'm/d/y', - 'long' => 'l, F j, Y', -); - - -switch ( $_POST['action'] ) : - case 'load': - $listFields = array( - 'city' => __('City', $gcd), - 'country' => __('Country', $gcd), - 'venue' => __('Venue', $gcd), - 'eventName' => __('Event Name', $gcd), - 'date' => __('Date', $gcd), - 'time' => __('Time', $gcd), - 'shortNotes' => __('Short Notes', $gcd), - 'tickets' => __('Ticket Link', $gcd), - 'map' => __('Map Link', $gcd), - ); - - $titleFields = array( - 'city' => __('City', $gcd), - 'venue' => __('Venue', $gcd), - 'country' => __('Country', $gcd), - 'eventName' => __('Event Name', $gcd), - 'date' => __('Date', $gcd), - ); - - $defaults = array( - 'archive' => -1, - 'category' => get_option('default_category'), - 'no-upcoming' => __('Sorry, there aren’t any upcoming gigs right now. Check back soon!', $gcd), - 'no-past' => __('There aren’t any gigs here right now. Check back soon!', $gcd), - 'silk-link' => 1, - 'b4b-link' => 1, - 'rss-link' => 1, - 'gigs-table-show' => array_keys($listFields), - 'gig-title-show' => array('city', 'date'), - 'eventName-label' => __("Who", $gcd), - 'ages-list' => array(__('All Ages', $gcd), __('21+', $gcd), __('16+', $gcd)), - 'list-venue-link' => 0, - 'list-headers' => 0, - 'template' => 'basic', - 'time-12h' => 1, - 'calendar-position' => "bottom", - 'tbd-text' => __("TBD"), - 'tours-display' => 0, - 'tours-empty' => 0, - 'tours-sort' => 'date', - 'user_level' => 'level_5', - 'post-filtering' => 1, - 'admin-only-settings' => 0, - ); - - unset($defaults['gigs-table-show'][array_search('eventName', $defaults['gigs-table-show'])]); - unset($defaults['gigs-table-show'][array_search('country', $defaults['gigs-table-show'])]); - - if ( is_array($options) ) { - $options = array_merge($defaults, $options); - } else { - $options = $defaults; - } - if ( is_array($options['date']) ) { - $options['date'] = array_merge($date_defaults, $options['date']); - } else { - $options['date'] = $date_defaults; - } - - if ( (int) get_option('gig_db_version') == -1 ) { - die (__('Oops! It looks like you’re missing some or all of the tables required for this plugin. They should have been created automatically, but you can create them with the tables.sql file in the same folder as this plugin. If you have any questions, you can use the feedback form in the next tab.')); - } - ?> - -
    new page first.', $gcd) ?>
    - - mysql_get_server_info() ) : ?> -
    - Warning: You are running MySQL server version . This plugin requires version 4.1 or higher to hide the future gig posts from your homepage. Your best option is to use a plugin like Advanced Category Excluder to hide the gigs using the category option below.'); ?> -
    - -
    - - -

    -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    - -

    - -
    - -
    - - -

    -
    -
      - -
    • - - <? _e('Delete', $gcd) ?> - -
    • - -
    - <? _e('Add', $gcd) ?> - -

    -
    - -
    date() function format)', $gcd) ?>
    -
    date() function format)', $gcd) ?>
    - -
    date() function format)', $gcd) ?>
    - -
    - -
    - - -

    -
    -
      - - -
    • - - -
    • - - - $value ) : ?> - -
    • - - -
    • - - -
    -
    - -
    - -
    - -
    - -

    - -
    -
      - - -
    • - - -
    • - - - $value ) : ?> - -
    • - - -
    • - - -
    - -
    - -

    -
    - -
    - -
    - - -

    -
    -
    - Note: It’s ok to say "no". I’ve offered this freely with no expectations, but I’d be very grateful if you said "yes"', $gcd) ?> -
    - -
    -
    - Note: The Silk Icons that I used in this plugin are licensed under the Creative Commons. You must link back to him somewhere on your site. If you link to him on another page, giving him credit, or you have replaced the icons, or you do not display any of them publicly on your site, you may turn off this link.', $gcd) ?>
    - -

    -
    -
    - - -
    -
    - - - - - (empty($args['date-short']) ? $date_defaults['short'] : $args['date-short']), - 'archive' => (empty($args['date-archive']) ? $date_defaults['archive'] : $args['date-archive']), - 'long' => (empty($args['date-long']) ? $date_defaults['long'] : $args['date-long']), - ); - - unset($args['apply-changes'], $args['nonce'], $args['action'], $args['date-long'], $args['date-archive'], $args['date-short'], $args['long-date-format'], $args['short-date-format']); - - foreach ( $args as $key => $value ) { - if ( is_string($value) ) { - $args[$key] = stripslashes($value); - } - } - - $options = get_option('gigs-calendar'); - if ( is_array($options) ) { - $args = array_merge($options, $args); - } - if ( is_array($args['date']) ) { - $args['date'] = array_merge($args['date'], $dates); - } else { - $args['date'] = $dates; - } - - update_option('gigs-calendar', $args); - $options = get_option('gigs-calendar'); - if ( $_POST['apply-changes'] != 'no' ) { - $g = new gig(); - $g->search('future' == $_POST['apply-changes'] ? 'date >= CURDATE()' : null); - while ( $g->fetch() ) { - $g->save(false); - } - } - break; -endswitch; - -?> diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/tables.sql --- a/web/wp-content/plugins/gigs-calendar/tables.sql Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ --- Database tables for the Gigs Calendar Plugin v0.2 --- Database version: 2 - --- Note: Ignore this file unless your database tables are not created automatically. --- Replace "[Your database prefix here]" with the appropriate database prefix, for example "wp_". - --- -------------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `[Your database prefix here]gigs_gig` ( - `id` int(10) unsigned NOT NULL auto_increment, - `venueID` int(10) unsigned NOT NULL, - `date` date NOT NULL, - `notes` text NOT NULL, - `postID` bigint(20) unsigned NOT NULL, - `eventName` varchar(255) NOT NULL, - `tour_id` INT UNSIGNED NULL, - PRIMARY KEY (`id`) -); - --- -------------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `[Your database prefix here]gigs_performance` ( - `id` int(10) unsigned NOT NULL auto_increment, - `gigID` int(10) unsigned NOT NULL, - `time` time default NULL, - `link` varchar(255) NOT NULL, - `shortNotes` varchar(255) NOT NULL, - `ages` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -); - --- -------------------------------------------------------- - -CREATE TABLE `[Your database prefix here]gigs_tour` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `name` VARCHAR( 255 ) NOT NULL , - `notes` MEDIUMTEXT NOT NULL , - `pos` INT UNSIGNED NOT NULL -); --- -------------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `[Your database prefix here]gigs_venue` ( - `id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) NOT NULL, - `address` text NOT NULL, - `city` varchar(255) NOT NULL, - `state` varchar(255) NOT NULL, - `country` varchar(255) NOT NULL, - `postalCode` varchar(255) NOT NULL, - `contact` varchar(255) NOT NULL, - `phone` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `link` varchar(255) NOT NULL, - `notes` text NOT NULL, - `private` tinyint(4) NOT NULL, - `apiID` int(10) unsigned NOT NULL, - `deleted` tinyint(4) NOT NULL, - `customMap` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -); diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/attribution.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/attribution.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - -
    - - Blogs for Bands', $gcd); ?> - - - Mark James', $gcd); ?> - -
    \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/gig-post.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/gig-post.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -
    - - - eventName) ) : ?> - - - - - - - - - - - - - - notes) ) : ?> - - - -
    eventName ?>
    -
    date, 'long'); ?>
    - fetch() ) : ?> -
    - time); ?> - shortNotes) ) : ?> - - - shortNotes; ?> - - - - ages; ?> - link) ) : ?> - <?php _e('Buy Tickets', $gcd); ?> - -
    - -
    - private ) : ?> -
    - -
    - link) ) : ?> - name; ?> - - name; ?> - - () -
    -
    getAddress()); ?>
    - notes) ) : ?> -

    notes); ?>

    - - -
    notes); ?>
    - -

    «

    - -
    - \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/gigs-list.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/gigs-list.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -
    - - - - - - - - - - - - - $g ) : ?> - performances as $key => $p ) : ?> - - '', - 'country' => '', - 'venue' => '', - 'eventName' => '', - 'date' => '', - 'time' => '', - 'shortNotes' => '', - 'tickets' => ( $upcoming ? '' : '' ), - 'map' => '', - ); - } else { - $fields = array( - 'city' => '', - 'country' => '', - 'venue' => '', - 'eventName' => '', - 'date' => '', - 'time' => '', - 'shortNotes' => '', - 'tickets' => ( $upcoming ? '' : '' ), - 'map' => '', - ); - } - echo dtcGigs::selectFields($fields, $g); - ?> - - - - -
    {' . $g->cityState . '}{' . $g->country . '}{' . $g->name . '}{' . $g->eventName . '}{' . $g->date . '}{' . $p->time . '}{' . $p->shortNotes . '}' . ( !empty($p->link) ? '' . __('Buy Tickets', $gcd) . '' : '') . '' . ($g->mapLink ? '' . __('Map', $gcd) . '' : '') . '{' . $p->time . '}{' . $p->shortNotes . '}' . ( !empty($p->link) ? '' . __('Buy Tickets', $gcd) . '' : '') . '
    - -
    - -
    - -
    \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/next-widget.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/next-widget.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - -
    - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/rss.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/rss.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ - -
    - \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/style.css --- a/web/wp-content/plugins/gigs-calendar/templates/basic/style.css Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -div.attribution, div.gigs-rss { - text-align: center; - font-size: 87%; - margin: .5em 0px; -} - -div.gigs-rss img { - position: relative; - top: 2px; -} - -div.attribution span { - margin: 0px 1em; -} - -table.gigs { - width: 100%; - text-align: left; - font-size: .9em; - border-collapse: collapse; - border: 1px dotted #666; -} - -table.gigs td.icon { - width: 18px; - text-align: center; -} - -table.gigs td.time { - text-align: right; -} - -table.gigs a { - font-weight: bold; -} - -table.gigs a img { - border: 0px; -} - - -table.gigs tr.gig { - border-top: 1px dotted #666; -} - -table.gigs td.shortNotes { - padding-left: 4px; -} - -.bold { - font-weight: bold; -} - -img.buy { - position: relative; - top: 3px; -} - -table.gigs caption { - font-weight: bold; - font-size: 125%; - text-align: left; -} - -table.gigs caption div.notes{ - font-weight: normal; - font-size: 80%; - text-align: left; -} - -table.gigs, div.no-gigs { - margin-bottom: 1em; -} - -/** Next Gig Widget **/ - .gig.next { - padding-left: 10px; - } \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/basic/upcoming-widget.php --- a/web/wp-content/plugins/gigs-calendar/templates/basic/upcoming-widget.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - -
      - cityState; - break; - case 'venue': - $link[] = $g->name; - break; - case 'eventName': - $link[] = $g->eventName; - break; - } - } - $link = array_unique($link); - foreach ( $link as $key => $value ) { - if ( empty($value) ) unset($link[$key]); - } - ?> -
    • mysqlDate . ' ' . $p->time, (date('Y') == date('Y', strtotime($g->mysqlDate))) ? $args['dateFormat'] : $args['dateFormatYear']) ?>: - -
    • - -
    - -
    - \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/templates/readme-first.txt --- a/web/wp-content/plugins/gigs-calendar/templates/readme-first.txt Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -Gigs Calendar Templates - -WARNING! - -Do not edit any files in this folder. If you do, you do so at your own risk. -WordPress will delete any changes you make when you perform the automatic -upgrade for this plugin. - -Instead create a gigs-templates folder in your wp-content directory and copy -the basic template there before you make any changes. - -For more information, visit the official documentation page: -http://dev.blogsforbands.com/gigs-calendar-template-system/ \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/tours.ajax.php --- a/web/wp-content/plugins/gigs-calendar/tours.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -search(null, ($options['tours-sort'] == 'custom' ? '`pos`' : '`name`')); - ?> -
    - -
    - - - - - - - - - - - - - - fetch() ) : ?> - "> - - - - - - "> - - - - - -
    id; ?>name; ?>notes) ) > 40 ) { - echo substr( strip_tags($t->notes), 0, 40 ) . '...'; - } else { - echo strip_tags($t->notes); - } - ?> -
    - <?php _e('Edit', $gcd) ?> - - <?php _e('Map', $gcd) ?> - - <?php _e('Delete', $gcd) ?> -
    -
    - - - - - setupEvents = function() { - - - setupPerformances(); - } - - setupEvents(); - - }(jQuery)); - - - - - name = $_POST['name']; - $t->notes = $_POST['notes']; - - if ( $t->save() ) { - echo '{success:true, tour:' . $t->toJSON() . '}'; - } else { - echo '{success:false}'; - } - break; - case 'getRow': - $t = new tour($_POST['id']); - ?> - "> - id; ?> - name; ?> - notes) ) > 40 ) { - echo substr( strip_tags($t->notes), 0, 40 ) . '...'; - } else { - echo strip_tags($t->notes); - } - ?> - -
    - <?php _e('Edit', $gcd) ?> - - <?php _e('Map', $gcd) ?> - - <?php _e('Delete', $gcd) ?> -
    - - - "> - - - - delete(); - echo '{"success": ' . ($result ? 'true' : 'false') . ',"action":"delete"' . ($result ? '' : ',"error":"db"') . '}'; - break; - case 'edit': - $t = new tour($_POST['id']); - ?> -
    - - - - - - - - - -
    -

    -
    -
    - -
    -
    - - - - - -
    -
    - - - name = $_POST['name']; - $t->notes = $_POST['notes']; - - $t->save(); - echo '{success:true, tour:' . $t->toJSON() . '}'; - break; - - case 'performance-form': - if ( isset($_POST['id']) ) { - pForm($_POST['id'], false); - } else { - pForm((int) $_POST['count'], true); - } - break; -} -?> \ No newline at end of file diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/venues.ajax.php --- a/web/wp-content/plugins/gigs-calendar/venues.ajax.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,306 +0,0 @@ -get_results('SELECT * FROM `' . TABLE_CATS . '` ORDER BY `' . $options['categorySortColumn'] .'` ' . $options['categorySortDirection']); - $v = new venue(); - $v->search('deleted = 0', 'name'); - ?> -
    - -
    -
    -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    - -
    -
    - - - - -
    -
    -
    - - - - - - - - - - - - - - fetch() ) : ?> - "> - - - - - - - - "> - - - - - -
    id; ?>name; ?>city . (!empty($v->state) ? ', ' . $v->state : '') ?>phone ?> -
    - <?php _e('Edit', $gcd) ?> - <?php _e('Map', $gcd) ?> - link) ) : ?> - <?php _e('Homepage', $gcd) ?> - - <?php _e('Delete', $gcd) ?> -
    -
    - - - $value ) { - $v->$key = $value; - } - if ( $v->save() ) { - echo '{success:true, venue:' . $v->toJSON() . '}'; - } else { - echo '{success:false}'; - } - break; - case 'map': - //$v = new venue($_GET['id']); - case 'getRow': - $v = new venue($_POST['id']); - ?> - - id; ?> - name; ?> - city . (!empty($v->state) ? ', ' . $v->state : '') ?> - phone ?> - email) ? '' . $v->email . '' : '' ?> - -
    - <?php _e('Edit', $gcd) ?> - <?php _e('Map', $gcd) ?> - link) ) : ?> - <?php _e('Homepage', $gcd) ?> - - <?php _e('Delete', $gcd) ?> -
    - - - "> - - - - delete(); - echo '{"success": ' . ($result ? 'true' : 'false') . ',"action":"delete"' . ($result ? '' : ',"error":"db"') . '}'; - break; - - case 'edit': - $v = new venue($_POST['id']); - ?> -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    - -
    -
    - - - - - -
    -
    - - - $value ) { - $v->$key = $value; - } - if ( $v->save() ) { - echo '{success:true, venue:' . $v->toJSON() . '}'; - } else { - echo '{success:false}'; - } - break; -} - - diff -r 6b96085291d7 -r fb7cd02b9848 web/wp-content/plugins/gigs-calendar/version.php --- a/web/wp-content/plugins/gigs-calendar/version.php Tue Jan 05 09:48:24 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -