mirror of
https://github.com/ClaytonWWilson/FightHub.git
synced 2025-12-13 06:18:46 +00:00
Fixed merge
This commit is contained in:
commit
21addd4591
80
index.php
80
index.php
@ -139,5 +139,85 @@ function writeEntryforIndex() {
|
||||
|
||||
?>
|
||||
<!-- This is where php code for loading preview videos below the titlebar will go -->
|
||||
|
||||
<div class="video-list-container">
|
||||
<!-- Entry 1 -->
|
||||
<div id="video-item">
|
||||
<iframe width="640" height="360" src="https://www.youtube.com/embed/eCI8eAbq-4c" frameborder="0"
|
||||
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
<a href="https://www.youtube.com/watch?v=eCI8eAbq-4c">Video Title Here</a>
|
||||
|
||||
<div id="players-characters">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header">Players</td>
|
||||
<td class="header">Characters</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="data" id="table-border">Player1</td>
|
||||
<td class="data" id="table-border">Character1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="data" id="table-border">Player2</td>
|
||||
<td class="data" id="table-border">Character2</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="game-stage">
|
||||
<p>Game Name</p>
|
||||
<p>Stage Name</p>
|
||||
</div>
|
||||
|
||||
<div id="description">
|
||||
<p>The description goes here.......</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Entry 2 -->
|
||||
|
||||
<div id="video-item">
|
||||
<iframe width="640" height="360" src="https://www.youtube.com/embed/eCI8eAbq-4c" frameborder="0"
|
||||
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
<a href="https://www.youtube.com/watch?v=eCI8eAbq-4c">Video Title Here</a>
|
||||
|
||||
<div id="players-characters">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header">Players</td>
|
||||
<td class="header">Characters</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="data" id="table-border">Player1</td>
|
||||
<td class="data" id="table-border">Character1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="data" id="table-border">Player2</td>
|
||||
<td class="data" id="table-border">Character2</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="game-stage">
|
||||
<p>Game Name</p>
|
||||
<p>Stage Name</p>
|
||||
</div>
|
||||
|
||||
<div id="description">
|
||||
<p>The description goes here.......</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
2
main.css
2
main.css
@ -143,4 +143,4 @@ table .header {
|
||||
color: #FF3D53;
|
||||
font-family: "Calibri";
|
||||
margin-left: 310px;
|
||||
}
|
||||
}
|
||||
103
scripts/main.js
103
scripts/main.js
@ -1,6 +1,103 @@
|
||||
|
||||
// Validates the data inputs on the upload form
|
||||
function validateUpload() {
|
||||
console.log("Validated!");
|
||||
document.getElementById("upload-form").submit();
|
||||
}
|
||||
var url_bar = document.getElementById('url');
|
||||
var video_title = document.getElementById('title');
|
||||
var username = document.getElementById('username');
|
||||
// var description = document.getElementById('description'); // optional
|
||||
var video_date = document.getElementById('video-date');
|
||||
// var length = document.getElementById('length'); // optional
|
||||
var characters = document.getElementById('characters');
|
||||
var players = document.getElementById('players');
|
||||
var game = document.getElementById('game');
|
||||
var stage = document.getElementById('stage');
|
||||
|
||||
// console.log('url_bar: ' + url_bar);
|
||||
// console.log('video_title: ' + video_title);
|
||||
// console.log('username: ' + username);
|
||||
// console.log('description: ' + description);
|
||||
// console.log('video_date: ' + video_date);
|
||||
// console.log('length: ' + length);
|
||||
// console.log('characters: ' + characters);
|
||||
// console.log('players: ' + players);
|
||||
// console.log('game: ' + game);
|
||||
// console.log('stage: ' + stage);
|
||||
|
||||
|
||||
// Checking that the required text boxes are filled in, and highlighting them red
|
||||
// if they are not
|
||||
var form_complete = true;
|
||||
|
||||
// URL
|
||||
if (url_bar.value == "") {
|
||||
form_complete = false;
|
||||
url_bar.style = "border-color:red;"
|
||||
} else {
|
||||
url_bar.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Video Title
|
||||
if (video_title.value == "") {
|
||||
form_complete = false;
|
||||
video_title.style = "border-color:red;"
|
||||
} else {
|
||||
video_title.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Username
|
||||
if (username.value == "") {
|
||||
form_complete = false;
|
||||
username.style = "border-color:red;"
|
||||
} else {
|
||||
username.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Video Date
|
||||
if (video_date.value == "") {
|
||||
form_complete = false;
|
||||
video_date.style = "border-color:red;"
|
||||
} else {
|
||||
video_date.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Characters
|
||||
if (characters.value == "") {
|
||||
form_complete = false;
|
||||
characters.style = "border-color:red;"
|
||||
} else {
|
||||
characters.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Players
|
||||
if (players.value == "") {
|
||||
form_complete = false;
|
||||
players.style = "border-color:red;"
|
||||
} else {
|
||||
players.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Game
|
||||
if (game.value == "") {
|
||||
form_complete = false;
|
||||
game.style = "border-color:red;"
|
||||
} else {
|
||||
game.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// Stage
|
||||
if (stage.value == "") {
|
||||
form_complete = false;
|
||||
stage.style = "border-color:red;"
|
||||
} else {
|
||||
stage.style = "border-color:green;"
|
||||
}
|
||||
|
||||
// If the form is completely filled out, call the submit function for the form
|
||||
// and redirect them to submit.php, otherwise alert them that they've forgotten to
|
||||
// fill in some of the form
|
||||
if (form_complete) {
|
||||
document.getElementById("upload-form").submit();
|
||||
} else {
|
||||
alert('Please fill out the rest of the upload form.');
|
||||
}
|
||||
}
|
||||
|
||||
66
submit.php
Normal file
66
submit.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
$servername = "localhost";
|
||||
$username = "fighthubuser";
|
||||
$password = "cC33dC8W";
|
||||
$database = "fighthubdata";
|
||||
|
||||
$conn = new mysqli($servername, $username, $password, $database);
|
||||
|
||||
if($conn->connect_error) {
|
||||
//echo "it dead<br>i";
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$url = $_GET['url'];
|
||||
$title = $_GET['title'];
|
||||
$username = $_GET['username'];
|
||||
$description = $_GET['description'];
|
||||
$event_date = $_GET['video-date'];
|
||||
$length = $_GET['length'];
|
||||
$characters = $_GET['characters'];
|
||||
$players = $_GET['players'];
|
||||
$game = $_GET['game'];
|
||||
$stage = $_GET['stage'];
|
||||
$date = date('Y\-m\-d');
|
||||
//echo "here<br>";
|
||||
|
||||
$url = mysqli_real_escape_string($conn, $url);
|
||||
//echo "done<br>";
|
||||
$title = mysqli_real_escape_string($conn, $title);
|
||||
$username = mysqli_real_escape_string($conn, $username);
|
||||
$description = mysqli_real_escape_string($conn, $description);
|
||||
$event_date = mysqli_real_escape_string($conn, $event_date);
|
||||
$length = mysqli_real_escape_string($conn, $length);
|
||||
$characters = mysqli_real_escape_string($conn, $characters);
|
||||
$players = mysqli_real_escape_string($conn, $players);
|
||||
$game = mysqli_real_escape_string($conn, $game);
|
||||
$stage = mysqli_real_escape_string($conn, $stage);
|
||||
$date = mysqli_real_escape_string($conn, $date);
|
||||
//echo "there boi<br>";
|
||||
//echo "<script type='text/javascript'>alert('".$stage."');</script>";
|
||||
|
||||
$sql = "INSERT INTO video (video_url, video_name, username, date_upload, date_video, video_length, description, characters, players, game, stage, approved) VALUES ('$url', '$title', '$username', '$date', '$event_date', '$length', '$description', '$characters', '$players', '$game', '$stage', TRUE)";
|
||||
|
||||
//echo "<script type='text/javascript'>alert($sql);</script>";
|
||||
//echo $sql;
|
||||
|
||||
if($conn->query($sql) === TRUE){
|
||||
echo "New record created successfully";
|
||||
}
|
||||
else {
|
||||
echo "Error";
|
||||
echo $conn->error;
|
||||
}
|
||||
$conn->close()
|
||||
|
||||
//echo "<script type='text/javascript'>window.location.href = 'index.php';</script>"
|
||||
|
||||
//header("Location: http://ec2-18-217-5-198.us-east-2.compute.amazonaws.com/index.php");
|
||||
|
||||
//exit;
|
||||
?>
|
||||
|
||||
<script>
|
||||
location.replace("http://ec2-18-217-5-198.us-east-2.compute.amazonaws.com/index.php");
|
||||
</script>
|
||||
|
||||
125
upload.php
125
upload.php
@ -1,63 +1,62 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>FightHub - Upload</title>
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<script src="scripts/main.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Titlebar -->
|
||||
<form class="search" action="search.php">
|
||||
<h1 class="title-text">FightHub</h1>
|
||||
<input type="text" name="query" class="search" placeholder="Search..">
|
||||
<input type="submit" name="submit" class="submit" value="Search">
|
||||
<a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a>
|
||||
</form>
|
||||
|
||||
<!-- submit.php will read the variables from the url and add it to the database -->
|
||||
<form class="upload-form" id="upload-form" action="submit.php">
|
||||
|
||||
<h3>Youtube URL *</h3>
|
||||
<input type="text" name="url" id="url">
|
||||
|
||||
<h3>Name *</h3>
|
||||
<input type="text" name="name" id="name">
|
||||
|
||||
<h3>Username *</h3>
|
||||
<input type="text" name="username">
|
||||
|
||||
<h3>Description</h3>
|
||||
<textarea name="description" cols="30" rows="10"></textarea>
|
||||
|
||||
<h3>Event Date</h3>
|
||||
<input type="date" name="video-date">
|
||||
|
||||
<h3>Video Length</h3>
|
||||
<input type="text" name="length">
|
||||
|
||||
<h3>Characters (Seperated by commas) *</h3>
|
||||
<input type="text" name="characters">
|
||||
|
||||
<h3>Players (Seperated by commas) *</h3>
|
||||
<input type="text" name="players">
|
||||
|
||||
<h3>Select Game *</h3>
|
||||
<select name="game">
|
||||
<option disabled selected value>-- Game --</option>
|
||||
<option value="Street Fighter V">Street Fighter V</option>
|
||||
<option value="Mortal Kombat 11">Mortal Kombat 11</option>
|
||||
<option value="Super Smash Bros Melee">Super Smash Bros Melee</option>
|
||||
<option value="Super Smash Bros Ultimate">Super Smash Ultimate</option>
|
||||
<option value="Killer Instinct">Killer Instinct</option>
|
||||
<option value="Injustice">Injustice</option>
|
||||
</select>
|
||||
|
||||
<h3>Stage Name *</h3>
|
||||
<input type="text" name="stage">
|
||||
|
||||
|
||||
<input type="button" name="submit_button" value="Submit" onclick="validateUpload()">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>FightHub - Upload</title>
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<script src="scripts/main.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Titlebar -->
|
||||
<form class="search" action="search.php">
|
||||
<h1 class="title-text">FightHub</h1>
|
||||
<input type="text" name="query" class="search" placeholder="Search..">
|
||||
<input type="submit" name="submit" class="submit" value="Search">
|
||||
<a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a>
|
||||
</form>
|
||||
|
||||
<!-- submit.php will read the variables from the url and add it to the database -->
|
||||
<form class="upload-form" id="upload-form" action="submit.php">
|
||||
|
||||
<h3>Youtube URL *</h3>
|
||||
<input type="text" name="url" id="url">
|
||||
|
||||
<h3>Video Title *</h3>
|
||||
<input type="text" name="title" id="title">
|
||||
|
||||
<h3>Username *</h3>
|
||||
<input type="text" name="username" id="username">
|
||||
|
||||
<h3>Description</h3>
|
||||
<textarea name="description" cols="30" rows="10" id="description"></textarea>
|
||||
|
||||
<h3>Event Date *</h3>
|
||||
<input type="date" name="video-date" id="video-date">
|
||||
|
||||
<h3>Video Length</h3>
|
||||
<input type="text" name="length" id="length">
|
||||
|
||||
<h3>Characters (Seperated by commas) *</h3>
|
||||
<input type="text" name="characters" id="characters">
|
||||
|
||||
<h3>Players (Seperated by commas) *</h3>
|
||||
<input type="text" name="players" id="players">
|
||||
|
||||
<h3>Select Game *</h3>
|
||||
<select name="game" id="game">
|
||||
<option disabled selected value>-- Game --</option>
|
||||
<option value="Street Fighter V">Street Fighter V</option>
|
||||
<option value="Mortal Kombat 11">Mortal Kombat 11</option>
|
||||
<option value="Super Smash Bros Melee">Super Smash Bros Melee</option>
|
||||
<option value="Super Smash Bros Ultimate">Super Smash Ultimate</option>
|
||||
<option value="Killer Instinct">Killer Instinct</option>
|
||||
<option value="Injustice">Injustice</option>
|
||||
</select>
|
||||
|
||||
<h3>Stage Name *</h3>
|
||||
<input type="text" name="stage" id="stage">
|
||||
|
||||
<input type="button" name="submit_button" value="Submit" onclick="validateUpload()">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user