The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
RSS News Feed Hack Details »» | |||||||||||||||||||||||||
My friend made this hack, he owns http://www.liquidpro.net. Check him out.
You may contact him at liquidpro@neo.rr.com. Or you can IM him on AIM at LiquidPro10. An example is shown at http://www.xtreme-forumz.net. Go to the Techno forum under the General category. Then the CNET News sub-forum. RSS News Feed Hack for vB 3.0.0. As long as vBulletin doesn't change the database structure much, this should be good for the next release also, and those to come. Allows you to have a live RSS news feed (such as one from Google or CNET) in a forum. The user that posts it will basically be a bot, which *should* only be used for posting the news, but you can even make it for a regular user. Comments are welcome! Instructons: Note: DON'T FORGET TO MAKE A BACKUP OF EACH FILE BEFORE YOU MODIFY IT! Copy the files to your web server... keep the same directory structure as in the zip file. Run the rss_install.php file to setup the RSS script. If you're upgrading run the rss_upgrade.php file to setup the RSS script. Don't forget to remove all previous modifications (you can find them by searching for "LiquidPro") #### open the /index.php script #### Find this: PHP Code:
PHP Code:
Find this: PHP Code:
PHP Code:
Find this: PHP Code:
PHP Code:
Hack by: Andrew Wickham (http://www.liquidpro.net) Hack for: Xtreme-Forumz (http://www.xtreme-forumz.net) Show Your Support
|
Comments |
#52
|
||||
|
||||
Cron job is much safer and nicer to do this with
|
#53
|
||||
|
||||
Is there a way to pull the news from RSS into the postbit itself when you click a link? I've seen it before but i don't know how they do that.
|
#54
|
|||
|
|||
Xyphen:
I have another three things in mind: 1.) Add in the admin section a name to each feed so that you only have to create one user-bot but you can distinguish them by the name given in the AdminCP and the name given in the AdminCP should then also be used as username when wwriting data to mysql. e.g. I currently pull data from NZZ Online, from NZZ Wirtschaft, 20min Ausland, AltaVista and Google.de I currently have for each news service another user setup but I think I should be able to do it with one user only that can be distinguished in the admin and forum section. 2.) You use in in code "<br><br>" do make row breaks. Maybe you could check whether on this board HTML is enabled and if not use "\n\n" instead and "View full article" could be a phrase so that it can be translated easily into other languages. 3.) Increase forum counts when news are added and decrease forum counts when they are deleted. Maybe adding also a feature that deletes news older than xx days. Anyway, great work so far and I would help you out but my skills aren't as advanced as yours although I'm learning. |
#55
|
|||
|
|||
Code:
for($i = count($rss_allItems) - 1; $i >= 0; $i--) { $rss_allItems[$i][OLD] = false; } Now, there are a couple more things that are issues. For one there's no check for mysql_escape_string which will be bad if you actually grab rss feeds from, say a site that uses " or '. I've already run into this one tonight; Fix: In includes/RSS/rss_update.php, look for Code:
$rss_title = str_replace("'", "\'", $rss_title); $rss_description = str_replace("'", "\'", $rss_description); Code:
$rss_description=mysql_escape_string($rss_description); $rss_title=mysql_escape_string($rss_title); // $rss_title = str_replace("'", "\'", $rss_title); // $rss_description = str_replace("'", "\'", $rss_description); In response to the cron thing, it's really a simple thing to do (until this is officially added to the cron somehow). Create a file in your public_html, call it rssfeed.php (or whatever), and in it, just add: Code:
<? require_once('./global.php'); require_once('./includes/functions_bigthree.php'); require_once('./includes/functions_forumlist.php'); require_once('./includes/RSS/rss_update.php'); ?> Code:
*/5 * * * * php /path/to/your/file/rssfeed.php BTW, i've integrated this into vbadvanced, for those wanting info on how, let me know and if there's enough interest I'll post it here. As far as forums and counts, I agree this is something that shouldn't be updated. However, if you (really) want to update your forums and posts, having this count in them, you can update your postcounts from admincp. This will fix that problem. Hopefully, I'll be able to come up with a workaround for that in the near future, but who knows. Great code, glad to see it finally working!! |
#56
|
|||
|
|||
I'd be interested to know how you did that integrate into vbAdvanced. I've installed now vbIndex 3.0.x and also vbAdvanced but I only have troubles with certain things in vbIndex so I assumbe I'll stick to vBadvanced.
Btw, my code change (true --> false) was quite simple if you look at the logic of what is approved and not. I was looking first at the wrong spot either but basically if you set it to "true" it marks all fetched news items from the feed as [old], then if there are no items in the db it markes them all as [new], and then it fetches the items from the database and marks duplicate entries as [old] (which they already were). Regarding the Cron: How does it work? Those vB crons aren't really added to the system crontab right? Does it check everytime when a vB page is called whether one of the specified crons if overdue and then execute it? |
#57
|
|||
|
|||
I'll get together tonight or in the next couple of days and put a hack together. It certainly wasn't a 3 or 4 line edit and I'm almost positive I missed something in there. Once I'm sure it works, I'll post it.
As far as cron, it's not added to the user's crontab (vbulletin isn't), no. In fact, I'd bet you'd run into the same problem there too, because it is called every time the page updates, so your best answer would be to create the file and call it via cron however often you want it to. I'm only a beginning hack however (as far as vb is concerned), haven't played with the cron stuff too much (yet). |
#58
|
|||
|
|||
you're code works fine
|
#59
|
|||
|
|||
Where can i find news feeds for soccer/football
|
#60
|
|||
|
|||
When the news is updating i always get this error. Obviously with a different storyline.
Database error in vBulletin 3.0.0 Release Candidate 4: Invalid SQL: INSERT INTO post (`threadid`, `username`, `userid`, `title`, `dateline`, `pagetext`, `allowsmilie`, `showsignature`, `visible`) VALUES ('21596', 'News Poster', '3137', 'Stevenage 0-1 Telford', '1076235015', 'Stevenage's hopes of closing the gap on the play-off places suffered a blip as they crashed 1-0 at home to Telford.<br><br>View the Entire Article ', '1', '1', '1') mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's hopes of closing the gap on the play-off places suffered a bl mysql error number: 1064 Date: Sunday 08th of February 2004 05:10:18 AM Script: http://www.myfootballforum.com/forumdisplay.php?f=318 Referer: http://www.myfootballforum.com/index.php? Username: boro_boy IP Address: 62.254.64.9 |
#61
|
|||
|
|||
now my sites, stopped working. I'm running RC4
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|