1. leht 1-st

[2.0.23] Video Wärav Advanced BBCode Box Mod

Postitatud: Pühapäev, 06 Mai 2007, 00:14
Postitas Pistik
Tegemist siis Eestimaise videokeskkonna Video Wärav (info) foorumi postitustesse videode lisamise mod'iga.

Lisamine:
Pilt

Ja väljund:
Pilt

Ikoon: Pilt

Kood: Vali kõik

##############################################################
## MOD Title: integrate video wärav in advanced bbcode box
## MOD Author: Michelinimehike < silx99@gmail.com > (n/a) http://www.emol.be
## MOD Description: This mod add image button to your advanced BBcode box, for video wärav
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 10 minutes
## Files To Edit: language/lang_english/lang_main.php
##                templates/subSilver/posting_body.tpl
##                templates/subSilver/bbcode.tpl
##                includes/bbcode.php
##                mods/bbcode_box/bbcode_box.js
##                mods/bbcode_box/add_bbcode.js
## Included Files: videowww.gif
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: put the included images in mods/bbcode_box/images/ !!!
## You need to install the advanced bbcode box mod BEFORE installing this mod !! ( http://www.phpbbhacks.com/download/1059 )
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
language/lang_estonian/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['youtube_link'] = 'Link';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bbcode_help']['videowww'] = 'Video Wärav: [videowww]Video Wärav URL[/videowww]';
$lang['videowww_link'] = 'Link';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<img border="0" src="mods/bbcode_box/images/code.gif" name="code" type="image" onClick="BBCcode()" onMouseOver="helpline('code')" class="postimage" alt="Code">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<img border="0" src="mods/bbcode_box/images/youtube.gif" name="youtube" type="image" onClick="BBCyoutube()" onMouseOver="helpline('youtube')" class="postimage" alt="Youtube">
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<img border="0" src="mods/bbcode_box/images/videowww.gif" name="videowww" type="image" onClick="BBCvideowww()" onMouseOver="helpline('videowww')" class="postimage" alt="Video Wärav">
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END youtube -->

#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN videowww -->
<object width="425" height="320">
   <param name="movie" value="http://video.www.ee/www_video6.swf?video={VIDEOWWWID}"></param>
   <embed src="http://video.www.ee/www_video6.swf?video={VIDEOWWWID}" type="application/x-shockwave-flash" width="425" height="320"></embed>
</object><br />
<a href="http://video.www.ee/?video={VIDEOWWWID}" target="_blank">{VIDEOWWWLINK}</a><br />
<!-- END videowww -->

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl['youtube'] = str_replace('{YOUTUBELINK}', $lang['youtube_link'], $bbcode_tpl['youtube']);

#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_tpl['videowww'] = str_replace('{VIDEOWWWID}', '\\1', $bbcode_tpl['videowww']);
$bbcode_tpl['videowww'] = str_replace('{VIDEOWWWLINK}', $lang['videowww_link'], $bbcode_tpl['videowww']);


#
#-----[ FIND ]------------------------------------------
#
// [youtube]YouTube URL[/youtube] code..
$patterns[] = "#\[youtube\]http://(?:www\.)?youtube.com/watch\?v=([0-9A-Za-z-_]{11})[^[]*\[/youtube\]#is";
$replacements[] = $bbcode_tpl['youtube'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
 // [videowww]Video Wärav URL[/videowww] code..
$patterns[] = "#\[videowww\]http://video.www.ee/\?video=([0-9A-Za-z-_]{13})[^[]*\[/videowww\]#is";
$replacements[] = $bbcode_tpl['videowww'];

#
#-----[ OPEN ]------------------------------------------
#
mods/bbcode_box/bbcode_box.js
#
#-----[ FIND ]------------------------------------------
#
googlevid_help = "Post a google video";
#
#-----[ AFTER, ADD ]------------------------------------------
#
videowww_help = "Post a videowww video";
#
#-----[ FIND ]------------------------------------------
#
var GVideo = 0;

#
#-----[ AFTER, ADD ]------------------------------------------
#
var videowww = 0;

#
#-----[ FIND ]------------------------------------------
#
function BBCyoutube() {
   var FoundErrors = '';
   var enterURL   = prompt("Give the URL of the page containing the movie", "http://");
   if (!enterURL)    {
      FoundErrors += "Didnt gave an URL";
   }
   if (FoundErrors)  {
      alert("Error:"+FoundErrors);
      return;
   }
   var ToAdd = "[youtube]"+enterURL+"[/youtube]";
   PostWrite(ToAdd);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
function BBCvideowww() {
var FoundErrors = '';
var enterURL   = prompt("Enter the video URL", "http://");
if (!enterURL)    {
	FoundErrors += " You didn't write the file URL";
}
if (FoundErrors)  {
	alert("Error:"+FoundErrors);
	return;
}
var ToAdd = "[videowww]"+enterURL+"[/videowww]";
PostWrite(ToAdd);
}

#
#-----[ OPEN ]------------------------------------------
#
mods/bbcode_box/add_bbcode.js
#
#-----[ FIND ]------------------------------------------
#
googlevid_help = "Post a google video";
#
#-----[ AFTER, ADD ]------------------------------------------
#
videowww_help = "Post a videowww video";

#
#-----[ FIND ]------------------------------------------
#
var GVideo = 0;

#
#-----[ AFTER, ADD ]------------------------------------------
#
var videowww = 0;
#
#-----[ FIND ]------------------------------------------
#
function BBCyoutube() {
   var FoundErrors = '';
   var enterURL   = prompt("Give the URL of the page containing the movie", "http://");
   if (!enterURL)    {
      FoundErrors += "Didnt gave an URL";
   }
   if (FoundErrors)  {
      alert("Error:"+FoundErrors);
      return;
   }
   var ToAdd = "[youtube]"+enterURL+"[/youtube]";
   PostWrite(ToAdd);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
function BBCvideowww() {
var FoundErrors = '';
var enterURL   = prompt("Enter the video URL", "http://");
if (!enterURL)    {
	FoundErrors += " You didn't write the file URL";
}
if (FoundErrors)  {
	alert("Error:"+FoundErrors);
	return;
}
var ToAdd = "[videowww]"+enterURL+"[/videowww]";
PostWrite(ToAdd);
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Töötav näide: vormel1.webart.ee/foorum