vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to add 1 character to the title of all RSS feeds through SQL (https://vborg.vbsupport.ru/showthread.php?t=291286)

John Diver 11-21-2012 10:35 PM

How to add 1 character to the title of all RSS feeds through SQL
 
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 10: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.

kh99 11-22-2012 11:11 AM

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).
Code:

$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:
Code:

$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 03: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:

Code:

$itemdata->set('title', strip_bbcode($html_parser->parse_wysiwyg_html_to_bbcode($feed['xml']->parse_template($feed['titletemplate'], $item))));
vb3:

Code:

$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 :)


All times are GMT. The time now is 10:33 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
  • Page Generation 0.01991 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete