<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>feedcache-config.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,16 @@
 == CHANGELOG ==
 
+1.0.3 - 07/10/2008
+* update WP options to only use 2 option fields via an options array
+
+1.0.2 - 07/09/2008
+* use feed_tools gem for parsing
+* single YAML config file
+* store RSS cache into the WP database
+
+0.9.8 - 05/04/2008
+* allow for up to 99 feed groups now
+
 0.9.5 - 12/02/2007
 * added option to open feed links in a new browser window
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +0,0 @@
-* update the readme file
-
-* get away from forcing the feedcache plugin directory to be called 'feedcache' - allow users to call it what they want and then just check for the base directory and path via PHP
-
-* switch from using Ruby to using the built-in WP fetch_rss calls that use Magpie and caching
-
-* make Feedity.com feeds work with plugin
-
-* make the feed groups sortable by newest items.  If a feed has new items it should be &quot;floated up&quot; to the top of that group</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,6 @@ FEEDCACHE_DIR = '/path/to/your/wordpress/wp-content/plugins/feedcache'
 CHAR_COUNT = 75
 # Set to 'true' if you want to receive error emails from the CRON job
 CRON_EMAILS = false
-# Run as threaded
-THREADED = false
-
 
 #################################################################
 #                                                               #
@@ -17,31 +14,45 @@ THREADED = false
 #################################################################
 $LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__))
 
-require 'net/http'
-require 'lib/feedparser'
-require 'uri'
+require 'rubygems'
+require 'active_record'
+require 'feed_tools'
 require 'yaml'
 
 # Read master config settings
 MASTER_CONFIG = &quot;#{FEEDCACHE_DIR}/master-config.txt&quot;
+params = []
 cfg = File.open(MASTER_CONFIG, 'r') do |f|
-  @params = f.gets.split('~');
+  params = f.gets.split('~');
 end
 # parse the parameters from the config file
-@groups_num   = @params[0].strip.to_i
-@display_num  = @params[1].strip
-@title_pre    = @params[2].strip
-@title_post   = @params[3].strip
-@format_text  = @params[4].strip == 'true' ? true : false
-@link_target  = @params[5].strip == 'true' ? '_blank' : '_self'
+@groups_num   = params[0].strip.to_i
+@display_num  = params[1].strip
+@title_pre    = params[2].strip
+@title_post   = params[3].strip
+@format_text  = params[4].strip == 'true' ? true : false
+@link_target  = params[5].strip == 'true' ? '_blank' : '_self'
+WPDB_PREFIX   = params[6].strip
+@wpdb_host    = params[7].strip
+@wpdb_name    = params[8].strip
+@wpdb_user    = params[9].strip
+@wpdb_pass    = params[10].strip
 
-# Load config and cache file variables
-CONFIG_FILE = &quot;#{FEEDCACHE_DIR}/files/feedcache-config.yml&quot;
-CACHE_FILES = []
-1.upto(@groups_num) do |i|
-  CACHE_FILES &lt;&lt;  &quot;#{FEEDCACHE_DIR}/files/feedcache-cache#{i}.txt&quot;
+ActiveRecord::Base.establish_connection(
+  :adapter  =&gt; 'mysql',
+  :host     =&gt; @wpdb_host,
+  :username =&gt; @wpdb_user,
+  :password =&gt; @wpdb_pass,
+  :database =&gt; @wpdb_name
+)
+
+class WPFeed &lt; ActiveRecord::Base
+  set_table_name &quot;#{WPDB_PREFIX}feedcache_data&quot;
 end
 
+# Load config and cache file variables
+CONFIG_FILE = &quot;#{FEEDCACHE_DIR}/feedcache-config.yml&quot;
+
 # RSS formatting function
 def shorten_text(txt)
   if txt.size &gt; CHAR_COUNT
@@ -57,82 +68,68 @@ def shorten_text(txt)
   end
 end
 
-if THREADED
-  # fork a thread for each config file here
-  send_cron_emails = CRON_EMAILS ? '-e' : ''
-  @groups_num.each do |group|
-    pid = fork {
-      # exec scripts here
-      system(&quot;/usr/bin/env ruby feedcache-lite.rb -p #{CONFIG_FILE} -g #{group} -n #{@display_num.to_i} -f #{@format_text} -l #{@link_target} -c #{CHAR_COUNT.to_i} #{send_cron_emails}&quot;)
-    }
-    Process.detach(pid)
+begin # read the config file settings
+  @all_feeds = {}
+  yaml_config = YAML.load_file(CONFIG_FILE)
+  1.upto(@groups_num) do |num|
+    feeds = []
+    next if yaml_config[&quot;group#{num}&quot;].nil?
+    yaml_config[&quot;group#{num}&quot;].each {|x| feeds &lt;&lt; x.strip if (!x.nil? &amp;&amp; !x.strip.blank?) }
+    @all_feeds[num] = feeds
+    feeds = nil
   end
+rescue =&gt; e
+  if CRON_EMAILS
+    puts &quot;Error reading YAML configuration file&quot;
+    puts e.inspect
+    puts e.backtrace
+  end
+end  
 
-else
-
-  begin # read the config file settings
-    @all_feeds = {}
-    yaml_config = YAML.load_file(CONFIG_FILE)
-    1.upto(@groups_num) do |num|
-      feeds = []
-      next if yaml_config[&quot;group#{num}&quot;].nil?
-      yaml_config[&quot;group#{num}&quot;].each {|x| feeds &lt;&lt; x.strip if (!x.nil? &amp;&amp; !x.strip.empty?) }
-      @all_feeds[num] = feeds
-      feeds = nil
-    end
-  rescue =&gt; e
-    if CRON_EMAILS
-      puts &quot;Error reading YAML configuration file&quot;
-      puts YAML.dump(e)
-    end
-  end  
-
-  @all_feeds.each do |k,v|
-    tmp = ''
-    @processed = 0
+@all_feeds.each do |k,v|
+  tmp = ''
+  @processed = 0
 
-    # parse the feeds here
-    v.each do |feed|
-      # puts &quot;Group: #{k}, Feed: #{feed}&quot;
-      html_text = ''
-      data = feed.split('|')
-      feed_url, feed_title, feed_num, feed_format = data[0], data[1], data[2], data[3]
-      begin
-        source = Net::HTTP::get URI::parse(feed_url)
-        fp = FeedParser::Feed::new(source)
-          html_text &lt;&lt; @title_pre + (feed_title || fp.title || '') + @title_post
-          html_text &lt;&lt; &quot;&lt;ul&gt;&quot;
-          fp.items.each_with_index do |item, idx|
-            break if feed_num ? feed_num.to_i == idx.to_i : @display_num.to_i == idx.to_i
-            output = ''
-            output &lt;&lt; &quot;&lt;li&gt;&lt;a href='#{item.link}' target='#{@link_target}'&gt;&quot;
-            if feed_format &amp;&amp; feed_format == 'true'
-              txt = &quot;#{item.title.downcase.gsub(/^[a-z]|\s+[a-z]/) {|a| a.upcase}}&quot;
-              output &lt;&lt; shorten_text(txt)
-            elsif @format_text == true
-              txt = &quot;#{item.title.downcase.gsub(/^[a-z]|\s+[a-z]/) {|a| a.upcase}}&quot;
-              output &lt;&lt; shorten_text(txt)
-            else
-              output &lt;&lt; &quot;#{item.title}&quot;
-            end
-            output &lt;&lt; &quot;&lt;/a&gt;&lt;/li&gt;\n&quot;
-            html_text &lt;&lt; output
-          end # end fp.items.each
-          html_text &lt;&lt; &quot;&lt;/ul&gt;&lt;br /&gt;\n&quot;
-          tmp &lt;&lt; html_text
-          @processed += 1
-      rescue =&gt; e
+  # parse the feeds here
+  v.each do |feed|
+    html_text = ''
+    data = feed.split('|')
+    feed_url, feed_title, feed_num, feed_format = data[0], data[1], data[2], data[3]
+    begin
+      fp = FeedTools::Feed.open(feed_url)
+      html_text &lt;&lt; @title_pre + (feed_title || fp.title || '') + @title_post
+      html_text &lt;&lt; &quot;&lt;ul&gt;&quot;
+      fp.items.each_with_index do |item, idx|
+        break if feed_num ? feed_num.to_i == idx.to_i : @display_num.to_i == idx.to_i
+        output = ''
+        output &lt;&lt; &quot;&lt;li&gt;&lt;a href='#{item.link}' target='#{@link_target}'&gt;&quot;
+        if feed_format &amp;&amp; feed_format == 'true'
+          txt = &quot;#{item.title.downcase.gsub(/^[a-z]|\s+[a-z]/) {|a| a.upcase}}&quot;
+          output &lt;&lt; shorten_text(txt)
+        elsif @format_text == true
+          txt = &quot;#{item.title.downcase.gsub(/^[a-z]|\s+[a-z]/) {|a| a.upcase}}&quot;
+          output &lt;&lt; shorten_text(txt)
+        else
+          output &lt;&lt; &quot;#{item.title}&quot;
+        end
+        output &lt;&lt; &quot;&lt;/a&gt;&lt;/li&gt;\n&quot;
+        html_text &lt;&lt; output
+      end # end fp.items.each
+      html_text &lt;&lt; &quot;&lt;/ul&gt;&lt;br /&gt;\n&quot;
+      tmp &lt;&lt; html_text
+      @processed += 1
+    rescue =&gt; e
+      if CRON_EMAILS
         puts &quot;Error processing feed - Group #{k.to_i + 1} - #{feed_url}&quot;
-        puts YAML.dump(e)
-      end  
-    end
+        puts e.inspect
+        puts e.backtrace
+      end
+    end  
+  end
 
-    # if we had new feeds, move them to the cache file
-    if @processed &gt; 0
-      cache = File::open(CACHE_FILES[k], &quot;w&quot;)
-      cache &lt;&lt; tmp
-      cache.close
-    end
-  end #--&gt; @all_feeds.each do |k,v|
-  
-end # end if THREADED
\ No newline at end of file
+  # if we had new feeds, move them to the cache file
+  if @processed &gt; 0
+    wp_data = WPFeed.find_or_initialize_by_group_id(k)
+    wp_data.update_attributes(:data =&gt; tmp, :updated_at =&gt; Time.now)
+  end
+end #--&gt; @all_feeds.each do |k,v|</diff>
      <filename>feedcache-cron.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,14 +4,22 @@ Plugin Name: FeedCache
 Plugin URI: http://www.craigjolicoeur.com/feedcache
 Description: Caches RSS Feeds for display on WP site sidebar.  This prevents multiple HTTP requests with each page load since the feeds can be read from the cache file.
 Author: Craig P Jolicoeur
-Version: 0.9.9
+Version: 1.0.3
 Author URI: http://www.craigjolicoeur.com/
 */
 
+// Pre-2.6 compatibility
+if ( !defined('WP_CONTENT_URL') ) {
+	define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
+}
+if ( !defined('WP_CONTENT_DIR') ) {
+	define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
+}
+
 // Constants
 define(&quot;MAX_GROUPSIZE&quot;, 10);
-define(&quot;FEEDCACHE_PATH&quot;, ABSPATH . &quot;wp-content/plugins/feedcache&quot;);
-define(&quot;FEEDCACHE_FILES_PATH&quot;, FEEDCACHE_PATH . '/' . &quot;files/&quot;);
+define(&quot;FEEDCACHE_PATH&quot;, WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__)));
+define(&quot;FEEDCACHE_FILES_PATH&quot;, FEEDCACHE_PATH . '/');
 define(&quot;DEFAULT_PRE_TAG&quot;, &quot;&lt;h3&gt;&quot;);
 define(&quot;DEFAULT_POST_TAG&quot;, &quot;&lt;/h3&gt;&quot;);
 define(&quot;DEFAULT_FORMAT_TEXT&quot;, &quot;true&quot;);
@@ -30,17 +38,76 @@ include_once(FEEDCACHE_PATH . '/lib/spyc/spyc.php');
 
 // Wordpress hooks
 add_action('admin_menu', 'feedcache');
+register_activation_hook(__FILE__, 'feedcache_install');
+
+// DB setup
+$feedcache_db_version = &quot;1.0&quot;;
+function feedcache_install () {
+	global $wpdb;
+	global $feedcache_db_version;
+	
+	// Install DB table if not already installed
+	$table_name = $wpdb-&gt;prefix . &quot;feedcache_data&quot;;
+	if ($wpdb-&gt;get_var(&quot;show tables like '$table_name'&quot;) != $table_name) {
+		$sql = &quot;CREATE TABLE &quot; . $table_name . &quot; (
+			id mediumint(9) NOT NULL AUTO_INCREMENT,
+			group_id mediumint(9) NOT NULL,
+			data text default NULL,
+			updated_at datetime default NULL,
+			UNIQUE KEY id (id),
+			UNIQUE KEY group_id (group_id)
+			);&quot;;
+			
+			require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
+			dbDelta($sql);
+			
+			add_option(&quot;feedcache_db_version&quot;, $feedcache_db_version);
+	}
+
+	// Check if DB table upgrade is needed
+	$installed_ver = get_option(&quot;feedcache_db_version&quot;);
+	if ($installed_ver != $feedcache_db_version) {
+		$sql = &quot;&quot;; // New DB schema here
+		
+		require_once(ABSPATH . 'wp-admin/inclues/upgrade.php');
+		dbDelta($sql);
+		
+		update_option(&quot;feedcache_db_version&quot;, $feedcache_db_verion);
+	}
+	
+	$new_groups = array();
+	$new_options = array(
+		'group_num' =&gt; DEFAULT_GROUP_NUM,
+		'display_num' =&gt; DEFAULT_DISPLAY_NUM,
+		'title_pre' =&gt; DEFAULT_PRE_TAG,
+		'title_post' =&gt; DEFAULT_POST_TAG,
+		'format_text' =&gt; DEFAULT_FORMAT_TEXT,
+		'target_blank' =&gt; false
+	);
+	// if old options exist, update to new system
+	foreach ( $new_options as $key =&gt; $value ) {
+		if( $existing = get_option('feedcache_'.$key) ) {
+			$new_options[$key] = $existing;
+			delete_option('feedcache_'.$key);
+		}
+	}
+	// if old groups exist, update to new system
+	for ($i=1; $i&lt;=99; $i++) {
+		if( $existing = get_option(&quot;feedcache_rss_list$i&quot;) ) {
+			$new_groups[&quot;group$i&quot;] = $existing;
+			delete_option(&quot;feedcache_rss_list$i&quot;);
+		}
+	}
+	add_option('plugin_feedcache_groups', $new_groups);
+	add_option('plugin_feedcache_options', $new_options);
+	
+}
 
 // Functions
 function feedcache_display_feeds($rss_group = '1', $fname = 'feedcache-cache') {
-  $fname = trim($fname.$rss_group);
-  if (strlen($fname) &gt; 0) {
-    $fname = FEEDCACHE_FILES_PATH . $fname . '.txt';
-    if (file_exists($fname)) {
-      $file_content = file_get_contents($fname);
-      return $file_content;
-    }
-  }
+	global $wpdb;
+	$feed_data = $wpdb-&gt;get_row(&quot;SELECT * FROM &quot; . $wpdb-&gt;prefix . &quot;feedcache_data WHERE group_id = $rss_group&quot;);
+	return $feed_data-&gt;data;
 }
 
 function fc_build_config_file($group_array, $fname = 'feedcache-config') {
@@ -70,6 +137,7 @@ function fc_build_config_file($group_array, $fname = 'feedcache-config') {
 }
 
 function fc_build_master_config($group_num, $display_num, $title_pre, $title_post, $format_text, $target_blank, $fname = 'master-config') {
+	global $wpdb;
 	$fpath = FEEDCACHE_PATH . &quot;/$fname&quot; . &quot;.txt&quot;;
 
   if (is_writable($fpath)) {
@@ -77,7 +145,7 @@ function fc_build_master_config($group_num, $display_num, $title_pre, $title_pos
       echo &quot;Cannot open file ($fpath)&quot;;
       exit;
     }
-    if (fwrite($handle, &quot;$group_num~$display_num~$title_pre~$title_post~$format_text~$target_blank&quot;) === FALSE) {
+    if (fwrite($handle, &quot;$group_num~$display_num~$title_pre~$title_post~$format_text~$target_blank~$wpdb-&gt;prefix~&quot;.DB_HOST.&quot;~&quot;.DB_NAME.&quot;~&quot;.DB_USER.&quot;~&quot;.DB_PASSWORD) === FALSE) {
       echo &quot;Cannot write to file ($fpath)&quot;;
       exit;
     }
@@ -94,51 +162,44 @@ function feedcache() {
 }
 
 function feedcache_subpanel() {
-		for ($i=1; $i&lt;=MAX_GROUPSIZE; $i++) {
-			add_option(&quot;feedcache_rss_list$i&quot;, '');
-		}
-    add_option('feedcache_group_num', DEFAULT_GROUP_NUM);
-    add_option('feedcache_display_num', DEFAULT_DISPLAY_NUM);
-    add_option('feedcache_title_pre', DEFAULT_PRE_TAG);
-    add_option('feedcache_title_post', DEFAULT_POST_TAG);
-    add_option('feedcache_format_text', DEFAULT_FORMAT_TEXT);
-		add_option('feedcache_target_blank', false);
-
-		if ($_POST['stage'] == 'prep') {
-			update_option('feedcache_group_num', $_POST['feedcache_group_num']);
+
+	if ($_POST['stage'] == 'prep') {
+		$options = get_option('plugin_feedcache_options');
+		$options['group_num'] = $_POST['feedcache_group_num'];
+		update_option('plugin_feedcache_options', $options);
+	}
+   
+	$options = get_option('plugin_feedcache_options');
+	$number_of_groups = $options['group_num'];
+
+  if ($_POST['stage'] == 'process' ) {
+		for ($i=1; $i&lt;=$number_of_groups; $i++) {
+			$group_array[&quot;group$i&quot;] = $_POST[&quot;feedcache_rss_list$i&quot;]; //explode(&quot;\n&quot;, $_POST[&quot;feedcache_rss_list$i&quot;]);
 		}
-    
-		$number_of_groups = get_option('feedcache_group_num');
-
-    if ($_POST['stage'] == 'process' ) {
-			// $group_array = [];
-
-			for ($i=1; $i&lt;$number_of_groups; $i++) {
-				update_option(&quot;feedcache_rss_list$i&quot;, $_POST[&quot;feedcache_rss_list$i&quot;]);
-				$group_array[&quot;group$i&quot;] = explode(&quot;\n&quot;, $_POST[&quot;feedcache_rss_list$i&quot;]);
-			}
-			fc_build_config_file($group_array);
-
-			// update other variables and master config
-			update_option('feedcache_display_num', $_POST['feedcache_display_num']);
-			update_option('feedcache_title_pre', $_POST['feedcache_title_pre']);
-			update_option('feedcache_title_post', $_POST['feedcache_title_post']);
-			update_option('feedcache_format_text', $_POST['feedcache_format_text']);
-			update_option('feedcache_target_blank', $_POST['feedcache_target_blank']);
-			fc_build_master_config($number_of_groups, $_POST['feedcache_display_num'], $_POST['feedcache_title_pre'], $_POST['feedcache_title_post'], $_POST['feedcache_format_text'], $_POST['feedcache_target_blank']);
-    }
+		update_option('plugin_feedcache_groups', $group_array);
+		fc_build_config_file($group_array);
+
+		// update other variables and master config
+		$new_options = $_POST['feedcache'];
+		$new_options['group_num'] = $number_of_groups;
+		update_option('plugin_feedcache_options', $new_options);
+		fc_build_master_config($new_options['group_num'], $new_options['display_num'], $new_options['title_pre'], $new_options['title_post'], $new_options['format_text'], $new_options['target_blank']);
+  }
+
+	$options = get_option('plugin_feedcache_options');
+	$groups = get_option('plugin_feedcache_groups');
 ?&gt;
     
-    &lt;div class=&quot;wrap&quot;&gt;
-        &lt;h2 id=&quot;write-post&quot;&gt;FeedCache&amp;hellip;&lt;/h2&gt;
-        &lt;p&gt;Fill in the list of RSS feeds you want to process and how you want them formatted and displayed on your site.  If you notice any bugs or have suggestions please contact the developers at &lt;a href=&quot;http://www.craigjolicoeur.com/feedcache&quot; title=&quot;Craig Jolicoeurs's Home Page&quot;&gt;FeedCache on craigjolicoeur.com&lt;/a&gt;.&lt;/a&gt;&lt;/p&gt;
-        &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;?page=feedcache/feedcache.php&quot; name=&quot;prep_form&quot;&gt;
-            &lt;input type=&quot;hidden&quot; name=&quot;stage&quot; value=&quot;prep&quot; /&gt;
-            &lt;fieldset class=&quot;options&quot;&gt;
-                &lt;legend&gt;FeedCache Options&lt;/legend&gt;
-
-								&lt;div&gt;
-									How many RSS Groups do you want?
+   &lt;div class=&quot;wrap&quot;&gt;
+       &lt;h2 id=&quot;write-post&quot;&gt;FeedCache&amp;hellip;&lt;/h2&gt;
+       &lt;p&gt;Fill in the list of RSS feeds you want to process and how you want them formatted and displayed on your site.  If you notice any bugs or have suggestions please contact the developers at &lt;a href=&quot;http://www.craigjolicoeur.com/feedcache&quot; title=&quot;Craig Jolicoeurs's Home Page&quot;&gt;FeedCache on craigjolicoeur.com&lt;/a&gt;.&lt;/a&gt;&lt;/p&gt;
+       &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;&quot; name=&quot;prep_form&quot;&gt;
+				&lt;table class=&quot;form-table&quot;&gt;
+					&lt;tbody&gt;
+						&lt;tr valign=&quot;top&quot;&gt;
+							&lt;th scope=&quot;row&quot;&gt;How many RSS Groups do you want?&lt;/th&gt;
+							&lt;td&gt;
+								&lt;label for=&quot;feedcache_group_num&quot;&gt;
 									&lt;select name=&quot;feedcache_group_num&quot; onchange=&quot;document.prep_form.submit();&quot;&gt;
 										&lt;?php
 											for($i=1; $i &lt;= MAX_GROUPSIZE; $i++) {
@@ -151,70 +212,88 @@ function feedcache_subpanel() {
 											}
 										?&gt;
 									&lt;/select&gt;
-								&lt;/div&gt;
-						&lt;/fieldset&gt;
-				&lt;/form&gt;
-									
-        &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;?page=feedcache/feedcache.php&quot;&gt;
-            &lt;input type=&quot;hidden&quot; name=&quot;stage&quot; value=&quot;process&quot; /&gt;
-            &lt;fieldset class=&quot;options&quot;&gt;
-                &lt;div&gt;
-		  &lt;p&gt;Enter the list of RSS Feeds [1 per line]&lt;/p&gt;
-		  &lt;p&gt;Following the RSS URL, there are up to three (3) additional options you can specify for each feed: 1. Feed title, 2.
-		  Number of items to display, 3. Option to enable special formatting of feed text (boolean value - true/false)&lt;/p&gt;
-		  &lt;p&gt;If you wish to specify the third option, you MUST also set the first two options.  If you wish to set the
-		  second option, you MUST also specify the first option&lt;/p&gt;
-		  &lt;p&gt;All options should be separated by the pipe ('|') character with no spaces before and after the pipe&lt;/p&gt;
-          &lt;p&gt;(e.g. http://www.yourfeed.com/feed|Feed Title|4|false)&lt;/p&gt;
-
-					&lt;?php
-						for($i=1; $i&lt;=$number_of_groups; $i++) {
-					?&gt;
-						&lt;h3&gt;Group &lt;?php echo $i; ?&gt;&lt;/h3&gt;
-					  &lt;textarea name=&quot;feedcache_rss_list&lt;?php echo $i; ?&gt;&quot; rows=&quot;10&quot; style=&quot;width:90%;&quot;&gt;&lt;?php echo get_option(&quot;feedcache_rss_list$i&quot;); ?&gt;&lt;/textarea&gt;
-					&lt;?php
-						}
-					?&gt;
+								&lt;/label&gt;
+							&lt;/td&gt;
+						&lt;/tr&gt;
+					&lt;/tbody&gt;
+				&lt;/table&gt;
+         &lt;input type=&quot;hidden&quot; name=&quot;stage&quot; value=&quot;prep&quot; /&gt;
+			&lt;/form&gt;&lt;!-- end #prep_form --&gt;
+								
+       &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;&quot;&gt;
+		  	&lt;div&gt;
+					&lt;p&gt;Enter the list of RSS Feeds [1 per line]&lt;/p&gt;
+				  &lt;p&gt;Following the RSS URL, there are up to three (3) additional options you can specify for each feed: 1. Feed title, 2.
+				  Number of items to display, 3. Option to enable special formatting of feed text (boolean value - true/false)&lt;/p&gt;
+				  &lt;p&gt;If you wish to specify the third option, you MUST also set the first two options.  If you wish to set the
+				  second option, you MUST also specify the first option&lt;/p&gt;
+				  &lt;p&gt;All options should be separated by the pipe ('|') character with no spaces before and after the pipe&lt;/p&gt;
+		      &lt;p&gt;(e.g. http://www.yourfeed.com/feed|Feed Title|4|false)&lt;/p&gt;
+				&lt;/div&gt;
+				&lt;table class=&quot;form-table&quot;&gt;
+					&lt;tbody&gt;
+						&lt;?php
+							for ($i=1; $i&lt;=$number_of_groups; $i++) {
+						?&gt;
+							&lt;tr valign=&quot;top&quot;&gt;
+								&lt;th scope=&quot;row&quot;&gt;Group &lt;?php echo $i; ?&gt;&lt;/th&gt;
+								&lt;td&gt;
+									&lt;textarea name=&quot;feedcache_rss_list&lt;?php echo $i; ?&gt;&quot; rows=&quot;10&quot; cols=&quot;60&quot; style=&quot;width:98%;&quot;&gt;&lt;?php echo $groups[&quot;group$i&quot;]; ?&gt;&lt;/textarea&gt;
+								&lt;/td&gt;
+							&lt;/tr&gt;
+						&lt;?php
+							}
+						?&gt;
+						&lt;tr valign=&quot;top&quot;&gt;
+							&lt;th scope=&quot;row&quot;&gt;Number of articles to display:&lt;/th&gt;
+							&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;feedcache[display_num]&quot; style=&quot;width:20px;&quot; value=&quot;&lt;?php echo $options['display_num']; ?&gt;&quot; /&gt;
+							&lt;/td&gt;
+						&lt;/tr&gt;
+						&lt;tr valign=&quot;top&quot;&gt;
+							&lt;th scope=&quot;row&quot;&gt;Format feed text for capitalization: &lt;/th&gt;
+							&lt;td&gt;
+								&lt;label for&quot;feedcache[format_text]&quot;&gt;
+									&lt;select name=&quot;feedcache[format_text]&quot;&gt;
+								    &lt;option value='true' &lt;?php if ($options['format_text'] == 'true') { echo 'selected'; } ?&gt; &gt;True&lt;/option&gt;
+								    &lt;option value='false' &lt;?php if ($options['format_text'] == 'false') { echo 'selected'; } ?&gt;										&lt;/select&gt;
+								&lt;/label&gt;
+							&lt;/td&gt;
+						&lt;/tr&gt;
+						&lt;tr valign=&quot;top&quot;&gt;
+							&lt;th scope=&quot;row&quot;&gt;Open feed links in a new window:&lt;/th&gt;
+							&lt;td&gt;
+								&lt;label for&quot;feedcache[target_blank]&quot;&gt;
+									&lt;select name=&quot;feedcache[target_blank]&quot;&gt;
+								    &lt;option value='true' &lt;?php if ($options['target_blank'] == 'true') { echo 'selected'; } ?&gt; &gt;True&lt;/option&gt;
+								    &lt;option value='false' &lt;?php if ($options['target_blank'] == 'false') { echo 'selected'; } ?&gt;										&lt;/select&gt;
+								&lt;/label&gt;
+							&lt;/td&gt;
+						&lt;/tr&gt;
+						&lt;tr valign=&quot;top&quot;&gt;
+							&lt;th scope=&quot;row&quot;&gt;Feed title display pre/post tags:&lt;/th&gt;
+							&lt;td&gt;
+                 &lt;input type=&quot;text&quot; name=&quot;feedcache[title_pre]&quot; style=&quot;width:50px;&quot; value=&lt;?php echo '\''. $options['title_pre'] . '\''; ?&gt; /&gt;&amp;nbsp;/&amp;nbsp;
+                 &lt;input type=&quot;text&quot; name=&quot;feedcache[title_post]&quot; style=&quot;width:50px;&quot; value=&lt;?php echo '\''. $options['title_post'] . '\''; ?&gt; /&gt; &lt;em style=&quot;font-size:11px;&quot;&gt;e.g &amp;lt;h2&amp;gt; / &amp;lt;/h2&amp;gt;&lt;/em&gt;
+							&lt;/td&gt;
+						&lt;/tr&gt;
+					&lt;/tbody&gt;
+				&lt;/table&gt;
+
+	      &lt;div class=&quot;submit&quot;&gt;
+					&lt;input type=&quot;submit&quot; value=&quot;Update FeedCache Preferences &amp;raquo;&quot; name=&quot;Submit&quot; /&gt;
+				&lt;/div&gt;
+				&lt;input type=&quot;hidden&quot; name=&quot;stage&quot; value=&quot;process&quot; /&gt;
+			&lt;/form&gt;&lt;!-- end main form --&gt;
 				
-		&lt;/div&gt;
-		&lt;div&gt;
-		  &lt;p&gt;
-		    &lt;label for='feedcache_display_num'&gt;Number of articles to display: &lt;/label&gt;
-		    &lt;input type=&quot;text&quot; name=&quot;feedcache_display_num&quot; style=&quot;width: 20px;&quot; value=&lt;?php echo '\'' . get_option('feedcache_display_num') . '\''; ?&gt; /&gt;
-		  &lt;/p&gt;
-			&lt;p&gt;
-			  &lt;label for='feedcache_format_text'&gt;Format feed text for proper capitalization: &lt;/label&gt;
-			  &lt;select name=&quot;feedcache_format_text&quot;&gt;
-			    &lt;option value='true' &lt;?php if (get_option('feedcache_format_text') == 'true') { echo 'selected'; } ?&gt; &gt;True&lt;/option&gt;
-			    &lt;option value='false' &lt;?php if (get_option('feedcache_format_text') == 'false') { echo 'selected'; } ?&gt; &gt;False&lt;/option&gt;
-			  &lt;/select&gt;
-		  &lt;/p&gt;
-			&lt;p&gt;
-			  &lt;label for='feedcache_target_blank'&gt;Open feed links in a new window: &lt;/label&gt;
-			  &lt;select name=&quot;feedcache_target_blank&quot;&gt;
-			    &lt;option value='true' &lt;?php if (get_option('feedcache_target_blank') == 'true') { echo 'selected'; } ?&gt; &gt;True&lt;/option&gt;
-			    &lt;option value='false' &lt;?php if (get_option('feedcache_target_blank') == 'false') { echo 'selected'; } ?&gt; &gt;False&lt;/option&gt;
-			  &lt;/select&gt;
-		  &lt;/p&gt;
-		  &lt;p&gt;
-		    &lt;label for=&quot;feedcache_title_pre_post&quot;&gt;Feed Title Display Pre/Post Tags: &lt;/label&gt;
-                    &lt;input type=&quot;text&quot; name=&quot;feedcache_title_pre&quot; style=&quot;width:50px;&quot; value=&lt;?php echo '\''. get_option('feedcache_title_pre') . '\''; ?&gt; /&gt;&amp;nbsp;/&amp;nbsp;
-                    &lt;input type=&quot;text&quot; name=&quot;feedcache_title_post&quot; style=&quot;width:50px;&quot; value=&lt;?php echo '\''. get_option('feedcache_title_post') . '\''; ?&gt; /&gt; &lt;em style=&quot;font-size:11px;&quot;&gt;e.g &amp;lt;h2&amp;gt; / &amp;lt;/h2&amp;gt;&lt;/em&gt;
-		  &lt;/p&gt;
-		&lt;/div&gt;
-	    &lt;/fieldset&gt;
-
-      &lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Update FeedCache Preferences &amp;raquo;&quot; name=&quot;Submit&quot; /&gt;&lt;/p&gt;
-
-	    &lt;fieldset id=&quot;script-settings&quot; class=&quot;options&quot;&gt;
-	        &lt;legend&gt;CRON Script Settings&lt;/legend&gt;
-		&lt;p&gt; 
-		    Here is the &lt;b&gt;feedcache directory path&lt;/b&gt; to use in the CRON script:&lt;br /&gt;
-		    &lt;?php echo FEEDCACHE_PATH . &quot;&lt;br /&gt;&quot;; ?&gt;
-		&lt;/p&gt;
-            &lt;/fieldset&gt;
-        &lt;/form&gt;
-    &lt;/div&gt;
+			
+			&lt;div class=&quot;options&quot; id=&quot;script-settings&quot;&gt;
+        &lt;h3&gt;CRON Script Settings&lt;/h3&gt;
+				&lt;p&gt; 
+			    Here is the &lt;b&gt;feedcache directory path&lt;/b&gt; to use in the CRON script:&lt;br /&gt;
+			    &lt;?php echo FEEDCACHE_PATH . &quot;&lt;br /&gt;&quot;; ?&gt;
+				&lt;/p&gt;
+			&lt;/div&gt;
+   &lt;/div&gt;&lt;!-- end .wrap --&gt;
 
 &lt;?php            
 }</diff>
      <filename>feedcache.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,18 @@
 === FeedCache ===
 Contributors: cpjolicoeur
 Donate link: http://www.craigjolicoeur.com/feedcache
-Tags: RSS, ATOM, feed, cache
+Tags: RSS, ATOM, feed, cache, Ruby, CRON
 Requires at least: 1.5
-Tested up to: 2.5.*
-Stable tag: 0.9.9
+Tested up to: 2.6.*
+Stable tag: 1.0.3
 
 Caches RSS Feeds for display on your WP sidebar. 
 
 == Requirements ==
 
 * Ruby
+* Rubygems with the following gems available: active_record, feed_tools
+	(If you are hosted with Dreamhost you have these gems already.  If you are hosted elsewhere you will need to check.  If you run a VPS or dedicated machine like me, then just install them via `sudo gem install`)
 * CRON access
 
 == Description ==
@@ -19,15 +21,14 @@ FeedCache will retrieve, cache and store locally a list of RSS feeds that you ca
 
 == Installation ==
 
-1. Upload the feedcache directory to your wordpress wp-content/plugins directory.
+1. Upload the feedcache directory to your wordpress wp-content/plugins directory. Make sure the feedcache directory is writeable by the web server (rw-rw-rw 666).
 
-2a. Change the file permissions on the master-config.txt file to rw-rw-rw- (666)
-2b. Change the file permissions on the files/ directory to rwxrwxrwx (777)
+2. Change the file permissions on the master-config.txt file to rw-rw-rw- (666)
 
 3. Activate the FeedCache plugin through your wordpress plugin menu
 
 4. Setup FeedCache options under the Options -&gt; FeedCache Options menu
-	(a) Choose the number of feed groups you want (1 - 10)
+	(a) Choose the number of feed groups you want (1 - 99)
   (b) Add your list of RSS feeds 1 per line and set the other options.  You can have up to 4 different groupings of RSS feeds to cache.
       If you wish to manually override the name of the feed, place a pipe character &quot;|&quot; after the RSS URL and then type the name you want to use (e.g http://www.craigjolicoeur.com|Craig P Jolicoeur)
       If you wish to manually override the number of feed items to display, place a pipe character &quot;|&quot; after the feed title and enter the number to display
@@ -60,14 +61,14 @@ FeedCache will retrieve, cache and store locally a list of RSS feeds that you ca
 == Upgrading ==
 
 **** IMPORTANT ************************************************************************
-	If you are upgrading from a version of FeedCache prior to v0.9, please
+	If you are upgrading from a version of FeedCache prior to v0.9.8, please
 	deactivate and delete your existing feedcache plugin directory and follow the new
 	installation steps.
 ***************************************************************************************
 
 1. Deactivate the previous version of FeedCache through your Wordpress plugins menu
 
-2. Upload the new feedcache-cron.rb, feedcache.php and complete lib/ directory files to your existing feedcache directory.  You do not need to overwrite your existing files/ directory or the master-config.txt file.
+2. Upload the new feedcache-cron.rb, feedcache.php and complete lib/ directory files to your existing feedcache directory.  You do not need to overwrite your master-config.txt file.
 
 3. Enter the correct FEEDCACHE_DIR variable in the feedcache-cron.rb script
 
@@ -78,11 +79,11 @@ FeedCache will retrieve, cache and store locally a list of RSS feeds that you ca
 
 = Why would I need this plugin? =
 
-If you are using your WP installation to display other website's RSS feeds, this will save HTTP requests and improve page load times for your users.
+If you are using your WP installation to display other website's RSS feeds, this will save HTTP requests and improve page load times for your users.  By using a CRON job to fetch and format the feeds, the user will not have to wait during page load for the feed to be updated.
 
 = Will FeedCache work with Atom feeds? = 
 
-Yes!  Since version 0.8, FeedCache will work with both RSS and ATOM feeds.
+Yes!  FeedCache will work with both RSS and ATOM feeds.
 
 = Can I receive error emails from the CRON process? =
 </diff>
      <filename>readme.txt</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>files/README</filename>
    </removed>
    <removed>
      <filename>lib/feedparser.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/all-wcprops</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/entries</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/format</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/feedparser.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/filesizes.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/html-output.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/html2text-parser.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/rexml_patch.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/sgml-parser.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/text-output.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/.svn/text-base/textconverters.rb.svn-base</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/feedparser.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/filesizes.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/html-output.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/html2text-parser.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/rexml_patch.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/sgml-parser.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/text-output.rb</filename>
    </removed>
    <removed>
      <filename>lib/feedparser/textconverters.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>fe1b27f7e07d17b62f850c3285f4b1a1870c9f12</id>
    </parent>
  </parents>
  <author>
    <name>Craig P Jolicoeur</name>
    <email>cpjolicoeur@gmail.com</email>
  </author>
  <url>http://github.com/cpjolicoeur/feedcache/commit/4f49060a624f824341b49102bd3c82ae1c1362fc</url>
  <id>4f49060a624f824341b49102bd3c82ae1c1362fc</id>
  <committed-date>2008-07-10T09:16:03-07:00</committed-date>
  <authored-date>2008-07-10T09:16:03-07:00</authored-date>
  <message>update to version 1.0.3 from wordpress.org</message>
  <tree>849f13952255761f0b3e50d14c21b07469cdd787</tree>
  <committer>
    <name>Craig P Jolicoeur</name>
    <email>cpjolicoeur@gmail.com</email>
  </committer>
</commit>
