https://www.icyphoenix.com/viewtopic.php?f=4&t=6428
-----------------------------------
Lopalong
Sun 06 Sep, 2009 01:33

CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
To create a new BBCode for adding video links, you will need to [i][b]create[/b][/i] and [b][i][u]REPLACE[/u][/i][/b] the [b]$html =[/b] Code for the video format you are trying to add, and also create two icons for the editor.

Copy your icons as megavideo.gif and megvideo1.gif to /images/bbcb_mg/gif/*.gif

Then replace all of the [b](MegaVideo, megavideo, MEGAVIDEO)[/b] words or parts of words here with the name of the video format you are going to use - Then follow the instructions to install it.

[b]MegaVideo: Instructions with ($html Option 1.)[/b]
[spoiler][code linenumbers=false]Open : includes/bbcb_mg.php

Find:

	'L_BBCB_MG_YOUTUBE' => $lang['bbcb_mg_youtube'],


After Add:

	'L_BBCB_MG_MEGAVIDEO' => $lang['bbcb_mg_megavideo'],

Find: 

	'L_YOUTUBE_HELP' => $lang['s_youtube_help'],

After Add: 

	'L_MEGAVIDEO_HELP' => $lang['s_megavideo_help'],


Open : includes/bbcode.php

Find: 

		'youtube'		=> array('nested' => true, 'inurl' => true, 'allow_empty' => false),

After Add: 

		'megavideo'		=> array('nested' => true, 'inurl' => true, 'allow_empty' => false),

Find: 

($tag === 'youtube')

Inline After Add: (Note the leading space)

 || ($tag === 'megavideo')

Find:

				elseif ($tag === 'googlevideo')

Before Add:

				elseif ($tag === 'megavideo') 
				{ 
				$html = '<object width="640" height="480"><param name="movie" value="http://www.megavideo.com/v/' . $content . '.800360084.3" /><embed src="http://www.megavideo.com/v/' . $content . '.800360084.3" type="application/x-shockwave-flash" width="640" height="480"></embed></object><br /><a href="http://megavideo.com/?v=' . $content . '" target="_blank">Link</a><br />'; 
				}

Open: templates/common/js/bbcb_mg.js

Find:

var youtube = 0;

After Add:

var megavideo = 0;

Find:

'[youtube]','[/youtube]',

After Add:

'[megavideo]','[/megavideo]',

Find:

function BBCyoutube()
{
	var FoundErrors = '';
	var enterURL = prompt(s_youtube_insert, s_id_insert_tip);
	if (!enterURL)
	{
		FoundErrors += s_id_insert_error;
	}
	if (FoundErrors)
	{
		alert(s_gen_error + FoundErrors);
		return;
	}
	var ToAdd = "[youtube]" + enterURL + "[/youtube]";
	PostWrite(ToAdd);
}

After Add:

function BBCmegavideo()
{
  var FoundErrors = ''; 
  var enterURL = prompt(s_megavideo_insert, s_id_insert_tip); 
  if (!enterURL) 
  { 
    FoundErrors += s_id_insert_error; 
  } 
  if (FoundErrors) 
  { 
    alert(s_gen_error + FoundErrors); 
    return; 
  } 
  var ToAdd = "[megavideo]"+enterURL+"[/megavideo]"; 
  PostWrite(ToAdd); 
}

Open:

templates/default/bbcb_mg.tpl

Find:

					<a href="javascript:BBCyoutube()"><img src="{BBCB_MG_IMG_PATH}youtube{BBCB_MG_IMG_EXT}" name="youtube" onmouseover="helpline('youtube')" alt="{L_BBCB_MG_YOUTUBE}" title="{L_BBCB_MG_YOUTUBE}" class="bbimages" /></a>

After Add:

					<a href="javascript:BBCmegavideo()"><img src="{BBCB_MG_IMG_PATH}megavideo{BBCB_MG_IMG_EXT}" name="megavideo" onmouseover="helpline('megavideo')" alt="{L_BBCB_MG_MEGAVIDEO}" title="{L_BBCB_MG_MEGAVIDEO}" class="bbimages" /></a>

Open: language/lang_english/lang_bbcb_mg.php

Find:

	'bbcb_mg_youtube' => 'YouTube',

After Add:

	'bbcb_mg_megavideo' => 'MegaVideo',

Find:

$js_lang['s_youtube_insert'] = 'Please write YouTube file ID';

After Add:

$js_lang['s_megavideo_insert'] = 'Please write Megavideo file ID';

Find:

$js_lang['s_youtube_help'] = 'Insert YouTube video file: [youtube]YouTube ID[/youtube]';

After Add:

$js_lang['s_megavideo_help'] = 'Insert MegaVideo video file: [megavideo]MegaVideo ID[/megavideo]';[/code][/spoiler]


[b]MegaVideo: (Option 2.)[/b] [megavideo]Tags[/megavideo]
[spoiler][code linenumbers=false]					$html = '<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="432" height="351"><param name="movie"  value="http://wwwstatic.megavideo.com/ep_gr.swf?&amp;v=' . $content . '&image=" /><param name="play" value="false" />
<param name="loop" value="false" /><param name="quality" value="high" />
<param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" />
<embed src="http://wwwstatic.megavideo.com/ep_gr.swf?&amp;v=' . $content . '&image=" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  width="432" height="351" play="false" loop="false" quality="high" allowscriptaccess="never" allownetworking="internal"></embed></object>';[/code][/spoiler]


[b]TwitVideo:[/b] [twitvideo]Tags[/twitvideo]
[spoiler][code linenumbers=false]					$html = '<object width="425" height="344"><param name="movie" value="http://www.twitvid.com/player/' . $content . '"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.twitvid.com/player/' . $content . '" quality="high" allowscriptaccess="always" allowNetworking="all" allowfullscreen="true" wmode="transparent" height="344" width="425"></object>';[/code][/spoiler]


[b]Atom:[/b] [atom]Tags[/atom]
[spoiler][code linenumbers=false]					$html = '<embed src="http://media.mtvnservices.com/mgid:hcx:content:atom.com:' . $content . '" type="application/x-shockwave-flash" wmode="window" width="425" height="354" allowFullscreen="true" flashvars="autoPlay=false"></embed>';[/code][/spoiler]


[b]Xfire Video:[/b] [xfirevideo]Tags[/xfirevideo]
[spoiler][code linenumbers=false]					$html = '<embed id="VideoPlayback"src="http://media.xfire.com/swf/vplayer.swf?videoid=' . $content . '" style="width: 425px; height: 350px;" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed>';[/code][/spoiler]

[b]Added by rixard:[/b] [url=http://icyphoenix.com/viewtopic.php?p=44074#p44074][b]BLIP.TV & VIMEO[/b]


[b]More Video Codes.[/b] http://www.phpbb3bbcodes.com/viewforum.php?f=26&start=25

[b]Note:[/b] To convert pbpBB3 Video Codes to Icy Phoenix, [b][i][u]REPLACE[/u][/i][/b] [b]{TEXT}[/b] with [b]' . $content . '[/b]


-----------------------------------
Danielc
Sun 06 Sep, 2009 14:52

Re: [DOC - IP V1.3*] Add Video BBCode And Buttons To The Editor. (Walkthrough)
-----------------------------------
Thanks for this post!!!! I knew about adding the bbcode parsing, but not how to add the button and the javascript..
Thanks!!


-----------------------------------
novice programmer
Sun 06 Sep, 2009 15:37

Re: [DOC - IP V1.3*] Add Video BBCode And Buttons To The Editor. (Walkthrough)
-----------------------------------
Great one!

I will move it to the docs section and add the tag on the title ;)

For the historical records, the original title was:

[DOC - IP V1.3*] Add Video BBCode And Buttons To The Editor. (Walkthrough)


-----------------------------------
rixard
Mon 07 Sep, 2009 06:47

Re: CUSTOMIZATION - Add Video BBCode And Buttons To The Editor. (Walkthrough)
-----------------------------------
Thanks!, 

Can I add the [b]Blip.tv[/b] and [b]Vimeo[/b] html codes at this post?

[hr]

[b]BLIP.TV[/b]
[spoiler][code linenumbers=false]				elseif ($tag === 'blip')
				{
					$width = in_array($width, $width_array) ? $width : '425';
					$height = in_array($height, $height_array) ? $height : '350';
					$html = '<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://blip.tv/play/' . $content . '"></param><embed style="width:' . $width . 'px; height:' . $height . 'px;" type="application/x-shockwave-flash" src="http://blip.tv/play/' . $content . '"quality="best" bgcolor="#f8f8f8" allowscriptaccess="always" allowfullscreen="true" ></embed></object><br /><a href="http://blip.tv/play/' . $content . '" target="_blank">Link</a><br />';
				}[/code][/spoiler]

[hr]

[b]VIMEO[/b]				
[spoiler][code linenumbers=false]				elseif ($tag === 'vimeo')
				{
					$width = in_array($width, $width_array) ? $width : '425';
					$height = in_array($height, $height_array) ? $height : '350';
					$html = '<object width="' . $width . '" height="' . $height . '"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' . $content . '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=' . $content . '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed></object><br /><a href="http://vimeo.com/moogaloop.swf?clip_id=' . $content . '" target="_blank">Link</a><br />';
				}[/code][/spoiler]


-----------------------------------
Lopalong
Mon 07 Sep, 2009 13:55

Re: CUSTOMIZATION - How To Add Video BBCode And Buttons To The Editor
-----------------------------------
Thanks rixard, of course you can add extra video bbCode here. ;)

I've just added yours (Linked) to the first post, plus added some more codes and a link to about 90 more video codes.  :mricy:


-----------------------------------
Chaotic
Mon 07 Sep, 2009 17:46

Re: CUSTOMIZATION - How To Add Video BBCode And Buttons To The Editor
-----------------------------------
Great tutorial and very detailed.

As always, good work.


-----------------------------------
Lopalong
Tue 08 Sep, 2009 01:11

Re: CUSTOMIZATION - How To Add Video BBCode And Buttons To The Editor
-----------------------------------
Aw shucks!  :oops:


-----------------------------------
DWho
Wed 09 Sep, 2009 22:23

Re: CUSTOMIZATION - How To Add Video BBCode And Buttons To The Editor
-----------------------------------
[quote user="Lopalong" post="44090"]Aw shucks!  :oops:[/quote]

lol... thanks for the guide... 

looking at bbcode mods so this will come in handy

 :mrgreen:  :mrgreen:


-----------------------------------
Lopalong
Wed 09 Sep, 2009 23:35

Re: CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
Yeah! Mike, phpbb3bbcodes.com has certainly got some interesting bbCodes on offer, and I particularly am going to have a look at the one that forms columns. ;)

Looks like we will need a BBCODE tag in the docs section if I start running amok.  :lol:


-----------------------------------
spydie
Thu 10 Sep, 2009 00:22

Re: CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
We hope you start a BBcode DOC.

because some off us are really in need of them.


-----------------------------------
Lopalong
Thu 10 Sep, 2009 00:32

Re: CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
[ot user="spydie" post="44191"]We hope you start a BBcode DOC.

because some off us are really in need of them.[/ot]

Something like this maybe?

http://www.icyphoenix.com/viewtopic.php?f=4&t=1604


-----------------------------------
spydie
Thu 10 Sep, 2009 11:40

Re: CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
yep. something alike.

but with code´s that actualy work with icy 1.3

and some new ones


-----------------------------------
Lopalong
Thu 10 Sep, 2009 13:34

Re: CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
-----------------------------------
includes/bbcode.php lists all of the available internal BBcodes for IP mostly in CAPS "// SIZE and // ALIGN" etc. Why don't you or someone else check them out against the Glossary and see if there are any of them missing?

 :twisted: 

Any new ones that are added for IP belong in the DOCS section, and I may suggest to MG that we could / may need a BBCODE prefix for those additions. Meanwhile there aren't enough docs to warrant it.

So there's nothing stopping anyone else from writing some; and if language is the problem - - - - - - - - - I'll spell-check them etc, for anyone who asks me to, before they release them.  :mricy:


