/*
Plugin Name: FeedList
Plugin URI: http://rawlinson.us/blog/articles/feedlist-plugin/
Description: Displays any ATOM or RSS feed in your blog.
Author: Bill Rawlinson
Author URI: http://blog.rawlinson.us/
Version: 2.22.3
*/
// include files
$relroot = dirname(__FILE__).'/../../../';
// get the magpie libary
if (file_exists($relroot . 'wp-includes/rss.php')) {
require_once($relroot . 'wp-includes/rss.php');
} else if(file_exists($relroot . 'wp-includes/rss-functions.php')){
require_once($relroot . 'wp-includes/rss-functions.php');
} else {
function FeedListInitError(){
?>
There was a problem initializing the feedlist plugin. Make sure the file feedlist.php is directly under your wp-content/plugins directory and not a subdirectory.
}
}
// end
// end
class FeedList {
var $dateFormat = "F j, Y, g:i a";
var $id;
var $items;
var $rs;
var $args;
var $feed;
var $output;
function FeedList($args){
$this->args = $args;
$this->id = md5(uniqid(rand(), true));
}
function GetID(){
$this->Debug($this->id);
}
/* core methods */
// called automagically if you use an inline filter (inside a post/page).
function FeedListFilter(){
return $this->BuildFeedOutput();
}
// call this if you want to process one feed
function FeedListFeed(){
echo $this->BuildFeedOutput();
}
// call this if you want to process a feed file
function FeedListFile(){
$this->args = $this->GetArgumentArray();
$this->output = '';
// Seed the random number generator:
srand((double)microtime()*1000000);
$feed = Array();
$feedInfo = $this->LoadFile($this->args['file']);
if(count($feedInfo)){ // we have some feeds
// Randomize the array:
shuffle($feedInfo);
// Make sure we are set to show something:
($this->args['feedsToShow'] < 1) ? 1 : $this->args['feedsToShow'];
($this->args['feedsToShow'] > sizeof($feedInfo)) ? sizeof($feedInfo) : $this->args['feedsToShow'];
// we will fetch each feed, then coallate items
for($i=0;$i<$this->args['feedsToShow'];$i++){
$thisFeed = $feedInfo[$i];
$urlAndTitle = preg_split("/~/", $thisFeed);
$feedUrl = trim($urlAndTitle[0]);
$feedTitle = trim($urlAndTitle[1]);
$this->rs = $this->GetFeed($feedUrl);
if($this->rs){
$this->items = $this->rs->items;
if($this->args['random']){
shuffle($this->items);
}
// Slice off the number of items that we want:
if ($this->args['num_items'] > 0)
{
$this->items = array_slice($this->items, 0, $this->args['num_items']);
}
if(!$this->args['mergeFeeds']){
$this->output.= '
';
} else {
$this->output = $this->args['before'] . 'No Items Were Found In the Provided Feeds. Perhaps there is a communication problem.' . $this->args['after'];
}
// coallate feed items
echo $this->output;
}
/* end core methods */
/* basic settings - you can edit these */
function GetSettings(){
/*
CONFIGURATION SETTINGS
----------------------
cacheTimeout how long should your cache file live in seconds? By default it is 21600 or 6 hours.
most sites prefer you use caching so please make sure you do!
connectionTimeout how long should I try to connect the feed provider before I give up, default is 15 seconds
showRssLinkListJS TRUE by default and will include a small block of JS in your header. If it is false the JS will not be
included. If you want the $new_window = 'true' option to use the JS then this must also be true.
Otherwise both true and simple will hardcode the target="_blank" into the new window links
*/
// DEFINE THE SETTINGS -- EDIT AS YOU NEED:
$feedListDebug = false; // To debug this script during programming (true/false).
$cacheTimeout = 21600; // 21600 sec is 6 hours.
$connectionTimeout = 15; // 15 seconds is default
$showRSSLinkListJS = true;
$Language = 'en_US'; // Choose your language (from the available languages below,in the translations):
$Translations = array(); // Please send in your suggestions/translations:
// English:
$Translations['en_US'] = array();
$Translations['en_US']['ReadMore'] = 'Read more...';
// Dutch:
$Translations['nl_NL'] = array();
$Translations['nl_NL']['ReadMore'] = '[lees verder]';
// French:
$Translations['fr_FR'] = array();
$Translations['fr_FR']['ReadMore'] = 'Lisez davantage';
$feedListFile = '/feeds.txt'; // IF you are going to use the random feedlist generator make sure this holds the correct name for your feed file:
// Build an array out of the settings and send them back:
$settings = array ( 'feedListDebug' => $feedListDebug,
'cacheTimeout' => $cacheTimeout,
'connectionTimeout' => $connectionTimeout,
'showRSSLinkListJS' => $showRSSLinkListJS,
'language' => $Language,
'translations' => $Translations,
'feedListFile' => $feedListFile
);
return $settings;
}
function GetDefaults(){
$settings = $this->GetSettings();
return array( 'rss_feed_url' => 'http://del.icio.us/rss',
'num_items' => 15,
'show_description' => true,
'random' => false,
'before' => '
',
'after' => '
',
'description_separator' => ' - ',
'encoding' => false,
'sort' => 'none',
'new_window' => false,
'ignore_cache' => false,
'suppress_link' => false,
'show_date' => false,
'additional_fields' => '',
'max_characters' => 0,
'max_char_wordbreak' => true,
'file'=>$settings['file'],
'feedsToShow'=>0,
'mergeFeeds'=>false,
'show_date_per_item' => false,
'show_description_only' => false
);
}
/* end basic settings */
function BuildFeedOutput(){
$this->args = $this->GetArgumentArray();
$this->rs = $this->GetFeed($this->args['rss_feed_url']);
$this->output = '';
if($this->rs){
$this->items = $this->rs->items;
if($this->args['random']){
shuffle($this->items);
}
// Slice off the number of items that we want:
if ($this->args['num_items'] > 0)
{
$this->items = array_slice($this->items, 0, $this->args['num_items']);
}
$this->output = $this->Draw();
}
return $this->output;
}
function Draw(){
$settings = $this->GetSettings();
$this->items = $this->NormalizeDates($this->items);
$this->items = $this->SortItems($this->items,$this->args['sort']);
// Explicitly set this because $new_window could be "simple":
$target = '';
if($this->args["new_window"] == true && $settings["showRSSLinkListJS"])
{
$target=' rel="external" ';
}
elseif ($this->args["new_window"] == true || $settings["new_window"] == 'simple')
{
$target=' target="_blank" ';
}
$this->output ='';
foreach($this->items as $item){
$thisLink = '';
$linkTitle = '';
$thisDescription = '';
$thisTitle = $item['title'];
$thisItemDate = '';
if($this->args['show_description_only']){
$this->args['show_description'] = true;
}
if ($this->args['encoding']){ // very poor and limited internationalization effort
$thisTitle = htmlentities(utf8_decode($thisTitle));
}
if (isset($item['content']['encoded']) || isset($item['description'])){
if (isset($item['description'])){
$thisDescription = $item['description'];
}
else{
$thisDescription = $item['content']['encoded'];
}
// Handle max_characters and max_char_wordbreak before the htmlentities makes it more complicated:
if (!empty($this->args['max_characters']) && is_numeric($this->args['max_characters']))
{
$thisDescription = substr($thisDescription, 0, $this->args['max_characters']);
// If true, we cut on the last space:
if (!empty($this->args['max_char_wordbreak']))
{
$max_char_pos = strrpos($thisDescription, ' ');
if ($max_char_pos > 0)
{
$thisDescription = substr($thisDescription, 0, $max_char_pos);
}
}
} else if ($encoding) {
//further really weak attempt at internationalization
$thisDescription = htmlentities(utf8_decode($thisDescription));
}
$linkTitle = $thisDescription;
$linkTitle = strip_tags($linkTitle);
$linkTitle = str_replace(array("\n", "\t", '"'), array('', '', "'"), $linkTitle);
$linkTitle = substr($linkTitle, 0, 300);
// if we are only showing the description we don't need the separator..
if (strlen(trim($thisDescription)) && !$this->args['show_description_only'])
{
$thisDescription = $this->args['description_separator'].$thisDescription;
}
}
// Only build the hyperlink if a link is provided..and we are not told to suppress the link:
if (!$this->args['suppress_link'] && strlen(trim($item['link'])) && strlen(trim($thisTitle)) && !$this->args['show_description_only']){
$thisLink = ''.$thisTitle.'';
}
elseif (strlen(trim($item['link'])) && $this->args['show_description'])
{
// If we don't have a title but we do have a description we want to show.. link the description
$thisLink = ''.$thisDescription.'';
$thisDescription = '';
}
else
{
$thisLink = '' . $thisTitle . '';
}
if($this->args['show_date_per_item']){
$thisItemDate = '
' . $item['feeddate'] . '
';
}
// Determine if any extra data should be shown:
$extraData = '';
if (strlen($this->args['additional_fields'])){
// Magpie converts all key names to lowercase so we do too:
$this->args['additional_fields'] = strtolower($this->args['additional_fields']);
// Get each additional field:
$addFields = explode('~', $this->args['additional_fields']);
foreach ($addFields as $addField)
{
// Determine if the field was a nested field:
$fieldDef = explode('.', $addField);
$thisNode = $item;
foreach($fieldDef as $fieldName)
{
// Check to see if the fieldName has a COLON in it, if so then we are referencing an array:
$thisField = explode(':', $fieldName);
$fieldName = $thisField[0];
$thisNode = $thisNode[$fieldName];
if (count($thisField) == 2)
{
$fieldName = $thisField[1];
$thisNode = $thisNode[$fieldName];
}
}
if (is_string($thisNode) && isset($thisNode))
{
$extraData .= '
We have a lot of books that we need to clear out, we know you can get books for less money at other book dealers so we are going to eliminate our book section. We are offering a buy two get one free sale on books. Buy any two books and get a third of equal or lesser value for FREE. Limited to stock on hand.
Online: Put three books in your cart, and the server will charge you for the three but Susan will make the correction when she processes your order. You do need to pay shipping on all three books. Order online at www.hearttohandonline.com
At the Shop: Visit us and mention this sale!
Sale runs through May 5th. Hundreds of books to choose from, pictured is just an example of what we have to offer.
Heart To Hand Quilt Shop
412 Beavercreek Road
Suite 607
Oregon City, OR 97045
503-230-9075
Or visit us on the web: www.hearttohandonline.com
Open: Tuesdays: 11:00am to 9:00pm Fridays 10:00am to 2:00pm Saturdays 10:00am to 5:00 pm.
Here is the fourth block in the McKenna Ryan Block of the Month program: Wish Upon A Star. The embellishments and quilting are not done yet but I thought you would enjoy seeing this block. The Polar Bears are throwing snowballs!
We started Wish Upon A Star back in January. Anyone can join at any time. We meet on the third Saturday of each month, or you can order the supplies online and work at home. We have fabric kits, patterns and embellishments for this great Winter Holiday Quilt.
So come join us! For information on the block program and to order it online visit our website. To register for the class at our Oregon City Store you can get more information here.
March 21st was National Quilting Day. Shown here is a quilt top sewn by Barbara Timby she also donated the fabric, Beth Durand donated her long-arm quilting skills and Heart to Hand donated the batting and backing. This will be given to our local Habitat for Humanity. Thanks to Barbara and Beth for a great charity quilt! We will let you know more details about this donation later this month.
You can still get this free pattern at the link above.
In other activities, Jan just put up a beautiful wall of purses and purse patterns at the shop. Norma and I are teaching classes on totes and encourage you to sign up.
Norma is teaching Six-Pack Stack Reversible Tote that uses six different Fat quarters. I will be teaching the Birdie Sling class. I hope you will consider coming and joining us.
Beth just finished this cute tote, using a panel from Michael Miller’s Dick and Jane Fabrics. Very simple and so very cute! Anyone can make it and NO pattern needed!
All of us at Heart To Hand would like to wish you and yours a wonderful Easter Day! We thank you for your faithfulness as our customers during these difficult economy days in our country. Without you we would not be here, and we do realize that! We know when you order, visit or call you are making a choice to buy your fabrics and supplies from us. Please let us know what we can do to serve you, our loyal customers!
Hoppy Day!
Wendy and The Heart To Hand Team
“The resurrection gives my life meaning and direction and the opportunity to start over no matter what my circumstances. ”
There are lots of signs that spring is about.Today, here in Oregon, we had glimpses of beautiful weather among the rain drops.But there is more, the Daffodils and tulips are starting to bloom in my garden.
Peeps line the isles of the local grocery stores calling my name in new colors and flavors and waiting for Easter Baskets.I love Peeps.I have not purchased a package this year, showing SOME restraint, but I usually like to buy them on clearance.Can you believe it; even Lenox China has a line of Peeps-ware. This cute Peeps Easter Basket is just ONE example. I wonder if that means they will go on clearance after Monday.I am sure I can only wish, if you see this $100 piece for $20 let me know!!!
Of course new fabrics arriving in the shop are also signs of Spring.I just finished adding 17 fabrics to the web.I love the colors.I think many of you know I am pretty partial to purple, and while there are a couple of purples, there are some beautiful greens, teals, oranges and red! All signs of Spring.
Several of our customers have been working on “One Block Wonder” projects.I bought one fabric just for them this week called “English Countryside” wow is it a beautiful fabric by Debbie Beaves. Maybe we can convince Chris to make a sample out of it and teach another class in the “One Block Wonder” so you can join us!
What ever signs of Spring are showing in your neighborhood, I hope they are wonderful!
I struggle with leftovers. They are good for a day or so and then I get bored with them. So I wrap them up in the freezer to save for another day and usually end up throwing out the leftovers six months later. But having cleaned the fridge and freezer a week or so ago I decided that there was a 2 pound leftover pork tenderloin roast in the freezer that I did not want to go bad. I have been thinking of pulled pork sandwiches. Not that I have ever had one, but still I was thinking of them.
So after cleaning the kitchen, I pulled the pork out and mixed up a sauce of French onion soup, catsup, mustard, brown sugar, and vinegar. Mixing it well in the crock-pot, I tossed in my leftover tenderloin. The house smells wonderful! It has been cooking for about six hours on low and I will cook it another two. Then shred the pork and roll it into my new favorite bread option. Flat-out whole grain flat bread. YUMMY.
So dinner was taken care of and I was off to my next project. Making this cute purse pattern designed by Amy Butler called a “Birdie Sling“. I made this bag in great Spring and Summer fabric colors using fabric leftovers. I think it is a cute bag, and realize that this been a day of leftovers in cooking and sewing, and everything can look new again from a different prospective.
Just in time for Spring, from RJR Fabrics comes the newest Farmers Market 2008 collection. This is a Twice the Charm Pack which includes 18 wonderful fruit and vegetable pieces in 5-1/2″ X 22″ strips with pinked edges.
Last time we had this type of collection I designed a fun and easy Picnic Time Quilt. Slice up all your strips and sew together this fun project.
The fabrics in this collection are truly wonderful, bright and beautiful. Make a strip quilt, a wall hanging or how about a market tote using the Charm Party Tote Pattern.
We also received another Twice the Charm pack from RJR called Beachfront Cottages designed by Demetria Hayward. This fabric displays a variety of shells, stripes, florals and beautiful background fabrics.