Commit d46724ff authored by carboncrafters's avatar carboncrafters

changes

parent 7f68c469
......@@ -93,7 +93,7 @@ $conn->close();
case 'basic':
if (!empty($_GET["id"])) {
$id = test_input($_GET["id"]);
$sql = "SELECT id, `name`, `date`, views, descr, user, deleted FROM ids WHERE id='$id'";
$sql = "SELECT id, `name`, `date`, views, descr, user, deleted, dl FROM ids WHERE id='$id'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
......@@ -106,7 +106,7 @@ $conn->close();
$descr = $row["descr"];
$user = $row["user"];
$id = $row["id"];
//$dl = $row["dl"];
$dl = $row["dl"];
}
if ($deleted=="0") {
$return["id"] = $id;
......@@ -115,7 +115,7 @@ $conn->close();
$return["views"] = $views;
$return["description"] = $descr;
$return["uid"] = $user;
//$return["dl"] = $dl;
$return["dl"] = $dl;
echo json_encode($return);
}else{
$return["error"]="true";
......
<!DOCTYPE html>
<html>
<head>
<script>
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS );
var results = regex.exec( window.location.href ); if( results == null ) return "";
else return results[1];
}
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
......@@ -11,13 +23,13 @@
<script src="https://cdn.emalm.com/js/setlang.js"></script>
<?php
require $_SERVER["DOCUMENT_ROOT"].'/cookie.php';
$domain = "emalm.com";
//get the requested url
$browlin = $_GET["v"];
$browlin = explode('/', $browlin);
//get json data
$json = file_get_contents("https://cdn.$domain/json/$browlin[0].json");
$json = file_get_contents("https://emalm.com/api/?get=basic&id=$browlin[0]");
if($json === FALSE) {
header("HTTP/1.0 404 Not Found");
......@@ -26,9 +38,10 @@ $json = file_get_contents("https://cdn.$domain/json/$browlin[0].json");
exit;
}
$obj = json_decode($json, true);
$uploaderid = $obj["uid"];
//end of json stuff
//get the data from the database
require $_SERVER["DOCUMENT_ROOT"].'/conn.php';
/*require $_SERVER["DOCUMENT_ROOT"].'/conn.php';
$sql = "SELECT * FROM videos WHERE id='$browlin[0]'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
......@@ -53,18 +66,18 @@ if ($result->num_rows > 0) {
exit;
}
$conn->close();
$conn->close();*/
?>
<!-- meta tags and stuff -->
<meta property="og:site_name" content="emalm.com">
<meta property="og:title" content="Emalm video - <?= $title ?>">
<meta property="og:title" content="Emalm video - <?= $obj["title"] ?>">
<meta property="og:type" content="video">
<meta property="og:url" content="https://emalm.com/?v=<?= $obj["id"]?>">
<meta property="og:image" content="https://cdn.emalm.com/video/<?= $obj["id"]."/".$obj["id"]?>.jpg">
<meta property="og:description" content="Emalm video sharing.<br><?= nl2br($desc) ?>">
<meta property="og:description" content="Emalm video sharing.<br><?= nl2br($obj["description"]) ?>">
<meta property="og:video" content="https://cdn.emalm.com/video/<?= $obj["id"]."/".$obj["id"]."-MUX-low.webm" ?>">
<meta name="description" content="Emalm video sharing.\n<br><?= nl2br($desc)?>">
<meta name="description" content="Emalm video sharing.\n<br><?= nl2br($obj["description"])?>">
<meta name="theme-color" content="#ffff00">
<meta name="keywords" content="">
<meta property="id" content="<?= $title ?>">
......@@ -73,43 +86,44 @@ $conn->close();
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
<meta name="twitter:card" content="player" />
<meta name="twitter:site" content="@emalm" />
<meta name="twitter:title" content="Emalm video - <?= $title ?>" />
<meta name="twitter:title" content="Emalm video - <?= $obj["title"] ?>" />
<meta name="twitter:image" content="https://cdn.emalm.com/video/<?= $obj["id"]."/".$obj["id"].".jpg" ?>" />
<meta name="twitter:player" content="https://emalm.com/vid/player.html?vid=<?= $obj["id"] ?>" />
<meta name="twitter:player:width" content="1280" />
<meta name="twitter:player:height" content="720" />
<meta name="description" content="<?php Print(nl2br($desc)) ; ?>">
<meta name="keywords" content="video sharing, <?php echo $obj["name"] ;?>">
<meta name="description" content="<?php Print(nl2br($obj["description"])) ; ?>">
<meta name="keywords" content="video sharing, <?php echo $obj["title"] ;?>">
<meta name="author" content="<?php echo $obj["uid"] ;?>">
<link rel="stylesheet" href="https://cdn.emalm.com/css/main.css">
<link rel="stylesheet" href="https://cdn.emalm.com/css/video.css">
<title>
<?= $obj["name"]." - Emalm" ?>
<?= $obj["title"]." - Emalm" ?>
</title>
</head>
<body class="push">
<div include="/menu.html"></div>
<?php
include $_SERVER["DOCUMENT_ROOT"].'/'.$displang.'/menu.html'; ?>
include $_SERVER["DOCUMENT_ROOT"].'menu.html'; ?>
<aside class="rside" >
<?php include $_SERVER["DOCUMENT_ROOT"].'/ad.php'; ?>
</aside >
<section class="left">
<iframe class="iframe-container" style="max-height:70vh;height:100vh; width:100%;margin-left:auto;margin-right:auto;left:auto;" src="https://emalm.com/vid/player.html?vid=<?=$id?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe class="iframe-container" style="max-height:70vh;height:100vh; width:100%;margin-left:auto;margin-right:auto;left:auto;" src="https://emalm.com/vid/player.html?vid=<?=$obj["id"]?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<table width="100%">
<tr><td colspan="3">
<h2><?= $title ?></h2></td><tr>
<h2><?= $obj["title"] ?></h2></td><tr>
<tr width="90%"><td>
<b>Views:
<?php
echo $views;
echo $obj["views"];
require $_SERVER["DOCUMENT_ROOT"].'/conn.php';
$sql = "UPDATE videos SET views=views + 1 WHERE id='$browlin[0]' ";
if ($conn->query($sql) === TRUE) {
......@@ -119,7 +133,7 @@ $sql = "UPDATE videos SET views=views + 1 WHERE id='$browlin[0]' ";
</td><td style="text-align:right">Votes:###</td><td style="text-align:right">
<?php
if(($loggedUser==$obj["uid"] && $obj["uid"] != 0 )||$priv=='1'){
echo"<a href=\"https://emalm.com/delete.php?type=vid&id=$id\">delet dis</a>";
echo"<a href=\"https://emalm.com/delete.php?type=vid&id=".$obj["id"]."\">delet dis</a>";
}
......@@ -157,6 +171,7 @@ $conn->close();
<td width="75%">
<!--download and stuff gotta change this later so itll obey the dl property in sql-->
<?php
if($uploaderid=='0'){echo"<h4>Anonymous</h4>";}else{
require $_SERVER["DOCUMENT_ROOT"].'/conn.php';
$sql = "SELECT * FROM users WHERE uid='$uploaderid'";
......@@ -185,7 +200,7 @@ echo '<e><a href="https://emalm.com/dl.php?type=vid&id='.$obj["id"].'&orig=0&ext
<tr>
<td text-align="left" >
<br>
<p draggable="true"> <?= nl2br($desc) ?></p>
<p draggable="true"> <?= nl2br($obj["description"]) ?></p>
</td>
</tr>
</table>
......@@ -195,19 +210,7 @@ echo '<e><a href="https://emalm.com/dl.php?type=vid&id='.$obj["id"].'&orig=0&ext
<hr height="3px" />
<!-- comment gota do this as well-->
<h4>### Comments</h4>
<?php
// define variables and set to empty values
$err=0;
$email = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["eml"])) {
$txterr = "Email is required!";
$err = 1;
}
}
?>
<table>
<tr width="90%">
<td width="5%" class="top">
......@@ -254,7 +257,8 @@ You have to be logged in to comment!
</table>
</section>
<div include="/footer.html"></div>
<script src="https://cdn.emalm.com/js/gdpr.js"></script>
</body>
<?php include $_SERVER["DOCUMENT_ROOT"].'/'.$displang.'/fot.php'; ?>
......@@ -118,7 +118,7 @@ include $_SERVER["DOCUMENT_ROOT"].'menu.html'; ?>
<table width="100%">
<tr><td colspan="3">
<h2><?= $title ?></h2></td><tr>
<h2><?= $obj["title"] ?></h2></td><tr>
<tr width="90%"><td>
<b>Views:
<?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment