1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Merge origin/master

Conflicts:
	install/index.php
	view/include/navbar.php
	view/mini-upload-form/videoEncoder.php
This commit is contained in:
daniel 2017-08-05 12:45:30 -03:00
commit 50a3aa76c0
7 changed files with 196 additions and 120 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
/nbproject/private/
/videos/
/nbproject/
/nbproject/
/docker/

View file

@ -13,7 +13,7 @@ if (!file_exists($_POST['systemRootPath'] . "index.php")) {
exit;
}
$mysqli = @new mysqli($_POST['databaseHost'], $_POST['databaseUser'], $_POST['databasePass']);
$mysqli = @new mysqli($_POST['databaseHost'], $_POST['databaseUser'], $_POST['databasePass'], "", $_POST['databasePort']);
/*
* This is the "official" OO way to do it,
@ -125,6 +125,7 @@ $content = "<?php
\$mysqlHost = '{$_POST['databaseHost']}';
\$mysqlPort = '{$_POST['databasePort']}';
\$mysqlUser = '{$_POST['databaseUser']}';
\$mysqlPass = '{$_POST['databasePass']}';
\$mysqlDatabase = '{$_POST['databaseName']}';
@ -140,5 +141,14 @@ $fp = fopen($_POST['systemRootPath'] . "videos/configuration.php", "wb");
fwrite($fp, $content);
fclose($fp);
//copy the 100% progress sample file to be used when the uploaded file is already encoded in the MP4 or WBM formats
exec("cp {$_POST['systemRootPath']}install/FinishedProgressSample.* {$_POST['systemRootPath']}videos/", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Error copying the encoding progress sample files. Check whether the directory {$_POST['systemRootPath']}videos/ exists and the process have permission";
echo json_encode($obj);
exit;
}
$obj->success = true;
echo json_encode($obj);

View file

@ -24,7 +24,7 @@ require_once '../objects/functions.php';
?>
<div class="container">
<h3 class="alert alert-success">
<span class="glyphicon glyphicon-ok-circle"></span>
<span class="glyphicon glyphicon-ok-circle"></span>
Your system is installed, remove the <code><?php echo $global['systemRootPath']; ?>install</code> directory to continue
<hr>
<a href="<?php echo $global['webSiteRootURL']; ?>" class="btn btn-success btn-lg center-block">Go to the main page</a>
@ -44,14 +44,14 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?> is Present</strong>
</div>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your server is <?php echo $_SERVER['SERVER_SOFTWARE']; ?>, you must install Apache</strong>
</div>
</div>
<?php
}
?>
@ -63,7 +63,7 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>PHP <?php echo PHP_VERSION; ?> is Present</strong>
</div>
</div>
<?php
} else {
?>
@ -82,7 +82,7 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Mod Rewrite module is Present</strong>
</div>
</div>
<?php
} else {
?>
@ -95,7 +95,7 @@ require_once '../objects/functions.php';
Restart apache2 after<br>
<pre><code>/etc/init.d/apache2 restart</code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -106,7 +106,7 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your videos directory is writable</strong>
</div>
</div>
<?php
} else {
?>
@ -129,7 +129,7 @@ require_once '../objects/functions.php';
<br>
<pre><code>sudo chmod -R 777 <?php echo $dir; ?></code></pre>
</details>
</div>
</div>
<?php
}
$pathToPHPini= php_ini_loaded_file();
@ -144,20 +144,20 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?></strong>
</div>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your post_max_size is <?php echo ini_get('post_max_size'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -168,20 +168,20 @@ require_once '../objects/functions.php';
<div class="alert alert-success">
<span class="glyphicon glyphicon-check"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?></strong>
</div>
</div>
<?php
} else {
?>
<div class="alert alert-danger">
<span class="glyphicon glyphicon-unchecked"></span>
<strong>Your upload_max_filesize is <?php echo ini_get('upload_max_filesize'); ?>, it must be at least 100M</strong>
<details>
Edit the <code>php.ini</code> file
Edit the <code>php.ini</code> file
<br>
<pre><code>sudo nano <?php echo $pathToPHPini; ?></code></pre>
</details>
</div>
</div>
<?php
}
?>
@ -209,6 +209,10 @@ require_once '../objects/functions.php';
<label for="databaseHost">Database Host</label>
<input type="text" class="form-control" id="databaseHost" placeholder="Enter Database Host" value="localhost" required="required">
</div>
<div class="form-group">
<label for="databasePort">Database Port</label>
<input type="text" class="form-control" id="databasePort" placeholder="Enter Database Port" value="3306" required="required">
</div>
<div class="form-group">
<label for="databaseUser">Database User</label>
<input type="text" class="form-control" id="databaseUser" placeholder="Enter Database User" value="root" required="required">
@ -252,7 +256,7 @@ require_once '../objects/functions.php';
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
@ -261,7 +265,7 @@ require_once '../objects/functions.php';
<script src="../view/bootstrap/bootstrapSelectPicker/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../view/js/seetalert/sweetalert.min.js" type="text/javascript"></script>
<script src="../view/js/script.js" type="text/javascript"></script>
<script>
$(function () {
$('.selectpicker').selectpicker();
@ -279,12 +283,13 @@ require_once '../objects/functions.php';
swal("Sorry!", "Your System Admin Password must be confirmed!", "error");
return false;
}
modal.showPleaseWait();
var webSiteRootURL = $('#webSiteRootURL').val();
var systemRootPath = $('#systemRootPath').val();
var webSiteTitle = $('#webSiteTitle').val();
var databaseHost = $('#databaseHost').val();
var databasePort = $('#databasePort').val();
var databaseUser = $('#databaseUser').val();
var databasePass = $('#databasePass').val();
var databaseName = $('#databaseName').val();
@ -298,6 +303,7 @@ require_once '../objects/functions.php';
systemRootPath: systemRootPath,
webSiteTitle: webSiteTitle,
databaseHost: databaseHost,
databasePort: databasePort,
databaseUser: databaseUser,
databasePass: databasePass,
databaseName: databaseName,

View file

@ -4,7 +4,7 @@ global $global;
global $config;
$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser,$mysqlPass,$mysqlDatabase);
$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser,$mysqlPass,$mysqlDatabase,@$mysqlPort);
$now = new DateTime();
$mins = $now->getOffset() / 60;
@ -36,4 +36,4 @@ session_set_cookie_params($config->getSession_timeout());
session_start();
require_once $global['systemRootPath'].'objects/Object.php';
require_once $global['systemRootPath'].'locale/function.php';
require_once $global['systemRootPath'].'locale/function.php';

View file

@ -74,22 +74,23 @@ h4{
}
footer {
color: white;
color: #444;
padding: 25px;
background-color: #000;
background-color: #F2F2F2;
border-top: 1px solid #DDD;
text-align: center;
margin: 0;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active{
color: #000;
footer .btn-outline:hover,
footer .btn-outline:focus,
footer .btn-outline:active{
color: #444;
background: white;
border: solid 2px white;
}
.btn-outline {
color: white;
border: solid 2px white;
footer .btn-outline {
color: #444;
border: solid 2px #444;
background: transparent;
transition: all 0.3s ease-in-out;
margin: 0 5px;
@ -477,17 +478,68 @@ img.rotate270, img.rotate-90{
.navbar-brand {
padding: 0px !important; /* firefox bug fix */
margin-left: 10px !important;
height: auto;
}
.navbar-brand>img {
height: 100%;
width: auto;
width: 120px;
}
.navbar .list-inline li{
padding: 0 2px;
.list-inline {
display: flex;
justify-content: left;
}
footer ul.list-inline{
justify-content: center;
}
footer ul.list-inline li{
justify-content: center;
align-items: center;
}
/** header **/
nav ul.items-container {
display: flex;
justify-content: flex-end;
margin: 0px;
padding: 0px;
}
nav ul.items-container,
nav ul.items-container li{
list-style: none;
}
nav ul.items-container li:first-child{
flex: 1;
display: flex;
}
nav ul.items-container li:first-child ul.left-side{
display: flex;
align-items: center
}
nav ul.items-container li:last-child{
margin-right: 20px;
}
nav ul.items-container li ul.right-menus {
display: flex;
flex-direction: row;
}
nav ul.items-container li ul.right-menus li{
margin-left: 20px;
}
/** header **/
.navbar .container{
padding: 0 2px;
align-items: center;
}
.list-inline > li {
display: flex;
}
.navbar .list-inline{
margin: 0;
display: flex;
align-items: center;
}
/* Play List */
.playlistList{
@ -591,4 +643,4 @@ img.rotate270, img.rotate-90{
.galleryVideo{
height: 180px;
}
}
}

View file

@ -9,89 +9,95 @@ if (empty($_SESSION['language'])) {
}
?>
<nav class="navbar navbar-default navbar-fixed-top ">
<div class="container-fluid">
<ul class="list-inline pull-left">
<li>
<button class="btn btn-default navbar-btn pull-left" id="buttonMenu" ><span class="fa fa-bars"></span></button>
<script>
$('#buttonMenu').click(function (event) {
event.stopPropagation();
$('#sidebar').fadeToggle();
});
$(document).on("click", function () {
$("#sidebar").fadeOut();
});
$("#sidebar").on("click", function (event) {
event.stopPropagation();
});
</script>
</li>
<li>
<a class="navbar-brand" href="<?php echo $global['webSiteRootURL']; ?>" >
<img src="<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>" alt="<?php echo $config->getWebSiteTitle(); ?>" class="img-responsive ">
</a>
</li>
<li class="hidden-xs">
<form class="navbar-form navbar-left" action="<?php echo $global['webSiteRootURL']; ?>" >
<div class="input-group" >
<input class="form-control" type="text" name="search" placeholder="<?php echo __("Search"); ?>">
<span class="input-group-addon" style="width: 50px;"><span class="glyphicon glyphicon-search"></span></span>
</div>
</form>
</li>
</ul>
<ul class="pull-right list-inline ">
<?php
if (User::canUpload()) {
if(!empty($config->getEncoderURL())){
?>
<ul class="items-container">
<li>
<ul class="left-side">
<li>
<a href="<?php echo $config->getEncoderURL(), "?webSiteRootURL=", urlencode($global['webSiteRootURL']), "&user=", urlencode(User::getUserName()), "&pass=", urlencode(User::getUserPass()); ?>" class="btn btn-default navbar-btn pull-left" data-toggle="tooltip" title="<?php echo __("Video and Audio Upload"); ?>" data-placement="bottom" ><span class="fa fa-upload"></span></a>
</li>
<?php
}else{
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations" class="btn btn-default navbar-btn pull-left" data-toggle="tooltip" title="<?php echo __("Configure an Encoder URL"); ?>" data-placement="bottom" ><span class="fa fa-cogs"></span></a>
</li>
<?php
}
}
?>
<button class="btn btn-default navbar-btn pull-left" id="buttonMenu" ><span class="fa fa-bars"></span></button>
<script>
$('#buttonMenu').click(function (event) {
event.stopPropagation();
$('#sidebar').fadeToggle();
<li class="pull-right">
<select class="selectpicker" id="navBarFlag" data-width="fit">
<?php
$flags = getEnabledLangs();
foreach ($flags as $value) {
$selected = "";
if ($value == 'en') {
$value = 'us';
}
if ($lang == $value) {
$selected = 'selected="selected"';
}
echo "<option data-content='<span class=\"flag-icon flag-icon-{$value}\"></span>' value=\"{$value}\" {$selected}>{$value}</option>";
}
?>
</select>
<script>
$(function () {
$('#navBarFlag').selectpicker('setStyle', 'btn-default');
$('#navBarFlag').selectpicker('setStyle', 'navbar-btn', 'add');
$('#navBarFlag').on('change', function () {
var selected = $(this).find("option:selected").val();
window.location.href = "<?php echo $global['webSiteRootURL']; ?>?lang=" + selected;
});
});
</script>
</li>
</ul>
</div>
$(document).on("click", function () {
$("#sidebar").fadeOut();
});
$("#sidebar").on("click", function (event) {
event.stopPropagation();
});
</script>
</li>
<li>
<a class="navbar-brand" href="<?php echo $global['webSiteRootURL']; ?>" >
<img src="<?php echo $global['webSiteRootURL'], $config->getLogo(); ?>" alt="<?php echo $config->getWebSiteTitle(); ?>" class="img-responsive ">
</a>
</li>
<li class="hidden-xs">
<form class="navbar-form navbar-left" action="<?php echo $global['webSiteRootURL']; ?>" >
<div class="input-group" >
<input class="form-control" type="text" name="search" placeholder="<?php echo __("Search"); ?>">
<span class="input-group-addon" style="width: 50px;"><span class="glyphicon glyphicon-search"></span></span>
</div>
</form>
</li>
</ul>
</li>
<li>
<ul class="right-menus">
<?php
if (User::canUpload()) {
if (!empty($config->getEncoderURL())) {
?>
<li>
<a href="<?php echo $config->getEncoderURL(), "?webSiteRootURL=", urlencode($global['webSiteRootURL']), "&user=", urlencode(User::getUserName()), "&pass=", urlencode(User::getUserPass()); ?>" class="btn btn-default navbar-btn pull-left" data-toggle="tooltip" title="<?php echo __("Video and Audio Upload"); ?>" data-placement="bottom" ><span class="fa fa-upload"></span></a>
</li>
<?php
} else {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations" class="btn btn-default navbar-btn pull-left" data-toggle="tooltip" title="<?php echo __("Configure an Encoder URL"); ?>" data-placement="bottom" ><span class="fa fa-cogs"></span></a>
</li>
<?php
}
}
?>
<li>
<select class="selectpicker" id="navBarFlag" data-width="fit">
<?php
$flags = getEnabledLangs();
foreach ($flags as $value) {
$selected = "";
if ($value == 'en') {
$value = 'us';
}
if ($lang == $value) {
$selected = 'selected="selected"';
}
echo "<option data-content='<span class=\"flag-icon flag-icon-{$value}\"></span>' value=\"{$value}\" {$selected}>{$value}</option>";
}
?>
</select>
<script>
$(function () {
$('#navBarFlag').selectpicker('setStyle', 'btn-default');
$('#navBarFlag').selectpicker('setStyle', 'navbar-btn', 'add');
$('#navBarFlag').on('change', function () {
var selected = $(this).find("option:selected").val();
window.location.href = "<?php echo $global['webSiteRootURL']; ?>?lang=" + selected;
});
});
</script>
</li>
</ul>
</li>
</ul>
<div id="sidebar" class="list-group-item" style="display: none;">
<div id="sideBarContainer">
@ -294,4 +300,4 @@ if (empty($_SESSION['language'])) {
</ul>
</div>
</div>
</nav>
</nav>

View file

@ -26,9 +26,10 @@ if (!empty($ad)) {
}
?>">
<video poster="<?php echo $poster; ?>" controls crossorigin
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered" id="mainVideo" data-setup='{ aspectRatio: "<?php echo $aspectRatio; ?>" }'>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.mp4" type="video/mp4">
class="embed-responsive-item video-js vjs-default-skin <?php echo $vjsClass; ?> vjs-big-play-centered"
id="mainVideo" data-setup='{ aspectRatio: "<?php echo $aspectRatio; ?>" }'>
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.webm" type="video/webm">
<source src="<?php echo $global['webSiteRootURL']; ?>videos/<?php echo $playNowVideo['filename']; ?>.mp4" type="video/mp4">
<p><?php echo __("If you can't view this video, your browser does not support HTML5 videos"); ?></p>
<p class="vjs-no-js">
<?php echo __("To view this video please enable JavaScript, and consider upgrading to a web browser that"); ?>