Remove CantTouchThis

This commit is contained in:
Sky Johnson 2024-06-29 08:07:30 -05:00
parent ed98c2c3c2
commit e3023f8b39
9 changed files with 176 additions and 312 deletions

View File

@ -1,22 +1,7 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class Article {
private $ID;
private $Title;
private $Cover;
@ -25,30 +10,30 @@ CANTTOUCH;
private $PostDate;
private $Comments;
private $Description;
public function __construct($id) {
$this->ID = $id;
$this->getArticle($id);
}
private function getArticle($id) {
$db = new DatabaseModule();
$getArticle = $db->Handle->prepare('SELECT * FROM ms_articles WHERE id = :id');
$getArticle->bindValue(':id', $id, PDO::PARAM_INT);
$getArticle->execute();
$ArticleInfo = $getArticle->fetch();
$getArticle->closeCursor();
$this->Title = $ArticleInfo['articleName'];
$this->Cover = $ArticleInfo['articleCover'];
$this->Author = $ArticleInfo['articleAuthor'];
@ -56,27 +41,27 @@ CANTTOUCH;
$this->PostDate = betterDate($ArticleInfo['articleDate']);
$this->Comments = $ArticleInfo['articleComments'];
$this->Description = $ArticleInfo['articleDescription'];
}
public function __get($what) {
if(property_exists($this, $what)) {
return $this->{$what};
} else {
return null;
}
}
public function update($what) {
}
}
?>
?>

View File

@ -1,74 +1,59 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class ArticleComment {
private $ID;
private $Author;
private $Content;
private $PostDate;
private $ArticleID;
public function __construct($id) {
$this->ID = $id;
$this->getArticleComment($id);
}
private function getArticleComment($id) {
$db = new DatabaseModule();
$getArticle = $db->Handle->prepare('SELECT * FROM ms_articlecomments WHERE id = :id');
$getArticle->bindValue(':id', $id, PDO::PARAM_INT);
$getArticle->execute();
$ArticleInfo = $getArticle->fetch();
$getArticle->closeCursor();
$this->Author = $ArticleInfo['commentAuthor'];
$this->Content = $ArticleInfo['commentContent'];
$this->PostDate = betterDate($ArticleInfo['commentDate']);
$this->ArticleID = $ArticleInfo['articleID'];
}
public function __get($what) {
if(property_exists($this, $what)) {
return $this->{$what};
} else {
return null;
}
}
public function update($what) {
}
}
?>
?>

View File

@ -1,75 +1,60 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class EpisodeComment {
private $ID;
private $Author;
private $Content;
private $PostDate;
private $ShowID;
public function __construct($id) {
$this->ID = $id;
$this->getComment($id);
}
private function getComment($id) {
$db = new DatabaseModule();
$get = $db->Handle->prepare('SELECT * FROM episodecomments WHERE id = :id');
$get->bindValue(':id', $id, PDO::PARAM_INT);
$get->execute();
$data = $get->fetch();
$get->closeCursor();
$this->Author = $data['commentAuthor'];
$this->Content = $data['commentContent'];
$this->PostDate = betterDate($data['commentDate']);
$this->ArticleID = $data['showID'];
}
public function __get($what) {
if(property_exists($this, $what)) {
return $this->{$what};
} else {
return null;
}
}
public function update($what) {
}
}
?>
?>

View File

@ -1,19 +1,4 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class Project {
/* -- User info variables; used for the functions here -- */
@ -23,28 +8,28 @@ CANTTOUCH;
private $Title;
private $Cover;
private $LastUpdate;
/* -- User class constructor -- */
public function __construct($id) {
$this->ID = $id;
$this->getProject($id);
}
/* -- Used in the constructor to access the DB and get all the user's info and populate the variables -- */
private function getProject($id) {
// Open database connection
$db = new DatabaseModule();
// Get user information from the DB
$getProject = $db->Handle->prepare('SELECT * FROM ms_projects WHERE id = :id');
$getProject->bindValue(':id', $id, PDO::PARAM_INT); // bind $id to the placeholder
$getProject->execute();
$ProjectInfo = $getProject->fetch(); // get the results from the query
$getProject->closeCursor(); // close the SELECT query from continuing its search
// Populate the variables
$this->ID = $ProjectInfo["id"];
$this->Type = $ProjectInfo["type"];
@ -53,7 +38,7 @@ CANTTOUCH;
$this->Cover = $ProjectInfo["cover"];
$this->lastUpdate = betterDate($ProjectInfo["lastUpdate"]);
}
/* -- Returns whatever info needed at the moment -- */
public function __get($what) {
if(property_exists($this, $what)) {
@ -62,10 +47,10 @@ CANTTOUCH;
return null;
}
}
/* -- Updates a value in the DB belonging to the user -- */
public function update($what) {
}
}
?>
?>

View File

@ -1,123 +1,108 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class Show {
private $ID;
private $Title;
private $ShowID;
private $Thumbnail;
private $Description;
private $EpisodeArray;
private $EpisodeComments;
private $db;
private $ThumbPath = "http://localhost:8888/Resources/Images/Thumbs/Show/";
public function __construct($id) {
$DBM = new DatabaseModule();
$this->db = $DBM->Handle;
$this->ShowID = $id;
$this->CommentBox = GetTemplate('comments/commentbox');
$this->CommentForm = GetTemplate('comments/commentform');
$this->getData();
$this->GetEpisodeList();
}
private function getData() {
$get = $this->db->prepare('SELECT * FROM ms_projects WHERE showid = :id');
$get->bindValue(':id', $this->ShowID, PDO::PARAM_INT); // bind $id to the placeholder
$get->execute();
$data = $get->fetch();
$get->closeCursor();
$this->ID = $data["id"];
$this->Title = $data["title"];
$this->Thumbnail = $this->ThumbPath . $data["thumbnail"];
$this->Description = $data["desc"];
}
public function __get($what) {
if(property_exists($this, $what)) {
return $this->{$what};
} else {
return null;
}
}
public function GetEpisodeList() {
$get = $this->db->prepare("SELECT * FROM episodes WHERE `show` = :s ORDER BY id DESC");
$get->bindValue(':s', $this->ShowID, PDO::PARAM_INT);
$get->execute();
$episodes = $get->fetchAll();
$get->closeCursor();
$this->EpisodeArray = $episodes;
}
public function GetEpisodeComments($id) {
$get = $this->db->prepare('SELECT * FROM episodecomments WHERE showID = :id');
$get->bindValue(':id', $id, PDO::PARAM_INT);
$get->execute();
$data = $get->fetchAll();
$list = array();
foreach($data as $ID) {
$comment = new EpisodeComment($ID['id']);
$poster = new User($comment->Author);
$list[] = ParseTemplate($this->CommentBox, array('a' => $poster->Avatar, 'u' => $poster->Username, 'c' => BBCode(magicClean($comment->Content)), 'd' => $comment->PostDate));
}
return $list;
}
}
?>
?>

View File

@ -1,19 +1,4 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
class User {
/* -- User info variables; used for the functions here -- */
@ -33,10 +18,10 @@ CANTTOUCH;
private $Reputation;
private $isVerified;
private $MemberLevel;
/* User Database Handle */
private $DB = null;
/* ------------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------- */
@ -45,10 +30,10 @@ CANTTOUCH;
$DM = new DatabaseModule();
$DM->createUserHandle();
$this->DB = $DM->userHandle;
$this->UserID = $id;
$this->getUser($id);
}
@ -57,19 +42,19 @@ CANTTOUCH;
private function getUser($id) {
$db = $this->DB;
// Get username and ID from the database
$getUser = $db->prepare('SELECT * FROM ms_users WHERE id = :id');
$getUser->bindValue(':id', $id, PDO::PARAM_INT); // bind $id to the placeholder
$getUser->execute();
$User = $getUser->fetch(); // get the results from the query
$getUser->closeCursor(); // close the SELECT query from continuing its search
// Populate the variable(s)
$this->Username = $User['username'];
$this->Title = $User['title'];
$this->Email = $User['email'];
$this->Gender = $User['gender'];
@ -83,28 +68,28 @@ CANTTOUCH;
$this->Reputation = $User['reputation'];
$this->MemberLevel = $User['mlevel'];
}
/* ------------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------- */
public function __get($what) {
if(property_exists($this, $what)) {
return $this->{$what};
} else {
return null;
}
}
public function update($what) {
}
}
?>
?>

View File

@ -1,19 +1,4 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
<?php
/*
--- The Community Module

View File

@ -1,19 +1,4 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #888; padding-top: 18px;">
<center><img style="max-height: 600px;" src="../../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
/*
--- The Database Module

View File

@ -1,55 +1,39 @@
<?php
if(!defined('SAFE')) {
$page = <<<CANTTOUCH
<html>
<head>
</head>
<body style="padding:0px; margin:0px; background-color: #425b5c;">
<center><img src="../../Images/General/CantTouchThis.png" /></center>
</body>
</html>
CANTTOUCH;
die($page);
}
<?php
if(!empty($_COOKIE['MadSplashUser'])) {
$user = explode(" ", $_COOKIE['MadSplashUser']);
echo <<<SUPERNAV
<section id="SuperNav">
<div class="left" style="padding-left: 12px;">
Heyas, <a href="#">{$user[1]}</a>! You can go to your <a href="#">User CP</a> or <a href="http://localhost:8888/Resources/Scripts/PHP/Hubs/CommunityHub.php?user={$user[0]}&action=logout">logout</a>.
</div>
<div class="right">
<a class="YouTube" href="http://youtube.com/User/MadSplashTV" target="_blank">&nbsp;</a>
<a class="Twitter" href="http://twitter.com/MadSplashStudio" target="_blank">&nbsp;</a>
<div class="CrossNav">
<img src="../Resources/Images/Icons/General/CrossNavDark.png" style="width: 28px; height: 28px;" />
<ul>
<a href="http://therpg.madsplash.net/" target="_blank">
<li class="RPG">
<img src="../Resources/Images/Logos/TheRPG.png" style="width: 38px; float: left; margin-right: 4px; margin-top: 4px;" />
<a class="RPGLink">The RPG</a> <br />
Our up-and-coming web-and-text-based RPG. Play!
</li>
</a>
<li class="footer">
<div style="padding: 4px 8px;">
Follow us here, too: <br />
<div class="right">
<a class="YouTube" href="http://youtube.com/User/MadSplashTV" target="_blank">&nbsp;</a>
<a class="Twitter" href="http://twitter.com/MadSplashStudio" target="_blank">&nbsp;</a>
</div>
<div class="clear"> </div>
</div>
</li>
@ -62,36 +46,36 @@ SUPERNAV;
echo <<<SUPERNAV
<section id="SuperNav">
<div class="left" style="padding-left: 12px;">
Hey there, Guest. You can <a href="http://localhost:8888/community/index.php?page=login">login</a>
Hey there, Guest. You can <a href="http://localhost:8888/community/index.php?page=login">login</a>
or <a href="http://localhost:8888/community/index.php?page=register">register</a> here.
</div>
<div class="right">
<a class="YouTube" href="http://youtube.com/User/MadSplashTV" target="_blank">&nbsp;</a>
<a class="Twitter" href="http://twitter.com/MadSplashStudio" target="_blank">&nbsp;</a>
<div class="CrossNav">
<img src="../Resources/Images/Icons/General/CrossNavDark.png" style="width: 28px; height: 28px;" />
<ul>
<a href="http://therpg.madsplash.net/" target="_blank">
<li class="RPG">
<img src="../Resources/Images/Logos/TheRPG.png" style="width: 38px; float: left; margin-right: 4px; margin-top: 4px;" />
<a class="RPGLink">The RPG</a> <br />
Our up-and-coming web-and-text-based RPG. Play!
</li>
</a>
<li class="footer">
<div style="padding: 4px 8px;">
Follow us here, too: <br />
<div class="right">
<a class="YouTube" href="http://youtube.com/User/MadSplashTV" target="_blank">&nbsp;</a>
<a class="Twitter" href="http://twitter.com/MadSplashStudio" target="_blank">&nbsp;</a>
</div>
<div class="clear"> </div>
</div>
</li>
@ -101,4 +85,4 @@ SUPERNAV;
</section>
SUPERNAV;
}
?>
?>