getAdminOptions(); } /*-------------------------------------------------------------------- Administrative Functions --------------------------------------------------------------------*/ // Option loader function function getAdminOptions() { // Set default values for the options $adminKeyOpt = ""; $adminCalFeedsOpt = "http://www.google.com/calendar/feeds/i8m14fqigtkhpj744qml1vht920bq5j0%40import.calendar.google.com/public/full"; $adminPageMaxEntriesOpt = 15; $adminWikiOpt = "true"; $adminShowNav = "true"; $adminOptions = array($this->adminKeyOptName => $adminKeyOpt, $this->adminCalFeedsOptName => $adminCalFeedsOpt, $this->adminPageMaxEntriesOptName => $adminPageMaxEntriesOpt, $this->adminWikiOptName => $adminWikiOpt, $this->adminShowNavName => $adminShowNav); // Get values from the WP options table in the database, re-assign if found $dbOptions = get_option($this->adminOptionsName); if (!empty($dbOptions)) { foreach ($dbOptions as $key => $option) $adminOptions[$key] = $option; } // Update the options for the panel update_option($this->adminOptionsName, $adminOptions); return $adminOptions; } // Print the admin page for the plugin function printAdminPage() { // Get the admin options $adminOptions = $this->getAdminOptions(); if (isset($_POST['update_wpngCalendarSettings'])) { if (isset($_POST['wpngAPIKey'])) { $adminOptions[$this->adminKeyOptName] = $_POST['wpngAPIKey']; } if (isset($_POST['wpngCalFeeds'])) { $adminOptions[$this->adminCalFeedsOptName] = $_POST['wpngCalFeeds']; } if (isset($_POST['wpngPageMax'])) { $adminOptions[$this->adminPageMaxEntriesOptName] = $_POST['wpngPageMax']; } if (isset($_POST['wpngShowWiki'])) { $adminOptions[$this->adminWikiOptName] = $_POST['wpngShowWiki']; } if (isset($_POST['wpngShowNav'])) { $adminOptions[$this->adminShowNavName] = $_POST['wpngShowNav']; } update_option($this->adminOptionsName, $adminOptions); // update settings notification below ?>

">

Wordpress Austin Tech Events Calendar Plugin

Google GDATA API Key

You can get a Google GDATA API key here

Google Calendar Feed

The feed must be a public feed viewable by anyone; be sure to use the address for the full feed, not basic

Maximum # of Entries To Show On A Page

Process Calendar Description As Wiki Markup

    

Show Navigation Links On The Page

    

getAdminOptions(); ?> '; // Add the Wiky converter file wp_enqueue_script('wiky-js', get_bloginfo('wpurl') . '/wp-content/plugins/austin-tech-events-calendar/js/wiky.js', null, '1.0'); // Add the plugin's JS file wp_enqueue_script('wpng-calendar', get_bloginfo('wpurl') . '/wp-content/plugins/austin-tech-events-calendar/js/functions.js', array('date-js'), '0.85'); // Add the plugin's CSS file echo ''; } // Add the display settings to the header function addWPNGSettings() { $adminOptions = $this->getAdminOptions(); ?> showCalendar); if ($custFieldValues != NULL) { $weeks = $custFieldValues[0]; $content = $this->displayPageCalendar($weeks); } } return $content; } // Display the calendar in a Page function displayPageCalendar($weeks) { // Get the feed URL from the options $adminOptions = $this->getAdminOptions(); // Set the default for number of weeks to query if none (or invalid) if (($weeks == null) or (!is_numeric($weeks))) { $weeks = 4; } ?>
loading...
5, 'wpng_cal_widget_title' => 'Austin Tech Events'); } ?>
loading...
5, 'wpng_cal_widget_title' => 'Austin Tech Events'); } if($_POST['updateWPNGWidgetSettings']) { $options = array('wpng_cal_widget_list_size' => $_POST['evnt_cnt'], 'wpng_cal_widget_title' => $_POST['evnt_list_title']); update_option('wpng_cal_widget_options', $options); } echo '

Sidebar title:

'; echo '

Number of events to show:

'; echo ''; } register_sidebar_widget('Austin Tech Events','widgetWPNGCalendar'); register_widget_control('Austin Tech Events','widgetWPNGCalendarOptions', 200, 200); } } } // Instantiate the class if (class_exists("WPNGCalendar")) { $dl_pluginWPNGCal = new WPNGCalendar(); } // Initialize the admin panel if the plugin has been activated if (!function_exists("WPNGCalendar_ap")) { function WPNGCalendar_ap() { global $dl_pluginWPNGCal; if (!isset($dl_pluginWPNGCal)) { return; } if (function_exists('add_options_page')) { add_options_page('Austin Tech Events', 'Austin Tech Events', 9, basename(__FILE__), array(&$dl_pluginWPNGCal, 'printAdminPage')); } } } // Actions and filters if (isset($dl_pluginWPNGCal)) { /*-------------------------------------------------------------------- Actions --------------------------------------------------------------------*/ // Add the admin menu add_action('admin_menu', 'WPNGCalendar_ap'); // Initialize options on plugin activation add_action("activate_austin-tech-events-calendar/austin-tech-events.php", array(&$dl_pluginWPNGCal, 'init')); // Add plugin needs to the header of each page add_action('wp_head', array(&$dl_pluginWPNGCal, 'addJSAPIHeader'), 1); add_action('wp_head', array(&$dl_pluginWPNGCal, 'addWPNGSettings'), 1); add_action('wp_head', array(&$dl_pluginWPNGCal, 'addWPNGHeader'), 1); add_action('wp_head', array(&$dl_pluginWPNGCal, 'addOnLoadScript'), 1); // Add the widget add_action('plugins_loaded', array(&$dl_pluginWPNGCal, 'widgetWPNGCalendarInit'), 1); /*-------------------------------------------------------------------- Filters --------------------------------------------------------------------*/ // Filter to display the calendar in a page add_filter('the_content', array(&$dl_pluginWPNGCal, 'placePageCalendar'), '7'); } ?>