Friday, September 10, 2010

Images

Collection of the latest Tax pictures online..

class rss_parser {

var $rss_url;
var $num_to_show;
var $offset; //added in version 0.4.3
var $do_update;
var $tags = array();
var $content;
var $rss = array();

var $feed_title;
var $feed_link;
var $feed_description;

var $my_html;

function rss_parser($url, $numtoshow = 10, $html = "", $update = FALSE, $offset = 1)
{
$this->rss_url = $url;
$this->num_to_show = $numtoshow;
$this->do_update = $update;
$this->my_html = preg_replace(“/(#{.*?):(.*?})/”, “\\1__\\2″, $html); //xx:xx tag workaround
$this->offset = –$offset;
$this->content = $this->fetch_feed();
$this->parse_feed();
$this->show();
}

/* string */
function fetch_feed()
{
$url_parts = parse_url($this->rss_url);

$filename = $url_parts['host'] . str_replace(“/”, “,”, $url_parts['path']) . “_” . @$url_parts['query'];
if(file_exists($this->data_directory . “/$filename”)) {
$last = filemtime($this->data_directory . “/$filename”);
if(time() – $last > $this->update_interval * 60 || $this->update_interval == 0) {
$update = 1;
}
} else {
$create= 1;
}

if($create == 1 || ($this->do_update == TRUE && $update == 1)) {
$fp = @fsockopen($url_parts['host'], 80, $errno, $errstr, 5);
if (!$fp) {
echo “Couldn’t open rss feed {$this->feed_url} in {$_SERVER['PHP_SELF']}
\n”;
return;
}

fputs($fp, “GET ” . $url_parts['path'] . “?” . @$url_parts['query'] . ” HTTP/1.0\r\n”
.”Host: ” . $url_parts['host'] . “\r\n”
.”User-Agent: Drew’s RSS Reader 0.1\r\n”
.”Connection: Close\r\n\r\n”);

while(!feof($fp)) {
$rss_data .= @fgets($fp, 1024);
}

list(, $rss_data) = explode(“\r\n\r\n”, $rss_data, 2);

$output = @fopen($this->data_directory . “/$filename”, “w+”);
if(!$output) {
return $rss_data;
} else {
flock($output, LOCK_EX);
fputs($output, $rss_data);
flock($output, LOCK_UN);
fclose($output);
}
} //update

return file_get_contents($this->data_directory . “/$filename”);
}

/* void */
function parse_feed()
{
preg_match(“/(.*?)<\/title>/”, $this->content, $title);<br /> $this->feed_title = @$title[1];</p><p> preg_match(“/<link>(.*?)<\/link>/”, $this->content, $link);<br /> $this->feed_link = @$link[1];</p><p> preg_match(“/<description>(.*?)<\/description>/”, $this->content, $description);<br /> $this->feed_description = @$description[1];</p><p> preg_match_all(“/<item[^>]*>(.*?)<\/item>/s”, $this->content, $items);<br /> if (sizeof($items[0]) == 0) {<br /> echo “<br />\n”;<br /> }</p><p> for($i = 0; $i < sizeof($items[0]); ++$i) {</p><p> preg_match_all("/(?:<([\w:]*)[^>]*>\s*(?:<!\[CDATA\[)?(.*?)(?:]]>)?\s*<\/\\1>)+?/si”, preg_replace(“/<item[^>]*>/”, “”, $items[0][$i]), $elements);<br /> for($j = 0; $j < sizeof($elements[0]); ++$j) {<br /> $elements[1][$j] = str_replace(":", "__", $elements[1][$j]);<br /> $elements[2][$j] = str_replace(" ", " ", $elements[2][$j]); //regex fix for items with unicode character<br /> $this->rss[$i][$elements[1][$j]] = trim(html_entity_decode($elements[2][$j]));<br /> }<br /> }<br /> }</p><p> /* void */<br /> function show()<br /> {<br /> if($this->my_html == “”) {<br /> $this->show_html();<br /> } else {<br /> $this->show_user_html();<br /> }<br /> }</p><p> function show_html()<br /> {<br /> $show = (sizeof($this->rss) > $this->num_to_show ? $this->num_to_show : sizeof($this->rss));<br /> for($i = $this->offset; $i < $this->offset + $show; ++$i) {<br /> echo “- <a href=\"{$this->rss[$i]['link']}\” onclick=\”return GB_showFullScreen(‘#{title}’, this.href)\” rel=\”nofollow\”>{$this->rss[$i]['title']}</a><br />\n”;<br /> }<br /> }</p><p> function show_user_html()<br /> {<br /> $show = (sizeof($this->rss) > $this->num_to_show + $this->offset ? $this->num_to_show : sizeof($this->rss));<br /> $show = ($this->offset + $this->num_to_show > sizeof($this->rss) ? sizeof($this->rss) – $this->offset : $this->num_to_show);<br /> for($i = $this->offset; $i < $this->offset + $show; ++$i) {<br /> extract($this->rss[$i]);<br /> $item = preg_replace(“/#\{([^}]+)}/e”, “$\\1″, $this->my_html);<br /> echo $item;<br /> }<br /> }</p><p>} // end class</p><p>//set our feeds<br /> $feeds = array(<br /> “http://api.flickr.com/services/feeds/photos_public.gne?tags=Tax&lang=en-us&format=rss_200″</p><p>);</p><p>//pick a random feed to display<br /> srand ((double)microtime()*1000000);<br /> $randomurl = rand(0, count($feeds)-1);</p><p>$url = $feeds[$randomurl];</p><p>//define layout for rss item display<br /> $html = ”<br /><h3>#{title}</h3><p>\n”;<br /> $html .= ”<p>#{description}</p><p>\n”;<br /> $html .= ” <a href="http://www.taxationtoday.com/pictures/#{link}" title='Pictures' onclick=\"return GB_showFullScreen('Tax Pictures on Flickr', this.href)\" rel=\"nofollow\">Read more…</a></p><p>\n”;<br /> $html .= ”<br /><hr size='1' />\n”;</p><p>//check url of feed we’re trying to display<br /> //echo $url;</p><p>$rss = new rss_parser($url, 10, $html, 1); //Parse and Display<br /> ?></p><p style="text-align: center;"><script type="text/javascript">google_ad_client="pub-6183580695833604";google_ad_slot="4552818312";google_ad_width=336;google_ad_height=280;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></p><!-- google_ad_section_end --> <!-- google_ad_section_start(weight=ignore) --></div></div></div><div id="sidebars"><div id="sidebar_1" class="sidebar"><ul class="sidebar_list"><li class="widget thesis_widget_google_cse" id="google-custom-search"><form action="http://www.taxationtoday.com/search/" id="cse-search-box"><div> <input type="hidden" name="cx" value="partner-pub-6183580695833604:8e2qab-wm82" /> <input type="hidden" name="cof" value="FORID:10" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" size="31" /> <input type="submit" name="sa" value="Search" /></div></form> <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script> </li><li class="widget widget_categories" id="categories-221797521"><h3>Categories</h3><ul><li class="cat-item cat-item-1"><a rel="nofollow" href="http://www.taxationtoday.com/estate/" title="View all posts filed under Estate Taxes">Estate Taxes</a></li><li class="cat-item cat-item-9"><a rel="nofollow" href="http://www.taxationtoday.com/planning/" title="View all posts filed under Financial Planning">Financial Planning</a></li><li class="cat-item cat-item-14"><a rel="nofollow" href="http://www.taxationtoday.com/services/" title="View all posts filed under Financial Services">Financial Services</a></li><li class="cat-item cat-item-5"><a rel="nofollow" href="http://www.taxationtoday.com/income/" title="View all posts filed under Income Taxes">Income Taxes</a></li><li class="cat-item cat-item-7"><a rel="nofollow" href="http://www.taxationtoday.com/online/" title="View all posts filed under Online Taxes">Online Taxes</a></li><li class="cat-item cat-item-8"><a rel="nofollow" href="http://www.taxationtoday.com/payroll/" title="View all posts filed under Payroll Taxes">Payroll Taxes</a></li><li class="cat-item cat-item-11"><a rel="nofollow" href="http://www.taxationtoday.com/property/" title="View all posts filed under Property Taxes">Property Taxes</a></li><li class="cat-item cat-item-12"><a rel="nofollow" href="http://www.taxationtoday.com/sales/" title="View all posts filed under Sales Taxes">Sales Taxes</a></li><li class="cat-item cat-item-15"><a rel="nofollow" href="http://www.taxationtoday.com/state/" title="View all posts filed under State Taxes">State Taxes</a></li><li class="cat-item cat-item-3"><a rel="nofollow" href="http://www.taxationtoday.com/forms/" title="View all posts filed under Tax Forms">Tax Forms</a></li><li class="cat-item cat-item-4"><a rel="nofollow" href="http://www.taxationtoday.com/help/" title="View all posts filed under Tax Help">Tax Help</a></li><li class="cat-item cat-item-6"><a rel="nofollow" href="http://www.taxationtoday.com/law/" title="View all posts filed under Tax Law">Tax Law</a></li><li class="cat-item cat-item-10"><a rel="nofollow" href="http://www.taxationtoday.com/preparation/" title="View all posts filed under Tax Preparation">Tax Preparation</a></li><li class="cat-item cat-item-13"><a rel="nofollow" href="http://www.taxationtoday.com/saving/" title="View all posts filed under Tax Saving">Tax Saving</a></li><li class="cat-item cat-item-16"><a rel="nofollow" href="http://www.taxationtoday.com/taxes/" title="View all posts filed under Taxes">Taxes</a></li></ul></li><li class="widget gsom_widget" id="g-lock-double-opt-in-manager"><h3>Newsletter</h3><p>Join our newsletter and receive our exclusive Special Report<br /><img src="http://cdn.taxationtoday.com/images/report-sm.jpg" alt="Tax Savings and Reductions Report" class="report" /></p><script type="text/javascript" src="http://www.taxationtoday.com/wp-content/plugins/g-lock-double-opt-in-manager/js/glock2.min.js"></script><script type="text/javascript" src="http://www.taxationtoday.com/wp-content/plugins/g-lock-double-opt-in-manager/js/gsom_s.min.js"></script><form id="gsom-optin" action="http://www.taxationtoday.com/" method="post"><div class="gsom-optin-form" id="gsom-optin-form-12841114538"></div></form><p style="font-size:x-small; line-height:1.5em;">Our strict privacy policy keeps your email address 100% safe and secure.</p><script type="text/javascript">(function(){function rungsom(){var gsomForm=[{"label":"First Name:","name":"gsom_fname_field","oldName":"","value":"","type":"text"},{"label":"Email:","name":"gsom_email_field","oldName":"","value":"","type":"text"},{"label":"","name":"gsomsubscribe","oldName":"","value":"Subscribe","type":"submit"}];gsomBuildForm({makeDivs:true,arr:gsomForm,place:"gsom-optin-form-12841114538"});}if(window.addEventListener){window.addEventListener("load",rungsom,false);}else{window.attachEvent("onload",rungsom);}})();</script></li><li class="widget widget_text" id="text-238893631"><h3>Tax Ebooks</h3><div class="textwidget"><a href="http://www.taxationtoday.com/ebook.html" onclick="window.open(this.href,'_blank');return false;" title="Tax Ebook" rel="nofollow"><img src="http://cdn.taxationtoday.com/images/ebook1-sm.jpg" alt="Tax Ebook" class="ebooks" /></a><br /></div></li><li class="widget widget_etSocialLinks" id="easy-thesis-social-links"><h3>Follow Us</h3><br /><div class="etsocialwidget"><ul><li id="tt_social"><a href="http://twitter.com/taxsupport" rel="nofollow" target="_blank"><img src="http://cdn.taxationtoday.com/wp-content/themes/thesis/custom/skins/tt-easythesis/images/social/twitter-64x64.png" alt="Social Link 1" /></a></li><li id="tt_social3"><a href="http://feeds2.feedburner.com/OnlineTaxGuides" rel="nofollow" target="_blank"><img src="http://cdn.taxationtoday.com/wp-content/themes/thesis/custom/skins/tt-easythesis/images/social/rss-64x64.png" alt="Social Link 3" /></a></li><li id="tt_social5"><a href="http://www.taxationtoday.com" rel="nofollow" target="_blank"><img src="http://cdn.taxationtoday.com/wp-content/themes/thesis/custom/skins/tt-easythesis/images/social/youtube-64x64.png" alt="Social Link 5" /></a></li></ul></div></li></ul></div></div></div><div id="footer"><p class="footer_copy"> <a href="http://www.taxationtoday.com/privacy-policy/" rel="nofollow" title="Privacy Policy">Privacy Policy</a> | <a href="http://www.taxationtoday.com/terms-of-service/" rel="nofollow" title="Terms of Service">Terms of Service</a> | <a href="http://www.taxationtoday.com/sitemap/" title="Sitemap">Sitemap</a><br />Copyright © 2010 <a href="http://www.taxationtoday.com">Online Tax Guide</a></p><p class="backtotop"> <a class="top"></a></p></div></div></div> <!--[if lte IE 8]><div id="ie_clear"></div> <![endif]--> <!-- google_ad_section_end --></body></html> <!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk Page Caching using disk (enhanced) (user agent is rejected) Database Caching 5/10 queries in 0.024 seconds using disk Object Caching 3002/3008 objects using disk Content Delivery Network via Amazon Web Services: CloudFront: Amazon Web Services: S3: cdn.taxationtoday.com Served from: www.taxationtoday.com @ 2010-09-10 09:37:30 -->