Completed
Push — master ( 3024c9...954431 )
by Michael
04:21
created

video.php ➔ xtubeGetVideoThumb()   C

Complexity

Conditions 19
Paths 34

Size

Total Lines 64
Code Lines 46

Duplication

Lines 29
Ratio 45.31 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 19
eloc 46
c 2
b 0
f 0
nc 34
nop 7
dl 29
loc 64
rs 5.9421

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * Module: XoopsTube
5
 *
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 *
10
 * PHP version 5
11
 *
12
 * @category        Module
13
 * @package         Xoopstube
14
 * @author          XOOPS Development Team
15
 * @copyright       2001-2016 XOOPS Project (http://xoops.org)
16
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17
 * @link            http://xoops.org/
18
 * @since           1.0.6
19
 *
20
 * @param $returnsource
21
 *
22
 * @return string
23
 */
24
25
function xtubeReturnSource($returnsource)
26
{
27
    switch ($returnsource) {
28
        case 0:
29
            $returnsource = _AM_XOOPSTUBE_YOUTUBE;
30
            break;
31
        case 1:
32
            $returnsource = _AM_XOOPSTUBE_METACAFE;
33
            break;
34
        case 2:
35
            $returnsource = _AM_XOOPSTUBE_IFILM;
36
            break;
37
        case 3:
38
            $returnsource = _AM_XOOPSTUBE_PHOTOBUCKET;
39
            break;
40
        case 4:
41
            $returnsource = _AM_XOOPSTUBE_VIDDLER;
42
            break;
43
        case 100:
44
            $returnsource = _AM_XOOPSTUBE_GOOGLEVIDEO;
45
            break;
46
        case 101:
47
            $returnsource = _AM_XOOPSTUBE_MYSPAVETV;
48
            break;
49
        case 102:
50
            $returnsource = _AM_XOOPSTUBE_DAILYMOTION;
51
            break;
52
        case 103:
53
            $returnsource = _AM_XOOPSTUBE_BLIPTV;
54
            break;
55
        case 104:
56
            $returnsource = _AM_XOOPSTUBE_CLIPFISH;
57
            break;
58
        case 105:
59
            $returnsource = _AM_XOOPSTUBE_LIVELEAK;
60
            break;
61
        case 106:
62
            $returnsource = _AM_XOOPSTUBE_MAKTOOB;
63
            break;
64
        case 107:
65
            $returnsource = _AM_XOOPSTUBE_VEOH;
66
            break;
67
        case 108:
68
            $returnsource = _AM_XOOPSTUBE_VIMEO;
69
            break;
70
        case 109:
71
            $returnsource = _AM_XOOPSTUBE_MEGAVIDEO;
72
            break;
73
        case 200:
74
            $returnsource = _AM_XOOPSTUBE_XOOPSTUBE;
75
            break;
76
    }
77
78
    return $returnsource;
79
}
80
81
// *******************************************************
82
// Function for determining source for creating screenshot
83
// *******************************************************
84
/**
85
 * @param        $vidid
86
 * @param        $title
87
 * @param        $source
88
 * @param        $picurl
89
 * @param        $screenshot
90
 * @param string $width
91
 * @param string $height
92
 *
93
 * @return string
94
 */
95
function xtubeGetVideoThumb($vidid, $title, $source, $picurl, $screenshot, $width = '', $height = '')
0 ignored issues
show
Coding Style introduced by
xtubeGetVideoThumb uses the super-global variable $GLOBALS which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
96
{
97
    if ('' === $width || '' === $height) {
98
        $width  = $GLOBALS['xoopsModuleConfig']['shotwidth'];
99
        $height = $GLOBALS['xoopsModuleConfig']['shotheight'];
100
    }
101
    $thumb = '';
102
    switch ($source) {
103
        // YouTube
104 View Code Duplication
        case 0:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
105
            $thumb = '<img src="http://img.youtube.com/vi/' . $vidid . '/default.jpg"  title="' . $title . '" alt="' . $title . '" width="' . $width . '" height="' . $height
106
                     . '" style="padding: 0px; border-style: none;" />';
107
            break;
108
109
        // MetaCafe
110
        case 1:
111
            list($metaclip) = explode('[/]', $vidid);
112
            $videothumb['metathumb'] = $metaclip;
0 ignored issues
show
Coding Style Comprehensibility introduced by
$videothumb was never initialized. Although not strictly required by PHP, it is generally a good practice to add $videothumb = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
113
            $thumb                   =
114
                '<img src="http://www.metacafe.com/thumb/' . $videothumb['metathumb'] . '.jpg" title="' . $title . '" alt="' . $title . '" width="' . $width . '" height="' . $height
115
                . '" style="padding: 0px; border-style: none;" />';
116
            break;
117
118
        // iFilm/Spike
119 View Code Duplication
        case 2:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
120
            $thumb = '<img src="http://img3.ifilmpro.com/resize/image/stills/films/resize/istd/' . $vidid . '.jpg?width=' . $width . '"  title="' . $title . '" alt="' . $title
121
                     . '" style="padding: 0px; border-style: none;" />';
122
            break;
123
124
        // Photobucket
125 View Code Duplication
        case 3:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
126
            $thumb = '<img src="http://i153.photobucket.com/albums/' . $vidid . '.jpg" width="' . $width . '" height="' . $height . '"  title="' . $title . '" alt="' . $title
127
                     . '" style="padding: 0px; border-style: none;" />';
128
            break;
129
130
        // Photobucket
131 View Code Duplication
        case 4:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
132
            $thumb = '<img src="http://cdn-thumbs.viddler.com/thumbnail_2_' . $vidid . '.jpg" width="' . $width . '" height="' . $height . '"  title="' . $title . '" alt="' . $title
133
                     . '" style="padding: 0px; border-style: none;" />';
134
            break;
135
136
        // Google Video, MySpace TV, DailyMotion, BrightCove, Blip.tv, ClipFish, LiveLeak, Maktoob, Veoh
137
        case 100:
138
        case 101:
139
        case 102:
140
        case 103:
141
        case 104:
142
        case 105:
143
        case 106:
144
        case 107:
145
        case 108:
146 View Code Duplication
        case 109:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
147
            $thumb = '<img src="' . $picurl . '" width="' . $width . '" height="' . $height . '"  title="' . $title . '" alt="' . $title . '" style="padding: 0px; border-style: none;" />';
148
            break;
149
150
        // Determine if video source is XoopsTube for thumbnail
151 View Code Duplication
        case 200:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
152
            $thumb = '<img src="' . XOOPS_URL . '/' . $screenshot . '" width="' . $width . '" height="' . $height . '"  title="' . $title . '" alt="' . $title
153
                     . '" style="padding: 0px; border-style: none;" />';
154
            break;
155
    }
156
157
    return $thumb;
158
}
159
160
// **********************************
161
// Function for determining publisher
162
// **********************************
163
/**
164
 * @param     $vidid
165
 * @param     $publisher
166
 * @param int $source
167
 *
168
 * @return string
169
 */
170
function xtubeGetVideoPublisher($vidid, $publisher, $source = 0)
171
{
172
    switch ($source) {
173
        // Determine if video source YouTube for publisher
174
        case 0:
175
            $publisher = '<a href="http://www.youtube.com/profile?user=' . $publisher . '" target="_blank">' . $publisher . '</a>';
176
            break;
177
178
        // Determine if video source MetaCafe for publisher
179
        case 1:
180
            $publisher = '<a href="http://www.metacafe.com/channels/' . $publisher . '" target="_blank">' . $publisher . '</a>';
181
            break;
182
183
        // Determine if video source iFilm/Spike for publisher
184
        case 2:
185
            $publisher = '<a href="http://www.ifilm.com/profile/' . $publisher . '" target="_blank">' . $publisher . '</a>';
186
            break;
187
188
        // Determine if video source Photobucket for publisher
189
        case 3:
190
            $string = 'th_';
191
            list($photobucket) = explode($string, $vidid);
192
            $ppublisher['ppublisher'] = $photobucket;
0 ignored issues
show
Coding Style Comprehensibility introduced by
$ppublisher was never initialized. Although not strictly required by PHP, it is generally a good practice to add $ppublisher = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
193
            $publisher                = '<a href="http://s39.photobucket.com/albums/' . $ppublisher['ppublisher'] . '" target="_blank">' . $publisher . '</a>';
194
            break;
195
196
        // Determine if video source is Viddler for publisher
197
        case 4:
198
            $publisher = '<a href="http://www.viddler.com/explore/' . $publisher . '/" target="_blank">' . $publisher . '</a>';
199
            break;
200
201
        // Determine if video source is Google Video for publisher
202
        case 100:
203
        case 101:
204
        case 103:
205
        case 106:
206
        case 108:
207
        case 109:
208
            //            $publisher = $publisher;
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
209
            break;
210
211
        // Determine if video source is DailyMotion for publisher
212
        case 102:
213
            $publisher = '<a href="http://www.dailymotion.com/' . $publisher . '" target="_blank">' . $publisher . '</a>';
214
            break;
215
216
        // Determine if video source is ClipFish for publisher
217
        case 104:
218
            $publisher = '<a href="http://www.clipfish.de/user/' . $publisher . '" target="_blank">' . $publisher . '</a>';
219
            break;
220
221
        // Determine if video source is LiveLeak for publisher
222
        case 105:
223
            $publisher = '<a href="http://www.liveleak.com/user/' . $publisher . '" target="_blank">' . $publisher . '</a>';
224
            break;
225
226
        // Determine if video source is Veoh for publisher
227
        case 107:
228
            $publisher = '<a href="http://www.veoh.com/users/' . $publisher . '" target="_blank">' . $publisher . '</a>';
229
            break;
230
231
        // Determine if video source is XoopsTube for publisher
232
        case 200:
233
            //            $publisher = $publisher;
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
234
            break;
235
    }
236
237
    return $publisher;
238
}
239
240
// ************************************************
241
//Function for displaying videoclip (embedded code)
242
// ************************************************
243
/**
244
 * @param $vidid
245
 * @param $source
246
 * @param $screenshot
247
 * @param $picurl
248
 *
249
 * @return string
250
 */
251
function xtubeShowVideo($vidid, $source, $screenshot, $picurl)
0 ignored issues
show
Unused Code introduced by
The parameter $screenshot is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style introduced by
xtubeShowVideo uses the super-global variable $GLOBALS which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
252
{
253
    global $xoopsModule;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
254
    $showvideo = '';
255
    $autoplay  = $GLOBALS['xoopsModuleConfig']['autoplay'];
256
    if ($GLOBALS['xoopsModuleConfig']['autoplay']) {
257
        $autoplay2   = 'yes';
258
        $autoplay3   = 'true';
259
        $photobucket = '&ap=1';
260
        $google      = 'FlashVars="autoPlay=true"';
261
        $viddler     = 'flashvars="autoplay=t"';
262
    } else {
263
        $autoplay2   = 'no';
264
        $autoplay3   = 'false';
265
        $photobucket = '';
266
        $google      = '';
267
        $viddler     = '';
268
    }
269
270
    //  $hquality = '';
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
271
    //  if ($hq == 1) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
272
    //      $hquality = '&ap=%2526fmt%3D18&';
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
273
    //  }
274
275
    switch ($source) {
276
        // YouTube
277
        case 0:
278
            //  $showvideo = '<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/' . $vidid . '&ap=%2526fmt%3D18&&autoplay=' . $autoplay . '&rel=1&fs=1&color1=0x999999&color2=0x999999&border=0&loop=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $vidid . '&ap=%2526fmt%3D18&&autoplay=' . $autoplay . '&rel=1&fs=1&color1=0x999999&color2=0x999999&border=0&loop=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="480" height="295"></embed></object>';
279
//            $showvideo = '<embed src="http://www.youtube.com/v/' . $vidid . '&autoplay=' . $autoplay
280
//                         . '&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>';
281
282
            $showvideo = '<iframe src="http://www.youtube.com/embed/' . $vidid . '?html5=1&amp;rel=0&amp;hl=en_US&amp;version=3' . '&autoplay=' . $autoplay
283
                         . '&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></iframe>';
284
            break;
285
286
        // MetaCafe
287
        case 1:
288
            $showvideo = '<embed flashVars="playerVars=showStats=no|autoPlay=' . $autoplay2 . '" src="http://www.metacafe.com/fplayer/' . $vidid
289
                         . '.swf" width="480" height="295" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
290
            break;
291
292
        // iFilm/Spike
293
        case 2:
294
            $showvideo =
295
                '<embed width="480" height="295" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip='
296
                . $vidid . '" allowfullscreen="true"> </embed>';
297
            break;
298
299
        // Photobucket
300
        case 3:
301
            $vidid     = str_replace('th_', '', $vidid);
302
            $showvideo =
303
                '<embed width="480" height="295" type="application/x-shockwave-flash" wmode="transparent" src="http://i51.photobucket.com/player.swf?file=http://vid51.photobucket.com/albums/' . $vidid
304
                . '.flv' . $photobucket . '"></embed>';
305
            break;
306
307
        // Viddler
308
        case 4:
309
            $showvideo = '<embed src="http://www.viddler.com/player/' . $vidid . '/" width="480" height="295" type="application/x-shockwave-flash" ' . $viddler
310
                         . ' allowScriptAccess="always" allowFullScreen="true" name="viddler_' . $vidid . '" ></embed>';
311
            break;
312
313
        // Google Video
314
        case 100:
315
            $showvideo =
316
                '<embed style="width:480px; height:295px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=' . $vidid . '&hl=en" ' . $google
317
                . '> </embed>';
318
            break;
319
320
        // MySpace TV
321
        case 101:
322
            $showvideo = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $vidid . ',t=1,mt=video,ap=' . $autoplay
323
                         . '" width="480" height="295" allowFullScreen="true" type="application/x-shockwave-flash"></embed>';
324
            break;
325
326
        // DailyMotion
327
        case 102:
328
            $showvideo = '<embed src="http://www.dailymotion.com/swf/' . $vidid . '&autoPlay=' . $autoplay
329
                         . '" type="application/x-shockwave-flash" width="480" height="295" allowFullScreen="true" allowScriptAccess="always"></embed>';
330
            break;
331
332
        // Blip.tv
333
        case 103:
334
            $showvideo =
335
                '<embed src="http://blip.tv/play/' . $vidid . '" type="application/x-shockwave-flash" width="480" height="295" allowscriptaccess="always" allowfullscreen="true" flashvars="autostart='
336
                . $autoplay3 . '"></embed>';
337
            break;
338
339
        // ClipFish
340
        case 104:
341
            $showvideo = '<embed src="http://www.clipfish.de/videoplayer.swf?as=' . $autoplay . '&videoid=' . $vidid
342
                         . '==&r=1&c=0067B3" quality="high" bgcolor="#0067B3" width="464" height="380" name="player" align="middle" allowFullScreen="true" allowScriptAccess="always"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'; // Change c=0067B3 for different player color
343
            break;
344
345
        // LiveLeak
346
        case 105:
347
            $showvideo = '<embed src="http://www.liveleak.com/e/' . $vidid . '" type="application/x-shockwave-flash" flashvars="autostart=' . $autoplay3
348
                         . '" wmode="transparent" width="450" height="370"></embed>';
349
            break;
350
351
        // Maktoob
352
        case 106:
353
            $showvideo =
354
                '<embed width="448" height="320" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="flvplayer" bgcolor="#ffffff" devicefont="true" wmode="transparent" quality="high" src="http://clipat.maktoob.com/flvplayerOurJS.swf?file=http://'
355
                . $vidid . '.flv&enablejs=true&image=' . $picurl . '&lightcolor=0x557722&backcolor=0x000000&frontcolor=0xCCCCCC&showfsbutton=true&autostart=' . $autoplay3
356
                . '&logo=http://clipat.maktoob.com/language/ar_sa/images/clipat-icon.png&displaywidth=448" />';
357
            break;
358
359
        // Veoh
360
        case 107:
361
            $showvideo = '<embed src="http://www.veoh.com/veohplayer.swf?permalinkId=' . $vidid . '&id=anonymous&player=videodetailsembedded&affiliateId=&videoAutoPlay=' . $autoplay
362
                         . '" allowFullScreen="true" width="480" height="295" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
363
            break;
364
365
        // Vimeo
366
        case 108:
367
            $showvideo = '<embed src="http://vimeo.com/moogaloop.swf?clip_id=' . $vidid . '&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1&autoplay=' . $autoplay
368
                         . '" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" quality="best" width="400" height="321"></embed>';
369
            break;
370
371
        // Megavideo
372
        case 109:
373
            $showvideo = '<object width="640" height="363"><param name="movie" value="http://www.megavideo.com/v/' . $vidid
374
                         . '"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/' . $vidid
375
                         . '" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="363"></embed></object>';
376
            break;
377
378
        // XoopsTube
379
        case 200:
380
            //        $showvideo = '<embed src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname')
381
            //            . '/include/mediaplayer.swf" width="425" height="350" allowScriptAccess="always" allowFullScreen="true" flashvars="width=425&height=350&file='
382
            //            . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['videodir'] . '/' . $vidid . '&image=' . XOOPS_URL . '/'
383
            //            . $GLOBALS['xoopsModuleConfig']['videoimgdir'] . '/' . $screenshot . '&autostart=' . $autoplay3 . '"></embed>';
0 ignored issues
show
Unused Code Comprehensibility introduced by
42% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
384
385
            $showvideo = '
386
                     <script type="text/javascript" src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/flvplayer/flowplayer/flowplayer.min.js"></script>
387
                     <a href="' . XOOPS_URL . '/' . $xoopsModule->getVar('dirname') . '/' . $vidid . '" style="display: block; width: 520px; height: 330px;" id="player"></a>
388
                     <script>
389
                         flowplayer("player", "' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/flvplayer/flowplayer/flowplayer.swf", {
390
                             clip: {
391
                                 autoPlay: ' . $autoplay3 . ',
392
                                 autoBuffering: true
393
                                 }
394
                             }
395
                         );
396
                     </script>
397
                     ';
398
399
            break;
400
    }
401
402
    return $showvideo;
403
}
404