BBCodeBox3

prosilver | subsilver2

Willkommen und Guten Morgen, Guest  Beim nächsten Piep ist es zwischen 8:00 und 9:00 Uhr

It is currently Sun 23. Feb 2025, 09:04

All times are UTC + 1 hour [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Mon 8. Mar 2010, 02:41 
Administrator
User avatar

Posts: 427

Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...

Joined:
Sun 13. Jan 2008, 23:44

[DEV] Auto Video Embed

MOD-Title: Auto Video Embed
MOD-Version: 0.0.2
MOD-Author: 4seven

Credits: Marc Reichelt for EMFF-Player
Credits: Jeroen Wing for JW Player

Requests:
http://www.phpbb.com/community/viewtopi ... p=12129575
http://www.phpbb.com/community/viewtopi ... p=12135145
http://www.phpbb.com/community/viewtopi ... p=11879555
https://www.phpbb.de/community/viewtopi ... 0#p1166200

MOD-Description: This Mod makes it possible to embed videos from popular video-sites by simply posting a link

phpBB-Version: phpBB 3.0.x
phpBB-Languages: multilingual
phpBB-Styles: all Styles

Demo: http://4seven.bplaced.net/phpbb3/viewtopic.php?f=11&t=283

Image (follows)

Download:
Attachment:

Features:
- insert portal-videos by just posting a link
- insert flv-videos and mp3 by just posting a link
- enable /disable video-sites
- easy install (only 2 edits)
- xhtml 1.0 strict

Current Provided Video Portals:
- clipfish
- dailymotion
- gametrailers
- googlevideo
- megavideo
- metacafe
- myspace
- myvideo
- veoh
- vimeo
- yahoo
- youtube

Other Provided Formats:
- flv
- mp3

The right Syntax to Embed:
Code:
http://www.clipfish.de/video/3272443/darth-vader-tanzt
http://www.dailymotion.com/video/xbf4y7_revenge-seoyeun-lee_creation
http://www.myflvsite.com/video/yourchosenfile.flv
http://www.gametrailers.com/video/jay-z-vs-dj-hero/62888
http://video.google.com/videoplay?docid=8135690990081075324&ei=_E6US5PKEoen-AbLyPnYAg&q=test#
http://www.megavideo.com/?v=DK2AZWPO
http://www.metacafe.com/watch/4282595/new_peugeot
http://www.mymusicsite.com/audio/yourchosenfile.mp3
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=4517474
http://www.myvideo.de/watch/6735176/the_nanny_hehe_ur_geil_xDDDDDDDDDDDDDD
http://www.veoh.com/browse/videos/category/movies_horror/watch/e9150
http://www.vimeo.com/9325052
http://video.yahoo.com/watch/6897444/17936899
http://www.youtube.com/watch?v=TyLV4lxMc1g&feature=popular


New in v.0.0.2:
- fixing some missing xhtml 1.0 strict errors
- flv-player added (to insert flv by posting a flv-link)
for video-sites, that dont provide xhtml 1.0 strict object-syntax
demo: http://4seven.bplaced.net/phpbb3/viewtopic.php?p=1092#p1092
- mp3-player added (to insert mp3 by posting a mp3-link)
demo: http://4seven.bplaced.net/phpbb3/viewtopic.php?p=1094#p1094

Quote:
fix #1 v.0.0.2 (in current package yet)
- now flv- and mp3-code work with prime-links in post-preview
- works without prime-links also
http://www.phpbb.com/community/viewtopi ... #p12359285

Quote:
fix #2 v.0.0.2 (in current package yet)
- broken preview, if more than one video-link is added (fixed)
- broken preview, if a html-link is added after a video-link (fixed)
hint: add a html-link (without [url] tags) always after the video-link(s), not between (unfixed)

open
auto_video_embed_post.php

find all
Code:
#U                


replace all with
Code:
#is                

Quote:
fix #3 for all who have installed this snippet:
http://www.phpbb.com/kb/article/links-o ... w-windows/

Attachment:


Example to modify and transform a existing BBCode to Auto Video Embed
viewtopic.php?p=1348#p1348

Requests:
- set mod off (per user setting > ucp) bcs. if user have low bandwidth: http://www.phpbb.com/community/viewtopi ... #p12320835
- optional link under video: http://www.phpbb.com/community/viewtopi ... #p12320835


Top
 Profile  
 
PostPosted: Sat 13. Mar 2010, 03:54 
Administrator
User avatar

Posts: 427

Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...

Joined:
Sun 13. Jan 2008, 23:44

Install Instruction Auto Video Embed v.0.0.2

1 Download Package

2 Copy

root/mediaplayer/*.* > mediaplayer/*.*
root/includes/auto_video_embed_post.php > includes/auto_video_embed_post.php
root/includes/auto_video_embed_view.php > includes/auto_video_embed_view.php

3 Open

posting.php

Find

Code:
    if (!sizeof($error))
    {  


After Add

Code:
// Auto Video Embed / 4seven / 2010    
 include($phpbb_root_path . 'includes/auto_video_embed_post.' . $phpEx);
// Auto Video Embed / 4seven / 2010          


4 Open

viewtopic.php

Find

Code:
    // Parse the message and subject
    $message = censor_text($row['post_text']);  


After Add

Code:
// Auto Video Embed / 4seven / 2010    
 include($phpbb_root_path . 'includes/auto_video_embed_view.' . $phpEx);
// Auto Video Embed / 4seven / 2010                   


5 Edit in

auto_video_embed_post.php
auto_video_embed_view.php

the Config Area, so u only have the desired Video-Portals

Code:
// ---------------- CONFIG ---------------
// change true to false to switch off
$clipfish     false;
$dailymotion  false;
$flv          false;
$gametrailers false;
$googlevideo  false;
$megavideo    false;
$metacafe     false;
$mp3          false;
$myspace      false;
$myvideo      false;
$veoh         false;
$vimeo        false;
$yahoo        false;
$youtube      true;
// ---------------- CONFIG ---------------          


6 Clear all Board- and Browser-Caches


Top
 Profile  
 
PostPosted: Wed 17. Mar 2010, 22:55 
Administrator
User avatar

Posts: 427

Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...

Joined:
Sun 13. Jan 2008, 23:44

Example to modify and transform a existing BBCode to Auto Video Embed



Instruction - collecting informations

The very important thing is to find the unique usable syntax of this bbcode

bbcode
Code:
[TUTV]{TEXT}[/TUTV]  


replacement
Code:
<object width="425" height="350"><param name="movie" value="http://tu.tv/tutvweb.swf?kpt={TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://tu.tv/tutvweb.swf?kpt={TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>  


aha, here it is: {TEXT}

which also shows us the important part in html-replacement http://tu.tv/tutvweb.swf?kpt={TEXT}

nothing else matters at this time.

now we have to find out the important embed part.

there he is: http://tu.tv/tutvweb.swf?kpt=aHR0cDovL3d3dy50dS50di92aWRlb3Njb2RpL3QvZS90ZWxldHViYmllcy1wdXRvLmZsdg==&xtp=1025292

in this example the "real" browser-link is not usable (like in youtube), bcs. it contains nothing we can use to embed
Code:
http://tu.tv/videos/teletubbies-puto


now we have all information we need ;-)



Instruction - name the portal-variable

first find in both files:
auto_video_embed_post.php
auto_video_embed_view.php

Code:
$myvideo      = false;  


after add (bcs. of alphabetical-order)

Code:
$tutv         = false;  




Instruction - the main code-transform

1. enter the given portal-variable ($tutv)
2. find a distinctive link part (except http://) which stands alone and have no interruption between (here we take tu.tv/tutvweb.swf?kpt=)
3. mask all /, & and ? with \ in '#search_part#' of preg_replace and transform {TEXT} with (.*?)
4. take the html-replacement to the , 'replace_part' in preg_replace and notice like (.*?) interact with its dual $1 ($2 if it interact with a second (.*?) etc.)

auto_video_embed_post.php
Quote:
if (($tutv) && (strpos($preview_message, 'tu.tv/tutvweb.swf?kpt=') !== false)){
$preview_message = preg_replace('#<a class="postlink" href="http:\/\/tu.tv\/tutvweb.swf\?kpt=(.*?)">(.*?)<\/a>#U', '<object width="425" height="350"><param name="movie" value="http://tu.tv/tutvweb.swf?kpt=$1"></param><param name="wmode" value="transparent"></param><embed src="http://tu.tv/tutvweb.swf?kpt=$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $preview_message);}


auto_video_embed_view.php
Quote:
if (($tutv) && (strpos($message, 'tu.tv/tutvweb.swf?kpt=') !== false)){
$message = preg_replace('#<a class="postlink" href="http:\/\/tu.tv\/tutvweb.swf\?kpt=(.*?)">(.*?)<\/a>#U', '<object width="425" height="350"><param name="movie" value="http://tu.tv/tutvweb.swf?kpt=$1"></param><param name="wmode" value="transparent"></param><embed src="http://tu.tv/tutvweb.swf?kpt=$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $message);}


the framework is (in brief exceptions) still the same

- follow the syntax in this example
- the '#search_part#' is still the same, except other link or embed-part.
- the part , 'replace_part' is the normal html-replacement (the difference is the transform from {TEXT} to $1 (if a (.*?) have the first position in '#search_part#')).
- take a look at the other codes in original-files (may youtube) where the url-link is directly usable to transform and learn a bit from those integrated "examples".


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
POWERED_BY
[ Time : 0.017s | 21 Queries | GZIP : Off | Board-Version: 3.0.7 PL1 ]