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)

Viper007Bond 11-12-2006 11:26 PM

Quote:

Originally Posted by UK Jimbo (Post 1115516)
I wonder if there's a way of preventing that from happening?

Yeah, I'll just check for the right $_POST value to see if it's a preview or not. :)

And thanks for the regex. I may be quite good at PHP/MySQL, but I'm still a noob at regex. :(

exilera 11-13-2006 02:20 AM

I added the custom BB code for just YouTube per the instructions, but it doesn't seem to be working. Here's a link to a post on my forum using the code.

http://www.jabber-box.com/jabber/showthread.php?t=27

Any idea why it's not displaying the video?

Viper007Bond 11-13-2006 05:08 AM

Quote:

Originally Posted by exilera (Post 1115972)
Any idea why it's not displaying the video?

You have HTML in your URL...

Code:

http://www.youtube.com/v/<font color="#555143">wfWfX3GdDUo</font>

UK Jimbo 11-13-2006 07:59 AM

Quote:

Originally Posted by Viper007Bond (Post 1115827)
And thanks for the regex. I may be quite good at PHP/MySQL, but I'm still a noob at regex. :(

No worries. My perl background helps me out with that. Really powerful and useful to learn.

Viper007Bond 11-13-2006 08:12 AM

Quote:

Originally Posted by UK Jimbo (Post 1115516)
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?

Only happens with the WYSIWYG editor since that apparently uses the BBCode parser to make it's output. :confused:

delmarva 11-13-2006 05:59 PM

One problem I see with this mod: If you click anywhere but the https://vborg.vbsupport.ru/
image, it takes you to the YouTube.com home page. Any way around this?

Otherwise, the members get stuck spending hours on Youtube instead of continuing to browse my site. :)

Mecho 11-13-2006 07:48 PM

Quote:

Originally Posted by delmarva (Post 1116468)
One problem I see with this mod: If you click anywhere but the https://vborg.vbsupport.ru/
image, it takes you to the YouTube.com home page. Any way around this?

Otherwise, the members get stuck spending hours on Youtube instead of continuing to browse my site. :)

I need it too .

Viper007Bond 11-14-2006 03:47 AM

Nothing I can do about any of that kinda stuff. It's their Flash file being loaded off their server.

delmarva 11-14-2006 04:24 AM

THat's cool, man. Great job on the mod. Excellent stuff.

Adult SEO 11-14-2006 07:44 AM

Hi!

The plugin itself contains a bug, the code is sometimes already parsed and available in $parsedtext instead of $text.

This code will fix it.

One other bug, Google video is available on multiple domains also on video.google.nl or co.uk etc. Also fixed with this code.

I didn't test YouTube however.

PHP Code:

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

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

$viper_replacements = array(
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'docid=$1"',
);

$viper_replacements2 = array(
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[YOUTUBE]$2[/YOUTUBE]',
    
'[GOOGLEVIDEO]$1[/GOOGLEVIDEO]',
);

if (!empty(
$parsedtext)) {
$parsedtext preg_replace($viper_patterns$viper_replacements$parsedtext);
} else {
$text preg_replace($viper_patterns2$viper_replacements2$text);




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.01155 seconds
  • Memory Usage 1,751KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (5)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