From e3023f8b39a4fbb23df01d5d4aa9c52db3dfe605 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Sat, 29 Jun 2024 08:07:30 -0500 Subject: [PATCH] Remove CantTouchThis --- app/classes/Article.php | 69 ++++++++------------ app/classes/ArticleComment.php | 65 ++++++++----------- app/classes/EpisodeComment.php | 67 ++++++++------------ app/classes/Project.php | 37 ++++------- app/classes/Show.php | 109 ++++++++++++++------------------ app/classes/User.php | 57 ++++++----------- app/modules/CommunityModule.php | 17 +---- app/modules/DatabaseModule.php | 15 ----- app/supernav.php | 52 ++++++--------- 9 files changed, 176 insertions(+), 312 deletions(-) diff --git a/app/classes/Article.php b/app/classes/Article.php index 664c7d3..4cec490 100755 --- a/app/classes/Article.php +++ b/app/classes/Article.php @@ -1,22 +1,7 @@ - - - - - -
- - -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) { - + } } -?> \ No newline at end of file +?> diff --git a/app/classes/ArticleComment.php b/app/classes/ArticleComment.php index 4c8cf19..6b72e0e 100755 --- a/app/classes/ArticleComment.php +++ b/app/classes/ArticleComment.php @@ -1,74 +1,59 @@ - - - - - -
- - -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) { - + } - + } -?> \ No newline at end of file +?> diff --git a/app/classes/EpisodeComment.php b/app/classes/EpisodeComment.php index e7a8a80..23c7df1 100755 --- a/app/classes/EpisodeComment.php +++ b/app/classes/EpisodeComment.php @@ -1,75 +1,60 @@ - - - - - -
- - -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) { - + } - + } -?> \ No newline at end of file +?> diff --git a/app/classes/Project.php b/app/classes/Project.php index dd17a24..5645120 100755 --- a/app/classes/Project.php +++ b/app/classes/Project.php @@ -1,19 +1,4 @@ - - - - - -
- - -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) { - + } } -?> \ No newline at end of file +?> diff --git a/app/classes/Show.php b/app/classes/Show.php index cced659..77ba9d1 100755 --- a/app/classes/Show.php +++ b/app/classes/Show.php @@ -1,123 +1,108 @@ - - - - - -
- - -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; - + } - + } -?> \ No newline at end of file +?> diff --git a/app/classes/User.php b/app/classes/User.php index 6cceea2..f0acd35 100755 --- a/app/classes/User.php +++ b/app/classes/User.php @@ -1,19 +1,4 @@ - - - - - -
- - -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) { - + } - + } -?> \ No newline at end of file +?> diff --git a/app/modules/CommunityModule.php b/app/modules/CommunityModule.php index 71c8441..e62cd00 100755 --- a/app/modules/CommunityModule.php +++ b/app/modules/CommunityModule.php @@ -1,19 +1,4 @@ - - - - - - -
- - -CANTTOUCH; - - die($page); - } + - - - - - -
- - -CANTTOUCH; - - die($page); - } /* --- The Database Module diff --git a/app/supernav.php b/app/supernav.php index e1ced4c..86c9d99 100755 --- a/app/supernav.php +++ b/app/supernav.php @@ -1,55 +1,39 @@ - - - - - - -
- - -CANTTOUCH; - - die($page); - } - +
Heyas, {$user[1]}! You can go to your User CP or logout.
- +
  - +
- +
  • - + The RPG
    Our up-and-coming web-and-text-based RPG. Play!
  • - + @@ -62,36 +46,36 @@ SUPERNAV; echo <<
    - Hey there, Guest. You can login + Hey there, Guest. You can login or register here.
    - +
      - +
    - +
    • - + The RPG
      Our up-and-coming web-and-text-based RPG. Play!
    • - + @@ -101,4 +85,4 @@ SUPERNAV; SUPERNAV; } -?> \ No newline at end of file +?>