Skip to content

Commit

Permalink
First Upload
Browse files Browse the repository at this point in the history
All the files
  • Loading branch information
ExusV committed Oct 23, 2016
0 parents commit 1bb4afe
Show file tree
Hide file tree
Showing 36 changed files with 1,664 additions and 0 deletions.
84 changes: 84 additions & 0 deletions config/configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
*****************************************************************************************
Version 2.2b
____ _______ ____ _______ ____ _______
| /\ /\ | | | | | | | | | |\ | |
| / \ / \ |____| | | |____| | |____| | \ | |
| / \/ \ | | | | \ | | | | \ | |
| / \ | |_______| | \ | | | | \| | (Wow it took a while making this "Important" sign)
|
|
|
\ /
.
THIS SCRIPT IS STILL IN BETA
I've spent so much time working on this, please if you notice anything DO NOT hesitate
to report it. If you want more features, just request them, this script is going to be
fully supported by me. (as of 24th Oct 16 - 00:48)
Do not hesitate to edit this file, I made it to be edited!
I'd love if you used this/parts of this in your work, but please give me the appropriate
credit, as it'd break my heart if you didn't.
I could've gone to sleep but I've been determained on getting this finished!
Thank you for downloading this, enjoy! :)
My shoulder is killing me, so yeah, I am not going to write any more now...
*****************************************************************************************
*/

/* The name you want to call your video streaming site */
$website_name = "MyStream";

/* Display the page name in the header bar with the name
e.g.
0 = YourSiteName
1 = YourSiteName | ThePageName
*/

$dispPageName = 1;

/* MySQL Information */
$serverip = "localhost";
$username = "root";
$password = "root";
$dbname = "mystream";

$devmode = 1;

/* The folder that this is stored in, if its in the main directory where you land when you goto your domain, then just set this to your domain name! */
$website_root_user = "localhost:1111/MyStream"; // Dont leave / at the end

/* The directory for where images are stored, just leave this how it is, unless you want to change it (there is no reason to to be honest), the default directory where images are stored is public/images/ if you want to store it in a folder before public you need to write ../imagepath
Also dont add a / to the end */
$image_dir = "images";

/* This is just to avoid spam bots, as registration should be private as its for people awaiting a rank */
/* Give this to anyone who you want to register - its to access the register page */
$registration_password = "12345";

/* User timeout in minutes */
$user_timeout = 30;

/*
This is editable, but I wouldn't recommend it.
Defining of the resource cost of LOW, MID or HIGH for use underneath
- The higher, the more resources it uses
- The more resources it uses, the longer the user will have to wait for it to load:
*/
define(LOW, 10);
define(MID, 15);
define(HIGH, 20);

/*
You can edit this
Resource Load for Password Hashing | LOW = Not as secure but fast | MID = Adds a bit of extra time | HIGH = Adds a lot of extra time
the time it takes is variable on the server you have - powerful server = less time - slow server = more time.
*/
$hash_cost = MID;
?>
Binary file added core/.DS_Store
Binary file not shown.
56 changes: 56 additions & 0 deletions core/init.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/*
* This file shouldn't be used for anything but declaration and definitions
* This file should NOT be modified
* You HAVE been warned!
*/

/* Document Root for ALL files */
/*
define(ROOT, $_SERVER['DOCUMENT_ROOT'] . "/Stream");
*/

// This is for the **DEVELOPER COPY ONLY** //

define(ROOT, $_SERVER["DOCUMENT_ROOT"] . "/Stream");

////////////////////////////////////////////

require(ROOT . "/config/configuration.php");

/* Website Name */
define(WEBSITE_NAME, $website_name);

/* Display Page Name With Website Name */
define(DISPpage, $dispPageName);

/* MySQL Information */
define(SQL_SERVER_IP, $serverip);
define(SQL_USERNAME, $username);
define(SQL_PASSWORD, $password);
define(SQL_DB_NAME, $dbname);

/* Developer Mode - Displays all errors -> Boolean (1/0) */
define(DEVELOPMENT, $devmode);

/* Website Root - Where the default files start from */
$website_root = $website_root_user . "/public";
define(WEBSITE_DOMAIN, $website_root);

/* Default images folder */
define(IMAGE_DIR, $image_dir);

/* Registration Password */
define(REGISTER_PASS, $registration_password);

/* User auto login expiration - Where it stays logged in for x amount of time */
$user_timeout = $user_timeout * 60;
define(USER_LOGOUT_TIME, $user_timeout);

/* Hash Cost */
define(PASS_HASH_COST, $hash_cost);

require(ROOT . "/public/libraries/modules/connect/pdo_connect.php");


?>
Binary file added public/.DS_Store
Binary file not shown.
Binary file added public/admin/.DS_Store
Binary file not shown.
69 changes: 69 additions & 0 deletions public/admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php session_start(); require("../../core/init.php");
if (isset($_SESSION['logged_in']) AND $_SESSION['logged_in'] == 1) {
$fetchRank = $conn->prepare("SELECT * FROM `user` WHERE `email`=:email");
$fetchRank->bindParam(":email", $_COOKIE['username']); // Yes that cookie ['username'] does contain the email
$fetchRank->execute();
while ($fr = $fetchRank->fetch(PDO::FETCH_ASSOC)) {
if (password_verify($_COOKIE['password'], $fr['password'])) {
echo "SUCCESS!";
}

?>
<html>
<title><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | Adminisration"; }; ?></title>
<link rel="stylesheet" type="text/css" href="../../theme/style.css">
<script src="https://code..com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<body>

<div class="header">
<div class="inner-header">
<h1><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | Home"; } ?></h1>
</div>
</div>
<div class="menu">
<a href="../index.php">Home</a>
<a href="../browse.php">Browse</a>
<a href="../search.php">Search</a>
<a href="../about.php">About</a>
</div>
<br><br><br><br><br><br>

<a href="new_category.php">
<div class="header">
<div class="inner-header">
<h1>Add New Category</h1>
</div>
</div>
</a>


<a href="new_series.php">
<div class="header">
<div class="inner-header">
<h1>Add New Series</h1>
</div>
</div>
</a>

<br><br>

<a href="new_show.php">
<div class="header">
<div class="inner-header">
<h1>Add New Show</h1>
</div>
</div>
</a>

<div class="header">
<div class="inner-header">
<h1>View Users</h1>
</div>
</div>



</body>
</html>

<?php } } ?>
39 changes: 39 additions & 0 deletions public/admin/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php require("../../core/init.php"); ?>

<html>
<title><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | Login"; }; ?></title>
<link rel="stylesheet" type="text/css" href="../../theme/style.css">
<script src="https://code..com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<body>

<div class="header">
<div class="inner-header">
<h1><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | Login"; } ?></h1>
</div>
</div>
<div class="menu">
<a href="../index.php">Home</a>
<a href="../browse.php">Browse</a>
<a href="../search.php">Search</a>
<a href="../about.php">About</a>
</div>
<br><br><br><br><br><br>

<div class="centered">

<h1>Login</h1>
<form action="../../libraries/modules/auth/lauth.php" method="post">
<div class="admin_input">
<input type="big_input" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<input type="submit" value="Submit">
</div>
</form>

</div>




</body>
</html>
49 changes: 49 additions & 0 deletions public/admin/new_category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php session_start(); require("../../core/init.php");
if (isset($_SESSION['logged_in']) AND $_SESSION['logged_in'] == 1) {
$fetchRank = $conn->prepare("SELECT * FROM `user` WHERE `email`=:email");
$fetchRank->bindParam(":email", $_COOKIE['username']); // Yes that cookie ['username'] does contain the email
$fetchRank->execute();
while ($fr = $fetchRank->fetch(PDO::FETCH_ASSOC)) {
if (password_verify($_COOKIE['password'], $fr['password'])) {
echo "SUCCESS!";
}

?>
<html>
<title><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | New Category"; }; ?></title>
<link rel="stylesheet" type="text/css" href="../../theme/style.css">
<script src="https://code..com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<body>

<div class="header">
<div class="inner-header">
<h1><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | New Category"; } ?></h1>
</div>
</div>
<div class="menu">
<a href="../index.php">Home</a>
<a href="../browse.php">Browse</a>
<a href="../search.php">Search</a>
<a href="../about.php">About</a>
</div>
<br><br><br><br><br><br>

<div class="centered">
<h1>Add a New Category</h1>
<form action="submit.php" method="post" enctype="multipart/form-data">
<div class="admin_input">
<input type="big_input" name="name" placeholder="Category Name">
<input type="big_input" name="type" placeholder="If your a smartarse and enable this and edit it then whatever your doing wont work!" value="category" style="display:none;">
<input type="file" name="img" id="img">
<input type="submit" value="Submit">
</div>
</form>

</div>




</body>
</html>
<?php } } ?>
64 changes: 64 additions & 0 deletions public/admin/new_series.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php session_start(); require("../../core/init.php");
if (isset($_SESSION['logged_in']) AND $_SESSION['logged_in'] == 1) {
$fetchRank = $conn->prepare("SELECT * FROM `user` WHERE `email`=:email");
$fetchRank->bindParam(":email", $_COOKIE['username']); // Yes that cookie ['username'] does contain the email
$fetchRank->execute();
while ($fr = $fetchRank->fetch(PDO::FETCH_ASSOC)) {
if (password_verify($_COOKIE['password'], $fr['password'])) {
echo "SUCCESS!";
}

?>
<html>
<title><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | New Series"; }; ?></title>
<link rel="stylesheet" type="text/css" href="../../theme/style.css">
<script src="https://code..com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<body>

<div class="header">
<div class="inner-header">
<h1><?php echo WEBSITE_NAME; if (DISPpage == 1) { echo " | New Series"; } ?></h1>
</div>
</div>
<div class="menu">
<a href="../index.php">Home</a>
<a href="../browse.php">Browse</a>
<a href="../search.php">Search</a>
<a href="../about.php">About</a>
</div>
<br><br><br><br><br><br>

<div class="centered">
<h1>Add a New Series</h1>
<form action="submit.php" method="post" enctype="multipart/form-data">
<div class="admin_input">
<input type="big_input" name="name" placeholder="Series Name">
<input type="big_input" name="desc" placeholder="Series Description">
<select name="category">

<?php
$list_categories = $conn->prepare("SELECT * FROM `category`");
$list_categories->execute();
while ($lc = $list_categories->fetch(PDO::FETCH_ASSOC)) {
?>

<option value="<?php echo $lc['name']; ?>"><?php echo $lc['name']; ?></option>

<?php } ?>

</select>
<input type="big_input" name="type" placeholder="If your a smartarse and enable this and edit it then whatever your doing wont work!" value="series" style="display:none;">
<input type="file" name="img" id="img">
<input type="submit" value="Submit">
</div>
</form>

</div>




</body>
</html>

<?php } } ?>
Loading

0 comments on commit 1bb4afe

Please sign in to comment.