Skip to content

Commit

Permalink
Merge pull request #20 from DanielnetoDotCom/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Vinzenz Hersche authored Mar 23, 2018
2 parents 015a9ca + 0fc0fa7 commit 39a9b09
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 35 deletions.
25 changes: 0 additions & 25 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,6 @@
}
?>


<?php
if (modRewriteEnabled()) {
?>
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Mod Rewrite module is Present</strong>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Mod Rewrite is not enabled</strong>
<details>
In order to use mod_rewrite you can type the following command in the terminal:<br>
<pre><code>a2enmod rewrite</code></pre><br>
Restart apache2 after<br>
<pre><code>/etc/init.d/apache2 restart</code></pre>
</details>
</div>
<?php
}
?>

<?php
if (checkVideosDir()) {
?>
Expand Down
20 changes: 18 additions & 2 deletions objects/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,31 @@ function parseVideos($videoString = null) {

$id = $matches[2];
return '//streamable.com/s/' . $id;
} else if (strpos($link, 'twitch.tv') !== FALSE) {
} else if (strpos($link, 'twitch.tv/videos') !== FALSE) {
//extract the ID
preg_match(
'/\/\/(www\.)?twitch.tv\/videos\/([a-zA-Z0-9_-]+)$/', $link, $matches
);

$id = $matches[2];
return '//player.twitch.tv/?video=' . $id . '#';
} else if (strpos($link, 'twitch.tv/videos') !== FALSE) {
//extract the ID
preg_match(
'/\/\/(www\.)?twitch.tv\/[a-zA-Z0-9_-]+\/v\/([a-zA-Z0-9_-]+)$/', $link, $matches
);

$id = $matches[2];
return '//player.twitch.tv/?video=' . $id . '#';
}else if (strpos($link, 'twitch.tv') !== FALSE) {
//extract the ID
preg_match(
'/\/\/(www\.)?twitch.tv\/([a-zA-Z0-9_-]+)$/', $link, $matches
);

$id = $matches[2];
return '//player.twitch.tv/?channel=' . $id . '#';
} else if (strpos($link, '/video/') !== FALSE) {
} else if (strpos($link, '/video/') !== FALSE) {
//extract the ID
preg_match(
'/(http.+)\/video\/([a-zA-Z0-9_-]+)($|\/)/i', $link, $matches
Expand Down
4 changes: 4 additions & 0 deletions objects/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ static function getStoragePath(){

static function getImageFromFilename($filename, $type = "video") {
global $global;
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
/*
$name = "getImageFromFilename_{$filename}{$type}_";
$cached = ObjectYPT::getCache($name, 86400);//one day
Expand Down Expand Up @@ -1299,6 +1300,9 @@ static function getImageFromFilename($filename, $type = "video") {
$obj->thumbsJpg = $obj->poster;
}
//ObjectYPT::setCache($name, $obj);
if(!empty($advancedCustom->disableAnimatedGif)){
$obj->thumbsGif = false;
}
return $obj;
}

Expand Down
2 changes: 1 addition & 1 deletion objects/video_ad.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static function getAdFromCategory($categories_id) {
. " AND (finish_max_prints = 0 OR finish_max_prints > (SELECT count(*) FROM video_ads_logs as val WHERE val.video_ads_id = va.id)) ";


$sql .= " LIMIT 1";
$sql .= "ORDER BY RAND() LIMIT 1";
//echo $sql;exit;
$res = $global['mysqli']->query($sql);
if ($res) {
Expand Down
1 change: 1 addition & 0 deletions plugin/CustomizeAdvanced/CustomizeAdvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function getEmptyDataObject() {
$obj->usePermalinks = false;
$obj->showAdsenseBannerOnTop = false;
$obj->showAdsenseBannerOnLeft = true;
$obj->disableAnimatedGif = false;
$o = new stdClass();
$o->type = "textarea";
$o->value = "";
Expand Down
9 changes: 2 additions & 7 deletions plugin/Live/view/modeYoutubeLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
$video['creator'] = '<div class="pull-left"><img src="' . User::getPhoto($user_id) . '" alt="" class="img img-responsive img-circle" style="max-width: 40px;"/></div><div class="commentDetails" style="margin-left:45px;"><div class="commenterName text-muted"><strong>' . $name . '</strong><br>' . $subscribe . '</div></div>';

$img = "{$global['webSiteRootURL']}plugin/Live/getImage.php?u={$_GET['u']}&format=jpg";
$data = getimgsize("{$global['systemRootPath']}videos/{$video['filename']}.jpg");
$imgw = $data[0];
$imgh = $data[1];
if(empty($imgw) || empty($imgh)){
$imgw = 640;
$imgh = 360;
}
$imgw = 640;
$imgh = 360;
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
Expand Down
14 changes: 14 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
User-Agent: *
Disallow:
Disallow: /user
Disallow: /plugin
Disallow: /mvideos
Disallow: /usersGroups
Disallow: /charts
Disallow: /upload
Disallow: /ads
Disallow: /comments
Disallow: /subscribes
Disallow: /update
Disallow: /locale

1 change: 1 addition & 0 deletions view/managerVideos.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ function createQueueItem(queueItem, position) {
$('#postersImage, #videoIsAdControl, .titles').slideUp();
$('#videoLinkContent').slideDown();
$('#videoLink').val('');
setTimeout(function(){waitToSubmit = false;}, 2000);
$('#videoFormModal').modal();
});
$("#checkBtn").click(function () {
Expand Down

0 comments on commit 39a9b09

Please sign in to comment.