YouTube on FUDforum [message #38734] |
Sat, 25 August 2007 07:52 |
ron4
Messages: 17 Registered: July 2007
Karma: 0
|
Junior Member |
|
|
Hi Ilia,
I was wondering whether it is possible to embed YouTube videos into a post.
I noticed it can be done by turning on HTML code, but is there another way?
How can I make such a tag?
thanks very much!
Ron
|
|
|
Re: YouTube on FUDforum [message #38755 is a reply to message #38734] |
Sun, 26 August 2007 16:43 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
I would not recommend allowing HTML posting as that is a major security hole for your forum, since HTML allows just about anything. If you want to add a new tag you need to edit the post_proc.inc.t and add url[/youtube] tag. You can use existing tags as a reference point.
FUDforum Core Developer
|
|
|
|
|
|
Re: YouTube on FUDforum [message #40807 is a reply to message #38788] |
Sun, 13 April 2008 20:42 |
|
Jaems
Messages: 27 Registered: February 2007
Karma: 0
|
Junior Member |
|
|
I got a YouTube embed to work in FUDcode by tweaking existing tags and drinking lots of coffee. Edit post_proc.inc.t to include the following lines:
This goes with the other replacements:
/* Start YouTubeReplace */
while (preg_match('!<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/([^"]+)"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/(.*?)" type="application/x-shockwave-flash" wmode="transparent"
width="425" height="355"></embed></object>!s', $fudml, $res)) {
$fudml = str_replace($res[0], '[youtube]'.$res[2].'[/youtube]',$fudml);
}
/* End YouTubeReplace */
This goes with the other cases
/* Start YouTubeCase*/
case 'youtube':
$url = substr($str, $epos+1, ($cpos-$epos)-1);
$end_tag[$cpos] = '" type="application/x-shockwave-flash" wmode="transparent"
width="425" height="355"></embed></object>';
$ostr .= '<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/'.$url.'"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/';
break;
/*End YouTubeCase */
I can't guarantee that some of that code isn't extraneous, since it is very reverse engineered. But it does work.
jnote.org
FUD version 2.7.7, Apache
[Updated on: Wed, 11 June 2008 22:21] Report message to a moderator
|
|
|
|
|
|
|
|
Re: YouTube on FUDforum [message #159802 is a reply to message #159799] |
Thu, 25 June 2009 19:32 |
thebugnut
Messages: 87 Registered: June 2005
Karma: 0
|
Member |
|
|
So first I need to create an icon and place it in the same folder as the other ones? Then what?
Here is the Code from that template...
<tr class="RowStyleA"><td class="GenText nw">{MSG: post_format_tools}</td><td>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td>
<table cellspacing="1" cellpadding="2" class="FormattingToolsBG">
<tr>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_bold}" accesskey="b" href="javascript: insertTag(document.post_form.msg_body, \'[B]\', \'[/B]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_bold.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_italics}" accesskey="i" href="javascript: insertTag(document.post_form.msg_body, \'[I]\', \'[/I]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_italic.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_underline}" accesskey="u" href="javascript: insertTag(document.post_form.msg_body, \'[U]\', \'[/U]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_underline.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_align_left}" href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=left]\', \'[/ALIGN]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_aleft.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_align_center}" href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=center]\', \'[/ALIGN]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_acenter.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_align_right}" href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=right]\', \'[/ALIGN]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_aright.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_link}" accesskey="w" href="javascript: url_insert();"><img alt="" src="{THEME_IMAGE_ROOT}/b_url.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_email}" accesskey="e" href="javascript: email_insert();"><img alt="" src="{THEME_IMAGE_ROOT}/b_email.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_image}" accesskey="m" href="javascript: image_insert();"><img alt="" src="{THEME_IMAGE_ROOT}/b_image.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_nlist}" accesskey="l" href="javascript: window_open(\'{TEMPLATE: fud_code_icons_lnk1}\', \'listmaker\', 350, 350);"><img alt="" src="{THEME_IMAGE_ROOT}/b_numlist.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_blist}" href="javascript: window_open(\'{TEMPLATE: fud_code_icons_lnk2}\', \'listmaker\', 350, 350);"><img alt="" src="{THEME_IMAGE_ROOT}/b_bulletlist.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_quote}" accesskey="q" href="javascript: insertTag(document.post_form.msg_body, \'[QUOTE]\', \'[/QUOTE]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_quote.gif" /></a></td>
<td class="FormattingToolsCLR"><a title="{MSG: post_common_code}" accesskey="c" href="javascript: insertTag(document.post_form.msg_body, \'[CODE]\', \'[/CODE]\');"><img alt="" src="{THEME_IMAGE_ROOT}/b_code.gif" /></a></td>
</tr>
</table>
</td>
<td>
<select name="fnt_size" onchange="insertTag(document.post_form.msg_body, \'[SIZE=\'+document.post_form.fnt_size.options[this.selectedIndex].value+\']\', \'[/SIZE]\'); document.post_form.fnt_size.options[0].selected=true">
<option value="" selected="selected">{MSG: post_size}</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<select name="fnt_color" onchange="insertTag(document.post_form.msg_body, \'[COLOR=\'+document.post_form.fnt_color.options[this.selectedIndex].value+\']\', \'[/COLOR]\'); document.post_form.fnt_color.options[0].selected=true">
<option value="">{MSG: post_color}</option>
<option value="skyblue" style="color:skyblue">Sky Blue</option>
<option value="royalblue" style="color:royalblue">Royal Blue</option>
<option value="blue" style="color:blue">Blue</option>
<option value="darkblue" style="color:darkblue">Dark Blue</option>
<option value="orange" style="color:orange">Orange</option>
<option value="orangered" style="color:orangered">Orange Red</option>
<option value="crimson" style="color:crimson">Crimson</option>
<option value="red" style="color:red">Red</option>
<option value="firebrick" style="color:firebrick">Firebrick</option>
<option value="darkred" style="color:darkred">Dark Red</option>
<option value="green" style="color:green">Green</option>
<option value="limegreen" style="color:limegreen">Lime Green</option>
<option value="seagreen" style="color:seagreen">Sea Green</option>
<option value="deeppink" style="color:deeppink">Deep Pink</option>
<option value="tomato" style="color:tomato">Tomato</option>
<option value="coral" style="color:coral">Coral</option>
<option value="purple" style="color:purple">Purple</option>
<option value="indigo" style="color:indigo">Indigo</option>
<option value="burlywood" style="color:burlywood">Burly Wood</option>
<option value="sandybrown" style="color:sandybrown">Sandy Brown</option>
<option value="sienna" style="color:sienna">Sienna</option>
<option value="chocolate" style="color:chocolate">Chocolate</option>
<option value="teal" style="color:teal">Teal</option>
<option value="silver" style="color:silver">Silver</option>
</select>
<select name="fnt_face" onchange="insertTag(document.post_form.msg_body, \'[FONT=\'+document.post_form.fnt_face.options[this.selectedIndex].value+\']\', \'[/FONT]\'); document.post_form.fnt_face.options[0].selected=true">
<option value="">{MSG: post_font}</option>
<option value="Arial" style="font-family:Arial">Arial</option>
<option value="Times" style="font-family:Times">Times</option>
<option value="Courier" style="font-family:Courier">Courier</option>
<option value="Century" style="font-family:Century">Century</option>
</select>
</td></tr></table></td></tr>
|
|
|
|