Skip to content

Commit 3314d85

Browse files
authored
Update plugin.php
1 parent 7ac5501 commit 3314d85

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

plugins/izlesene/plugin.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
* Version: 3.0
77
* Author: PHPVibe Crew
88
* Author URI: http://www.phpvibe.com
9-
* License: Commercial
10-
*/
11-
function _Izlesene($hosts = array())
9+
* License: GPL
10+
11+
function getIzleseneID($url)
12+
{
13+
$pieces_array = explode('/', $url);
14+
$end_piece = end($pieces_array);
15+
$id_pieces = explode('-', $end_piece);
16+
$last_piece = end($id_pieces);
17+
$videoId = preg_replace("/[^0-9]/", "", $last_piece);
18+
return $videoId;
19+
}
20+
21+
function RegisterIzlesene($hosts = array())
1222
{
1323
$hosts[] = 'izlesene';
1424
return $hosts;
@@ -23,7 +33,7 @@ function EmbedIzlesene($txt = '')
2333
if (!nullval($VibeLink)) {
2434
$variable = $VibeLink;
2535
$variable = substr($variable, 0, strpos($variable, "#list"));
26-
$id = $vid->getLastNr($variable);
36+
$id = getIzleseneID($variable);
2737
if (!nullval($id)) {
2838
$tembed = ' <iframe src="https://www.izlesene.com/embedplayer/' . $id . '/?showrel=0&loop=0&autoplay=1&autohide=1&showinfo=1&socialbuttons=0" allowfullscreen="true" frameborder="0"></iframe>';
2939
$txt .= $tembed;
@@ -39,5 +49,5 @@ function EmbedIzlesene($txt = '')
3949
}
4050

4151
add_filter('EmbedModify', 'EmbedIzlesene');
42-
add_filter('vibe-video-sources', '_Izlesene');
52+
add_filter('vibe-video-sources', 'RegisterIzlesene');
4353
?>

0 commit comments

Comments
 (0)