I needed newsfeeds now so I wrote a small simple pal to take a list of RSS files and show the content.
Just download the zip file and unzip it into your pals directory. Rename the file newsfeedpal.php to the first empty customboxXpal.php file and set the number you chose in the $forumlistcustombox variable. Create a directory called "newsfeeds" (for RSS file caching) in your pals directory and give the web server write permissions to it:
> chmod 777 newsfeeds
The script will show the latest info from Slashdot.org and freshmeat.net if you don't change anything, there is a list of a few other feeds you can use in the script. Some more can be found at this site: http://www.syndic8.com
This pal is written for IIP 5.3, but might work with earlier IIP 5.x versions, it even defaults to some own table wrappers if threads doesn't have any.
Updated the script with the ability to select if image and text input should be shown with each newsfeed. The new version is attached to the first post of this thread.
Yes, it's a nice way to add content to your site, and if you publish your own RSS file to get traffix. Unfortunately I've only found two interesting in Swedish. =/ One is very good though, Gnuheter, which is Gnu news sort of, and from DN, the biggest morning news paper in Sweden.
I've done another small update, if only one feed is entered, it shows the title of the feed in the header of the pal instead of inside it. I've updated the zip in the first post of this thread.
If I only chose one news feed, then the table confoms to the size limits I've set in the admin section of IIP. With multiple news feeds the table almost doubles in width.
Edit: Macslash was causing the table to be too wide. The took thinking different just a little too far for me
Just took a look at your site, it looks good. =] It might be a bit too much text though, unfortunately the rdf class I used doesn't seem to offer any options on how to display the content, it's all or nothing more or less.
problem with this. Maybe I am not understanding the directions. You create a directory under pals named newsfeeds and change mode to 777. You rename the newfeedpal.php to your first empty custombox3.php ( in my case the first open one ) set the variable to the number inside etc etc. Upload the two files into the pal directory and then place it where you want via IIP config. well the entrance page does not load on my test site when it gets to the newsfeed?
That's strange. You seem to have followed the instructions correctly, but it seems that the page just dies when the pal is loaded... I know I had problems on my home computer because of the flush() function not seeming to work on Apache 2+PHP. But that resulted in garbage showing, not stopping the page. You could try editing rdf.class.php and comment out the line that says flush() in the function finish() but that shouldn't be a problem really.
What newsfeeds are you using, could you possibly paste in the config part of your script?
Commenting out the flush() did not work and here are the variables
// ************************************************************************* // // Start of editable variables
// Select which Custom Box you use this pal as (can be 1-6): $forumlistcustombox = 3;
// The number of items to get from each feed $feeds = 3;
// An array containing links to the rss feeds you want to show. $newsfeeds = array( "Wired News" => "http://www.wired.com/news_drop/netcenter/netcenter.rdf", );
// Seconds between updating of cached rss file. $feed_refresh = 3600;
// Show image in newsfeed (true or false) $feed_image = true;
// Show text input field in newsfeed (true or false) $feed_textinput = false;
// End of editable variables // ************************************************************************* //
Strange. I copied your config to my local script and it turns out just fine.
What version of PHP are you using? And what webserver?
Try finding this line: $cbstorage = $TempStorage;
And add the following debug output after it: echo $TempStorage;
I'm not really sure what could be wrong. Do you have access to the web servers error log? If you could take a look into it and see if it says something it would be great.
The script is saved in DOS format for some reason (probably is in the original customboxpals), maybe you could try and save it in unix format?
I always have a problem viewing server log it never loads. However XML is active. There is nothing written in the newsfeed directory. It is 777. I added the echo statement where you told me. This hack is dieing before that point it seems.
OK, so it must be that the rdf class include for some reason stops the script, it really shouldn't be able to though, since it in itself does absolutely nothing.
Try adding this:
Code
<br />echo "Going to load rdf class now...<br />";<br />
Above this:
Code
<br />// Include the RDF class<br />require_once("rdf.class.php");<br /><br />echo "rdf class loaded<br />";<br />
Just to make sure it is actually when loading the class and not for some other reason it dies...
I made a small change to my earlier post, at first I had the error_reporting(7) right below the require, but it should go at the end of the newsfeedpal.php script.
It doesn't give any error at all? That is very weird.
Is the permissions correct for rdf.class.php? Is it readable by the web server?
Did you get any output when putting in an echo statement at the top of rdf.class.php? If you don't that script isn't loaded at all...
Nope nothing with that either. I mean the web server allows xml. There is not error but then the box is not displayed. Now if there was indeed not an error would not the table display. It seems it is choking before anything happens.
Nope nothing with that either. I mean the web server allows xml. There is not error but then the box is not displayed. Now if there was indeed not an error would not the table display. It seems it is choking before anything happens.
I get nothing from the debugging before and I get nothing printed with clean file and your version of rdf.class.php. That tells me that the problem is before this file? It should print your echo line in the rdf file but instead nothing but hang. I put the error_reporting line in index.php and it spits out errors for the pal boxes that load and the page stops when it gets to where the custombox3pal.php box is suppose to load.
I get nothing from the debugging before and I get nothing printed with clean file and your version of rdf.class.php. That tells me that the problem is before this file? It should print your echo line in the rdf file but instead nothing but hang. I put the error_reporting line in index.php and it spits out errors for the pal boxes that load and the page stops when it gets to where the custombox3pal.php box is suppose to load.
I solved it. Funny thing is the line require_once("rdf.class.php"); You meantioned nothing about setting the full path to the file. I figured since it was in the same directory that it would find it. I set the full path and it works.
Hmm. That means you don't have the current directory in your php include path. But even so, I thought you should have gotten an error if it didn't find the file, but apparently not, that requires even higher error level. Oh well, at least I've learned something.
I'll add the path to the script and update the first post. Thanks for finding that nasty little bug.
I've updated the attachment in the first post of this thread with a slightly updated script that takes care of some small bugs. If the script works for you there is no need to update. Thanks goes to Omegatron for finding one of the bugs and the fix for it.
Well I do not know what PHP include path is set at since this is not my server. Whats weird is Threads works fine but that is why one specifies in MAIN.INC.PHP the path to Threads directory so one can just put require in the("main.inc.php"); and it loads ubbt.inc.php
I guess some servers always require a PATH defined. I thought I too would have gotten an error.
Maybe I dont understand this. But I tried installing a pal box yesteday to mysite as per gardner instruction and it worked fine.
Now I was wondering, if the case only adding an html code after the <<COMMENT code. Than why not adding the html code one normally get from those news feed site and placing it as if your placing a normal html code. Than that I think should work exactly the same and get the NEWS FEED accordingly and placing it in the pal box of your choice. OR AM I MISSING SOMETHING
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.