Example #1
1
END:VEVENT

<?php 
        }
    }
    ?>
END:VCALENDAR
<?php 
    //Collect output and echo
    $eventsical = ob_get_contents();
    ob_end_clean();
    echo $eventsical;
    exit;
}
add_feed('avignon-activities', 'avignon_activities_ical');
function activities_feed_query($query)
{
    $today = date('Ymd');
    if ($query->is_feed('avignon-activities')) {
        $query->set('post_type', 'activities');
        $query->set('posts_per_page', -1);
        $query->set('meta_key', 'date2');
        $query->set('orderby', 'meta_value_num');
        $query->set('order', 'ASC');
        //$query->set('meta_compare', '>=');
        //$query->set('meta_value', $today);
    }
}
add_action('pre_get_posts', 'activities_feed_query');
// Update feeds all 600 seconds (about 10 minutes)
/**
 * Adds the custom feed, as specified by the user in the general settings.
 * 
 * @since 3.3
 */
function wprss_addfeed_add_feed()
{
    $general_settings = get_option('wprss_settings_general', 'wprss');
    if (!empty($general_settings) && isset($general_settings['custom_feed_url']) && !empty($general_settings['custom_feed_url'])) {
        $url = $general_settings['custom_feed_url'];
    } else {
        $url = $general_settings['custom_feed_url'] = 'wprss';
        update_option('wprss_settings_general', $general_settings);
    }
    // Add the feed
    add_feed($url, 'wprss_addfeed_do_feed');
    // Whether or not the feed is already registered or not
    $registered = FALSE;
    // Get all registered rewrite rules
    $rules = get_option('rewrite_rules');
    // If no rules exist, then it is not registered
    if (!is_array($rules)) {
        $registered = FALSE;
    } else {
        // Get all the array keys that match the given pattern
        // The resulting array will only contain the second part of each matching key ( $matches[1] )
        $feeds = array_keys($rules, 'index.php?&feed=$matches[1]');
        // Check if the rewrite rule for the custom feed is already registered
        foreach ($feeds as $feed) {
            if (strpos($feed, $url) !== FALSE) {
                $registered = TRUE;
            }
        }
    }
    // If not registered, flush the rewrite rules
    if (!$registered) {
        flush_rewrite_rules();
    }
}
Example #3
0
 public function add_eventlist_feed()
 {
     global $wp_rewrite;
     add_feed('eventlist', array(&$this, 'print_eventlist_feed'));
     add_action('generate_rewrite_rules', array(&$this, 'eventlist_feed_rewrite'));
     $wp_rewrite->flush_rules();
 }
Example #4
0
 public function init()
 {
     add_feed($this->options->get('el_feed_name'), array(&$this, 'print_eventlist_feed'));
     if ($this->options->get('el_head_feed_link')) {
         add_action('wp_head', array(&$this, 'print_head_feed_link'));
     }
 }
Example #5
0
 function init()
 {
     // Load language pack
     load_theme_textdomain('p2', get_template_directory() . '/languages');
     // Set up the AJAX read handler
     add_feed('p2.ajax', array($this, 'ajax_read'));
 }
Example #6
0
function rssmi_rss()
{
    $feed_options = get_option('rss_feed_options', 'option not found');
    if (!empty($feed_options) && isset($feed_options['feedslug'])) {
        add_feed($feed_options['feedslug'], 'rssmi_feed');
    }
}
 public static function load()
 {
     if (is_network_admin()) {
         self::$is_network_feed = true;
     }
     if (!is_admin()) {
         $feed_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
         if (self::FEED_NETWORK_QUERY_VAR === basename($feed_path)) {
             self::$is_network_feed = true;
         }
     }
     if (!self::$is_network_feed) {
         if (!isset(WP_Stream_Settings::$options['general_private_feeds']) || !WP_Stream_Settings::$options['general_private_feeds']) {
             return;
         }
     }
     add_action('show_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('show_user_profile', array(__CLASS__, 'user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'user_feed_key'));
     // Generate new Stream Feed Key
     add_action('wp_ajax_wp_stream_feed_key_generate', array(__CLASS__, 'generate_user_feed_key'));
     add_feed(self::FEED_QUERY_VAR, array(__CLASS__, 'feed_template'));
     add_feed(self::FEED_NETWORK_QUERY_VAR, array(__CLASS__, 'feed_template'));
 }
function eventorganiser_public_export()
{
    $eo_settings = get_option('eventorganiser_options');
    if (!empty($eo_settings['feed'])) {
        add_feed('eo-events', array('Event_Organiser_Im_Export', 'get_object'));
    }
}
Example #9
0
function bfox_plans_create_post_type()
{
    //TODO: add plans directory template archive - see: http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/
    register_post_type('bfox_plan', array('description' => __('Bible Reading Plans', 'bfox'), 'labels' => array('name' => __('Reading Plans', 'bfox'), 'singular_name' => __('Reading Plan', 'bfox'), 'edit_item' => __('Edit Reading Plan', 'bfox'), 'new_item' => __('New Reading Plan', 'bfox'), 'view_item' => __('View Reading Plan', 'bfox'), 'parent_item_colon' => __('Parent Plan:', 'bfox')), 'public' => true, 'rewrite' => array('slug' => 'reading-plans'), 'hierarchical' => true, 'supports' => array('title', 'excerpt', 'revisions', 'thumbnail'), 'register_meta_box_cb' => 'bfox_plans_register_meta_box_cb'));
    add_feed('readings-rss', 'bfox_plan_do_feed_readings');
    add_feed('readings-ical', 'bfox_plan_do_feed_readings');
}
Example #10
0
 function request_feed()
 {
     global $wp_rewrite;
     add_feed('feedforward', array($this, 'all_feed_assembler'));
     # Called because stated requirement at http://codex.wordpress.org/Rewrite_API/add_feed
     # Called as per http://codex.wordpress.org/Rewrite_API/flush_rules
     #$wp_rewrite->flush_rules(false);
 }
Example #11
0
function bgnp_init_rss_feeds()
{
    // Get option to be used as section-based Editors’ Picks RSS feed slug
    $bgnp_sec_feed_cat = get_option('bgnp_sec_feed_cat');
    //initialize the homepage and section-based news feeds
    add_feed('editors-picks', 'bgnp_do_rss_feed');
    add_feed('editors-picks-' . $bgnp_sec_feed_cat, 'bgnp_do_sec_feed');
}
Example #12
0
function my_calendar_add_feed()
{
    global $wp_rewrite, $wpdb;
    $mcdb = $wpdb;
    add_feed('my-calendar-rss', 'my_calendar_rss');
    add_feed('my-calendar-ics', 'my_calendar_ical');
    add_feed('my-calendar-print', 'my_calendar_print');
}
 function init_diamondPF()
 {
     $address = get_option('diamond_feed_address');
     if (!$address || $address == '') {
         $address = 'networkrss';
     }
     add_feed('networkrss', array($this, 'diamond_post_create_feed'));
 }
 public function add_podcast_feeds()
 {
     add_feed('pod', array($this, 'do_podcast_feed'));
     $extensions = $this->model->get_file_extensions();
     foreach ($extensions as $mime => $ext) {
         add_feed($ext, array($this, 'do_podcast_feed'));
     }
 }
Example #15
0
 /**
  * Initialise WP Geo feeds
  */
 function init()
 {
     // Add GeoRSS Feed Type
     add_feed('georss', array('WPGeo_Feeds', 'add_feed_georss'));
     add_filter('feed_content_type', array($this, 'feed_content_type'), 100);
     add_filter('post_limits', array($this, 'post_limits'));
     $this->add_feed_hooks();
 }
 /**
  * init function
  */
 public static function init()
 {
     add_action('wp_head', array('SimpleFoafPlugin', 'add_header'));
     add_filter('host_meta', array('SimpleFoafPlugin', 'add_host_meta_links'));
     add_filter('webfinger_user_data', array('SimpleFoafPlugin', 'add_webfinger_links'), 10, 3);
     // add 'foaf' as feed
     add_action('do_feed_foaf', array('SimpleFoafPlugin', 'do_feed_foaf'));
     add_feed('foaf', array('SimpleFoafPlugin', 'do_feed_foaf'));
 }
Example #17
0
 /**
  * Add new feed to NXTClass
  * @global <type> $nxt_rewrite
  */
 function add_feed()
 {
     if (function_exists('load_plugin_textdomain')) {
         $plugin_dir = basename(dirname(__FILE__));
         load_plugin_textdomain('nxtclass_wiki', '', $plugin_dir);
     }
     add_feed('wiki', array($this, 'create_feed'));
     add_action('generate_rewrite_rules', array($this, 'feed_rewrite_rules'));
 }
Example #18
0
 public static function init_rss_most_popular()
 {
     add_feed('most_popular', 'rss_most_popular');
     add_feed('most_popular_luxury', 'rss_most_popular_luxury');
     add_feed('most_popular_timberland', 'rss_most_popular_timberland');
     add_feed('most_popular_consulting', 'rss_most_popular_consulting');
     global $wp_rewrite;
     $wp_rewrite->flush_rules();
 }
Example #19
0
 /**
  * Constructor for the feeds class - defines all preset feeds.
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     $data = array('calendar' => array('ical' => array('apple' => array('name' => __('Apple Calendar', 'prosports'), 'protocol' => 'webcal'), 'outlook' => array('name' => __('Outlook', 'prosports'), 'protocol' => 'webcal'), 'google' => array('name' => __('Google', 'prosports'), 'prefix' => 'http://www.google.com/calendar/render?cid='))));
     $this->data = apply_filters('prosports_feeds', $data);
     foreach ($data as $post_type => $feeds) {
         foreach ($feeds as $slug => $formats) {
             add_feed('sp-' . $slug, array($this, $slug . '_feed'));
         }
     }
 }
Example #20
0
 /**
  * Callback for feeds.add
  */
 public static function feeds_add($url, $name = '')
 {
     /** We need some sort of value here 
     		if( !isset($params['name']) )
     			$params['name'] = '';
     
     		if(empty($params['url']))
     			throw new Exception( _r('No URL specified'), Errors::get_code('admin.feeds.no_url') );*/
     $result = add_feed($url, htmlspecialchars($name));
     clear_html_cache();
     return array('success' => 1, 'msg' => $result);
 }
 public static function load()
 {
     if (!isset(WP_Stream_Settings::$options['general_private_feeds']) || !WP_Stream_Settings::$options['general_private_feeds']) {
         return;
     }
     add_action('show_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('show_user_profile', array(__CLASS__, 'user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'user_feed_key'));
     // Generate new Stream Feed Key
     add_action('wp_ajax_wp_stream_feed_key_generate', array(__CLASS__, 'generate_user_feed_key'));
     add_feed(self::FEED_QUERY_VAR, array(__CLASS__, 'feed_template'));
 }
Example #22
0
 function addCustomPodcastRSS()
 {
     add_feed('listen', 'bvtPodcast');
     add_feed('ios', 'bvtiOS');
     function bvtPodcast()
     {
         require_once plugin_dir_path(__FILE__) . '/templates/podcast/rss-itunes.php';
     }
     function bvtiOS()
     {
         require_once plugin_dir_path(__FILE__) . '/templates/podcast/iosSlider.php';
     }
 }
 /**
  * register_post_types function.
  *
  * @access public
  * @return void
  */
 public function register_post_types()
 {
     if (post_type_exists("job_listing")) {
         return;
     }
     $admin_capability = 'manage_job_listings';
     /**
      * Taxonomies
      */
     if (get_option('job_manager_enable_categories')) {
         $singular = __('Job Category', 'wp-job-manager');
         $plural = __('Job Categories', 'wp-job-manager');
         if (current_theme_supports('job-manager-templates')) {
             $rewrite = array('slug' => _x('job-category', 'Job category slug - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'hierarchical' => false);
         } else {
             $rewrite = false;
         }
         register_taxonomy("job_listing_category", array("job_listing"), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => $plural, 'labels' => array('name' => $plural, 'singular_name' => $singular, 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'parent_item' => sprintf(__('Parent %s', 'wp-job-manager'), $singular), 'parent_item_colon' => sprintf(__('Parent %s:', 'wp-job-manager'), $singular), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'update_item' => sprintf(__('Update %s', 'wp-job-manager'), $singular), 'add_new_item' => sprintf(__('Add New %s', 'wp-job-manager'), $singular), 'new_item_name' => sprintf(__('New %s Name', 'wp-job-manager'), $singular)), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => $admin_capability, 'edit_terms' => $admin_capability, 'delete_terms' => $admin_capability, 'assign_terms' => $admin_capability), 'rewrite' => $rewrite));
     }
     $singular = __('Job Type', 'wp-job-manager');
     $plural = __('Job Types', 'wp-job-manager');
     if (current_theme_supports('job-manager-templates')) {
         $rewrite = array('slug' => _x('job-type', 'Job type slug - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'hierarchical' => false);
     } else {
         $rewrite = false;
     }
     register_taxonomy("job_listing_type", array("job_listing"), array('hierarchical' => true, 'label' => $plural, 'labels' => array('name' => $plural, 'singular_name' => $singular, 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'parent_item' => sprintf(__('Parent %s', 'wp-job-manager'), $singular), 'parent_item_colon' => sprintf(__('Parent %s:', 'wp-job-manager'), $singular), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'update_item' => sprintf(__('Update %s', 'wp-job-manager'), $singular), 'add_new_item' => sprintf(__('Add New %s', 'wp-job-manager'), $singular), 'new_item_name' => sprintf(__('New %s Name', 'wp-job-manager'), $singular)), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => $admin_capability, 'edit_terms' => $admin_capability, 'delete_terms' => $admin_capability, 'assign_terms' => $admin_capability), 'rewrite' => $rewrite));
     /**
      * Post types
      */
     $singular = __('Job Listing', 'wp-job-manager');
     $plural = __('Job Listings', 'wp-job-manager');
     if (current_theme_supports('job-manager-templates')) {
         $has_archive = _x('jobs', 'Post type archive slug - resave permalinks after changing this', 'wp-job-manager');
     } else {
         $has_archive = false;
     }
     $rewrite = array('slug' => _x('job', 'Job permalink - resave permalinks after changing this', 'wp-job-manager'), 'with_front' => false, 'feeds' => true, 'pages' => false);
     register_post_type("job_listing", apply_filters("register_post_type_job_listing", array('labels' => array('name' => $plural, 'singular_name' => $singular, 'menu_name' => $plural, 'all_items' => sprintf(__('All %s', 'wp-job-manager'), $plural), 'add_new' => __('Add New', 'wp-job-manager'), 'add_new_item' => sprintf(__('Add %s', 'wp-job-manager'), $singular), 'edit' => __('Edit', 'wp-job-manager'), 'edit_item' => sprintf(__('Edit %s', 'wp-job-manager'), $singular), 'new_item' => sprintf(__('New %s', 'wp-job-manager'), $singular), 'view' => sprintf(__('View %s', 'wp-job-manager'), $singular), 'view_item' => sprintf(__('View %s', 'wp-job-manager'), $singular), 'search_items' => sprintf(__('Search %s', 'wp-job-manager'), $plural), 'not_found' => sprintf(__('No %s found', 'wp-job-manager'), $plural), 'not_found_in_trash' => sprintf(__('No %s found in trash', 'wp-job-manager'), $plural), 'parent' => sprintf(__('Parent %s', 'wp-job-manager'), $singular)), 'description' => __('This is where you can create and manage job listings.', 'wp-job-manager'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'capabilities' => array('publish_posts' => $admin_capability, 'edit_posts' => $admin_capability, 'edit_others_posts' => $admin_capability, 'delete_posts' => $admin_capability, 'delete_others_posts' => $admin_capability, 'read_private_posts' => $admin_capability, 'edit_post' => $admin_capability, 'delete_post' => $admin_capability, 'read_post' => 'read_job_listing'), 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => $rewrite, 'query_var' => true, 'supports' => array('title', 'editor', 'custom-fields'), 'has_archive' => $has_archive, 'show_in_nav_menus' => false)));
     /**
      * Feeds
      */
     add_feed('job_feed', array($this, 'job_feed'));
     /**
      * Post status
      */
     register_post_status('expired', array('label' => _x('Expired', 'job_listing', 'wp-job-manager'), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop('Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>', 'wp-job-manager')));
     register_post_status('preview', array('public' => false, 'exclude_from_search' => true, 'show_in_admin_all_list' => false, 'show_in_admin_status_list' => false));
 }
function act_init_process()
{
    global $act_plugin_version, $options_act;
    if ($options_act['act_version'] != $act_plugin_version) {
        act_install();
    }
    if ($options_act['act_feed_display']) {
        require_once WP_PLUGIN_DIR . '/' . ACT_DIR . '/wp-activity-feed.php';
        add_feed('act-feed', 'act_feed');
    }
    if (isset($_POST['act_export'])) {
        require_once WP_PLUGIN_DIR . '/' . ACT_DIR . '/wp-act-export.php';
        act_export();
    }
}
/**
 * Universal Feed Registrar 
 * replaces old feed if existent
 * modifies rewrite rules accordingly
 * NOTE uses just-in-time initialization
 * @param   string
 * @param   array           custom options
 */
function tAddFeed($feedName, $args = array())
{
    global $wp_rewrite;
    global $tFeeds;
    if (!$tFeeds) {
        $tFeeds = array();
    }
    if (empty($feedName)) {
        $feedName = get_default_feed();
    }
    # rss2
    $tFeeds[$feedName] = $args;
    add_feed($feedName, 'tLoadFeed');
    # hook onto do_feed action
    add_action('generate_rewrite_rules', 'tFeedRewriteRules');
    $wp_rewrite->flush_rules();
}
 /**
  * Actions and filters to hook in after init
  **/
 function init()
 {
     # Add the podcasting feed type
     add_feed('podcast', array($this, 'do_feed_podcast'));
     # Add the podcast feed
     add_filter('query_vars', array($this, 'queryVars'));
     add_filter('posts_join', array($this, 'feedJoin'));
     add_filter('posts_where', array($this, 'feedWhere'));
     add_filter('posts_groupby', array($this, 'feedGroupby'));
     add_action('wp_head', array($this, 'addFeedDiscovery'));
     add_action('template_redirect', array($this, 'preventFeedburner'), -10);
     # Add podcasting information to feeds
     add_action('rss2_ns', array($this, 'addItunesXML'));
     add_filter('option_blogname', array($this, 'blognameFilter'));
     add_filter('option_blogdescription', array($this, 'blogdescriptionFilter'));
     add_action('rss2_head', array($this, 'addItunesFeed'));
     add_filter('rss_enclosure', array($this, 'removeEnclosures'));
     add_action('rss2_item', array($this, 'addItunesItem'));
 }
Example #27
0
/**
 * Register custom RSS template.
 */
function my_rss_template()
{
    add_feed('karen', 'my_custom_rss_render');
}
Example #28
0
function feed_add($icon, $title_template='', $title_data=array(), $body_template='', $body_data=array(), $body_general='', $images=array(), $image_links=array(), $target_ids='', $friend='', $appid=UC_APPID, $returnid=0) {
	$arg = array(
		'type' => 'manyou',
		'appid' => $icon,
		'uid' => $GLOBALS['discuz_uid'],
		'username' => addslashes($GLOBALS['discuz_user'])
	);
	$image = array();
	foreach($images as $k => $v) {
		if($v) {
			$image[] = array('src' => $v, 'link' => $image_links[$k]);
		}
	}
	$title_data = is_array($title_data) ? $title_data : array();
	$body_data = is_array($body_data) ? $body_data : array();
	$title_data['actor'] = '<a href="space.php?uid='.$GLOBALS['discuz_uid'].'">'.$GLOBALS['discuz_user'].'</a>{addbuddy}';
	$body_data['actor'] = '<a href="space.php?uid='.$GLOBALS['discuz_uid'].'">'.$GLOBALS['discuz_user'].'</a>{addbuddy}';
	$data = array(
		'title' => sstripslashes($title_data),
		'body' => sstripslashes($body_data),
		'image' => $image
	);
	$template = array(
		'title' => sstripslashes($title_template),
		'body' => sstripslashes($body_template.chr(0).chr(0).chr(0).$body_general)
	);
	add_feed($arg, $data, $template);
	return 1;
}
Example #29
0
 function links_rss()
 {
     add_feed('linklibraryfeed', 'link_library_generate_rss_feed');
 }
function wpdev_custom_rss_feed()
{
    add_feed('popular', 'wpdev_custom_rss_temp');
}