Zen Follower
- Join Date:
- Nov 2007
- Location:
- Upstate NY
- Posts:
- 233
- Plugin Contributions:
- 0
blank sidebox
I'm trying to add an RSS feed to the blank sidebox. RSS Scroller didn't work for me (and bad install instructions: tess you to put placing full HTML header into main_page defined page??? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tra"http://www.w3.org/TR/xhtml1/onal.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http, etc).
The other RSS mods I've found provide my store as a feed, rather than put external feeds on my page. I decided to try getting a feed from Magpie into the blank sidebox.
To get Magpie working, I think I need guidance about placing PHP code that calls include files and has required directories.
I have tried adding it in tpl_sidebox and/or sidebox_defines, but when I enable the code the center column loads and then the page breaks. I think the problem may be the include files. This code relies on 4 include files and 2 directories. I can put static text in there (content .= 'magpie'), and I've made calls to the zen database from a blank sidebox, but I don't know about placement for these include and required dirs.
I tried placing the dirs and inc files in includes/templates/sideboxes (where the tpl_file is located), and in includes/languages/english/extra_definitions (where the sidebox_defines file is located).
This is the code that works in a regular php page:
include('./rss_fetch.inc');
error_reporting(0);
$url = "anyrssfeed";
$rss = fetch_rss($url);
if ($rss) {
$items = array_slice($rss->items, 0, 15);
foreach ($items as $item) {
echo "<p><a href="" .$item['link']. "">"
.$item['title']. "</a></p>";
}
}
@ini_restore('error_reporting');
I have tried various combinations of the code below (with more and less content' assigns), and moved the include command to the top of the page, but whenever I leave this code active the home page loads the center column and then breaks.
$content .= '<p>' . TEXT_MAGPIE_SIDEBOX . '</p>';
error_reporting(0);
$content .= $url = "rssfeed";
$rss = fetch_rss($url);
if ($rss) {
$content .= $items = array_slice($rss->items, 0, 15);
$content .= foreach ($items as $item) {
$content .= echo "<p><a href="" .$item['link']. "">"
$content .= .$item['title']. "</a></p>";
$content .= '</div>';