Добрый день!При переходе с версии PHP 5.6 на PHP 7.x по рекомендации Joomla при обновлении до версии Joomla 3.9.0 появляется
ошибка:
Warning: Declaration of plgVideoboxHtml5Video::getThumb() should be compatible with Video::getThumb($id = false) in C:\OSPanel\domains\tg18112018.rus\plugins\videobox\html5video\html5video.php on line 15
1?php
2/*------------------------------------------------------------------------
3# plg_videobox - Videobox
4# ------------------------------------------------------------------------
5# author HitkoDev
6# copyright Copyright (C) 2014 HitkoDev. All Rights Reserved.
7# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8# Websites: http://hitko.eu/software/videobox
9-------------------------------------------------------------------------*/
10// no direct access
11defined( '_JEXEC' ) or die( 'Restricted Access' );
12
13jimport( 'videobox.video' );
14
15class plgVideoboxHtml5Video extends Video {
16
17 /*
18 * $id - Link to the video (relative to the site root for local videos)
19 */
20 function adapterSwitch($id, $title, $offset, $vb){
21 if(in_array(pathinfo($id, PATHINFO_EXTENSION), array('mp4', 'ogv', 'webm', 'm4v', 'oga', 'mp3', 'm4a', 22'webma', 'wav'))){
22 $id = rawurldecode($id);
23 if(substr($id, 0, 2)!= '//' && substr($id, 0, 7)!= 'http://' && substr($id, 0, 8)!= 25'https://'){
24 $id = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'] . '/' . $id);
25 } else {
26 $id = str_replace( array( 'http://' . $_SERVER['HTTP_HOST'],
27 'http://www.' . $_SERVER30['HTTP_HOST'],
28 'https://' . $_SERVER32['HTTP_HOST'],
29 'https://www.' . $_SERVER34['HTTP_HOST'],
30 '//' . $_SERVER['HTTP_HOST'],
31 '//www.' . $_SERVE37R37['HTTP_HOST']),
32 $_SERVER['DOCUMENT_ROOT'] . '/', $id, $count);
33 if($count > 0){
34 $id = str_replace('//', '/', $id);
35 } else {
36 $id = str_replace(' ', '%20', $id);
37 }
38 }
39 $video = new self($id, $title, $offset);
40 $video->poster = $vb->videoThumbnail($video, $vb->parametri, true);
41 return $video;
42 }
43 return false;
44 }
45
46 function __construct($id, $title = '', $offset = 0){
47 parent::__construct($id, $title, $offset);
48 if(in_array(pathinfo($id, PATHINFO_EXTENSION), array('oga', 'mp3', 'm4a', 'webma', 'wav'))) $this->type = 'a';
49 }
50
51 function getThumb(){
52 $id = $this->id;
53 $pi = pathinfo($id);
54 $id = $pi['dirname'] . '/' . $pi['filename'];
55 $ext = array('.png', '.jpg', '.jpeg', '.gif');
56 foreach($ext as $ex){
57 $im = @getimagesize($id . $ex);
58 if($im !== false) return array($id . $ex, $im[2]);
59 }
60 return false;
61 }
62
63 function getPlayerLink($autoplay = false){
64 $src = JURI::root(). '/plugins/videobox/html5video/player.php?video=' . rawurlencode(str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->id));
65 if(isset($this->poster) && $this->poster != '') $src .= '&poster=' . rawurlencode('../../system/videobox/' . $this->poster);
66 if($autoplay) $src .= '&autoplay=1';
67 if($this->offset != 0) $src .= '&start=' . $this->offset;
68 return $src;
69 }
70
71}
ошибка:
Warning: Declaration of plgVideoboxSoundCloudVideo::getThumb() should be compatible with Video::getThumb($id = false) in C:\OSPanel\domains\tg04112018.rus\plugins\videobox\soundcloudvideo\soundcloudvideo.php on line 591<?php
2/*------------------------------------------------------------------------
3# plg_videobox - Videobox
4# ------------------------------------------------------------------------
5# author HitkoDev
6# copyright Copyright (C) 2014 HitkoDev. All Rights Reserved.
7# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8# Websites: http://hitko.eu/software/videobox
9-------------------------------------------------------------------------*/
10// no direct access
11defined( '_JEXEC' ) or die( 'Restricted Access' );
12
13jimport( 'videobox.video' );
14
15class plgVideoboxSoundCloudVideo extends Video {
16
17 /*
18 * $id - link to the song (https://soundcloud.com/alestorm/shipwrecked)
19 */
20 function adapterSwitch($id, $title, $offset, $vb){
21 if(strpos($id, 'soundcloud')!==false){
22 if(isset($vb->parametri['sc_visual'])){
23 $visual = $vb->parametri['sc_visual'];
24 } else {
25 $visual = $this->getParam('visual', $vb->parametri['display_suffix'], '');
26 }
27 if($visual=='' || $visual==2) $visual = $this->params->get('visual', 1);
28 return new self($id, $title, $offset, $visual);
29 }
30 return false;
31 }
32
33 function __construct($id, $title = '', $offset = 0, $visual = true){
34 parent::__construct($id, $title, $offset);
35 $this->visual = $visual;
36 $this->type = 'a';
37 }
38
39 function getThumb(){
40 $data = json_decode(file_get_contents('http://soundcloud.com/oembed?url=' . rawurlencode($this->id). '&format=json'));
41 $data = explode('?', $data->thumbnail_url);
42 $img = $data[0];
43 $im = @getimagesize($img);
44 if($im !== false) return array($img, $im[2]);
45 return false;
46 }
47
48 function getPlayerLink($autoplay = false){
49 $src = 'https://w.soundcloud.com/player/?url=' . rawurlencode($this->id). '&show_artwork=true';
50 if($autoplay) $src .= '&auto_play=true';
51 if($this->visual){
52 $src .= '&visual=true';
53 } else {
54 $src .= '&visual=false';
55 }
56 return $src;
57 }
58
59}
ошибка:
Warning: Declaration of plgVideoboxVimeoVideo::getThumb() should be compatible with Video::getThumb($id = false) in C:\OSPanel\domains\tg04112018.rus\plugins\videobox\vimeovideo\vimeovideo.php on line 581<?php
2/*------------------------------------------------------------------------
3# plg_videobox - Videobox
4# ------------------------------------------------------------------------
5# author HitkoDev
6# copyright Copyright (C) 2014 HitkoDev. All Rights Reserved.
7# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8# Websites: http://hitko.eu/software/videobox
9-------------------------------------------------------------------------*/
10// no direct access
11defined( '_JEXEC' ) or die( 'Restricted Access' );
12
13jimport( 'videobox.video' );
14
15class plgVideoboxVimeoVideo extends Video {
16
17 /*
18 * $id - one of the following:
19 * - numeric Vimeo video ID
20 * - link to the video (http://vimeo.com/4700344)
21 */
22 function adapterSwitch($id, $title, $offset, $vb){
23 if(is_numeric($id)){
24 return new self($id, $title, $offset);
25 }
26 if(strpos($id, 'vimeo')!==false){
27 preg_match('/vimeo.com\/([0-9]*?)/isU', $id, $v_urls);
28 return new self($v_urls[1], $title, $offset);
29 }
30 return false;
31 }
32
33 function getTitle($forced = false){
34 if($forced && $this->title==''){
35 return 'http://vimeo.com/' . $this->id;
36 } else {
37 return $this->title;
38 }
39 }
40
41 function getThumb(){
42 $th = parent::getThumb();
43 if($th !== false) return $th;
44 $data = unserialize(file_get_contents('http://vimeo.com/api/v2/video/' . $this->id . '.php'));
45 $img = $data[0]['thumbnail_large'];
46 $im = @getimagesize($img);
47 if($im !== false) return array($img, $im[2]);
48 return false;
49 }
50
51 function getPlayerLink($autoplay = false){
52 $src = 'https://player.vimeo.com/video/' . $this->id . '?byline=0&portrait=0';
53 if($autoplay) $src .= '&autoplay=1';
54 if($this->offset != 0) $src .= '#t=' . $this->splitOffset();
55 return $src;
56 }
57
58}
ошибка:
Warning: Declaration of plgVideoboxYouTubeVideo::getThumb() should be compatible with Video::getThumb($id = false) in C:\OSPanel\domains\tg04112018.rus\plugins\videobox\youtubevideo\youtubevideo.php on line 601<?php
2/*------------------------------------------------------------------------
3# plg_videobox - Videobox
4# ------------------------------------------------------------------------
5# author HitkoDev
6# copyright Copyright (C) 2014 HitkoDev. All Rights Reserved.
7# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8# Websites: http://hitko.eu/software/videobox
9-------------------------------------------------------------------------*/
10// no direct access
11defined( '_JEXEC' ) or die( 'Restricted Access' );
12
13jimport( 'videobox.video' );
14
15class plgVideoboxYouTubeVideo extends Video {
16
17 /*
18 * $id - one of the following:
19 * - 11 characters YouTube video ID
20 * - link to the video (https://www.youtube.com/watch?v=KKWTdo5YW_I)
21 * - YouTube sharing link (http://youtu.be/KKWTdo5YW_I)
22 */
23 function adapterSwitch($id, $title, $offset, $vb){
24 if(strlen($id)==11 && preg_match('/([a-zA-Z0-9_-]{11})/', $id)==1){
25 return new self($id, $title, $offset);
26 }
27 if(strpos($id, 'youtube')!==false){
28 preg_match('/v=([a-zA-Z0-9_-]{11}?)/isU', $id, $v_urls);
29 return new self($v_urls[1], $title, $offset);
30 }
31 if(strpos($id, 'youtu.be')!==false){
32 preg_match('/youtu\.be\/([a-zA-Z0-9_-]{11}?)/isU', $id, $v_urls);
33 return new self($v_urls[1], $title, $offset);
34 }
35 return false;
36 }
37
38 function getTitle($forced = false){
39 if($forced && $this->title==''){
40 return 'http://youtu.be/' . $this->id;
41 } else {
42 return $this->title;
43 }
44 }
45
46 function getThumb(){
47 $th = parent::getThumb();
48 if($th !== false) return $th;
49 $img = 'http://i2.ytimg.com/vi/' . $this->id . '/hqdefault.jpg';
50 return array($img, IMAGETYPE_JPEG);
51 }
52
53 function getPlayerLink($autoplay = false){
54 $src = 'https://www.youtube.com/embed/' . $this->id . '?wmode=transparent&rel=0&fs=1';
55 if($autoplay) $src .= '&autoplay=1';
56 if($this->offset != 0) $src .= '&start=' . $this->offset;
57 return $src;
58 }
59
60}
Ни где не могу найти ответ. Как исправить ошибку. Кто знает?