1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Version 8.3 and mail fix

This commit is contained in:
daniel 2020-01-20 17:38:11 -03:00
parent ee4cd23aea
commit 3b13f66fce
72 changed files with 288 additions and 140 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
exit; exit;
} }
$installationVersion = "8.2"; $installationVersion = "8.3";
header('Content-Type: application/json'); header('Content-Type: application/json');

View file

@ -136,6 +136,7 @@ CREATE TABLE IF NOT EXISTS `videos` (
`only_for_paid` TINYINT(1) NULL DEFAULT NULL, `only_for_paid` TINYINT(1) NULL DEFAULT NULL,
`serie_playlists_id` INT(11) NULL DEFAULT NULL, `serie_playlists_id` INT(11) NULL DEFAULT NULL,
`sites_id` INT(11) NULL, `sites_id` INT(11) NULL,
`video_password` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `fk_videos_users_idx` (`users_id` ASC), INDEX `fk_videos_users_idx` (`users_id` ASC),
INDEX `fk_videos_categories1_idx` (`categories_id` ASC), INDEX `fk_videos_categories1_idx` (`categories_id` ASC),

View file

@ -4,7 +4,7 @@ require_once $global['systemRootPath'] . 'objects/functions.php';
// filter some security here // filter some security here
$securityFilter = array('error', 'catName', 'type', 'channelName', 'captcha', 'showOnly', 'key', 'link', 'email', 'country', 'region'); $securityFilter = array('error', 'catName', 'type', 'channelName', 'captcha', 'showOnly', 'key', 'link', 'email', 'country', 'region');
$securityFilterInt = array('videos_id', 'video_id', 'categories_id', 'user_id', 'users_id', 'comments_id', 'isAdmin', 'priority', 'totalClips'); $securityFilterInt = array('videos_id', 'video_id', 'categories_id', 'user_id', 'users_id', 'comments_id', 'isAdmin', 'priority', 'totalClips');
$securityRemoveSingleQuotes = array('search', 'searchPhrase', 'videoName', 'databaseName', 'sort', 'user', 'pass', 'encodedPass', 'isAdmin'); $securityRemoveSingleQuotes = array('search', 'searchPhrase', 'videoName', 'databaseName', 'sort', 'user', 'pass', 'encodedPass', 'isAdmin', 'videoLink', 'video_password');
$securityRemoveNonChars = array('resolution', 'format', 'videoDirectory'); $securityRemoveNonChars = array('resolution', 'format', 'videoDirectory');
$filterURL = array('videoURL', 'siteURL'); $filterURL = array('videoURL', 'siteURL');

View file

@ -3,7 +3,7 @@ require_once '../videos/configuration.php';
$images = Video::getImageFromFilename($video['filename']); $images = Video::getImageFromFilename($video['filename']);
$img = $images->poster; $img = $images->poster;
if (!empty($images->posterPortrait)) { if (!empty($images->posterPortrait) && strpos($images->posterPortrait, 'notfound_portrait') === false) {
$img = $images->posterPortrait; $img = $images->posterPortrait;
} }
$imgw = 1280; $imgw = 1280;
@ -28,6 +28,12 @@ $imgh = 720;
<meta property="video:duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" /> <meta property="video:duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
<meta property="duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" /> <meta property="duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
<style> <style>
body {
padding-top: 0;
}
footer{
display: none;
}
#bg{ #bg{
position: fixed; position: fixed;
width: 100%; width: 100%;
@ -41,7 +47,7 @@ $imgh = 720;
</head> </head>
<body class="<?php echo $global['bodyClass']; ?>"> <body class="<?php echo $global['bodyClass']; ?>">
<?php <?php
include $global['systemRootPath'] . 'view/include/navbar.php'; //include $global['systemRootPath'] . 'view/include/navbar.php';
?> ?>
<div id="bg"></div> <div id="bg"></div>
@ -71,7 +77,7 @@ $imgh = 720;
<div class="modal-footer" > <div class="modal-footer" >
<a href="<?php echo $_SERVER['REQUEST_URI'],strpos($_SERVER['REQUEST_URI'], "?")===false?"?":"&"; ?>rrating=1" class="btn btn-success pull-right"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></a> <a href="<?php echo $_SERVER['REQUEST_URI'],strpos($_SERVER['REQUEST_URI'], "?")===false?"?":"&"; ?>rrating=1" class="btn btn-success pull-right"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></a>
<a href="<?php echo $global["HTTP_REFERER"]; ?>" class="btn btn-danger pull-right"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a> <a href="<?php echo $global['webSiteRootURL']; ?>" class="btn btn-danger pull-right"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div> </div>
</div> </div>

View file

@ -0,0 +1,108 @@
<?php
require_once '../videos/configuration.php';
$images = Video::getImageFromFilename($video['filename']);
$img = $images->poster;
if (!empty($images->posterPortrait) && strpos($images->posterPortrait, 'notfound_portrait') === false) {
$img = $images->posterPortrait;
}
$imgw = 1280;
$imgh = 720;
?>
<!DOCTYPE html>
<html lang="<?php echo $_SESSION['language']; ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: Confirm Rating</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="image_src" href="<?php echo $img; ?>" />
<meta property="fb:app_id" content="774958212660408" />
<meta property="og:url" content="<?php echo $global['webSiteRootURL'], "video/", $video['clean_title']; ?>" />
<meta property="og:type" content="video.other" />
<meta property="og:title" content="<?php echo str_replace('"', '', $video['title']); ?> - <?php echo $config->getWebSiteTitle(); ?>" />
<meta property="og:description" content="<?php echo!empty($custom) ? $custom : str_replace('"', '', $video['title']); ?>" />
<meta property="og:image" content="<?php echo $img; ?>" />
<meta property="og:image:width" content="<?php echo $imgw; ?>" />
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
<meta property="video:duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
<meta property="duration" content="<?php echo Video::getItemDurationSeconds($video['duration']); ?>" />
<style>
body {
padding-top: 0;
}
footer{
display: none;
}
#bg{
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $images->poster; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30); /* For IE8 and earlier */
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
//include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div id="bg"></div>
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Title: <?php echo $video['title']; ?></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $img; ?>" class="img img-responsive"/>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php
if (!empty($_POST['video_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="video_password"><?php echo __("This Video Requires a Password"); ?></label>
<input type="text" class="form-control" id="video_password" name="video_password" placeholder="<?php echo __("Password"); ?>" required>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo $global['webSiteRootURL']; ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript">
$(window).on('load', function () {
$('#myModal').modal('show');
});
</script>
</body>
</html>

View file

@ -111,7 +111,7 @@ function createOrderInfo($getName, $mostWord, $lessWord, $orderString) {
} }
function createGallerySection($videos, $crc = "", $get = array()) { function createGallerySection($videos, $crc = "", $get = array()) {
global $global, $config, $obj, $advancedCustom; global $global, $config, $obj, $advancedCustom, $advancedCustomUser;
$countCols = 0; $countCols = 0;
$obj = AVideoPlugin::getObjectData("Gallery"); $obj = AVideoPlugin::getObjectData("Gallery");
$zindex = 1000; $zindex = 1000;
@ -228,6 +228,19 @@ function createGallerySection($videos, $crc = "", $get = array()) {
</span> </span>
</div> </div>
<?php } ?> <?php } ?>
<?php
if (!empty($advancedCustomUser->userCanProtectVideosWithPassword)) {
?>
<div>
<?php
if (!empty($value['video_password'])) {
?>
<i class="fas fa-lock" title="<?php echo __("Password Protected"); ?>" ></i>
<?php
}
?>
</div>
<?php } ?>
<div> <div>
<i class="far fa-clock"></i> <i class="far fa-clock"></i>
<?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?> <?php echo humanTiming(strtotime($value['videoCreation'])), " ", __('ago'); ?>
@ -306,42 +319,44 @@ function createGallerySection($videos, $crc = "", $get = array()) {
</div> </div>
<?php <?php
} }
?> ?>
<div class="col-xs-12 text-center clear clearfix" style="padding: 10px;"> <div class="col-xs-12 text-center clear clearfix" style="padding: 10px;">
<?php echo getAdsLeaderBoardMiddle(); ?> <?php echo getAdsLeaderBoardMiddle(); ?>
</div> </div>
<!-- <!--
createGallerySection createGallerySection
<?php <?php
$timesG[__LINE__] = microtime(true) - $startG; $timesG[__LINE__] = microtime(true) - $startG;
$startG = microtime(true); $startG = microtime(true);
foreach ($timesG as $key => $value) { foreach ($timesG as $key => $value) {
echo "Line: {$key} -> {$value}\n"; echo "Line: {$key
} } -> {$value
?> }\n";
--> }
<?php ?>
unset($_POST['disableAddTo']); -->
<?php
unset($_POST['disableAddTo']);
} }
function createChannelItem($users_id, $photoURL = "", $identification = "", $rowCount = 12) { function createChannelItem($users_id, $photoURL = "", $identification = "", $rowCount = 12) {
$total = Video::getTotalVideos("viewable", $users_id); $total = Video::getTotalVideos("viewable", $users_id);
if (empty($total)) { if (empty($total)) {
return false; return false;
} }
if (empty($photoURL)) { if (empty($photoURL)) {
$photoURL = User::getPhoto($users_id); $photoURL = User::getPhoto($users_id);
} }
if (empty($identification)) { if (empty($identification)) {
$identification = User::getNameIdentificationById($users_id); $identification = User::getNameIdentificationById($users_id);
} }
?> ?>
<div class="clear clearfix"> <div class="clear clearfix">
<h3 class="galleryTitle"> <h3 class="galleryTitle">
<img src="<?php <img src="<?php
echo $photoURL; echo $photoURL;
?>" class="img img-circle img-responsive pull-left" style="max-height: 20px;"> ?>" class="img img-circle img-responsive pull-left" style="max-height: 20px;">
<span style="margin: 0 5px;"> <span style="margin: 0 5px;">
<?php <?php
echo $identification; echo $identification;
@ -350,39 +365,39 @@ function createChannelItem($users_id, $photoURL = "", $identification = "", $row
<a class="btn btn-xs btn-default" href="<?php echo User::getChannelLink($users_id); ?>" style="margin: 0 10px;"> <a class="btn btn-xs btn-default" href="<?php echo User::getChannelLink($users_id); ?>" style="margin: 0 10px;">
<i class="fas fa-external-link-alt"></i> <i class="fas fa-external-link-alt"></i>
</a> </a>
<?php <?php
echo Subscribe::getButton($users_id); echo Subscribe::getButton($users_id);
?> ?>
</h3> </h3>
<div class="row"> <div class="row">
<?php <?php
$countCols = 0; $countCols = 0;
unset($_POST['sort']); unset($_POST['sort']);
$_POST['sort']['created'] = "DESC"; $_POST['sort']['created'] = "DESC";
$_POST['current'] = 1; $_POST['current'] = 1;
$_POST['rowCount'] = $rowCount; $_POST['rowCount'] = $rowCount;
$videos = Video::getAllVideos("viewable", $users_id); $videos = Video::getAllVideos("viewable", $users_id);
createGallerySection($videos); createGallerySection($videos);
?> ?>
</div> </div>
</div> </div>
<?php <?php
} }
$search = ""; $search = "";
$searchPhrase = ""; $searchPhrase = "";
function clearSearch() { function clearSearch() {
global $search, $searchPhrase; global $search, $searchPhrase;
$search = $_GET['search']; $search = $_GET['search'];
$searchPhrase = $_POST['searchPhrase']; $searchPhrase = $_POST['searchPhrase'];
unset($_GET['search']); unset($_GET['search']);
unset($_POST['searchPhrase']); unset($_POST['searchPhrase']);
} }
function reloadSearch() { function reloadSearch() {
global $search, $searchPhrase; global $search, $searchPhrase;
$_GET['search'] = $search; $_GET['search'] = $search;
$_POST['searchPhrase'] = $searchPhrase; $_POST['searchPhrase'] = $searchPhrase;
} }
?> ?>

View file

@ -348,6 +348,12 @@ abstract class PluginAbstract {
return 0; return 0;
} }
/**
*
* @param type $users_id
* @param type $videos_id
* @return 0 = I dont know, -1 = can not watch, 1 = can watch
*/
public function userCanWatchVideoWithAds($users_id, $videos_id) { public function userCanWatchVideoWithAds($users_id, $videos_id) {
return 0; return 0;
} }

View file

@ -0,0 +1,12 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
ALTER TABLE `videos`
ADD COLUMN `video_password` VARCHAR(45) NULL DEFAULT NULL;
UPDATE configurations SET version = '8.3', modified = now() WHERE id = 1;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;