PDA

View Full Version : rssbox



voicesfrombeyond
01-13-2007, 09:07 AM
1) Script Title: rssbox

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm

3) Describe problem: I'm brand new and need help setting the rss reader to work. After setting everything up and uploading to my server, I still can't get it to work. When I tried to invoke the shtml, nothing happens. Instead, I see the following on the top of the page:

feed_url('http://example.com/feed.xml'); $feed->cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache'); $feed->init(); $feed->handle_content_type(); ?>

What am I doing wrong? How can I fix it?

Also, the initial instrustions says to create two directories: php and cache. I did. But the instructions doesn't say where exactly to put the rssbox files. I have the rssbox files in the php I created. Is this correct. My host is ipowerweb and the directory is: /public_html/php/rssbox. Please let me know if I need to change anything.

ddadmin
01-13-2007, 10:22 AM
Can you post a URL to the problem page on your server? It's easier that way.


But the instructions doesn't say where exactly to put the rssbox files

By default you should simply perserve the original structure of the folders within the zip file when uploading to your site. In other words, you shouldn't change any directory information.

voicesfrombeyond
01-13-2007, 04:09 PM
Can you post a URL to the problem page on your server? It's easier that way.

Thanks for your reply. Here is the link:

http://www.voicesfrombeyond.com/rssarticle1.shtml

ddadmin
01-13-2007, 09:53 PM
Ok, the way your page is currently set up, I think pigs will fly before the RSS display box is shown :) You seem to have just taken the config portion of the PHP script and stuck it to the top of your page- this won't work.

Take a step back, and just upload all the contents of the zip file to your site, as is, and mantaining the structure:

demo.htm: working demo page of RSS display boxes
rssbox/rssdisplaybox.js
rssbox/virtualpaginate.js
rssbox/rssdisplaybox.css
rssbox/main.php
rssbox/outputbody.php
rssbox/loading.gif
rssbox/cache/ directory. Chmod 777 or 755!
simplepie/ directory, which contains the files that make up the SimplePie package

Most FTP programs will let you perserve the original structure of the uploaded directories when you upload them- do this. Be sure to chmod the cache directory to 777 as well.

Once that's done, try running demo.htm to see if it works. If not, post the link to it here.

voicesfrombeyond
01-14-2007, 09:18 AM
Okay, the demo and all files have been uploaded to root directory, public_html/rssbox. The url is: http://www.voicesfrombeyond.com/rssbox/demo.htm.

I also moved simplepie.inc from php folder to this folder for purposes of sending you the url to check out.
To do this, I had to rename the original rssbox folder which I had modified. The contents of main.php as modified is:

<?php
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com

require('/php/simplepie.inc'); //Specify path to simplepie.inc on your server (by default located inside "simplepie" directory)
$feed = new SimplePie();
$feed->cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache'); //Specify path to cache directory on your server relative to this file
$feed->handle_content_type();
require('outputbody.php'); //Path to custom "outputbody.php" file relative to this file

//Specify list of RSS URLs
$rsslist=array(
"sip" => "http://ezinearticles.com/rss/Self-Improvement-Spirituality.xml",
"goa" => "http://www.goarticles.com/cgi-bin/rss-search.cgi?l=20&s=1&c=91&D1=subject&title=Spirituality",
"giv" => "http://www.givemearticles.com/rss/givemearticles.cfm?directory=selfimprovement",
"atz" => "http://www.articlebiz.com/topic/114-1-spirituality/" //no trailing comma after last RSS URL!!
);
======================================================
The rssdisplaybox.js was modified as follows:
//Path to "main.php" *relative* to "demo.htm", or the HTML page on your server displaying the RSS Box:

var rssoutputscript="/rssbox/main.php"

//Switch to full URL to "main.php" on your server below, so script will work with any page on your server, not just "demo.htm"
//Do NOT change window.location.hostname, which is your site's root domain, dynamically determined
//Configure below line and uncomment it to activate it:

rssoutputscript="http://"+window.location.hostname+"/php/rssbox/main.php"
======================================
My feed1.shtml which is at http://www.voicesfrombeyond.com/feed1.shtml contains the following:

<script type="text/javascript">
<font size=-1>
//MAIN FUNCTION: rssdisplaybox("rssfeed_id", "rssbox_id", "rssbox_class")
var sip=new rssdisplaybox("sip", "sipbox", "sipclass")
sip.set_cache_time(10) //Change cache time of feed to 10 minutes (instead of default 30 minutes. Set to 0 to disable cache)
sip.set_items_shown(10, 5) //Fetch 10 entries, but display only 5 at a time (pagination links auto created)
sip.set_template("default") //Use "default" template, which outputs title + description + date
sip.setpagination("auto", "top") //Automatically generate the interface for the pagination links, plus position it to the top of the RSS Box
sip.set_template("titles") //Use "titles" template (see "outputbody.php"), which outputs title + category
sip.start() //Required: start script
</font>
</script>
==========================================
Thank you very much for your time and assistance. Please let me know what I'm doing wrong.

ddadmin
01-15-2007, 01:02 AM
Just by looking at http://www.voicesfrombeyond.com/rssbox/demo.htm, your paths are still incorrect. Inside your source, you're referencing the external files, such as the .js file, as follows:


<script type="text/javascript" src="rssbox/rssdisplaybox.js">
//credit notice here...
</script>

This tells the browser that the .js file is located in the directory:

rssbox/rssdisplaybox.js

relative to the directory the webpage is located in. Adding the two up, you're telling the browser the .js file is located in:

http://www.voicesfrombeyond.com/rssbox/rssbox/rssdisplaybox.js

Clearly not correct.

Is there any reason why you're moving and renaming files directories? That's the source of your problem. All you should be doing at this point to get the demo working is this:

1) Create an arbitrary directory, say "test" in your root directory.

2) Upload all the files of the zip into this directory as is and mantaining the original structure of the directories.

3) Chmod the cache directory and any other details as mentioned in the instructions

4) Run demo.htm to see if it works.

voicesfrombeyond
01-15-2007, 05:53 AM
I thought I followed the instructions when I uploaded the rssbox folder with its contents to my root directory resulting in /rssbox/files. I created a test folder, uploaded everything into this folder, including demo.htm. When I tested it, this is what I get. Is this what I'm supposed to see?

Dynamic Drive RSS Display Boxes: Source code and install instructions
Example 1 (CSS Drive):



Example 2 (BBC News):



Example 3 with "manual" pagination mode (NYTimes):
First - + Last



Example 4 with "manual" pagination mode (CSS Drive):
Prev Next

The link to test it is: http://www.voicesfrombeyond.com/test/demo.htm

ddadmin
01-15-2007, 08:34 AM
Hmm nope, if it worked you should see the RSS feeds being displayed. Where are the .js and .css files for this script currently located in? Per your link (http://www.voicesfrombeyond.com/test/demo.htm)it is assumed they're located in /test/rssbox/, for example:

http://www.voicesfrombeyond.com/test/rssbox/rssdisplaybox.js

which if you test it out you'll see is invalid...

voicesfrombeyond
01-15-2007, 05:00 PM
Originally, the files were in public_html/rssbox/ as the instructions here say: http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm and the reference to the js files was

<script type="text/javascript" src="rssbox/rssdisplaybox.js">
//credit notice here...
</script>

which was the way it came without modifications. But you said it was wrong. Then I created the "Test" folder and uploaded everything into it without the rssbox sub folder. Either way, what I showed you is what I get whether in test/*.js or rssbox/*.js

I'm so confused now. Originally, the instruction was to create a "php" and a "cache" folders in my root directory and copy the simplepie.inc into the php folder. Then I downloaded rssbox and the instructions were different. Do those instructions still hold? Do I still need the php and cache folders in my root directory? Where exactly is simplepie.inc supposed to be with rssbox?

ddadmin
01-15-2007, 08:00 PM
I'm confused too now :) It doesn't matter if you put the files for this script in your root directory or an arbitrary directory (ie: /test) of your choice- the key is to mantain the original structure of the files relative to one another. Here's the instructions on the script page:


To get the script up and running, just upload all files above as is to your PHP capable server, and make sure the directory "rssbox/cache/" has read+write permissions (typically chmod 777 or chmod 755) for the cache files to be created in. Then, call up demo.htm in your browser to see the script in action!

With the original structure being:


demo.htm: working demo page of RSS display boxes
rssbox/rssdisplaybox.js
rssbox/virtualpaginate.js
rssbox/rssdisplaybox.css
rssbox/main.php
rssbox/outputbody.php
rssbox/loading.gif
rssbox/cache/ directory. Chmod 777 or 755!
simplepie/ directory, which contains the files that make up the SimplePie package

So demo.htm should always be one folder above the .js file, with the later being is /rssbox. For example:

/test/demo.htm
/test/rssbox/rssdisplaybox.js
"

and so on.

voicesfrombeyond
01-16-2007, 03:19 AM
Thank you for your patience with me on this. I appreciate it. I wanted to come back to report that it is working now. As it turned out, my suspicions were right. The problem was with inconsistent setup and instructions.

I finally received a warning message which gave me the clue about what was going on. The problem was in main.php. It was referencing ../simplepie/simplepie.inc. Of course I didn't have such a folder. Once I created it and moved simplepie.inc to it, all worked. Hope this helps someone else.

Now, another curious and general question: Is there a way to display the articles on my site rather than taking the visitor to the articles source web site?

Here's the working link: http://www.voicesfrombeyond.com/feed1.shtml

Thank you.

ddadmin
01-16-2007, 07:40 AM
As it turned out, my suspicions were right. The problem was with inconsistent setup and instructions. I finally received a warning message which gave me the clue about what was going on. The problem was in main.php. It was referencing ../simplepie/simplepie.inc. Of course I didn't have such a folder. Once I created it and moved simplepie.inc to it, all worked.


I'm not sure how this is inconsistent with the instructions. As mentioned, the original directory structure of the zip file is as follows:

demo.htm: working demo page of RSS display boxes
rssbox/rssdisplaybox.js
rssbox/virtualpaginate.js
rssbox/rssdisplaybox.css
rssbox/main.php
rssbox/outputbody.php
rssbox/loading.gif
rssbox/cache/ directory. Chmod 777 or 755!
simplepie/ directory, which contains the files that make up the SimplePie package

So by default, main.php looks for simplepie.inc in ../simplepie/simplepie.inc. By keeping the original structure of the files when you upload them, you don't need to touch any file paths referenced.



Now, another curious and general question: Is there a way to display the articles on my site rather than taking the visitor to the articles source web site?

Hmm unfortunately no. The purpose of an RSS feed is to syndicate a site's content headlines, not the actual content. There's no incentive- only drawbacks- for a site offering their RSS feeds to allow their actual content to be syndicated as well.

voicesfrombeyond
01-16-2007, 08:30 AM
Another thing. I went to check my log file and found pages and pages of error log regarding cache not writeable. Yes, I did CHMOD it to 755. How do I turn the cache on and off to stop my log file from getting too big too quickly?

ddadmin
01-16-2007, 11:12 AM
755 may not do the trick depending on how your server is set up. Have you tried chmodding it 777?

voicesfrombeyond
01-16-2007, 05:35 PM
I use ipowerweb and they require 755. I currently run other cgi and php scripts and only 755 works, according to their tech support. But, I will try 777 tonight. If this fails, is there something else I need to check?

ddadmin
01-16-2007, 08:32 PM
If you can't chmod your directory to 777, you may want to try browsing the docs at Simplepie.org to see if there is a workaround. One helpful resource is their forum (http://simplepie.org/support/).

voicesfrombeyond
01-17-2007, 12:12 AM
Thanks. The solution "jumped out at me." It appears to be a known bug. Here's the link: http://simplepie.org/support/viewtopic.php?id=460

Also, I realize now why instructions were so confusing to me. I download the original simplepie from that site, with instructions to create "php" and "cache" folders in my root directory. Then I read about rrsbox, downloaded it, and trying to follow the instructions, appeared confusing from where I started. Sorry for the confusion.