',',','.','?','/','\\','|',';',':',chr(34),chr(39)); ################ # END SETTINGS # ################ ?> ..:: Reopen 9/11 - Catch the Real Terrorists ::..

== ".strtoupper($program_usage)." POSTINGS WITHIN THE LAST $days_before_archiving DAYS ==

\n"; else if ($HTTP_GET_VARS["history"] == "list") echo "

== ARCHIVED ".strtoupper($program_usage)." POSTINGS ==

\n"; //OPENS AND READS CONTENTS OF TASKS DIRECTORY $d = dir($posts_folder); while($entry = $d -> read()) { if (stristr($entry,$posts_file_extension) != false) $postfiles[] = str_replace($posts_file_extension,"",$entry); } $d->close(); //SORTS THE POSTING FILES BY DATE AND ALPHABETICALLY rsort($postfiles); //PARSES THE DATE AND POSTING TITLE FROM FILE NAME echo ""; foreach ($postfiles as $postfile) { list($post_date,$post_title) = split("__",$postfile); $post_year = substr($post_date,0,4); $post_month = substr($post_date,5,2); $post_day = substr($post_date,8,2); $post_title = str_replace("_"," ",$post_title); //DETERMINES WHETHER TO DISPLAY BASED ON DATE if (@$HTTP_GET_VARS["history"] == $postfile OR (@$HTTP_GET_VARS["history"] == "" AND intval((mktime(0,0,0,$post_month,$post_day,$post_year) - time())/86400) + $days_before_archiving >= 0)) { //DISPLAYS THE ACTIVE POSTINGS echo ""; echo ""; echo ""; //DETERMINES IF TO DISPLAY ARCHIVE INDEX } else if (@$HTTP_GET_VARS["history"] == "list") echo "".str_replace("_","-",$post_date)." -- $post_title
\n"; } echo "
$post_title

${post_month}-${post_day}-${post_year}
".implode("
\n",file($posts_folder.$postfile.$posts_file_extension))."

"; //ACTION IS TO CREATE A NEW POSTING } else if (@$HTTP_GET_VARS["action"] == "Create") { echo "

== CREATE NEW ".strtoupper($program_usage)." POSTING ==\n"; echo "

"; echo "\n"; echo "Date for posting: format: yyyy-mm-dd

\n"; echo "

Title of posting: \n"; echo "

Content of posting
\n"; echo "

Optional Picture: \n"; if ($password != '0') echo "

Enter Password: \n"; echo "

\n"; echo "

\n"; //ACTION IS TO SUBMIT AN ENTERED NEW POSTING } else if ($HTTP_GET_VARS["action"] == "CreateSubmit") { if ($HTTP_POST_VARS["date"] == "" OR $HTTP_POST_VARS["title"] == "" OR $HTTP_POST_VARS["content"] == "") echo "

ERROR: One or more of the required fields was not completed.
Please click BACK and try again.\n"; else if ($password != '0' AND $HTTP_POST_VARS["password"] != $password) echo "

ERROR: Invalid Password.\n"; else { foreach($bad_file_name_chars as $bad_file_name_char) { if(strchr(stripslashes($HTTP_POST_VARS["title"]),$bad_file_name_char)!=false) $found_bad_char++; } if ($found_bad_char>0) { echo "

ERROR: The title contained one or more invalid characters (".implode(" ",$bad_file_name_chars).").
\n"; echo "Please click the BACK button, fix this, and try again.

"; } else { $newpost_filename = $posts_folder.str_replace(" ","_",$HTTP_POST_VARS["date"])."__".str_replace(" ","_",$HTTP_POST_VARS["title"]).$posts_file_extension; if ($HTTP_POST_FILES['userfile']['name'] != "") { $uploaded_file_extension = strtolower(substr($HTTP_POST_FILES['userfile']['name'],strrpos($HTTP_POST_FILES['userfile']['name'],'.')+1)); if (in_array($uploaded_file_extension,$upload_file_acceptable_extensions) == false) echo "ERROR: '".$HTTP_POST_FILES['userfile']['name']."' is not an accepted file type.
\n"; else { if(copy($userfile,$upload_file_path.$HTTP_POST_FILES['userfile']['name'])) { $new_width = "460"; $new_height = "307"; $img_src = imagecreatefromjpeg($userfile); $dst_img = imagecreatetruecolor($new_width,$new_height); $true_width = imagesx($img_src); $true_height = imagesy($img_src); imagecopyresized ($dst_img, $img_src, 0, 0, 0, 0, 460, 307, $true_width, $true_height); ImageJPEG($dst_img,$upload_file_path.$HTTP_POST_FILES['userfile']['name']); $fw = fopen($newpost_filename,"ab"); $file = fwrite($fw,"

\"Uploaded".stripslashes($HTTP_POST_VARS["content"])."

"); $fp = fclose($fw); if ($fw) echo "

The new posting has been added successfully!\n"; else echo "

ERROR: There was a problem saving your new posting.\n"; } } } else { $fw = fopen($newpost_filename,"wb"); $file = fwrite($fw,stripslashes($HTTP_POST_VARS["content"])); $fp = fclose($fw); if ($fw) echo "

The new posting has been added successfully!\n"; else echo "

ERROR: There was a problem saving your new posting.
\n"; } } } //ACTION IS TO SELECT A POSTING FOR DELETION } else if ($HTTP_GET_VARS["action"] == "Delete") { //OPENS AND READS CONTENTS OF TASKS DIRECTORY $d = dir($posts_folder); while($entry = $d -> read()) { if (stristr($entry,$posts_file_extension) != false) $postfiles[] = str_replace($posts_file_extension,"",$entry); } $d->close(); //SORTS THE POSTING FILES BY DATE AND ALPHABETICALLY sort($postfiles); //BEGIN THE SELECTION FORM echo "

== DELETE A POSTING ==\n"; echo "

\n"; echo "

Select posting to delete: \n"; if ($password != '0') echo "

Enter Password: \n"; echo "

\n"; echo "

\n"; //ACTION IS TO DELETE A SELECTED POSTING } else if ($HTTP_GET_VARS["action"] == "DeleteSubmit") { if ($password == '0' OR $HTTP_POST_VARS["password"] == $password) { if (unlink($posts_folder.$HTTP_POST_VARS["filename"].$posts_file_extension)) echo "

The posting has been deleted successfully.\n"; else echo "

ERROR: There was a problem deleting that posting.\n"; } else echo "

ERROR: Invalid Password.\n"; //ACTION IS UNDEFINED } else echo "

Invalid Action\n"; //DISPLAYS ACTION LINKS echo "

[ "; echo "Recent postings | "; echo "Archives "; if ($password == '0') echo "| Create a new posting "; echo "]\n"; ?>