xBtit default script forum Youtube BBCode

  • 12 Replies
  • 4304 Views
*

jernatety

xBtit default script forum Youtube BBCode
« on: March 02, 2011, 06:52:13 pm »
Is there a bbcode for xBtit's own integrated forum? I've gone through the first five pages searching youtube and only find btit hacks.

Thank you

*

Offline King Cobra

  • XBTIT Maintainer / Developer
  • *****
  • 540
  • +0/-0
  • xbtitFM Administrator

*

jernatety

Re: xBtit default script forum Youtube BBCode
« Reply #2 on: March 03, 2011, 03:06:34 pm »
Advanced BBCode hack you are thinking? Yes, I have that installed. I don't see anywhere youtube bbcode though.

Thank you for replying.

*

cdx1

Re: xBtit default script forum Youtube BBCode
« Reply #3 on: March 03, 2011, 04:45:38 pm »
First off open /include/class.bbcode.php

find
Code: [Select]
  //Lists
  while (preg_match('/\[list(=(a|1))?\](.+?)\[\/list\]/i',$content))
    $content=preg_replace_callback('/\[list(=(a|1))?\](.+?)\[\/list\]/i','formatlist',$content);

Add after
Code: [Select]
// Video tag [video=url]
// YouTube Vids
$content = preg_replace("/\[video=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims", "<object width=\"500\" height=\"410\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $content);
// Google Vids
$content = preg_replace("/\[video=[^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\]/ims", "<embed style=\"width:500px; height:410px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\"  FlashVars=\"playerMode=embedded\"> </embed>", $content);

     //[video=http://somesite.com/test.swf]
        $content = preg_replace("/\[video=((www.|http:\/\/|https:\/\/)[^\s]+(\.swf))\]/i",
        "<param name=movie value=\\1/><embed width=470 height=350 src=\\1></embed>", $content);

then open style/xbtit_default/txtbbcode.tpl

find
Code: [Select]
        <td align="left"><input type="button" class="btn" name="img" value="Img" onclick="javascript: BBTag('[img]','[/img]',document.forms.<tag:form_name />.<tag:object_name />)" /></td>

Add after
Code: [Select]
        <td align="left"><input type="button" class="btn" name="img" value="YouTube" onclick="javascript: BBTag('[video=',']',document.forms.<tag:form_name />.<tag:object_name />)" /></td>
        <td align="left"><input type="button" class="btn" name="img" value="Flash" onclick="javascript: BBTag('[video=',']',document.forms.<tag:form_name />.<tag:object_name />)" /></td>
        <td align="left"><input type="button" class="btn" name="img" value="Google vids" onclick="javascript: BBTag('[video=',']',document.forms.<tag:form_name />.<tag:object_name />)" /></td>

all done enjoy the new video and flash functions your site now has   ;D

*

jernatety

Re: xBtit default script forum Youtube BBCode
« Reply #4 on: March 03, 2011, 10:19:33 pm »
Thank you for reply cdx1

I will definitely do this.

Will I see an icon or drop down feature to select the tags? Or do I just drop a youtube url directly into my forum post, and it automatically embed?

Thank you

*

cdx1

Re: xBtit default script forum Youtube BBCode
« Reply #5 on: March 03, 2011, 10:25:57 pm »
will look like this

http://img714.imageshack.us/img714/160/changeb.jpg
xBtit default script forum Youtube BBCode


 ;)

*

jernatety

Re: xBtit default script forum Youtube BBCode
« Reply #6 on: March 03, 2011, 10:27:36 pm »
Cool, I'll give it a shot. Thank you for your help!

*

jernatety

Re: xBtit default script forum Youtube BBCode
« Reply #7 on: March 04, 2011, 02:43:36 pm »
Ok, I make the changes. Everything goes smoothly

Everything also looks good

I test and click "youtube" button on WYSIWYG Editor toolbar

It adds
Code: [Select]
[video=]
I try adding my youtube url, like this
Code: [Select]
[video=http://www.youtube.com/v/wlPQmTI2Lkk]and like this
Code: [Select]
[video=http://www.youtube.com/watch?v=wlPQmTI2Lkk]
Both nothing happen. I just see the the url with the tags after I submit. Does it matter I'm already using "Updated Enhanced BBCode" hack?

Thank you

Thanks

*

cdx1

Re: xBtit default script forum Youtube BBCode
« Reply #8 on: March 04, 2011, 04:46:45 pm »
i have not tested with any other Bbcode hack so im not sure, just tested with this link [video=http://www.youtube.com/watch?v=wlPQmTI2Lkk] and it worked fine on my site test it and uninstall the other bbcode hack then see if it works

*

jernatety

Re: xBtit default script forum Youtube BBCode
« Reply #9 on: March 04, 2011, 04:54:28 pm »
Hi cdx1

Do your site have 2.2.1? That's what mine is. It's the newest script.

*

witter

Re: xBtit default script forum Youtube BBCode
« Reply #10 on: May 14, 2011, 04:05:15 pm »
thank you mate workin fine

*

MrHide

Re: xBtit default script forum Youtube BBCode
« Reply #11 on: November 21, 2011, 07:23:00 am »
thx for hack!!

*

Offline cavaclub

  • **
  • 4
  • +0/-0
Re: xBtit default script forum Youtube BBCode
« Reply #12 on: January 13, 2018, 03:05:47 am »
a recent update for it... i have change some things

Code: [Select]
$content = preg_replace('#\[youtube\](https:\/\/www.youtube\.com\/watch\?v=|https:\/\/youtu\.be\/)?(.*?)\[/youtube\]#si', '<iframe width="625" height="350" src="https://www.youtube.com/embed/\2" frameborder="0"></iframe>', $content);
Code: [Select]
<td align="left"><input type="button" class="btn" name="img" value="YouTube" onclick="javascript: BBTag('[youtube]','[/youtube]',document.forms.<tag:form_name />.<tag:object_name />)" /></td>

 


Powered by EzPortal