Forum Search:
FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.
Calendar
Search
Help
Members
Control Panel
Logout [ CommonCrawl [Bot] ]
Home
Post Form
Logged in user:
CommonCrawl [Bot] [
logout
]
Forum:
How To
Title:
Poll:
[CREATE POLL]
Message Icon:
No Icon
Smiley Shortcuts:
[
list all smilies
]
Formatting Tools:
Size
1
2
3
4
5
6
7
Color
Sky Blue
Royal Blue
Blue
Dark Blue
Orange
Orange Red
Crimson
Red
Firebrick
Dark Red
Green
Lime Green
Sea Green
Deep Pink
Tomato
Coral
Purple
Indigo
Burly Wood
Sandy Brown
Sienna
Chocolate
Teal
Silver
Font
Arial
Times
Courier
Century
Body:
Forum Options:
HTML
code is
off
BBcode
is
on
Images
are
on
Smilies
are
on
Editing Time Limit
: Unlimited
[quote title=Martin_E wrote on Thu, 25 November 2010 09:59]Some of forum users would like to copy an paste the URL of a youtube video. The user can easily put the URL into a message, e.g.: [url]http://www.youtube.com/watch?v=9vgicLc0W-g[/url] Here is my modification of [url=http://cvs.prohost.org/index.php/youtube_tag.plugin]this plugin[/url]. [code] <?php /** * copyright : (C) IT-Systemberatung Martin Eller * email : mail@eller-it.de * $Id: youtube_urltag.plugin 5021 2011-11-25 18:56:23Z meller $ * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. **/ // Initialize plugin plugin_add_hook('BBCODE2HTML', 'plugin_youtube_urltag_to_html'); plugin_add_hook('HTML2BBCODE', 'plugin_youtube_html_to_urltag'); // Convert http://www.youtube.com/watch?v=" to html code (post message) function plugin_youtube_urltag_to_html($array) { list($bbcode) = $array; $bbcode = preg_replace('#http\:\/\/www\.youtube\.com\/watch\?v\=([0-9a-zA-Z_\-]+)#si', '<object width="425" height="366"><param name="movie" value="http://www.youtube.com/v/\\1"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="425" height="366"></embed></object>', $bbcode); return array($bbcode); } // Convert html to http://www.youtube.com/watch?v=" tag (edit message) function plugin_youtube_html_to_urltag($array) { list($bbcode) = $array; $bbcode = preg_replace('#<object width="425" height="366"><param name="movie" value="http://www.youtube.com/v/([0-9a-zA-Z_\-]+)"></param><embed src="http://www.youtube.com/v/([0-9a-zA-Z_\-]+)" type="application/x-shockwave-flash" width="425" height="366"></embed></object>#si', 'http://www.youtube.com/watch?v=\\1', $bbcode); return array($bbcode); } function youtube_urltag_info() { return array('name' => 'Youtube Video implementation', 'desc' => 'Allow forum users to use the URL of Youtube video for embedding videos into forum posts.', 'version' => '0.9'); } ?> [/code] Edit: Some remarks[/quote]
File Attachments:
Allowed File Extensions:
jpg jpeg png gif txt doc gz bz2 inc php zip diff
Maximum File Size:
1024KB
Maximum Files Per Message:
3
Options:
Post Notification
Notify me when someone replies to this message.
Include Signature
Include your profile signature.
Disable smilies in this message
Topic View
Re: Aw: Re: Youtube plugin mod
Thu, 25 November 2010 17:50
naudefj
Karma:
We are not going to ship FUDforum with multiple YouTube plugins.
You are obviously welcome to call your plugin whatever you like and to even publish it on the FUDforum wiki.
Post by Martin_E is ignored
Re: Youtube plugin mod
Thu, 25 November 2010 10:40
naudefj
Karma:
Great job!
Maybe we should try to combine the two versions (to handle links & tags). I'll see what I can do later...
Post by Martin_E is ignored
Current Time:
Fri Jan 24 04:29:50 EST 2025
Total time taken to generate the page: 0.06111 seconds