View Full Version : How to add 1 character to the title of all RSS feeds through SQL
John Diver
11-21-2012, 11:35 PM
Hey,
I keep getting a problem which is also listed by a lot of users when there is no title in RSS feeds, here is 1 bug report and has been confirmed by others - http://tracker.vbulletin.com/browse/VBIV-5611
When there is no title in an RSS feed, it stops all feeds being retrieved.
Is there something I can add to the RSS file or add SQL to the database to simply add the chatacter "."?
Then even if there is no title, the feeds would still work
Not the best solution but it would work...
Thanks
Lynne
11-21-2012, 11:56 PM
If I understand the bug, the problem is when reading the rss feed. I can't think of how you are going to add something to the title prior to reading the (empty) title of the feed.
I haven't tested it, but looking at the code it seems like that should only happen if you press "Run Now" in the scheduled task manager. If it runs via cron.php it should just be ignored. But it's possible I'm missing something.
If you wanted to add a default title you could find this line in includes/cron/rssposter.php (around line 386 - it's actually there twice, you want the second one in the "case: 'thread'" section).
$itemdata->set('title', strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
And change it to something like:
$title = strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
if ($title === '') $title = '.'; // or whatever default title you want
$itemdata->set('title', $title);
So is this what's been causing your problems all along, do you think? I thought you were using vb3 and the bug report says this only happens in vb4 versions.
John Diver
11-28-2012, 04:04 PM
Thanks Kevin :)
Hopefully this will help others, I didn't mean to post this in the vb4 forum, it was meant to be in vb3 but I must have been looking through vb4 for fixes when I did the new thread :(
They are quite similar - vb4:
$itemdata->set('title', strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
vb3:
$itemdata->set('title', strip_bbcode(convert_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
I think this is what is stopping it running Kevin, when I run manually it shows the error, but when doing cron, there is no error at any time and it just stops running the feeds
Thanks again :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.