vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   replace words in rss (https://vborg.vbsupport.ru/showthread.php?t=303610)

yjeanrenaud 10-19-2013 09:28 PM

replace words in rss
 
Hi
I would like to do certain replacements in the xml rss feed for convenience of the subscribers. I therefore had a look at the external.php and thought, if I load a list of replacements and just parse the variale $output at the end of the script, right before
PHP Code:

echo $output

it should be enough. but it's not. any clues?

kh99 10-19-2013 09:42 PM

The output is cached, so maybe it didn't work because of that. The setting External Data Provider > Thread Cache Lifespan controls how long things are cached, but I don't know if you can turn it off by using 0 (the instructions don't mention it). You could either set it to 1 minute and wait between tests, or figure out where in the database it's stored and truncate the table between tests.

ETA: I guess it's the "externalcache" table.

yjeanrenaud 10-20-2013 06:50 PM

Ah I see, thanks for the tip. But $output should be the way to go, yes?

kh99 10-20-2013 06:56 PM

Yes, you should be able to do it by changing $output. If you're interested in doing it in a plugin, you could use hook external_complete.

ETA: and even if you don't want to use a plugin, you'll want to do your replace before the cache is written (which happens just after the hook is called).

yjeanrenaud 10-21-2013 05:17 PM

thanks alot!
is there any way to make these changes conditionally via plugin so not everyone gets the changes?

kh99 10-22-2013 10:26 AM

Well, you can't really do it by vbulletin user or group because the external.php script doesn't check for users logged in (you can see at the top of external.php it defines SKIP_SESSIONCREATE, which means it doesn't try to determine in the user is logged in). You could remove that but you'd add overhead to each call to the feed, and anyone who got the feed who wasn't logged in would show up as a guest on your forum. Also, if a member wanted to get the feed using a reader other than their browser, they wouldn't appear as a logged in user.

I hope that makes sense. I'm not sure exactly what your situation is, but maybe you could give some users a different url (with an added parameter or something), then check for that.


All times are GMT. The time now is 01:51 AM.

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.00972 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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