Man kopiert einfach die URL des zu verlinkenden Videos, klickt auf die Schaltfläche YouTube und fügt diesen Link dort ein. (Beispiel: https://www.youtube.com/watch?v=oJHDNWSJjek)
Die Parameter für die Höhe und Breite sind bereits im Script definiert und werden automatisch ausgegeben, sodaß die Videos in den entsprechenden Größen angezeigt werden. Vormals war das auch mit dem Flash Tag möglich. Dort musste man aber jedesmal die Größen manuell eingeben.
Die Tags können aber auch manuell angegeben werden.
Code: Alles auswählen
[media]Link[/media]
[GVideo]Link[/GVideo]
Quelle Originalcode: https://www.phpbb.com/community/viewtopic.php?t=458424
Hier der Quellcode für Plus 1.53
Code: Alles auswählen
##############################################################
## MOD Title: integrate media and google-video in advanced bbcode box
## MOD Author: freddie < freddie@tactic.be > https://www.tactic.be
## MOD Author Plus 1.53: Axel Zimmermann < axel@selsstieg.de > https://eselsstieg.de
## MOD Description: This mod adds 2 image buttons to your advanced BBcode box, one for media and one for google-video
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit:
## mods/bbcode_box/add_bbcode.js
## includes/bbcode.php
## templates/your template/bbcode.tpl
## templates/fisubsilversh/posting_body.tpl
## language/your language/lang_main.php
##
## Included Files: googlevid.gif, media.gif
##
## Verified Compatability: i'm running Plus 1.53 2.0.22
##
## topic on phpbb.com with screenshots : https://www.phpbb.com/phpBB/viewtopic.php?t=458424
##############################################################
## Author Notes: put the included images in mods/bbcode_box/images/ !!!
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
language/your language/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['bbcode_f_help']
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bbcode_help']['GVideo'] = 'GVideo: [GVideo]GVideo URL[/GVideo]';
$lang['GVideo_link'] = 'Link';
$lang['bbcode_help']['media'] = 'YouTube: [media]YouTube URL[/media]';
$lang['media_link'] = 'Link';
#
#-----[ OPEN ]------------------------------------------
#
templates/your template/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<img border="0" src="bbcode_box/images/ram.gif" width="24" height="20" name="ram" type="image" onClick="BBCram()"
onMouseOver="helpline('ram')" style="border-style: outset; border-width: 1" alt="Real Media">
#
#-----[ INLINE, AFTER, ADD ]------------------------------------------
#
<img border="0" src="bbcode_box/images/googlevid.gif" width="24" height="20" name="GVideo" type="image" onClick="BBCGVideo()"
onMouseOver="helpline('GVideo')" style="border-style: outset; border-width: 1" alt="GoogleVid"><img border="0"
src="bbcode_box/images/media.gif" width="24" height="20" name="media" type="image" onClick="BBCmedia()"
onMouseOver="helpline('media')" style="border-style: outset; border-width: 1" alt="Youtube">
#
#-----[ OPEN ]------------------------------------------
#
templates/your template/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
</EMBED></OBJECT><!-- END flash -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN GVideo -->
<object width="425" height="350">
<param name="movie" value="https://video.google.com/googleplayer.swf?docId={GVIDEOID}"></param>
<embed style="width:425px; height:350px;" id="VideoPlayback"
align="middle" type="application/x-shockwave-flash"
src="https://video.google.com/googleplayer.swf?docId={GVIDEOID}"
allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff"
scale="noScale" salign="TL" FlashVars="playerMode=embedded">
</embed>
</object><br />
<a href="https://video.google.com/googleplayer.swf?docId={GVIDEOID}" target="_blank">{GVIDEOLINK}</a><br />
<!-- END GVideo -->
<!-- BEGIN media -->
<object width="425" height="350">
<param name="movie" value="https://www.youtube.com/v/{YOUTUBEID}"></param>
<embed src="https://www.youtube.com/v/{YOUTUBEID}" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object><br />
<a href="https://media.com/watch?v={YOUTUBEID}" target="_blank">{YOUTUBELINK}</a><br />
<!-- END media -->
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_tpl['GVideo'] = str_replace('{GVIDEOID}', '\\1', $bbcode_tpl['GVideo']);
$bbcode_tpl['GVideo'] = str_replace('{GVIDEOLINK}', $lang['GVideo_link'], $bbcode_tpl['GVideo']);
$bbcode_tpl['media'] = str_replace('{YOUTUBEID}', '\\1', $bbcode_tpl['media']);
$bbcode_tpl['media'] = str_replace('{YOUTUBELINK}', $lang['media_link'], $bbcode_tpl['media']);
#
#-----[ FIND ]------------------------------------------
#
// [email]user@domain.tld[/email] code..
$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
$replacements[] = $bbcode_tpl['email'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [GVideo]GVideo URL[/GVideo] code..
$patterns[] = "#\[GVideo\]https://video.google.[A-Za-z0-9.]{2,5}/videoplay\?docid=([0-9A-Za-z-_]*)[^[]*\[/GVideo\]#is";
$replacements[] = $bbcode_tpl['GVideo'];
// [media]YouTube URL[/media] code..
$patterns[] = "#\[media\]https://(?:www\.)?media.com/watch\?v=([0-9A-Za-z-_]{11})[^[]*\[/media\]#is";
$replacements[] = $bbcode_tpl['media'];
#
#-----[ OPEN ]------------------------------------------
#
mods/bbcode_box/add_bbcode.js
#
#-----[ FIND ]------------------------------------------
#
var ram = 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
var media = 0;
var GVideo = 0;
#
#-----[ FIND ]------------------------------------------
#
function BBCimgr() {
var FoundErrors = '';
var enterURL = prompt("Enter the image URL","https://");
if (!enterURL) {
FoundErrors += "You didn't write the image URL";
}
if (FoundErrors) {
alert("Error :"+FoundErrors);
return;
}
var ToAdd = "[right]"+enterURL+"[/right]";
document.post.message.value+=ToAdd;
document.post.message.focus();
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
function BBCGVideo() {
var FoundErrors = '';
var enterURL = prompt("Give the URL of the page containing the movie", "https://");
if (!enterURL) {
FoundErrors += " Error: Didnt gave an URL";
}
if (FoundErrors) {
alert("Error:"+FoundErrors);
return;
}
var ToAdd = "[GVideo]"+enterURL+"[/GVideo]";
document.post.message.value+=ToAdd;
document.post.message.focus();
}
function BBCmedia() {
var FoundErrors = '';
var enterURL = prompt("Give the URL of the page containing the movie", "https://");
if (!enterURL) {
FoundErrors += " Error: Didnt gave an URL";
}
if (FoundErrors) {
alert("Error:"+FoundErrors);
return;
}
var ToAdd = "[media]"+enterURL+"[/media]";
document.post.message.value+=ToAdd;
document.post.message.focus();
}
#
#-----[ FIND ]------------------------------------------
#
ram_help="Insert Real Media file: [ram]File URL[/ram]";
#
#-----[ AFTER, ADD ]------------------------------------------
#
GVideo_help="Füge ein Google Video ein: [GVideo]Videolink[/GVideo]";
media_help="Füge ein YouTube Video ein: [media]Videolink[/media]";
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
templates/fisubsilversh/bbcode.tpl
<!-- BEGIN GVideo -->
<object width="425" height="350">
<param name="movie" value="https://video.google.com/googleplayer.swf?docId={GVIDEOID}"></param>
<embed style="width:425px; height:350px;" id="VideoPlayback"
align="middle" type="application/x-shockwave-flash"
src="https://video.google.com/googleplayer.swf?docId={GVIDEOID}"
allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff"
scale="noScale" salign="TL" FlashVars="playerMode=embedded">
</embed>
</object><br />
<a href="https://video.google.com/googleplayer.swf?docId={GVIDEOID}" target="_blank">{GVIDEOLINK}</a><br />
<!-- END GVideo -->
<!-- BEGIN media -->
<object width="425" height="350">
<param name="movie" value="https://www.youtube.com/v/{YOUTUBEID}"></param>
<embed src="https://www.youtube.com/v/{YOUTUBEID}" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object><br />
<a href="https://media.com/watch?v={YOUTUBEID}" target="_blank">{YOUTUBELINK}</a><br />
<!-- END media -->
Die Parameter "width" und "height" entsprechend anpassen!
Code: Alles auswählen
#
#-----[ OPEN ]------------------------------------------
#
templates/fisubsilversh/bbcode.tpl
Lösche dort folgende Stellen ...
Für YouTube
<br />
<a href="https://media.com/watch?v={YOUTUBEID}" target="_blank">{YOUTUBELINK}</a><br />
Für GoogleVideo
<br />
<a href="https://video.google.com/googleplayer.swf?docId={GVIDEOID}" target="_blank">{GVIDEOLINK}</a><br />
Zusätzlich noch die Sprachstrings in den Language Files entfernen!
#-----[ OPEN ]------------------------------------------
#
language/your language/lang_main.php
#
#-----[ DELETE ]------------------------------------------
#
$lang['GVideo_link'] = 'Link';
$lang['media_link'] = 'Link';
Gruß
Axel