4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 28, 2017, 08:50:24 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] Media sites v1.11.1 (2010-12-22)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 5 ... 18 » »» Print
Current Topic Rating: *****
Author Topic: [MOD] Media sites v1.11.1 (2010-12-22)  (Read 224040 times)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« on: February 01, 2009, 05:07:00 AM »


----------------- [ Index ] -----------------

----------------- [ Introduction ] -----------------

With this mod you'll be able add to your gallery videos (as remote images) from the following media sites:
youtube.com (since v1.9 playlist also supported)
metacafe.com
liveleak.com
stupidvideos.com (only url from <embed> can be used (or url with #NN at the end) and no autoplay)
video.yahoo.com
vids.myspace.com (only works with myspace player videos) (removed since v1.11)
break.com
spikedhumor.com
hulu.com (no autoplay)
myvideo.de (no autoplay) (added in v1.1)
rutube.ru (added in v1.2)
dailymotion.com (added in v1.3)
mtv.com (added in v1.3)
sevenload.com (added in v1.5)
izlesene.com (no autoplay) (added in v1.6)
mynet.com (added in v1.6)
onsmash.com (added in v1.6)
gametrailers.com (added in v1.6)
gamespot.com (added in v1.6)
smotri.com (added in v1.7)
collegehumor.com (added in v1.7)
googlewave.com (added in v1.8 ) (experimental, must have google wave account to view)
220.ro (added in v1.8)
trilulilu.ro (video links only!) (added in v1.8)
funnyordie.com (added in v1.8)
dailyhaha.com (no autoplay) (added in v1.8)
megavideo.com (no autoplay) (added in v1.8)
aniboom.com (added in v1.9)
vimeo.com (added in v1.9)
tm-tube.com (added in v1.9)
vevo.com (added in v1.10)
mp3upload.ca (added in v1.11)
zippyshare.com (audio only!) (added in v1.11)

Since version 1.4 new BBCode tag added: [media]media site url[/media] (check out Tweak 4 for more info)
Since version 1.5 can automatically fetch thumbnails from most media sites and save them locally on the server. For now this feature only works if media site submitted via members upload form, not ACP.

----------------- [ Screenshots / Demo ] -----------------


You can see the demo here



----------------- [ Changed files ] -----------------

includes/functions.php
download.php
member.php

----------------- [ New files ] -----------------

includes/media_sites.php
templates/<your template>/icons/*.gif (an icon for each site)
templates/<your template>/media/*.html (media template for each site)


----------------- [ Installation ] -----------------


Step 1

Download attached media_sites_vXX.zip and media_sites_templates_and_icons_vXX.zip packages. Unpack them and upload to your 4images root directory, restoring the following directory tree:

includes/media_sites.php

copy all files from template/default/icons/ folder to templates/<your template>/icons/ on your site

copy all files from template/default/media/ folder to templates/<your template>/media/ on your site


Step 2

Open includes/functions.php
Find:
1
function check_remote_media($remote_media_file) {

Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
  
if (media_sites($remote_media_file))
    return 
1;
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.1

Find:
1
function get_file_extension($file_name) {

Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
  
if ($data media_sites($file_name))
    return 
$data[0];
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.2

Find:
1
    $media $site_template->parse_template("media/".$file_extension);

Insert above:
1
2
3
4
5
6
7
8
9
/*
  MOD MEDIA SITES
  START INSERT
*/
    
media_sites_template_vars($media_src);
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.3

At the end, above closing ?> insert:
1
2
3
4
5
6
7
8
9
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
include(ROOT_PATH."includes/media_sites.php");
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.4 (added in v1.2)

Find:
1
function get_basename($path) {

Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
  
if ($data media_sites($path))
    return 
$data[1]['media_file'];
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.5 (added in v1.2)

Find:
1
function get_basefile($path) {

Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
  
if ($data media_sites($path))
    return 
$data[1]['media_file'];
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.6 (optional, needed for bbcode in comments) (added in v1.4)

Find:
1
    $text preg_replace($search_array$replace_array$text);

Insert above:
1
2
3
4
5
6
7
8
9
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
    
$text media_sites_bbcode($text);
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 2.7 (optional, it disables download button, you can skip entire step 3 if you apply this) (added in 2009-06-20)

Find:
1
  if (!check_permission("auth_download"$image_row['cat_id'])) {

Replace with:
1
2
3
4
5
6
7
8
9
/*
  MOD MEDIA SITES
  BEGIN REPLACE
*/
  
if (!check_permission("auth_download"$image_row['cat_id']) || media_sites($image_row['image_media_file'])) {
/*
  MOD MEDIA SITES
  END REPLACE
*/



Step 3

Open download.php
Find:
1
    while ($image_row $site_db->fetch_array($result)) {

Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
      
if (empty($image_row['image_download_url']) && $data media_sites($image_row['image_media_file']))
        continue;
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 3.1

Find:
1
2
  $remote_url 0;
  if (!empty(
$image_row['image_download_url'])) {

Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
  MOD MEDIA SITES
  BEGIN REPLACE
*/
  
$remote_url 0;
  if (empty(
$image_row['image_download_url']) && $data media_sites($image_row['image_media_file'], 1))
  {
    
$file['file_path'] = $data[1]['media_dl'];
    
$remote_url 1;
  }
  elseif (!empty(
$image_row['image_download_url'])) {
/*
  MOD MEDIA SITES
  END REPLACE
*/


Step 4

In ACP (Admin Control Panel) -> Settings -> add into "Valid file extensions" list (you can add any or all, in any order):
break,
dailymotion,
hulu,
liveleak,
metacafe,
mtv,
myvideo_de,
rutube_ru,
sevenload,
spikedhumor,
stupidvideos,
yahoovideo,
youtube,
izlesene,
mynet,
onsmash,
gametrailers,
gamespot,
smotri,
collegehumor,
googlewave,
220_ro,
trilulilu_ro,
funnyordie,
dailyhaha,
megavideo,
youtube_pl,
aniboom,
vimeo,
tm_tube,
vevo,
mp3upload,
zippyshare




Step 5 (added in v1.4)

Open member.php
Find:
1
  $remote_media_file format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'])));
Insert below:
1
2
3
4
5
6
7
8
9
10
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
  
if ($media_sites_data media_sites($remote_media_file))
    
$remote_media_file $media_sites_data[1]['media_src'];
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 5.1 (added in v1.5)

Find:
1
    if (!$uploaderror) {

Insert above:
1
2
3
4
5
6
7
8
9
10
11
12
/*
  MOD MEDIA SITES
  BEGIN INSERT
*/
    
if (empty($new_thumb_name) && $data media_sites_thumb($media_sites_data$cat_id$direct_upload))
    {
      
$new_thumb_name $data[0];
    }
/*
  MOD MEDIA SITES
  END INSERT
*/


Step 5.2 (added in v1.9)

Find:
1
      $media $site_template->parse_template("media/".$file_extension);

Insert above:
1
2
3
4
5
6
7
8
9
/*
  MOD MEDIA SITES
  START INSERT
*/
      
media_sites_template_vars($new_name);
/*
  MOD MEDIA SITES
  END INSERT
*/


Go to upload image form and use "URL:" field to upload media site videos.

Tweaks and version history in the next reply.

Attachments:

* media_sites_templates_and_icons_v1.11.zip (176.22 KB - downloaded 363 times.)
* media_sites_v1.11.1.zip (9.79 KB - downloaded 264 times.)
« Last Edit: December 23, 2010, 02:23:26 AM by V@no » Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #1 on: February 01, 2009, 05:14:41 AM »

----------------- [ Tweaks ] -----------------

Tweak 1

You can turn on/ff default autoplay by changing in includes/media_sites.php:
1
define("MEDIA_AUTOPLAY", 1); //autoplay videos by default?



Tweak 2

You can override the default autoplay by adding into the media site URL query: autoplay=1 (force enable autoplay) or autoplay=0 (force disable autoplay)
i.e.
http://www.youtube.com/watch?v=L5EpJuK91zE&autoplay=0



Tweak 3

You can specify width/height of the video by adding into media URL query width=NN and height=NN (the same way as in Tweak 2)



Tweak 4

Since version 1.4 you can use [media]media site url[/media] BBCode tags in comments and image descriptions (example: [media]http://www.youtube.com/watch?v=M-yGsP9PBrc[/media])
This feature is controlled in includes/media_sites.php by:
1
define("MEDIA_BBCODE"1); //use media sites in bbcode?
To disable, replace 1 with 0


Also, each individual media site can be disabled or enabled in bbcode MEDIA_BBCODE_YES with MEDIA_BBCODE_NO in it's array description.

As an example this is array description for "liveleak" media site:
  "liveleak"      => array("#^http://(www.)?liveleak.com/view.*[?&]i=([^&]+)#i",
                            2,
                            "http://www.liveleak.com/e/{ID}",
                            null,
                            MEDIA_BBCODE_YES,
                            "",
                    ),

Tweaks 1,2,3 also apply to BBCode.




----------------- [ Troubleshooting ] -----------------

  • 404 error thumbnails
    If it shows you 404 error thumbnails instead of normal thumbnails, check Step 2.x, specifically Step 2.1 and Step 4





----------------- [ Version history ] -----------------

v1.11.1 (2010-12-22) (re-do Step 1)
- Fixed: thumbnails were not created when original image is smaller then max dimentions set in 4images
- Fixed: thumbnails were not created for rutube.ru

v1.11 (2010-07-14) (more info here)
- CHANGED: thumbnail creation now using create_thumbnail() 4images function, not resize_image()
- ADDED: mp3upload.ca support
- ADDED: zippyshare support (audio only)
- REMOVED: myspacevideo support

v1.10 (2010-07-04) (more info here)
- ADDED: {media_ext} and {media_ext_icon} tags can be used to display file extension icon
- ADDED: vevo.com support (no autoplay)
- ADDED: megavideo "download" type urls (d= instead of v= url query)
- FIXED: in some cases fetching thumbnail could fail and corrupt already retreved data of the video
- FIXED: rutube.ru thumbnail creation

v1.9 (2010-02-13) (more info here)
- Fixed: wrong video or nothing showed after upload (added step 5.2)
- Added: work around if host disabled allow_url_fopen, which prevents downloading thumbnails
- Added: youtube playlist support
- Added: aniboom.com support
- Added: vimeo.com support
- Added: tm-tube.com support

v1.8 (2009-12-18) (more info here)
- Added: googlewave (experimental, must have google wave account to view)
- Added: 220.ro (video links only!)
- Added: trilulilu.ro (video links only!)
- Added: funnyordie.com
- Added: dailyhaha.com (no autoplay)
- Added: megavideo.com (no autoplay)

v1.7 (2009-11-28) (more info here)
- Added: smotri.com
- Added: collegehumor.com

v1.6 (2009-10-17) (more info here)
- Added: izlesene.com (no autoplay)
- Added: video.mynet.com
- Added: videos.onsmash.com
- Added: gametrailers.com
- Added: gamespot.com
- Fixed: break.com auto thumbnails didn't work
- Fixed: MEDIA_THUMB constant was ignored

v1.5.8 (2009-10-14) (more info here)
- Fixed: rutube.ru auto thumbnail didn't work

v1.5.7 (2009-10-13) (more info here)
- Fixed: rutube.ru didn't work

v1.5.6 (2009-06-20) (re-do Step 1)
- Added: optional Step 2.7
- Changed: mod's constants now can be copied into includes/constants.php
- Changed: template tag {is_media_site} now contains the ID of media site. can be used to display icons: {if is_media_site}<img src="icons/{is_media_site}.gif">{endif is_media_site}

v1.5.5 (2009-06-12) (re-do Step 1)
- Added: new template tag {is_media_site} can be used as conditional tag i.e. {if is_media_site}this is a media site{endif is_media_site}

v1.5 (2009-03-21) (more info here) (added Step 5.1)
- Fixed: problem with RSS feed when media site was used in a comment
- Fixed: sometimes additional options in the URL didn't work (width/height/autoplay)
- Fixed: metacafe.com didn't obey autoplay url option
- Fixed: mtv.com didn't obey autoplay options
- Added: width/height limit for BBCode
- Added: addresses to media sites home page
- Added: control for autoplay in ACP
- Added: sevenload.com support
- Added: auto thumbnails for youtube, metacafe, stupidvideos, yahoovideo, myspacevideo, liveleak, spikedhumor, myvideo.de, rutube.ru, dailymotion.com, mtv.com
- Changed: dailymotion.com doesn't require address from <embed> anymore
- Changed: break.com doesn't require address from <embed> anymore
- Changed: hulu.com doesn't require address from <embed> anymore

v1.4 (2009-03-11) (more info here) (added Step 2.6 and Step 5)
- Added fullscreen support for mtv.com
- Added ability use entire <embed> code to "upload" media sites
- Added bbcode support

v1.3 (2009-02-16)
- fixed spikedhumor.com
- added dailymotion.com (must use address from embed code)
- added mtv.com
- changed site list array to use "generic" (common) function to process most media sites.

v1.2 (2009-02-11)
- fixed unable use custom thumbnails (added Step 2.4 and Step 2.5)
- fixed myvideo.de
- added multilingual youtube support
- added rutube.ru

v1.1 (2009-02-02)
- added myvideo.de support

v1.0 (2009-02-01)
- first release (9 media sites supported)
« Last Edit: December 23, 2010, 02:24:36 AM by V@no » Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Sumale.my
Addicted member
******
Offline Offline

Posts: 1768

Thank You
-Given: 167
-Receive: 83

Neverdie


View Profile
« Reply #2 on: February 01, 2009, 03:09:10 PM »

Very Very Nice!
Logged
henkjan
Newbie
*
Offline Offline

Posts: 15

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #3 on: February 01, 2009, 05:09:57 PM »

Hello guys

Is it possible to get automatic thumbnails to 4images from this media sites like Youtube?

I need this for my media site.

Regards
Logged
meier
Jr. Member
**
Offline Offline

Posts: 58

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #4 on: February 02, 2009, 10:48:22 AM »

Hallo, was müste ich den tun das auch videos von www.myvideo.de funktionieren?

Desweiteren wird kein Vorschaubild angezeigt. An was könnte das liegen?

-----------Google Translate--------


Hello, what should I do the same videos of www.myvideo.de work?

Furthermore, there is no preview screen. In what could be the reason?
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #5 on: February 02, 2009, 03:20:59 PM »

Hello, what should I do the same videos of www.myvideo.de work?
Re-do step 1 and step 4

Furthermore, there is no preview screen. In what could be the reason?
If you mean no thumbnails, then this mod doesn't create thumbnails automatically
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
meier
Jr. Member
**
Offline Offline

Posts: 58

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 on: February 03, 2009, 10:27:28 AM »

Es funktioniert nur mit youtube, aber auch nur http://youtube........ und nicht http://de.youtube......  Question

Ich habe in der ACP myvideo_de oder myvideo eingegeben. Beides geht nicht.



---------Google-----------

   
It only works with youtube, but only http://youtube ........ and not http://de.youtube ...... ::

I have in the ACP myvideo_de or myVideo entered. Both does not work.
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #7 on: February 03, 2009, 03:08:22 PM »

in media_sites.php find:
1
  "youtube"       => "#^http://(www\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
Replace with:

1
  "youtube"       => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",

It will be included in next update.
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
meier
Jr. Member
**
Offline Offline

Posts: 58

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #8 on: February 03, 2009, 05:15:15 PM »

thanks
Logged
meier
Jr. Member
**
Offline Offline

Posts: 58

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #9 on: February 06, 2009, 12:10:14 AM »

Hallo,

ich glaube es stimmt noch irgendetwas nicht. myvideo.de geht nicht.

Wenn man sich z.b den Verweis ansieht:

http://www.myvideo.de/watch/1159869/Modellflieger_Video_Kamera_an_Board

ist da ein watch, wo aber in der media_sites movie steht.

Ich hab es geändert aber leider geht's immer noch nicht.

----------Google-----------

Hello,

I think it is not anything. myvideo.de does not.

If you look at the link z.b viewing:

http://www.myvideo.de/watch/1159869/Modellflieger_Video_Kamera_an_Board

is there a watch , but where in the media_sites movie is.

I've changed it but unfortunately it's still not.

----------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: media_sites.php                                      *
 *     File Version: 1.1                                                  *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
/*
Changes since previous version:
  - added myvideo.de
*/


if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

define("MEDIA_AUTOPLAY"1); //autoplay videos by default?

/*
 $media_sites = array(
  "FUNCNAME" => array("REGEX"
  or
  "EXTENSION" => array("REGEX", array("template_tag" => REGEXMATCH, "template_tag2" => REGEXMATCH2)),
  or
  "EXTENSION" => array("REGEX", array("template_tag" => array(REGEXMATCH, "SPRINTF"), "template_tag2" => REGEXMATCH2)),
  or

if used FUNCNAME, FUNCNAME will be used as EXTENSION and a function with name media_sites_custom_FUNCNAME must exist!
*/
$media_sites = array(
  
"youtube"       => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
  
"metacafe"      => "#^http://(www\.)?metacafe\.com/watch/(.*)#i",
  
"stupidvideos"  => "#^http://(www\.|images\.)?stupidvideos\.com.*([\?&]i=|\#)([0-9]+)#i",
  
"yahoovideo"    => "#^http://video\.yahoo\.com/watch/([0-9]+)/([0-9]+)#i",
  
"myspacevideo"  => "#^http://vids\.myspace\.com/.*[\?&]videoid=([0-9]+)#i",
  
"break"         => "#^http://embed\.break\.com/([0-9]+)#i"//(must use address from src in <embed> link)
  
"liveleak"      => "#^http://(www\.)?liveleak\.com/view\?.*&?i=([^&]+)#i",
  
"spikedhumor"   => "#^http://(www\.)?spikedhumor\.com/articles/([0-9]+)/Living-Glass\.html#i",
  
"hulu"          => "#^http://(www\.)hulu\.com/embed/([^/&\?]+)#i"//(must use address from src in <embed> link)
  
"myvideo_de"    => "#^http://(www\.)myvideo\.de/movie/([0-9]+)#i",

//  "youtube"       => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_id" => 2)),//functionless
//  "youtube"       => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_dl" => array(2, "http://www.youtube.com/v/%s"))),//functionless
//  "metacafe"      => array("#^http:\/\/(www\.)?metacafe\.com\/watch\/(.*)#i", array("media_dl" => array(2, "http://www.metacafe.com/fplayer/%s.swf"))), //functionless
);

function 
media_sites($url$type 0)
{
  global 
$config$media_sites;
  static 
$sites_cache = array();
  if (!isset(
$sites_cache[$url]))
  {
    
$sites_cache[$url] = false;
    foreach(
$media_sites as $key => $val)
    {
//      if (!in_array($key, $config['allowed_mediatypes_array']))
//        continue;

      
if (preg_match((is_array($val) ? $val[0] : $val), $url$match))
      {
        if (
is_array($val))
        {
          
$sites_cache[$url][0] = $key;
          
$sites_cache[$url][1] = array();
          foreach(
$val[1] as $tag => $m)
          {
            
$sites_cache[$url][1][$tag] = (is_array($m)) ? sprintf($m[1], $match[$m[0]]) : $match[$m];
          }
        }
        elseif (
function_exists("media_sites_custom_".$key))
        {
          
$func "media_sites_custom_".$key;
          if (
$result $func($url$match))
          {
            
$sites_cache[$url][0] = $key;
            
$sites_cache[$url][1] = $result;
          }
        }
        break;
      }
    }
  }
  return (
$type $sites_cache[$url] : ($sites_cache[$url] ? 0));
}

function 
media_sites_template_vars($url)
{
  if (!(
$data media_sites($url1)))
    return 
false;
  global 
$site_template;
  
$site_template->register_vars($data[1]);
  return 
true;
}




// BEGIN MEDIA FUNCTIONS

//youtube.com
function media_sites_custom_youtube($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_dl" => "http://www.youtube.com/v/".$match[2],
      
"media_id" => $match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//metacafe.com
function media_sites_custom_metacafe($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.metacafe.com/fplayer/".$match[2].".swf",
      
"media_ext" => "swf",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//stupidvideos.com
function media_sites_custom_stupidvideos($url$match)
{
  
$return false;
  if (isset(
$match[3]))
  {
    
$return = array(
      
"media_id" => $match[3],
      
"media_dl" => "http://images.stupidvideos.com/2.0.2/swf/video.swf?i=".$match[3]."&sa=1&sk=7&si=2&uid=0&usn=0",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//video.yahoo.com
function media_sites_custom_yahoovideo($url$match)
{
  
$return false;
  if (isset(
$match[1]) || isset($match[2]))
  {
    
$return = array(
      
"media_id" => @$match[2],
      
"media_vid" => @$match[1],
      
"media_dl" => "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34&id=".$match[2]."&vid=".$match[1]."&embed=1",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//vids.myspace.com
function media_sites_custom_myspacevideo($url$match)
{
  
$return false;
  if (isset(
$match[1]))
  {
    
$return = array(
      
"media_id" => $match[1],
      
"media_dl" => "http://player.hulu.com/embed/myspace_viral_player.swf?pid=nC2V0izs_saj6gpqL2XfgmEkV64au1rT&embed=true&autoplay=0&videoID=".$match[1],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//break.com (must use address from src in <embed> link)
function media_sites_custom_break($url$match)
{
  
$return false;
  if (isset(
$match[1]))
  {
    
$return = array(
      
"media_id" => $match[1],
      
"media_dl" => "http://embed.break.com/".$match[1],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//liveleak.com
function media_sites_custom_liveleak($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.liveleak.com/e/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//spikedhumor.com
function media_sites_custom_spikedhumor($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.spikedhumor.com/player/vcplayer.swf?file=http://www.spikedhumor.com/videocodes/".$match[2]."/data.xml",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//hulu.com (must use address from src in <embed> link)
function media_sites_custom_hulu($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.hulu.com/embed/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//myvide.de
function media_sites_custom_myvideo_de($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.myvideo.de/movie/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}
//  END MEDIA FUNCTIONS
?>
« Last Edit: February 06, 2009, 10:10:32 AM by meier » Logged
meier
Jr. Member
**
Offline Offline

Posts: 58

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #10 on: February 06, 2009, 05:38:01 PM »

So gehts.......ich hab zwar keine Ahnung davon, konnte es mir aber aus dem code ableiten.

---------

ähhh.......so work  Razz

--------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: media_sites.php                                      *
 *     File Version: 1.1                                                  *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
/*
Changes since previous version:
  - added myvideo.de
*/


if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

define("MEDIA_AUTOPLAY"1); //autoplay videos by default?

/*
 $media_sites = array(
  "FUNCNAME" => array("REGEX"
  or
  "EXTENSION" => array("REGEX", array("template_tag" => REGEXMATCH, "template_tag2" => REGEXMATCH2)),
  or
  "EXTENSION" => array("REGEX", array("template_tag" => array(REGEXMATCH, "SPRINTF"), "template_tag2" => REGEXMATCH2)),
  or

if used FUNCNAME, FUNCNAME will be used as EXTENSION and a function with name media_sites_custom_FUNCNAME must exist!
*/
$media_sites = array(
  
"youtube"       => "#^http://([^.]+\.)?youtube\.com/watch/?.*[\?&]v=([^&]+)#i",
  
"metacafe"      => "#^http://(www\.)?metacafe\.com/watch/(.*)#i",
  
"stupidvideos"  => "#^http://(www\.|images\.)?stupidvideos\.com.*([\?&]i=|\#)([0-9]+)#i",
  
"yahoovideo"    => "#^http://video\.yahoo\.com/watch/([0-9]+)/([0-9]+)#i",
  
"myspacevideo"  => "#^http://vids\.myspace\.com/.*[\?&]videoid=([0-9]+)#i",
  
"break"         => "#^http://embed\.break\.com/([0-9]+)#i"//(must use address from src in <embed> link)
  
"liveleak"      => "#^http://(www\.)?liveleak\.com/view\?.*&?i=([^&]+)#i",
  
"spikedhumor"   => "#^http://(www\.)?spikedhumor\.com/articles/([0-9]+)/Living-Glass\.html#i",
  
"hulu"          => "#^http://(www\.)hulu\.com/embed/([^/&\?]+)#i"//(must use address from src in <embed> link)
  
"myvideo_de"    => "#^http://(www\.)myvideo\.de/watch/([0-9]+)/([^/&\?]+)#i",

//  "youtube"       => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_id" => 2)),//functionless
//  "youtube"       => array("#^http:\/\/(www\.)?youtube\.com\/watch\/?[\?&]v=([^&]+)#i", array("media_dl" => array(2, "http://www.youtube.com/v/%s"))),//functionless
//  "metacafe"      => array("#^http:\/\/(www\.)?metacafe\.com\/watch\/(.*)#i", array("media_dl" => array(2, "http://www.metacafe.com/fplayer/%s.swf"))), //functionless
);

function 
media_sites($url$type 0)
{
  global 
$config$media_sites;
  static 
$sites_cache = array();
  if (!isset(
$sites_cache[$url]))
  {
    
$sites_cache[$url] = false;
    foreach(
$media_sites as $key => $val)
    {
//      if (!in_array($key, $config['allowed_mediatypes_array']))
//        continue;

      
if (preg_match((is_array($val) ? $val[0] : $val), $url$match))
      {
        if (
is_array($val))
        {
          
$sites_cache[$url][0] = $key;
          
$sites_cache[$url][1] = array();
          foreach(
$val[1] as $tag => $m)
          {
            
$sites_cache[$url][1][$tag] = (is_array($m)) ? sprintf($m[1], $match[$m[0]]) : $match[$m];
          }
        }
        elseif (
function_exists("media_sites_custom_".$key))
        {
          
$func "media_sites_custom_".$key;
          if (
$result $func($url$match))
          {
            
$sites_cache[$url][0] = $key;
            
$sites_cache[$url][1] = $result;
          }
        }
        break;
      }
    }
  }
  return (
$type $sites_cache[$url] : ($sites_cache[$url] ? 0));
}

function 
media_sites_template_vars($url)
{
  if (!(
$data media_sites($url1)))
    return 
false;
  global 
$site_template;
  
$site_template->register_vars($data[1]);
  return 
true;
}




// BEGIN MEDIA FUNCTIONS

//youtube.com
function media_sites_custom_youtube($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_dl" => "http://www.youtube.com/v/".$match[2],
      
"media_id" => $match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//metacafe.com
function media_sites_custom_metacafe($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.metacafe.com/fplayer/".$match[2].".swf",
      
"media_ext" => "swf",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//stupidvideos.com
function media_sites_custom_stupidvideos($url$match)
{
  
$return false;
  if (isset(
$match[3]))
  {
    
$return = array(
      
"media_id" => $match[3],
      
"media_dl" => "http://images.stupidvideos.com/2.0.2/swf/video.swf?i=".$match[3]."&sa=1&sk=7&si=2&uid=0&usn=0",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//video.yahoo.com
function media_sites_custom_yahoovideo($url$match)
{
  
$return false;
  if (isset(
$match[1]) || isset($match[2]))
  {
    
$return = array(
      
"media_id" => @$match[2],
      
"media_vid" => @$match[1],
      
"media_dl" => "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34&id=".$match[2]."&vid=".$match[1]."&embed=1",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//vids.myspace.com
function media_sites_custom_myspacevideo($url$match)
{
  
$return false;
  if (isset(
$match[1]))
  {
    
$return = array(
      
"media_id" => $match[1],
      
"media_dl" => "http://player.hulu.com/embed/myspace_viral_player.swf?pid=nC2V0izs_saj6gpqL2XfgmEkV64au1rT&embed=true&autoplay=0&videoID=".$match[1],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//break.com (must use address from src in <embed> link)
function media_sites_custom_break($url$match)
{
  
$return false;
  if (isset(
$match[1]))
  {
    
$return = array(
      
"media_id" => $match[1],
      
"media_dl" => "http://embed.break.com/".$match[1],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//liveleak.com
function media_sites_custom_liveleak($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.liveleak.com/e/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//spikedhumor.com
function media_sites_custom_spikedhumor($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.spikedhumor.com/player/vcplayer.swf?file=http://www.spikedhumor.com/videocodes/".$match[2]."/data.xml",
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//hulu.com (must use address from src in <embed> link)
function media_sites_custom_hulu($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.hulu.com/embed/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}

//myvide.de
function media_sites_custom_myvideo_de($url$match)
{
  
$return false;
  if (isset(
$match[2]))
  {
    
$return = array(
      
"media_id" => $match[2],
      
"media_dl" => "http://www.myvideo.de/watch/".$match[2],
      
"media_ext" => "flv",
      
"image_width" => REPLACE_EMPTY,
      
"image_height" => REPLACE_EMPTY,
      
"image_autoplay" => MEDIA_AUTOPLAY,
    );
    if (
preg_match_all("#[\?&](width|height|autoplay)=([0-9]+)#i"$url$match))
    {
      foreach(
$match[1] as $key => $val)
      {
        
$return["image_".$val] = $match[2][$key];
      }
    }
    
$return['image_autoplay'] = ($return['image_autoplay']) ? 0;
  }
  return 
$return;
}
//  END MEDIA FUNCTIONS
?>
Logged
__G__
Sr. Member
****
Offline Offline

Posts: 286

Thank You
-Given: 8
-Receive: 0


View Profile
« Reply #11 on: February 07, 2009, 11:36:09 AM »

wow it works great quick question what if we wanna upload a custom thumnail for the  video instead of default youtube or google or yahoo video thumnail i tryd uploading a custom thumnail but still the default one pops up i hope someone can help me here Very Happy
Logged
SnaFy
Full Member
***
Offline Offline

Posts: 130

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #12 on: February 10, 2009, 04:51:44 PM »

thnx V@no i am so Happy for this work
Logged

I love 4imagezZzZz7
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #13 on: February 12, 2009, 04:35:00 AM »

wow it works great quick question what if we wanna upload a custom thumnail for the  video instead of default youtube or google or yahoo video thumnail i tryd uploading a custom thumnail but still the default one pops up i hope someone can help me here Very Happy
Ok, try update to v1.2:

1) Do new added Step 2.4 and Step 2.5
2) and re-download both packages
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
__G__
Sr. Member
****
Offline Offline

Posts: 286

Thank You
-Given: 8
-Receive: 0


View Profile
« Reply #14 on: February 12, 2009, 05:15:02 AM »

great v@no this works like a charm exactly what i wanted and in fact its a good update so instead of just a youtube icon now we can add the real thumbnail associated with video THUMBS UP and thank you for the great mod


« Last Edit: February 18, 2009, 01:10:48 AM by __G__ » Logged
Pages: [1] 2 3 4 5 ... 18 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.348 seconds with 19 queries.