From 56b86a7abb0addc79ca1efa7a5e58e6ca2118b05 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 19 Sep 2019 01:38:02 -0400 Subject: [PATCH] add most embarrassing snippets --- README.md | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bfafb9c..f347c1d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@

- A PHP4-based bulletin board creatively titled **Jake's Bulletin Board**. This was my first-ever full programming creation back in 2003 (if you couldn't tell) saved for posterity after being rescued from a dust-caked floppy disk. ## Usage @@ -15,6 +14,109 @@ If you're bored on a rainy day, potential activities could include: - Actually getting this to run in 2019. +## Embarrassing Highlights + +Who cares if somebody wants to delete a post with the ID "`*`" no matter the author? ([delete_reply_submit.php](https://github.com/jakejarvis/jbb/blob/87b606797414b2fe563af85e269566fc5e076cc5/delete_reply_submit.php#L9)) + +```php + $query2 = "DELETE FROM jbb_replies +WHERE replyID ='$replyID'"; +$result2 = mysql_query ($query2) + or die ($query2); +``` + +Sessions based on storing an auto-incremented user ID in a cookie. ([login_submit.php](https://github.com/jakejarvis/jbb/blob/87b606797414b2fe563af85e269566fc5e076cc5/login_submit.php#L28)) + +```php +session_id($user->userID); +session_start(); +$_SESSION["ck_userID"] = $user->userID; +$_SESSION["ck_username"] = $user->username; +$_SESSION["ck_groupID"] = $user->groupID; +``` + +Viewing a "private" message based solely on a sequential message ID. ([pm_view.php](https://github.com/jakejarvis/jbb/blob/87b606797414b2fe563af85e269566fc5e076cc5/pm_view.php#L13)) + +```php +$query1 = "SELECT * FROM jbb_pm WHERE pmID = '$pmID'"; +``` + +Incredibly ambitious emoticon and [BBCode](https://en.wikipedia.org/wiki/BBCode) support. I honestly can't begin to explain this logic. ([functions.php](https://github.com/jakejarvis/jbb/blob/87b606797414b2fe563af85e269566fc5e076cc5/functions.php#L18)) + +```php +$replacement = ''; +$replacement2 = ''; +$replacement3 = ''; +$replacement4 = ''; +$replacement5 = ''; +// ... yada yada yada ... +$replacement21 = ''; +$replacement23 = ''; +$replacement24 = '