![]() |
Cron job is much safer and nicer to do this with :)
|
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.
|
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. |
Code:
for($i = count($rss_allItems) - 1; $i >= 0; $i--) { 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); Code:
$rss_description=mysql_escape_string($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:
<? 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!! |
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? |
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). |
you're code works fine :)
|
Where can i find news feeds for soccer/football
|
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 |
now my sites, stopped working. I'm running RC4
|
All times are GMT. The time now is 04:18 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|