This commit is contained in:
gosselingdevries 2024-12-04 12:58:51 +00:00 committed by GitHub
commit 637788b8fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 522 additions and 228 deletions

View File

@ -1,2 +1,9 @@
# FightHub # FightHub
A website that allows you to share videos of matches in fighting games. You can also search for videos added by other users. A website that allows you to share videos of matches in fighting games. You can also search for videos added by other users.
### Images
<p>
<img alt="0.png" src="./Screenshots/0.png" width="1000">
<img alt="1.png" src="./Screenshots/1.png" width="1000">
<img alt="2.png" src="./Screenshots/2.png" width="1000">
</p>

BIN
Screenshots/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

BIN
Screenshots/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
Screenshots/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

0
hello
View File

View File

@ -1,4 +1,4 @@
<html> <html lang="en">
<head> <head>
<title>FightHub - Home</title> <title>FightHub - Home</title>
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
@ -6,7 +6,7 @@
<body> <body>
<!-- Titlebar --> <!-- Titlebar -->
<form class="search" action="search.php"> <form class="search" action="search.php">
<h1 class="title-text">FightHub</h1> <a href="/"><h1 class="title-text">FightHub</h1></a>
<input type="text" name="query" class="search" placeholder="Search.."> <input type="text" name="query" class="search" placeholder="Search..">
<input type="submit" name="submit" class="submit" value="Search"> <input type="submit" name="submit" class="submit" value="Search">
<a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a> <a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a>
@ -138,6 +138,6 @@ function writeEntryforIndex() {
writeEntryforIndex(); writeEntryforIndex();
?> ?>
<!-- This is where php code for loading preview videos below the titlebar will go -->
</body> </body>
</html> </html>

397
main.css
View File

@ -1,146 +1,251 @@
body { body {
background-color: #1E1E1E; background-color: #1E1E1E;
} }
/* Styles for titlebar */ /* Styles for titlebar */
form.search { form.search {
/* border: white solid 1px; */ /* border: white solid 1px; */
height: 150px; height: 150px;
margin-top: -10px !important; margin-top: -10px !important;
width: 99% !important; width: 99% !important;
border-bottom: #727272 solid 2px; border-bottom: #727272 solid 2px;
} }
.title-text { .title-text {
float: left; float: left;
margin-top: 26px; margin-top: 26px;
padding-right: 20px; padding-right: 20px;
color: #FF3D53; color: #FF3D53;
font-family: "Calibri"; font-family: "Calibri";
font-size: 50pt; font-size: 50pt;
} }
.search { .search {
width: 50%; width: 50%;
padding: 10px; padding: 10px;
font-size: 20px; font-size: 20px;
margin-top: 45px; margin-top: 45px;
} }
.submit { .submit {
width: 150px; width: 150px;
padding: 10px; padding: 10px;
font-size: 20px; font-size: 20px;
} }
img.upload { img.upload {
width: 150px; width: 150px;
/* margin-bottom: -17px; */ /* margin-bottom: -17px; */
margin-top: 45px; margin-top: 45px;
float: right; float: right;
} }
/* Styles for upload.php */ /* Styles for upload.php */
form.upload-form { form.upload-form {
/* border: white solid 1px; */ /* border: white solid 1px; */
border-left: #727272 solid 2px; border-left: #727272 solid 2px;
border-right: #727272 solid 2px; border-right: #727272 solid 2px;
margin: 0 25% 0 25%; margin: 0 25% 0 25%;
} margin-top: 60px;
margin-bottom: 60px;
.upload-form input, .upload-form textarea, .upload-form select { }
display: block;
margin-left: 20px; .upload-form input, .upload-form textarea, .upload-form select {
/* margin-bottom: 30px; */ display: block;
/* border: white solid 1px; */ margin-left: 20px;
} /* margin-bottom: 30px; */
/* border: white solid 1px; */
.upload-form h3 { }
color: #FF3D53;
/* border: white solid 1px; */ .upload-form h3 {
margin-bottom: 0px; color: #FF3D53;
margin-left: 20px; /* border: white solid 1px; */
} margin-bottom: 0px;
margin-left: 2%;
/* Styles for Video element displays */ }
div.video-list-container { h3.url {
/* border: white solid 1px; */ /* padding-top: 40px; */
margin-left: 15%; /* border: white solid 1px; */
margin-right: 15%; }
}
.url {
#video-item { /* margin: auto !important; */
/* border: white solid 1px; */ width: 93%;
width: 100%; }
height: 178.75px;
padding-top: 10px; h3.title {
border-bottom: #727272 solid 2px; padding-top: 40px;
} }
iframe { .title {
width: 300px; /* margin: auto !important; */
height: 168.75px; width: 93%;
/* margin-top: 5px; */ }
margin-bottom: 10px;
float: left; .user-date {
} width: 93%;
margin-left: 3%;
.video-list-container a { /* margin: auto; */
color: #FF3D53; }
/* border: white solid 1px; */
padding-left: 10px; .username {
/* margin-top: 1000px !important; */ /* margin-left: 20px; */
font-family: "Calibri"; padding-top: 20px;
/* position: relative; */ margin-left: -20px;
} }
#players-characters { .video-date {
/* border: white solid 1px; */ float: right;
/* display: inline; */ margin-top: -62px;
} }
#players-characters table { .description {
color: #FF3D53; width: 93%;
font-size: 10pt; /* margin: auto !important; */
font-family: "Calibri"; resize: none;
padding-left: 10px; }
width: 20%;
margin-top: 10px; h3.description {
/* border-right: #727272 solid 2px; */ padding-top: 40px;
} }
table .data { .characters {
font-weight: lighter; width: 93%;
} /* margin: auto !important; */
}
table .header {
font-weight: bolder !important; h3.characters {
padding-bottom: 10px; padding-top: 40px;
} }
#table-border { .players {
border-bottom: #727272 solid 1px; width: 93%;
} /* margin: auto !important; */
}
#game-stage {
color: #FF3D53; h3.players {
float: right; padding-top: 40px;
font-family: "Calibri"; }
/* border: white solid 1px; */
/* border-right: #727272 solid 2px; */ .game-info {
margin-top: -83px; width: 93%;
width: 20%; margin-left: 3%;
text-align: left; /* margin: auto; */
} }
#description p { .game-name {
/* border: white solid 1px; */ padding-top: 20px;
color: #FF3D53; margin-left: -20px;
font-family: "Calibri"; }
margin-left: 310px;
} .stage-name {
float: right;
margin-top: -61px;
}
.length-button {
margin: 3%;
width: 93%;
/* border: white solid 1px; */
}
.length {
padding-top: 10px;
margin-left: -20px;
}
.button {
float: right;
margin-top: -21px;
}
h3 {
padding-left: 15px;
}
/* Styles for Video element displays */
div.video-list-container {
/* border: white solid 1px; */
margin-left: 15%;
margin-right: 15%;
}
#video-item {
/* border: white solid 1px; */
width: 100%;
height: 178.75px;
padding-top: 10px;
border-bottom: #727272 solid 2px;
}
iframe {
width: 300px;
height: 168.75px;
/* margin-top: 5px; */
margin-bottom: 10px;
float: left;
}
.video-list-container a {
color: #FF3D53;
/* border: white solid 1px; */
padding-left: 10px;
/* margin-top: 1000px !important; */
font-family: "Calibri";
/* position: relative; */
}
#players-characters {
/* border: white solid 1px; */
/* display: inline; */
}
#players-characters table {
color: #FF3D53;
font-size: 10pt;
font-family: "Calibri";
padding-left: 10px;
width: 20%;
margin-top: 10px;
/* border-right: #727272 solid 2px; */
}
table .data {
font-weight: lighter;
}
table .header {
font-weight: bolder !important;
padding-bottom: 10px;
}
#table-border {
border-bottom: #727272 solid 1px;
}
#game-stage {
color: #FF3D53;
float: right;
font-family: "Calibri";
/* border: white solid 1px; */
/* border-right: #727272 solid 2px; */
margin-top: -83px;
width: 20%;
text-align: left;
}
#description p {
/* border: white solid 1px; */
color: #FF3D53;
font-family: "Calibri";
margin-left: 310px;
}

View File

@ -1,6 +1,103 @@
// Validates the data inputs on the upload form // Validates the data inputs on the upload form
function validateUpload() { function validateUpload() {
console.log("Validated!"); var url_bar = document.getElementById('url');
document.getElementById("upload-form").submit(); 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.');
}
}

View File

@ -1,17 +1,16 @@
<html> <html lang="en">
<head> <head>
<title>FightHub - Search</title>
<title>FightHub - Home</title>
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
</head> </head>
<body> <body>
<!-- Titlebar --> <!-- Titlebar -->
<form class="search" action="search.php"> <form class="search" action="search.php">
<h1 class="title-text">FightHub</h1> <a href="/"><h1 class="title-text">FightHub</h1></a>
<input type="text" name="query" class="search" placeholder="Search.."> <input type="text" name="query" class="search" placeholder="Search..">
<input type="submit" name="submit" class="submit" value="Search"> <input type="submit" name="submit" class="submit" value="Search">
<a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a> <a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a>
</form> </form>
<!-- code for connecting to mysql --> <!-- code for connecting to mysql -->
@ -153,5 +152,5 @@ function writeEntryforIndex() {
?> ?>
</body> </body>
</html> </html>

66
submit.php Normal file
View 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-13-58-8-152.us-east-2.compute.amazonaws.com/index.php");
</script>

View File

@ -1 +0,0 @@
this is a test

View File

@ -1,63 +1,84 @@
<html> <html lang="en">
<head> <head>
<title>FightHub - Upload</title> <title>FightHub - Upload</title>
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
<script src="scripts/main.js"></script> <script src="scripts/main.js"></script>
</head> </head>
<body> <body>
<!-- Titlebar --> <!-- Titlebar -->
<form class="search" action="search.php"> <form class="search" action="search.php">
<h1 class="title-text">FightHub</h1> <a href="/"><h1 class="title-text">FightHub</h1></a>
<input type="text" name="query" class="search" placeholder="Search.."> <input type="text" name="query" class="search" placeholder="Search..">
<input type="submit" name="submit" class="submit" value="Search"> <input type="submit" name="submit" class="submit" value="Search">
<a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a> <a href="upload.php"><img src="images/upload.png" class="upload" alt="upload"></a>
</form> </form>
<!-- submit.php will read the variables from the url and add it to the database --> <!-- 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"> <form class="upload-form" id="upload-form" action="submit.php">
<h3>Youtube URL *</h3> <h3 class="url">Youtube URL *</h3>
<input type="text" name="url" id="url"> <input type="text" name="url" id="url" class="url">
<h3>Name *</h3> <h3 class="title">Video Title *</h3>
<input type="text" name="name" id="name"> <input type="text" name="title" id="title" class="title">
<h3>Username *</h3> <div class="user-date">
<input type="text" name="username"> <div class="username">
<h3>Username *</h3>
<h3>Description</h3> <input type="text" name="username" id="username">
<textarea name="description" cols="30" rows="10"></textarea> </div>
<h3>Event Date</h3>
<input type="date" name="video-date"> <div class="video-date">
<h3>Event Date *</h3>
<h3>Video Length</h3> <input type="date" name="video-date" id="video-date">
<input type="text" name="length"> </div>
</div>
<h3>Characters (Seperated by commas) *</h3>
<input type="text" name="characters"> <h3 class="description">Description</h3>
<textarea name="description" cols="30" rows="10" id="description" class="description"></textarea>
<h3>Players (Seperated by commas) *</h3>
<input type="text" name="players"> <h3 class="characters">Characters (Seperated by commas) *</h3>
<input type="text" name="characters" id="characters" class="characters">
<h3>Select Game *</h3>
<select name="game"> <h3 class="players">Players (Seperated by commas) *</h3>
<option disabled selected value>-- Game --</option> <input type="text" name="players" id="players" class="players">
<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> <div class="game-info">
<option value="Injustice">Injustice</option> <div class="game-name">
</select> <h3>Select Game *</h3>
<select name="game" id="game">
<h3>Stage Name *</h3> <option disabled selected value>-- Game --</option>
<input type="text" name="stage"> <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>
<input type="button" name="submit_button" value="Submit" onclick="validateUpload()"> <option value="Super Smash Bros Ultimate">Super Smash Ultimate</option>
</form> <option value="Killer Instinct">Killer Instinct</option>
<option value="Injustice">Injustice</option>
</body> </select>
</html> </div>
<div class="stage-name">
<h3 class="stage">Stage Name *</h3>
<input type="text" name="stage" id="stage" class="stage">
</div>
</div>
<div class="length-button">
<div class="length">
<h3>Video Length</h3>
<input type="text" name="length" id="length">
</div>
<div class="button">
<input type="button" name="submit_button" value="Submit" onclick="validateUpload()">
</div>
</div>
</form>
</body>
</html>