vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Using replacement variables to adapt old BBcode? (https://vborg.vbsupport.ru/showthread.php?t=232454)

thefnool 01-07-2010 01:44 PM

Using replacement variables to adapt old BBcode?
 
On my forum, until recently I was using YouTube bbcode with the following formatting:

Code:

[youtube=XXXXXX]XXXXXX[/youtube]
Where XXXXXX is the variable at the end of a youtube URL.

My new formatting is:

Code:

[youtube]http://www.youtube.com/watch?v=XXXXXX[/youtube]
However, with the change I am left with lots of posts containing unparsed embedded videos using the old code. I'm trying to work out a way to use replacement variables to alter every instance of the old formatting to the new formatting.

The way I see it, I need to globally replace [youtube=XXXXXX] with
Code:

[youtube]http://www.youtube.com/watch?v=
As this would mean that the closing [/youtube] tag would be left intact, and all old videos would then parse correctly.

What would the formatting be for a replacement variable that would replace all instances of [youtube=Anything goes here] with [youtube]http://www.youtube.com/watch?v= ?

If this is impossible, are there any plugins/products that would facilitate such a change? Or, is it possible to do a similarly specifically-targeted find/replace in my database?

Digital Jedi 01-09-2010 11:57 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=202476" target="_blank">AME 2.5</a> has some tools that will let your rebuild old BBCode and convert them to AME tags. In this case, your users don't even have to use a button to embed the video, or even know how to. A link to a YouTube page will auto embed when posted, and the conversion tool should make all the old embeds remain. It's lighter than BBCode and you can add additional sites pretty easily if you want them. I think it might be easier than what your trying to do, and make it even easier on your users.


All times are GMT. The time now is 09:49 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.02182 seconds
  • Memory Usage 1,709KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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