vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   BB Code Enhancements - Embed XHTML valid YouTube and Google Video into your posts (https://vborg.vbsupport.ru/showthread.php?t=130868)

iran.gs 11-11-2006 02:16 PM

Installed thanks so much l love it ...... xoxoxoxoxox

UK Jimbo 11-11-2006 02:52 PM

I'm using the following code for the plugin:

PHP Code:

$viper_patterns = array(
    
'#\[youtube\]http://(www.youtube|youtube).com/watch\?v=(.*?)&(.*?)\[/youtube\]#si',
    
'#\[youtube\]http://(www.youtube|youtube).com/watch\?v=(.*?)\[/youtube\]#si',
    
'#\[gvideo\]http://video\.google\.([^/]*?)/videoplay\?docid=(\d+)(.*?)\[/gvideo\]#si',
);

$viper_replacements = array(
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[GVIDEO]$2[/GVIDEO]',
);

$text preg_replace($viper_patterns$viper_replacements$text); 

The first change means that you can include content from local sites like video.google.co.uk, the second change (using \d+) is possible because the docid always seems to be an integer.

Viper007Bond 11-11-2006 09:00 PM

Don't forget that the Google Video ID can be negative. ;)

And I wasn't aware of Google.co.uk. I'll update and good thinking on the integer only. Thanks. :)

funkmeister 11-12-2006 05:03 AM

Great plug-in and works perfectly - thanks.

One thing - can you put update details in a revision list in the main entry post (above) for the plug-in - that way we don't have to scroll through pages of posts to find out what updates and new features have been made and added.

Thanks.

Viper007Bond 11-12-2006 07:52 AM

Quote:

Originally Posted by funkmeister
Great plug-in and works perfectly - thanks.

One thing - can you put update details in a revision list in the main entry post (above) for the plug-in - that way we don't have to scroll through pages of posts to find out what updates and new features have been made and added.

Thanks.

Uh, first real post on the first page? ;)

https://vborg.vbsupport.ru/showthread.php?t=130868#2

funkmeister 11-12-2006 02:00 PM

Quote:

Originally Posted by Viper007Bond
Uh, first real post on the first page? ;)

https://vborg.vbsupport.ru/showthread.php?t=130868#2

Ah, thanks :classic:

rex_b 11-12-2006 02:02 PM

Great hack- thank you sir

MAME 11-12-2006 03:42 PM

Youtube seemed to install fine, but googlevideo isnt showing up. Any ideas?

UK Jimbo 11-12-2006 03:44 PM

Quote:

Originally Posted by Viper007Bond
Don't forget that the Google Video ID can be negative. ;)

And I wasn't aware of Google.co.uk. I'll update and good thinking on the integer only. Thanks. :)

I looked at this for another 10 mins and think that this should do the trick for both expressions:

PHP Code:

$viper_patterns = array(
    
'#\[youtube\]http://(www.youtube|youtube).com/watch\?v=([\w]+)(.*?)\[/youtube\]#si',
    
'#\[gvideo\]http://video\.google\.([^/]*?)/videoplay\?docid=([\d\-]+)(.*?)\[/gvideo\]#si',
);

$viper_replacements = array(
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[GVIDEO]$2[/GVIDEO]',
); 

I spotted that if you preview a post the text in the editor window gets edited too which isn't ideal I guess. I wonder if there's a way of preventing that from happening?

UK Jimbo 11-12-2006 03:45 PM

Quote:

Originally Posted by MAME
Youtube seemed to install fine, but googlevideo isnt showing up. Any ideas?

I'm guessing that a link saying what BB Code you're using and a link to a post with it in would be handy for debugging.


All times are GMT. The time now is 02: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.01343 seconds
  • Memory Usage 1,745KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete