1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Minor code style patch.

This commit is contained in:
Caleb Mazalevskis 2019-12-23 21:02:31 +08:00
parent 8108fc1e68
commit 172fa35b49
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
15 changed files with 72 additions and 79 deletions

View file

@ -11,16 +11,16 @@
<hr> <hr>
<div class="alert alert-info"> <div class="alert alert-info">
<i class="fas fa-info-circle"></i> As a database increases in size full database backups take more time to complete, and require more storage space. please be patience <i class="fas fa-info-circle"></i> As a database increases in size full database backups take more time to complete, and require more storage space. please be patience
</div> </div>
<?php <?php
} else { } else {
?> ?>
<div class="alert alert-info"> <div class="alert alert-info">
<h2><i class="fas fa-undo"></i> Prevent Data Loss</h2> <h2><i class="fas fa-undo"></i> Prevent Data Loss</h2>
Backing up your video files and databases, running test restores procedures on your backups, and storing copies of backups in a safe, off-site location protects you from potentially catastrophic data loss. Backing up is the only way to protect your data. Backing up your video files and databases, running test restores procedures on your backups, and storing copies of backups in a safe, off-site location protects you from potentially catastrophic data loss. Backing up is the only way to protect your data.
<br> We can help you with this task, <br> We can help you with this task,
<a class="btn btn-info btn-sm btn-xs" href="https://www.avideo.com/plugins/">Buy our Backup Plugin Now</a> <a class="btn btn-info btn-sm btn-xs" href="https://www.avideo.com/plugins/">Buy our Backup Plugin Now</a>
</div> </div>
<?php <?php
} }
?> ?>
@ -34,7 +34,7 @@
<div class="alert alert-info"> <div class="alert alert-info">
<i class="fas fa-info-circle"></i> This Plugin helps you to clone your video site, it is really helpful for backup routines, load balance, etc.<br> <i class="fas fa-info-circle"></i> This Plugin helps you to clone your video site, it is really helpful for backup routines, load balance, etc.<br>
You May find some help how to use Clone Plugin <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin">here</a> You May find some help how to use Clone Plugin <a target="_blank" href="https://github.com/WWBN/AVideo/wiki/Clone-Site-Plugin">here</a>
</div> </div>
<?php <?php
$filter = array( $filter = array(
'cloneSiteURL' => 'Place here the URL of the site you want to clone'); 'cloneSiteURL' => 'Place here the URL of the site you want to clone');

View file

@ -1,4 +1,3 @@
<?php <?php
include './customize_settings_native.php'; include './customize_settings_native.php';
include './customize_settings_plugin.php'; include './customize_settings_plugin.php';
?>

View file

@ -1,7 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
global $global, $config; global $global, $config;
if(!isset($global['systemRootPath'])){ if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php'; require_once '../videos/configuration.php';
} }
require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/user.php';

View file

@ -9,7 +9,7 @@
<div class="alert alert-info"> <div class="alert alert-info">
Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own. Truly customize your AVideo and create a more professional video sharing site experience for your visitors by removing or replacing the footer, about page and Meta Description with your own.
<a class="btn btn-info btn-sm btn-xs" href="https://www.avideo.com/plugins/">Buy the Customize plugin now</a> <a class="btn btn-info btn-sm btn-xs" href="https://www.avideo.com/plugins/">Buy the Customize plugin now</a>
</div> </div>
<?php <?php
return false; return false;
} else { } else {

View file

@ -13,8 +13,8 @@ $dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
</div> </div>
</div> </div>
<div class="panel-body" style="padding: 0;"> <div class="panel-body" style="padding: 0;">
<iframe fameBorder="0" <iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php" src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php"
style="width: 100%; height: 300px; border: 0;"></iframe> style="width: 100%; height: 300px; border: 0;"></iframe>
</div> </div>
</div> </div>
@ -35,8 +35,8 @@ $dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/';
</div> </div>
</div> </div>
<div class="panel-body" style="padding: 0;"> <div class="panel-body" style="padding: 0;">
<iframe fameBorder="0" <iframe fameBorder="0"
src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php?playerSkin=<?php echo ($fileEx); ?>" src="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/playerSample.php?playerSkin=<?php echo ($fileEx); ?>"
style="width: 100%; height: 300px; border: 0;"></iframe> style="width: 100%; height: 300px; border: 0;"></iframe>
</div> </div>
</div> </div>

View file

@ -1,8 +1,8 @@
<?php <?php
function createTable($pluginName, $filter = array()){ function createTable($pluginName, $filter = array()) {
$plugin = AVideoPlugin::getObjectData($pluginName); $plugin = AVideoPlugin::getObjectData($pluginName);
if(empty($filter)){ if (empty($filter)) {
foreach ($plugin as $keyJson => $valueJson) { foreach ($plugin as $keyJson => $valueJson) {
$filter[$keyJson] = "&nbsp;"; $filter[$keyJson] = "&nbsp;";
} }
@ -15,13 +15,13 @@ function createTable($pluginName, $filter = array()){
$pluginsList = array(); $pluginsList = array();
if (!AVideoPlugin::exists($pluginName)) { if (!AVideoPlugin::exists($pluginName)) {
echo "<tr><td colspan='2'> Sorry you do not have the plugin </td></tr>"; echo "<tr><td colspan='2'> Sorry you do not have the plugin </td></tr>";
}else{ } else {
if(!empty($plugin)){ if (!empty($plugin)) {
$form = jsonToFormElements($plugin,$filter); $form = jsonToFormElements($plugin,$filter);
//var_dump($form); //var_dump($form);
echo implode("", $form); echo implode("", $form);
} }
echo "<tr><td colspan='2'> <button class='btn btn-block btn-primary'><i class='fa fa-save'></i> Save</button> </td></tr>"; echo "<tr><td colspan='2'> <button class='btn btn-block btn-primary'><i class='fa fa-save'></i> Save</button> </td></tr>";
} }
echo '</table></form>'; echo '</table></form>';
@ -63,9 +63,9 @@ function jsonToFormElements($json, $filter = array()) {
} }
function getPluginSwitch($pluginName) { function getPluginSwitch($pluginName) {
if(!AVideoPlugin::exists($pluginName)){ if (!AVideoPlugin::exists($pluginName)) {
$input = '<a href="https://www.avideo.com/plugins/" class="btn btn-danger btn-sm btn-xs">Buy this plugin now</a>'; $input = '<a href="https://www.avideo.com/plugins/" class="btn btn-danger btn-sm btn-xs">Buy this plugin now</a>';
}else{ } else {
$plugin = AVideoPlugin::loadPluginIfEnabled($pluginName); $plugin = AVideoPlugin::loadPluginIfEnabled($pluginName);
$pluginForced = AVideoPlugin::loadPlugin($pluginName); $pluginForced = AVideoPlugin::loadPlugin($pluginName);
$id = uniqid(); $id = uniqid();

View file

@ -244,7 +244,7 @@ switch ($_GET['page']) {
?> ?>
</table> </table>
</div> </div>
</div> </div>
<?php <?php
} }
?> ?>
@ -264,9 +264,9 @@ switch ($_GET['page']) {
} else { } else {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store
<a class="btn btn-danger" href="https://www.avideo.com/plugins/">Plugin Store</a> <a class="btn btn-danger" href="https://www.avideo.com/plugins/">Plugin Store</a>
</div> </div>
<?php <?php
} }
} }
@ -276,9 +276,9 @@ switch ($_GET['page']) {
} else { } else {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store
<a class="btn btn-danger" href="https://www.avideo.com/plugins/">Plugin Store</a> <a class="btn btn-danger" href="https://www.avideo.com/plugins/">Plugin Store</a>
</div> </div>
<?php <?php
} }
} }
@ -324,6 +324,3 @@ switch ($_GET['page']) {
</script> </script>
</body> </body>
</html> </html>

View file

@ -4,7 +4,7 @@
<div class="panel-heading"><?php echo __('Live') ?> <div class="pull-right"><?php echo getPluginSwitch('Live'); ?></div></div> <div class="panel-heading"><?php echo __('Live') ?> <div class="pull-right"><?php echo getPluginSwitch('Live'); ?></div></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
createTable("Live"); createTable("Live");
?> ?>
@ -16,7 +16,7 @@
<div class="panel-heading"><?php echo __('Live Chat') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveChat'); ?></div></div> <div class="panel-heading"><?php echo __('Live Chat') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveChat'); ?></div></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
createTable("LiveChat"); createTable("LiveChat");
?> ?>
@ -28,10 +28,10 @@
<div class="panel-heading"><?php echo __('Live Users') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveUsers'); ?></div></div> <div class="panel-heading"><?php echo __('Live Users') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveUsers'); ?></div></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
$filter = array( $filter = array(
'doNotDisplayCounter' => 'It will collect usage info but will not display the counter on the live video'); 'doNotDisplayCounter' => 'It will collect usage info but will not display the counter on the live video');
createTable("LiveUsers",$filter); createTable("LiveUsers",$filter);
?> ?>
@ -43,7 +43,7 @@
<div class="panel-heading"><?php echo __('Live Links') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveLinks'); ?></div></div> <div class="panel-heading"><?php echo __('Live Links') ?> <div class="pull-right"><?php echo getPluginSwitch('LiveLinks'); ?></div></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
createTable("LiveLinks"); createTable("LiveLinks");
?> ?>

View file

@ -2,7 +2,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><?php echo __("Email All Users"); ?></div> <div class="panel-heading"><?php echo __("Email All Users"); ?></div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<label class="col-md-4"> <label class="col-md-4">
Sent only to this email: Sent only to this email:

View file

@ -7,7 +7,7 @@
$filter = array( $filter = array(
'rewardPerView' => 'How much will your users receive per each video view', 'rewardPerView' => 'How much will your users receive per each video view',
'rewardOnlyLoggedUsersView' => 'Check this to allow only count rewards from logged users'); 'rewardOnlyLoggedUsersView' => 'Check this to allow only count rewards from logged users');
createTable("MonetizeUsers",$filter); createTable("MonetizeUsers",$filter);
?> ?>

View file

@ -1,5 +1,4 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
global $global, $config; global $global, $config;
if (!isset($global['systemRootPath'])) { if (!isset($global['systemRootPath'])) {
@ -30,9 +29,9 @@ $pluginDB = Plugin::getPluginByName($pluginName);
foreach ($pluginDO as $key => $value) { foreach ($pluginDO as $key => $value) {
if (isset($pluginValues[$key])) { if (isset($pluginValues[$key])) {
if(is_bool($pluginDO->$key)){ if (is_bool($pluginDO->$key)) {
$pluginDO->$key = empty($pluginValues[$key])?false:true; $pluginDO->$key = empty($pluginValues[$key])?false:true;
}else{ } else {
//$pluginDO->$key = str_replace('"', '\\"', $pluginValues[$key]); //$pluginDO->$key = str_replace('"', '\\"', $pluginValues[$key]);
$pluginDO->$key = $pluginValues[$key]; $pluginDO->$key = $pluginValues[$key];
} }
@ -44,6 +43,6 @@ $p->setObject_data(json_encode($pluginDO));
$obj = new stdClass(); $obj = new stdClass();
$obj->save = $p->save(); $obj->save = $p->save();
if($obj->save === false) error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?"); if ($obj->save === false) error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?");
echo (json_encode($obj)); echo (json_encode($obj));

View file

@ -1,7 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
global $global, $config; global $global, $config;
if(!isset($global['systemRootPath'])){ if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php'; require_once '../videos/configuration.php';
} }
require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/user.php';

View file

@ -1,16 +1,15 @@
<?php <?php
if (isset($_GET['getLanguage'])) {
if(isset($_GET['getLanguage'])) { $lngFile = './'.strtolower(str_replace(['.', '/', '\\'], '', $_GET['getLanguage'])).'.php';
if (!file_exists($lngFile)) {
header('HTTP/1.0 404 Not Found');
exit;
}
$lngFile = './'.strtolower(str_replace(['.', '/', '\\'], '', $_GET['getLanguage'])).'.php'; require_once($lngFile);
if(!file_exists($lngFile)) { echo json_encode($t);
header('HTTP/1.0 404 Not Found'); exit;
exit;
}
require_once($lngFile);
echo json_encode($t);
exit;
} }
$vars = array(); $vars = array();
@ -78,37 +77,37 @@ sort($vars);
$("#navBarFlag2").flagStrap({ $("#navBarFlag2").flagStrap({
inputName: 'country2', inputName: 'country2',
buttonType: "btn-default navbar-btn", buttonType: "btn-default navbar-btn",
onSelect: function(value, element) { onSelect: function(value, element) {
var tb1 = $('#originalWords'); var tb1 = $('#originalWords');
var tb2 = $('#translatedCode'); var tb2 = $('#translatedCode');
console.log('Changed language'); console.log('Changed language');
console.log(value); console.log(value);
$.ajax({ $.ajax({
url: 'index.php?getLanguage='+value, url: 'index.php?getLanguage='+value,
dataType: 'json' dataType: 'json'
}).done(function(data){ }).done(function(data){
console.log("Found existing translation!"); console.log("Found existing translation!");
var arrayOfLines = $('#originalWords').val().split('\n'); var arrayOfLines = $('#originalWords').val().split('\n');
$.each(arrayOfLines, function(index, item) { $.each(arrayOfLines, function(index, item) {
if(data.hasOwnProperty(item)) { if (data.hasOwnProperty(item)) {
$('#translatedCode').append(data[item]+'\n'); $('#translatedCode').append(data[item]+'\n');
} else { } else {
$('#translatedCode').append('\n'); $('#translatedCode').append('\n');
} }
}); });
tb1.scroll(function() { tb1.scroll(function() {
tb2.scrollTop(tb1.scrollTop()); tb2.scrollTop(tb1.scrollTop());
}); });
}).fail(function(){ }).fail(function(){
console.log("New translation"); console.log("New translation");
tb1.scroll(function() { tb1.scroll(function() {
}); });
}); });
} }
}); });
}); });
</script> </script>

View file

@ -336,4 +336,4 @@ $t['Site Settings'] = "Website Instellingen";
$t['Social Login Settings'] = "Social Inlog Instellingen"; $t['Social Login Settings'] = "Social Inlog Instellingen";
$t['Upload a File'] = "Bestand Uploaden"; $t['Upload a File'] = "Bestand Uploaden";
$t['Want to subscribe to this channel?'] = "Wilt u zich op dit kanaal abonneren?"; $t['Want to subscribe to this channel?'] = "Wilt u zich op dit kanaal abonneren?";
$t['Warning'] = "Let op"; $t['Warning'] = "Let op";

View file

@ -1,5 +1,4 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
if (empty($global['systemRootPath'])) { if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = "../"; $global['systemRootPath'] = "../";
@ -22,7 +21,7 @@ if (!is_writable($dir)) {
} }
$file = $dir.strtolower($_POST['flag']).".php"; $file = $dir.strtolower($_POST['flag']).".php";
$myfile = fopen($file, "w") or die("Unable to open file!"); $myfile = fopen($file, "w") or die("Unable to open file!");
if(!$myfile){ if (!$myfile) {
$obj->status = 0; $obj->status = 0;
$obj->error = __("Unable to open file!"); $obj->error = __("Unable to open file!");
die(json_encode($obj)); die(json_encode($obj));