/* Plugin Name: FeedBurner FeedSmith Plugin URI: http://www.feedburner.com/fb/a/help/wordpress_quickstart Description: Originally authored by Steve Smith, this plugin detects all ways to access your original WordPress feeds and redirects them to your FeedBurner feed so you can track every possible subscriber. Author: FeedBurner Author URI: http://www.feedburner.com Version: 2.3.1 */ $data = array( 'feedburner_url' => '', 'feedburner_comments_url' => '' ); $ol_flash = ''; function ol_is_authorized() { global $user_level; if (function_exists("current_user_can")) { return current_user_can('activate_plugins'); } else { return $user_level > 5; } } add_option('feedburner_settings',$data,'FeedBurner Feed Replacement Options'); $feedburner_settings = get_option('feedburner_settings'); function fb_is_hash_valid($form_hash) { $ret = false; $saved_hash = fb_retrieve_hash(); if ($form_hash === $saved_hash) { $ret = true; } return $ret; } function fb_generate_hash() { return md5(uniqid(rand(), TRUE)); } function fb_store_hash($generated_hash) { return update_option('feedsmith_token',$generated_hash,'FeedSmith Security Hash'); } function fb_retrieve_hash() { $ret = get_option('feedsmith_token'); return $ret; } function ol_add_feedburner_options_page() { if (function_exists('add_options_page')) { add_options_page('FeedBurner', 'FeedBurner', 8, basename(__FILE__), 'ol_feedburner_options_subpanel'); } } function ol_feedburner_options_subpanel() { global $ol_flash, $feedburner_settings, $_POST, $wp_rewrite; if (ol_is_authorized()) { // Easiest test to see if we have been submitted to if(isset($_POST['feedburner_url']) || isset($_POST['feedburner_comments_url'])) { // Now we check the hash, to make sure we are not getting CSRF if(fb_is_hash_valid($_POST['token'])) { if (isset($_POST['feedburner_url'])) { $feedburner_settings['feedburner_url'] = $_POST['feedburner_url']; update_option('feedburner_settings',$feedburner_settings); $ol_flash = "Your settings have been saved."; } if (isset($_POST['feedburner_comments_url'])) { $feedburner_settings['feedburner_comments_url'] = $_POST['feedburner_comments_url']; update_option('feedburner_settings',$feedburner_settings); $ol_flash = "Your settings have been saved."; } } else { // Invalid form hash, possible CSRF attempt $ol_flash = "Security hash missing."; } // endif fb_is_hash_valid } // endif isset(feedburner_url) } else { $ol_flash = "You don't have enough access rights."; } if ($ol_flash != '') echo '

' . $ol_flash . '

'; if (ol_is_authorized()) { $temp_hash = fb_generate_hash(); fb_store_hash($temp_hash); echo '
'; echo '

Set Up Your FeedBurner Feed

'; echo '

This plugin makes it easy to redirect 100% of traffic for your feeds to a FeedBurner feed you have created. FeedBurner can then track all of your feed subscriber traffic and usage and apply a variety of features you choose to improve and enhance your original WordPress feed.

  1. To get started, create a FeedBurner feed for ' . get_bloginfo('name') . '. This feed will handle all traffic for your posts.
  2. Once you have created your FeedBurner feed, enter its address into the field below (http://feeds.feedburner.com/yourfeed):
  3. Optional: If you also want to handle your WordPress comments feed using FeedBurner, create a FeedBurner comments feed and then enter its address below:

'; echo '
'; } else { echo '

Sorry, you are not allowed to access this page.

'; } } function ol_feed_redirect() { global $wp, $feedburner_settings, $feed, $withcomments; if (is_feed() && $feed != 'comments-rss2' && !is_single() && $wp->query_vars['category_name'] == '' && ($withcomments != 1) && trim($feedburner_settings['feedburner_url']) != '') { if (function_exists('status_header')) status_header( 302 ); header("Location:" . trim($feedburner_settings['feedburner_url'])); header("HTTP/1.1 302 Temporary Redirect"); exit(); } elseif (is_feed() && ($feed == 'comments-rss2' || $withcomments == 1) && trim($feedburner_settings['feedburner_comments_url']) != '') { if (function_exists('status_header')) status_header( 302 ); header("Location:" . trim($feedburner_settings['feedburner_comments_url'])); header("HTTP/1.1 302 Temporary Redirect"); exit(); } } function ol_check_url() { global $feedburner_settings; switch (basename($_SERVER['PHP_SELF'])) { case 'wp-rss.php': case 'wp-rss2.php': case 'wp-atom.php': case 'wp-rdf.php': if (trim($feedburner_settings['feedburner_url']) != '') { if (function_exists('status_header')) status_header( 302 ); header("Location:" . trim($feedburner_settings['feedburner_url'])); header("HTTP/1.1 302 Temporary Redirect"); exit(); } break; case 'wp-commentsrss2.php': if (trim($feedburner_settings['feedburner_comments_url']) != '') { if (function_exists('status_header')) status_header( 302 ); header("Location:" . trim($feedburner_settings['feedburner_comments_url'])); header("HTTP/1.1 302 Temporary Redirect"); exit(); } break; } } if (!preg_match("/feedburner|feedvalidator/i", $_SERVER['HTTP_USER_AGENT'])) { add_action('template_redirect', 'ol_feed_redirect'); add_action('init','ol_check_url'); } add_action('admin_menu', 'ol_add_feedburner_options_page'); ?> /* Plugin Name: Ultimate Tag Warrior Plugin URI: http://www.neato.co.nz/manyfaces/wordpress-plugins/ultimate-tag-warrior/ Description: Add tags to wordpress. Tags and tag/post associations are seperated out for great justice. And when I say great justice, I mean doing more with tags than just listing them. This is, the ultimate tag warrior. Version: 1.3 Legacy Author: Christine Davis Author URI: http://www.neato.co.nz */ $path = ini_get('include_path'); if (!(substr($path, strlen( $path ) - strlen(PATH_SEPARATOR)) === PATH_SEPARATOR)) { $path .= PATH_SEPARATOR; } $path .= $_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/UltimateTagWarrior"; ini_set("include_path", $path); include_once('ultimate-tag-warrior-core.php'); include_once('ultimate-tag-warrior-actions.php'); $utw = new UltimateTagWarriorCore(); $deliciousAPIURL = "http://del.icio.us/api/"; /* ultimate_show_popular_tags Creates a list of the most popular tags. Intended for sidebar use. The format of the tags is:
  • {tagname} ({count})
  • */ function ultimate_show_popular_tags($limit = 10) { global $utw; $utw->ShowPopularTags($limit, "
  • %taglink% (%tagcount%)
  • "); } /* ultimate_show_post_tags Displays a list of tags associated with the current post. $seperator goes between each tag (but not at the beginning or the end of the list) $baseurl is the base url for the text link $notagmessage is what will display if there are no tags for the post. */ function ultimate_show_post_tags($separator=" ", $baseurl='/tag/', $notagmessage = "", $morelinks="") { global $post, $utw; $id = $post->postid; if(empty($id)) { $id = $post->ID; } $baseformat = "%taglink%"; if ($baseurl != '/tag/') { $baseformat = "%tagdisplay%"; } if ($morelinks) { if (is_array($morelinks)) { foreach($morelinks as $link) { $baseformat .= " » "; } } else { $baseformat .= " » "; } } $format = Array(); $format["default"] = $baseformat . $separator; $format["last"] = $baseformat; $format["none"] = $notagmessage; $utw->ShowTagsForPost($id, $format); } /* ultimate_tag_archive You may remember my plugin Category Archive. This is a tag archive in the same style. Displays a list of the top x most popular tags, with the top y most recent posts for that tag. If there are more posts, there is also a link to the tag page for that tag. $limit the maximum number of tags to display $postlimit the maximum number of posts to display for each tag */ function ultimate_tag_archive($limit = 20, $postlimit=20) { global $wpdb, $tabletags, $tablepost2tag, $lzndomain; $baseurl = get_option('utw_base_url'); $q = "select t.tag, count(t.tag) as count from $tabletags t inner join $tablepost2tag p2t on p2t.tag_id = t.id group by tag having count > 0 order by count desc limit $limit"; $tags = $wpdb->get_results($q); if ($tags) { foreach($tags as $tag) { $out .= "
    "; $out .= "
    " . $tag->tag . " - " . $tag->count . "
    "; $q = "select p.ID, p.post_title from $tabletags t inner join $tablepost2tag p2t on p2t.tag_id = t.id inner join $wpdb->posts p on p2t.post_id = p.ID and t.tag='$tag->tag' limit $postlimit"; $posts = $wpdb->get_results($q); $out .= "
    "; if ($posts) { foreach ($posts as $post) { $out .= "ID) . "\">$post->post_title, "; } if (count($posts) == $postlimit) { $out .= "tag\">" . __("More from", $lzndomain) . " $tag->tag..."; } else { // trim trailing comma $out = substr($out, 0, -2); } } $out .= "
    "; $out .= "
    "; } } else { $out = __("No Tags", $lzndomain); } echo $out; } /* ultimate_tag_cloud Creates a tag cloud, which can be styled in CSS. */ function ultimate_tag_cloud($order='tag', $direction='asc') { global $wpdb, $tablepost2tag, $utw; $q = "SELECT count(*) FROM $tablepost2tag"; $totalTags = $wpdb->get_var($q); $tags = $utw->GetPopularTags(-1,$order, $direction); // The average number of times a tag appears on each post. $average = (count($tags) / $totalTags); $baseurl = get_option('utw_base_url'); $siteurl = get_option('home'); foreach($tags as $tag) { if ($tag->count > $average * 20) { $tagclass = "taglevel1"; } else if ($tag->count > $average * 10) { $tagclass = "taglevel2"; } else if ($tag->count > $average * 6) { $tagclass = "taglevel3"; } else if ($tag->count > $average * 4) { $tagclass = "taglevel4"; } else if ($tag->count > $average * 2) { $tagclass = "taglevel5"; } else if ($tag->count > $average) { $tagclass = "taglevel6"; } else if ($tag->count <= $average) { $tagclass = "taglevel7"; } $tag_name = strtolower($tag->tag); $tag_display = str_replace('_',' ', $tag->tag); $tag_display = str_replace('-',' ',$tag_display); echo "count)\">$tag_display "; } } /* ultimate_show_related_tags($pre="
  • ", $post="
  • ") Display a list of tags that are related to the current tag set. $pre and $post are the prefix and suffix for each tag. I can't do subselects on the mySQL version I'm developing on; so this is done the two-query way. I figure it's probably better to do it this way for anyone else who is running older mySQL. */ function ultimate_show_related_tags($pre = "
  • ", $post = "
  • ", $notags="None") { global $wpdb, $table_prefix, $posts, $table_prefix, $id, $utw; $tabletags = $table_prefix . 'tags'; $tablepost2tag = $table_prefix . "post2tag"; $tags = get_query_var("tag"); $tagset = explode(" ", $tags); $taglist = "'" . $tagset[0] . "'"; $tagcount = count($tagset); if ($tagcount > 1) { for ($i = 1; $i <= $tagcount; $i++) { if ($tagset[$i] <> "") { $taglist = $taglist . ", '" . $tagset[$i] . "'"; } } } $baseurl = get_option('utw_base_url'); foreach($tagset as $tag) { $baseurl .= $tag . "+"; } $siteurl = get_option("home"); $tags = $utw->GetRelatedTags($utw->GetTagsForTagString($taglist)); $format = array ("default"=> $pre . "+ %taglink% (%tagcount%)" . $post); echo $utw->FormatTags($tags, $format); } function ultimate_delicious_link() { global $post, $deliciousAPIURL, $wpdb, $table_prefix; $tabletags = $table_prefix . 'tags'; $tablepost2tag = $table_prefix . "post2tag"; if (is_numeric($post->ID)) { $q = <<ID order by tag asc SQL; $tags = $wpdb->get_results($q); if ($tags) { foreach($tags as $tag) { $taglist .= $tag->tag . " "; } echo "Post to del.icio.us"; } else { echo "ID)) . "&title=" . urlencode($post->post_title) . "\">Post to del.icio.us"; } } } ?>/* Plugin Name: Ultimate Tag Warrior: Tag Archive Plugin URI: http://www.neato.co.nz/ultimate-tag-warrior/ Description: Renders an archive view, based on tags. Depends on Ultimate Tag Warrior 2.5.1+ Version: 1.0 Author: Christine Davis Author URI: http://www.neato.co.nz */ $path = ini_get('include_path'); if (!(substr($path, strlen( $path ) - strlen(PATH_SEPARATOR)) === PATH_SEPARATOR)) { $path .= PATH_SEPARATOR; } $path .= $_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/UltimateTagWarrior"; ini_set("include_path", $path); include_once('ultimate-tag-warrior-core.php'); $utw = new UltimateTagWarriorCore(); /* ultimate_tag_archive You may remember my plugin Category Archive. This is a tag archive in the same style. Displays a list of the top x most popular tags, with the top y most recent posts for that tag. If there are more posts, there is also a link to the tag page for that tag. $limit the maximum number of tags to display $postlimit the maximum number of posts to display for each tag */ function UTW_TagArchive ($limit = 20, $postlimit=20) { global $wpdb, $tabletags, $tablepost2tag, $utw, $lzndomain; $baseurl = get_option('utw_base_url'); $tags = $utw->GetPopularTags($limit, 'count', 'desc'); if ($tags) { foreach($tags as $tag) { $out .= "
    "; $out .= "
    " . $utw->FormatTag($tag, "%taglink%") . " - " . $tag->count . "
    "; $q = "select p.ID, p.post_title from $tabletags t inner join $tablepost2tag p2t on p2t.tag_id = t.tag_id inner join $wpdb->posts p on p2t.post_id = p.ID and t.tag='$tag->tag' limit $postlimit"; $posts = $utw->GetPostsForTag($tag); $out .= "
    "; if ($posts) { foreach ($posts as $post) { $out .= "ID) . "\">$post->post_title, "; } if (count($posts) == $postlimit) { $out .= $utw->FormatTag($tag, "" . __("More from", $lzndomain) . " %tagdisplay%...");; } else { // trim trailing comma $out = substr($out, 0, -2); } } $out .= "
    "; $out .= "
    "; } } else { $out = __("No Tags", $lzndomain); } echo $out; } ?>