<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.drunkenfell.com/index.php?action=history&amp;feed=atom&amp;title=Help_talk%3AHow_To_Embed_a_YouTube_Video</id>
	<title>Help talk:How To Embed a YouTube Video - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.drunkenfell.com/index.php?action=history&amp;feed=atom&amp;title=Help_talk%3AHow_To_Embed_a_YouTube_Video"/>
	<link rel="alternate" type="text/html" href="https://www.drunkenfell.com/index.php?title=Help_talk:How_To_Embed_a_YouTube_Video&amp;action=history"/>
	<updated>2026-04-21T06:33:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://www.drunkenfell.com/index.php?title=Help_talk:How_To_Embed_a_YouTube_Video&amp;diff=75949&amp;oldid=prev</id>
		<title>imported&gt;Arkalor: moved Talk:How To Embed a YouTube Video to Help talk:How To Embed a YouTube Video: Moving to the Help namespace</title>
		<link rel="alternate" type="text/html" href="https://www.drunkenfell.com/index.php?title=Help_talk:How_To_Embed_a_YouTube_Video&amp;diff=75949&amp;oldid=prev"/>
		<updated>2014-04-09T00:40:42Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;https://www.drunkenfell.com/index.php?title=Talk:How_To_Embed_a_YouTube_Video&quot; class=&quot;mw-redirect&quot; title=&quot;Talk:How To Embed a YouTube Video&quot;&gt;Talk:How To Embed a YouTube Video&lt;/a&gt; to &lt;a href=&quot;https://www.drunkenfell.com/index.php?title=Help_talk:How_To_Embed_a_YouTube_Video&quot; title=&quot;Help talk:How To Embed a YouTube Video&quot;&gt;Help talk:How To Embed a YouTube Video&lt;/a&gt;: Moving to the Help namespace&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__ToC__&lt;br /&gt;
&lt;br /&gt;
== Modification ==&lt;br /&gt;
This function depends on an added extension, the following code is saved as a php file named '''&amp;lt;code&amp;gt;YouTubeTag.php&amp;lt;/code&amp;gt;''' in the extensions folder and '''&amp;lt;code&amp;gt;require_once('extensions/YouTubeTag.php');&amp;lt;/code&amp;gt;''' is added to [[LocalSettings.php]]. Note that this code is a slight modification of the [http://www.mediawiki.org/wiki/Extension:YouTubeTag original] in that it allows the width to be specified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:auto; overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/*&lt;br /&gt;
 * YouTubeTag.php - Provides youtube tag for embedding a YouTube video into a page.&lt;br /&gt;
 * @author Jim R. Wilson&lt;br /&gt;
 * @version 0.1&lt;br /&gt;
 * @copyright Copyright (C) 2007 Jim R. Wilson&lt;br /&gt;
 * @license The MIT License - http://www.opensource.org/licenses/mit-license.php &lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 * Description:&lt;br /&gt;
 *     This is a MediaWiki extension which adds an additional tag, &amp;lt;youtube&amp;gt;, for embedding&lt;br /&gt;
 *     YouTube videos into wiki articles.&lt;br /&gt;
 * Requirements:&lt;br /&gt;
 *     MediaWiki 1.6.x, 1.8.x, 1.9.x or higher&lt;br /&gt;
 *     PHP 4.x, 5.x or higher&lt;br /&gt;
 * Installation:&lt;br /&gt;
 *     1. Drop this script (YouTubeTag.php) in $IP/extensions&lt;br /&gt;
 *         Note: $IP is your MediaWiki install dir.&lt;br /&gt;
 *     2. Enable the extension by adding this line to your LocalSettings.php:&lt;br /&gt;
 *            require_once('extensions/YouTubeTag.php');&lt;br /&gt;
 * Usage:&lt;br /&gt;
 *     Once installed, you may utilize YouTubeTag by placing the &amp;lt;youtube&amp;gt; tag in an&lt;br /&gt;
 *     article's text:&lt;br /&gt;
 *         &amp;lt;youtube v=&amp;quot;aYouTubeId&amp;quot; /&amp;gt;&lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 * Copyright (c) 2007 Jim R. Wilson&lt;br /&gt;
 * &lt;br /&gt;
 * Permission is hereby granted, free of charge, to any person obtaining a copy &lt;br /&gt;
 * of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal &lt;br /&gt;
 * in the Software without restriction, including without limitation the rights to &lt;br /&gt;
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of &lt;br /&gt;
 * the Software, and to permit persons to whom the Software is furnished to do &lt;br /&gt;
 * so, subject to the following conditions:&lt;br /&gt;
 * &lt;br /&gt;
 * The above copyright notice and this permission notice shall be included in all &lt;br /&gt;
 * copies or substantial portions of the Software.&lt;br /&gt;
 * &lt;br /&gt;
 * THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, &lt;br /&gt;
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES &lt;br /&gt;
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND &lt;br /&gt;
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT &lt;br /&gt;
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, &lt;br /&gt;
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING &lt;br /&gt;
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR &lt;br /&gt;
 * OTHER DEALINGS IN THE SOFTWARE. &lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
# Confirm MW environment&lt;br /&gt;
if (defined('MEDIAWIKI')) {&lt;br /&gt;
 &lt;br /&gt;
# Credits&lt;br /&gt;
$wgExtensionCredits['parserhook'][] = array(&lt;br /&gt;
    'name'=&amp;gt;'YouTubeTag',&lt;br /&gt;
    'author'=&amp;gt;'Jim Wilson (wilson.jim.r&amp;amp;lt;at&amp;amp;gt;gmail.com)',&lt;br /&gt;
    'url'=&amp;gt;'http://jimbojw.com/wiki/index.php?title=YouTubeTag',&lt;br /&gt;
    'description'=&amp;gt;'Provides youtube tag embedding videos into a page.',&lt;br /&gt;
    'version'=&amp;gt;'0.1'&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
# Register Extension initializer&lt;br /&gt;
$wgExtensionFunctions[] = &amp;quot;wfYouTubeTagExtension&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
# Extension initializer&lt;br /&gt;
function wfYouTubeTagExtension() {&lt;br /&gt;
    global $wgParser, $wgMessageCache;&lt;br /&gt;
    $wgParser-&amp;gt;setHook( &amp;quot;youtube&amp;quot;, &amp;quot;renderYouTubeTag&amp;quot; );&lt;br /&gt;
    $wgMessageCache-&amp;gt;addMessage('youtubetag-bad-id', 'Invalid YouTube video ID supplied: [$1]');&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * Callback function for embedding video.&lt;br /&gt;
 * @param String $input Text between open and close tags - should always be empty or null.&lt;br /&gt;
 * @param Array $params Array of tag attributes.&lt;br /&gt;
 * @param Parser $parser Instance of Parser performing the parse.&lt;br /&gt;
 */&lt;br /&gt;
function renderYouTubeTag( $input, $params, &amp;amp;$parser ) {&lt;br /&gt;
&lt;br /&gt;
    # Check for 'v' parameter and ensure it has a valid value&lt;br /&gt;
    $v = htmlspecialchars($params['v']);&lt;br /&gt;
    if ($v==null || preg_match('%[^A-Za-z0-9_\\-]%',$v)) {&lt;br /&gt;
        return '&amp;lt;div class=&amp;quot;errorbox&amp;quot;&amp;gt;'.wfMsgForContent('youtubetag-bad-id', $v).'&amp;lt;/div&amp;gt;';&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    # Check for 'width' parameter and ensure it has a valid value&lt;br /&gt;
    $width = htmlspecialchars($params['width']);&lt;br /&gt;
    if ($width==null || preg_match('[0-9]',$width)) {&lt;br /&gt;
        $width=425;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width==0) {&lt;br /&gt;
        $width=425;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width&amp;gt;1024) {&lt;br /&gt;
        $width=1024;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width&amp;lt;100) {&lt;br /&gt;
        $width=100;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ratio = 425 / 350;&lt;br /&gt;
    $height = round($width / $ratio);&lt;br /&gt;
&lt;br /&gt;
    # Build URL and output embedded flash object&lt;br /&gt;
    $url = &amp;quot;http://www.youtube.com/v/$v&amp;quot;;&lt;br /&gt;
    return&lt;br /&gt;
        '&amp;lt;object width=&amp;quot;'.$width.'&amp;quot; height=&amp;quot;'.$height.'&amp;quot;&amp;gt;'.&lt;br /&gt;
        '&amp;lt;param name=&amp;quot;movie&amp;quot; value=&amp;quot;'.$url.'&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;'.&lt;br /&gt;
        '&amp;lt;param name=&amp;quot;wmode&amp;quot; value=&amp;quot;transparent&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;'.&lt;br /&gt;
        '&amp;lt;embed src=&amp;quot;'.$url.'&amp;quot; type=&amp;quot;application/x-shockwave-flash&amp;quot; '.&lt;br /&gt;
        'wmode=&amp;quot;transparent&amp;quot; width=&amp;quot;'.$width.'&amp;quot; height=&amp;quot;'.$height.'&amp;quot;&amp;gt;'.&lt;br /&gt;
        '&amp;lt;/embed&amp;gt;&amp;lt;/object&amp;gt;';&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
} # Closing MW Environment wrapper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Arkalor</name></author>
	</entry>
</feed>