I wrote this as I was bored and fancied having a play with the ECU RSS feed option. Using the RSS feed part of a ECU the results are endless what you can do with it, your not tied to using the standard units that the ECU site supplies.
Get the main HTML file from here. What I did was view the demo in it’s own window, viewed the source code and copied and pasted into my code editor. Then you need to save the file as a .php file.
At the very top of the file, add this PHP code.
<?php
$xml = simplexml_load_file("http://www.easycontentunits.com/rss/6553/3/rss2full.rss");
?>
Remember to change the URL to match the easy content unit you want to use.
Then replace the “< div id=’sidebar’ >” with the code below.
<div id="sidebar">
<ul class="spy">
<?php
foreach ($xml--->channel->children() as $item)
{
if($item->price!='')
{
echo '
<li>';
echo '<a title="View round" href="#"><img src="' . $item->image . '" alt="" width="70" height="70" /></a>';
echo '
<h5><a title="View round" href="#">' . substr($item->title, 0, 30) . '</a></h5>
';
echo '
' . substr($item->description, 0, 60) . '
';
echo '
<a title="Buy this item" href="#">£' . strip_tags($item->price) . '</a>';
echo '<a title="Buy this item" href="' . $item->link . '">Buy Now</a>
';
echo '</li>
';
}
}
?>
</ul>
</div>
You should then be able to upload the file then and view it, remember its a PHP file, so won’t run locally on your machine. also your host must support PHP (most do). My example is here.
If all is ok, you should then be able the put that div and where on page where you would like the ECU to appear.
I have been asked if this can be used in WordPress but unfortunately I have no experience of creating plug-ins for WordPress, so can’t answer that. All donations will be put to me buying books about WordPress, so you never know if I get enough donations, a WordPress plug-in could be next.
I may be able to answer some questions in the comments below, but am not a PHP or JavaScript guru.
Sorry, the comment form is closed at this time.