This blob has been accessed 495 times via Git panel.
- <?php
- require("core.php");
- if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
- if (file_exists("$maj_data_directory/hits.txt")) {
- $maj_global_hits_count = file_get_contents("$maj_data_directory/hits.txt");
- }
- else {
- $maj_global_hits_count = "0";
- }
- $maj_global_hits_count = $maj_global_hits_count + 1;
- }
- if (@mb_ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
- if (file_exists("$maj_data_directory/google.txt")) {
- $maj_google_hits_count = file_get_contents("$maj_data_directory/google.txt");
- }
- else {
- $maj_google_hits_count = "0";
- }
- $maj_google_hits_count = $maj_google_hits_count + 1;
- }
- if (isset($_REQUEST['download']) and !empty($_REQUEST['download']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
- ini_set("zlib.output_compression","off");
- if (($_REQUEST['type'] == "filedrop") and isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry/filedrop/files")) {
- if ($maj_logged_in_username == $maj_admin_username) {
- maj_download_file(str_replace("../","",@$_REQUEST['download']),"$maj_data_directory/items/$maj_req_entry/filedrop/files");
- }
- else {
- maj_download_file(str_replace("../","",@$_REQUEST['download']),"$maj_data_directory/items/$maj_req_entry/filedrop/files","$maj_data_directory/items/$maj_req_entry/filedrop/count");
- }
- }
- die();
- }
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
- $maj_comment_dir = "$maj_data_directory/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
- $maj_login_key = file_get_contents("$maj_comment_dir/key.txt");
- if ($_REQUEST['key'] == $maj_login_key) {
- if ($_REQUEST['action'] == "approve") {
- $maj_live_dir = "$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}";
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
- mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
- }
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}")) {
- mkdir("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}");
- }
- unlink("$maj_live_dir/key.txt");
- // clean-up old latest comments dir (start)
- if (file_exists("$maj_data_directory/comments/latest")) {
- rmdirr("$maj_data_directory/comments/latest");
- }
- // clean-up old latest comments dir (end)
- if (file_exists("$maj_data_directory/members/active") and !file_exists("$maj_data_directory/xucomment.txt")) {
- if (!file_exists("$maj_data_directory/comments/unread")) {
- mkdir("$maj_data_directory/comments/unread");
- }
- if (!file_exists("$maj_data_directory/comments/unread/$maj_req_entry")) {
- mkdir("$maj_data_directory/comments/unread/$maj_req_entry");
- }
- if ($maj_dh_unread_active_members = opendir("$maj_data_directory/members/active")) {
- while (($maj_unread_active_member = readdir($maj_dh_unread_active_members)) !== false) {
- if ($maj_unread_active_member != "." && $maj_unread_active_member != "..") {
- if ((!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/members")) or (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and file_exists("$maj_data_directory/items/$maj_req_entry/members") and file_exists("$maj_data_directory/items/$maj_req_entry/members/$maj_unread_active_member"))) {
- if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments")) {
- mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments");
- }
- if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread")) {
- mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread");
- }
- if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
- mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
- }
- }
- }
- }
- closedir($maj_dh_unread_active_members);
- }
- }
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
- while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
- if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories);
- }
- }
- if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/ml.txt") and file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and ($maj_private_categories == "0")) {
- if (file_exists("$maj_data_directory/ml-reply2.txt")) {
- $maj_ml_reply2 = file_get_contents("$maj_data_directory/ml-reply2.txt");
- }
- if (file_exists("$maj_data_directory/ml-from.txt")) {
- $maj_ml_from = $maj_ml_reply2;
- }
- else {
- $maj_ml_from = file_get_contents("$maj_live_dir/email.txt");
- }
- $maj_ml_from = str_replace(" at ","@",$maj_ml_from);
- $maj_ml_from_firstname = file_get_contents("$maj_live_dir/firstname.txt");
- $maj_ml_from_lastname = file_get_contents("$maj_live_dir/lastname.txt");
- $maj_ml_from = '"' . "$maj_ml_from_firstname $maj_ml_from_lastname" . '" <' . $maj_ml_from . '>';
- $maj_ml_subject = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (file_exists("$maj_data_directory/ml-prepend.txt")) {
- $maj_ml_prepend = file_get_contents("$maj_data_directory/ml-prepend.txt");
- $maj_ml_subject = str_replace($maj_ml_prepend,"",$maj_ml_subject);
- $maj_ml_subject = $maj_ml_prepend . " " . $maj_ml_subject;
- }
- $maj_ml_subject = str_replace("Re:","",$maj_ml_subject);
- $maj_ml_subject = "Re: " . $maj_ml_subject;
- $maj_ml_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
- $maj_ml_body = file_get_contents("$maj_live_dir/comment.txt");
- $maj_ml_body = str_replace('<br />',"\n",$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/crying.png" border="0">',':((',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/frown.png" border="0">',':(',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/laughing.png" border="0">',':D',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/lick.png" border="0">',':P',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/ohno.png" border="0">',':O',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/smile.png" border="0">',':)',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/surprised.png" border="0">','=)',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/undecided.png" border="0">',':\\',$maj_ml_body);
- $maj_ml_body = str_replace('<img src="images/smileys/wink.png" border="0">',';)',$maj_ml_body);
- $maj_ml_body = html_entity_decode($maj_ml_body,ENT_QUOTES,'UTF-8');
- if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt")) {
- $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("$maj_data_directory/pf-censor.txt")) {
- $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
- }
- else {
- $maj_censor = "[expletive]";
- }
- $maj_ml_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_ml_body);
- }
- if (file_exists("$maj_data_directory/ml-header.txt")) {
- $maj_ml_header = file_get_contents("$maj_data_directory/ml-header.txt");
- $maj_ml_body = $maj_ml_header . "\n\n" . $maj_ml_body;
- }
- $maj_ml_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $maj_ml_url = str_replace('//','/',$maj_ml_url);
- $maj_ml_url = "http://$maj_ml_url/index.php?entry=$maj_req_entry&show=comments";
- $maj_ml_body = $maj_ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $maj_ml_url;
- if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt")) {
- $maj_ml_body = $maj_ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
- }
- if (file_exists("$maj_data_directory/ml-footer.txt")) {
- $maj_ml_footer = file_get_contents("$maj_data_directory/ml-footer.txt");
- $maj_ml_body = $maj_ml_body . "\n\n" . $maj_ml_footer;
- }
- if ($maj_dh_ml_member = opendir("$maj_data_directory/members/active")) {
- while (($maj_ml_member = readdir($maj_dh_ml_member)) !== false) {
- if ($maj_ml_member != "." && $maj_ml_member != "..") {
- if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-noml.txt")) {
- continue;
- }
- if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-vacation.txt")) {
- continue;
- }
- $maj_ml_to_firstname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/firstname.txt");
- $maj_ml_to_lastname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/lastname.txt");
- $maj_ml_to = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/email.txt");
- $maj_ml_to = '"' . "$maj_ml_to_firstname $maj_ml_to_lastname" . '" <'. $maj_ml_to . '>';
- if (file_exists("$maj_data_directory/ml-reply2.txt")) {
- mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\n" .
- "Reply-To: $maj_ml_reply2\n" .
- "References: $maj_req_entry\n" .
- "X-Mailer: $maj_ml_mailer\n" .
- "Precedence: bulk");
- }
- else {
- mb_send_mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
- "From: $maj_ml_from\n" .
- "References: $maj_req_entry\n" .
- "X-Mailer: $maj_ml_mailer\n" .
- "Precedence: bulk");
- }
- }
- }
- closedir($maj_dh_ml_member);
- }
- }
- }
- if ($_REQUEST['action'] == "delete") {
- rmdirr($maj_comment_dir);
- }
- $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
- if ($maj_comment_count_value <= 1) {
- rmdirr("$maj_data_directory/comments/pending/$maj_req_entry");
- }
- else {
- $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
- $maj_comment_count_value = $maj_comment_count_value - 1;
- $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_req_entry/count.txt","w");
- }
- header("Location: index.php?entry=$maj_req_entry&show=comments");
- }
- }
- echo "<!DOCTYPE html>\n\n";
- if (isset($maj_req_entry) and !empty($maj_req_entry)) {
- if (file_exists("$maj_data_directory/items/$maj_req_entry")) {
- $maj_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- echo "<title>$maj_title</title>\r\n";
- if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- if (file_exists("$maj_data_directory/items/$maj_req_entry/views.txt")) {
- $maj_count_views = file_get_contents("$maj_data_directory/items/$maj_req_entry/views.txt");
- }
- else {
- $maj_count_views = "0";
- }
- $maj_count_views = $maj_count_views + 1;
- }
- if (isset($maj_req_show) and !empty($maj_req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == sha1($_POST['captcha_put'])) and (mb_ereg("@",$_POST['email'])) and (mb_ereg("\.",$_POST['email']))) {
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments")) {
- mkdir("$maj_data_directory/items/$maj_req_entry/comments");
- }
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/pending")) {
- mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending");
- }
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
- mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
- }
- mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir");
- $maj_body_content = ucfirst($_POST['new_comment']);
- $maj_body_content = htmlentities($maj_body_content,ENT_QUOTES,'UTF-8');
- $maj_body_content = str_replace("\n",'<br />',$maj_body_content);
- $maj_body_content = trim($maj_body_content);
- $maj_body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':|','<img src="images/smileys/indifferent.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':D','<img src="images/smileys/laughing.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':P','<img src="images/smileys/lick.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':O','<img src="images/smileys/ohno.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':)','<img src="images/smileys/smile.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace('=)','<img src="images/smileys/surprised.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$maj_body_content);
- $maj_body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$maj_body_content);
- $maj_fp_body_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/comment.txt","w");
- $maj_fp_timestamp_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/timestamp.txt","w");
- $maj_fp_firstname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/firstname.txt","w");
- $maj_firstname = htmlentities($_POST['firstname'],ENT_QUOTES,'UTF-8');
- $maj_firstname = trim($maj_firstname);
- if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
- $maj_firstname = mb_strtolower($maj_firstname);
- }
- $maj_firstname = ucwords($maj_firstname);
- $maj_fp_lastname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/lastname.txt","w");
- $maj_lastname = htmlentities($_POST['lastname'],ENT_QUOTES,'UTF-8');
- $maj_lastname = trim($maj_lastname);
- if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
- $maj_lastname = mb_strtolower($maj_lastname);
- }
- $maj_lastname = ucwords($maj_lastname);
- $maj_fp_email_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/email.txt","w");
- $maj_email = mb_strtolower($_POST['email']);
- $maj_email = trim($maj_email);
- $maj_email = htmlentities($maj_email,ENT_QUOTES,'UTF-8');
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/email.txt")) {
- $maj_email_root = mb_strtolower($_POST['email']);
- $maj_email_root = trim($maj_email_root);
- $maj_email_root = htmlentities($maj_email_root,ENT_QUOTES,'UTF-8');
- }
- if (isset($_POST['url']) and !empty($_POST['url']) and (mb_ereg("\.",$_POST['url']))) {
- $maj_fp_url_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/url.txt","w");
- $maj_url = str_replace("http://","",$_POST['url']);
- $maj_url = mb_strtolower($maj_url);
- $maj_url = trim($maj_url);
- $maj_url = "http://" . $maj_url;
- $maj_url = htmlentities($maj_url,ENT_QUOTES,'UTF-8');
- }
- if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $maj_fp_cauthor_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/author.txt","w");
- }
- $maj_key_rand = str_rand(14);
- $maj_fp_key_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/key.txt","w");
- $maj_comment_quote = ucfirst($_POST['new_comment']);
- $maj_sig_author = file_get_contents("$maj_data_directory/author.txt");
- $maj_sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $maj_sig_url = str_replace('//','/',$maj_sig_url);
- $maj_sig_url = "http://" . $maj_sig_url;
- $maj_email_to = mb_strtolower($_POST['email']);
- $maj_email_to = '"' . "$maj_firstname $maj_lastname" . '" <' . $maj_email_to . '>';
- if (file_exists("$maj_data_directory/email.txt")) {
- $maj_from_email_author = file_get_contents("$maj_data_directory/author.txt");
- $maj_from_email = file_get_contents("$maj_data_directory/email.txt");
- $maj_from_email = '"' . $maj_from_email_author . '" <' . $maj_from_email . '>';
- }
- $maj_commented_entry_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (!file_exists("$maj_data_directory/nak.txt") and file_exists("$maj_data_directory/email.txt")) {
- $maj_comment_thanks = "Hi $maj_firstname,\n\nThanks for submitting the following comment last $maj_timestamp:\n\n\"$maj_comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&show=comments\n\nThanks again! =)\n\n--\n$maj_sig_author\n$maj_sig_url\n";
- mb_send_mail($maj_email_to,"Thanks for sharing your thoughts!",$maj_comment_thanks,
- "From: $maj_from_email\n" .
- "Reply-To: $maj_from_email\n" .
- "X-Mailer: $maj_mailer\n" .
- "Precedence: bulk");
- }
- if (file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/xscreen.txt")) {
- $maj_comment_notice = "The following comment was submitted by $maj_email_to last $maj_timestamp for the entry \"$maj_commented_entry_title\":\n\n\"$maj_comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
- mb_send_mail($maj_from_email,"Pending Comment",$maj_comment_notice,
- "From: $maj_from_email\n" .
- "Reply-To: $maj_from_email\n" .
- "X-Mailer: $maj_mailer\n" .
- "Precedence: bulk");
- }
- if (!file_exists("$maj_data_directory/comments")) {
- mkdir("$maj_data_directory/comments");
- }
- if (!file_exists("$maj_data_directory/comments/pending")) {
- mkdir("$maj_data_directory/comments/pending");
- }
- $maj_pending_comment_flag = $maj_req_entry;
- if (!file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag")) {
- mkdir("$maj_data_directory/comments/pending/$maj_pending_comment_flag");
- }
- if (file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt")) {
- $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt");
- }
- else {
- $maj_comment_count_value = "0";
- }
- $maj_comment_count_value = $maj_comment_count_value + 1;
- $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt","w");
- }
- }
- }
- else {
- echo "<title>$maj_default_title</title>\r\n";
- }
- if (file_exists("$maj_data_directory/gl.txt")) {
- echo "\n<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\"></script>\n";
- }
- if (file_exists("$maj_data_directory/comments/pending") and (file_exists("$maj_data_directory/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")))) {
- if ($maj_dh_xscreen_comments = opendir("$maj_data_directory/comments/pending")) {
- while (($maj_xscreen_comment = readdir($maj_dh_xscreen_comments)) !== false) {
- if ($maj_xscreen_comment != "." && $maj_xscreen_comment != "..") {
- $maj_xscreen_comments[] = $maj_xscreen_comment;
- }
- }
- closedir($maj_dh_xscreen_comments);
- }
- rsort($maj_xscreen_comments);
- if (count($maj_xscreen_comments) > 0) {
- foreach ($maj_xscreen_comments as $maj_xscreen_dir) {
- if ($maj_dh_xscreen_pending = opendir("$maj_data_directory/items/$maj_xscreen_dir/comments/pending")) {
- while (($maj_xscreen_entry = readdir($maj_dh_xscreen_pending)) !== false) {
- if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- if (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")) {
- if ($maj_logged_in_username == file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
- $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
- header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
- }
- }
- else {
- $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
- header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
- }
- }
- }
- }
- }
- }
- }
- if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
- while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
- if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories);
- }
- }
- if ($maj_private_categories == "0") {
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
- if (!file_exists("$maj_data_directory/items/$maj_req_entry/private.txt")) {
- $maj_description = file_get_contents("$maj_data_directory/items/$maj_req_entry/body.txt");
- $maj_description = strip_tags($maj_description);
- $maj_description = html_entity_decode($maj_description);
- $maj_description = str_replace("&","&",$maj_description);
- $maj_description = str_replace("<","<",$maj_description);
- $maj_description = str_replace(">",">",$maj_description);
- $maj_description = str_replace("<br />"," ",$maj_description);
- $maj_description = str_replace("<br>"," ",$maj_description);
- $maj_description = str_replace("\r"," ",$maj_description);
- $maj_description = str_replace("\n"," ",$maj_description);
- $maj_description = str_replace(chr(10)," ",$maj_description);
- $maj_description = str_replace(chr(13)," ",$maj_description);
- $maj_description = trim($maj_description);
- $maj_description = mb_substr($maj_description,0,210);
- $maj_description = htmlentities($maj_description,ENT_QUOTES,'UTF-8');
- if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
- $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("$maj_data_directory/pf-censor.txt")) {
- $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
- }
- else {
- $maj_censor = "[expletive]";
- }
- $maj_description = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_description);
- }
- echo "<meta name=\"description\" content=\"{$maj_description}\">";
- }
- }
- }
- }
- if ($maj_dh_items = opendir("$maj_data_directory/items")) {
- while (($maj_item = readdir($maj_dh_items)) !== false) {
- if ($maj_item != "." && $maj_item != "..") {
- if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_egroups = opendir("$maj_data_directory/items/$maj_item/categories")) {
- while (($maj_egroup = readdir($maj_dh_egroups)) !== false) {
- if ($maj_egroup != "." && $maj_egroup != "..") {
- if (!file_exists("$maj_data_directory/categories/$maj_egroup")) {
- rmdirr("$maj_data_directory/items/$maj_item/categories/$maj_egroup");
- }
- if (file_exists("$maj_data_directory/categories/$maj_egroup/members")) {
- if ($maj_dh_mgroups = opendir("$maj_data_directory/categories/$maj_egroup/members")) {
- while (($maj_mgroup = readdir($maj_dh_mgroups)) !== false) {
- if ($maj_mgroup != "." && $maj_mgroup != "..") {
- if (!file_exists("$maj_data_directory/items/$maj_item/members/$maj_mgroup")) {
- if (!file_exists("$maj_data_directory/items/$maj_item/members")) {
- mkdir("$maj_data_directory/items/$maj_item/members");
- }
- mkdir("$maj_data_directory/items/$maj_item/members/$maj_mgroup");
- }
- }
- }
- closedir($maj_dh_mgroups);
- }
- }
- }
- }
- closedir($maj_dh_egroups);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_item/categories") and (count(glob("$maj_data_directory/items/$maj_item/categories/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/categories");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/members")) {
- if ($maj_dh_members = opendir("$maj_data_directory/items/$maj_item/members")) {
- while (($maj_member = readdir($maj_dh_members)) !== false) {
- if ($maj_member != "." && $maj_member != "..") {
- if (!file_exists("$maj_data_directory/members/active/$maj_member")) {
- rmdirr("$maj_data_directory/items/$maj_item/members/$maj_member");
- }
- }
- }
- closedir("$maj_data_directory/items/$maj_item/members");
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_item/members") and (count(glob("$maj_data_directory/items/$maj_item/members/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/members");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/comments/live") and (count(glob("$maj_data_directory/items/$maj_item/comments/live/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/comments/live");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/comments/pending") and (count(glob("$maj_data_directory/items/$maj_item/comments/pending/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/comments/pending");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/comments") and (count(glob("$maj_data_directory/items/$maj_item/comments/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/comments");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/filedrop/files") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/files/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/filedrop/files");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/filedrop/count") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/count/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/filedrop/count");
- }
- if (file_exists("$maj_data_directory/items/$maj_item/filedrop") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/filedrop");
- }
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("$maj_data_directory/items/$maj_item/album/captions") and (count(glob("$maj_data_directory/items/$maj_item/album/captions/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/album/captions");
- }
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("$maj_data_directory/items/$maj_item/album/views") and (count(glob("$maj_data_directory/items/$maj_item/album/views/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/album/views");
- unlink("$maj_data_directory/items/$maj_item/album/views.txt");
- }
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("$maj_data_directory/items/$maj_item/album") and (count(glob("$maj_data_directory/items/$maj_item/album/*")) < 1)) {
- rmdirr("$maj_data_directory/items/$maj_item/album");
- }
- if (file_exists("images/$maj_item/album") and (count(glob("images/$maj_item/album/*")) < 1)) {
- rmdirr("images/$maj_item/album");
- }
- if (file_exists("images/$maj_item") and (count(glob("images/$maj_item/*")) < 1)) {
- rmdirr("images/$maj_item");
- }
- if (file_exists("images/$maj_item/categories") and (count(glob("images/$maj_item/categories/*")) < 1)) {
- rmdirr("images/$maj_item/categories");
- }
- $maj_grand[] = $maj_item;
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
- if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- $maj_items[] = $maj_req_entry;
- }
- if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_archive) and fnmatch("$maj_req_archive*",$maj_item)) {
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_find)) {
- if ((($maj_req_find == "private") or ($maj_req_find == "member") or ($maj_req_find == "passwd")) and file_exists("$maj_data_directory/items/$maj_item/{$maj_req_find}.txt")) {
- $maj_items[] = $maj_item;
- }
- if ((($maj_req_find == "comments") or ($maj_req_find == "filedrop") or ($maj_req_find == "album")) and file_exists("$maj_data_directory/items/$maj_item/$maj_req_find")) {
- $maj_items[] = $maj_item;
- }
- if (($maj_req_find == "unfiled") and !file_exists("$maj_data_directory/items/$maj_item/categories")) {
- $maj_items[] = $maj_item;
- }
- }
- }
- else {
- $maj_items[] = $maj_item;
- }
- $maj_latest[] = $maj_item;
- if (file_exists("$maj_data_directory/items/$maj_item/album")) {
- $maj_albums[] = $maj_item;
- }
- $maj_random[] = $maj_item;
- $maj_archives[] = mb_substr($maj_item,0,6);
- }
- else {
- // non-admin stuff (start)
- if ($maj_item > $maj_today) {
- continue;
- }
- if (file_exists("$maj_data_directory/items/$maj_item/private.txt")) {
- continue;
- }
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_item/categories")) {
- while (($maj_item_category = readdir($maj_dh_entry_categories)) !== false) {
- if ($maj_item_category != "." && $maj_item_category != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_item_category/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories);
- }
- }
- if (($maj_private_categories > 0) and !file_exists("$maj_data_directory/items/$maj_item/cat.txt")) {
- continue;
- }
- if (file_exists("$maj_data_directory/items/$maj_item/members") and (!isset($maj_logged_in_username) or !file_exists("$maj_data_directory/items/$maj_item/members/$maj_logged_in_username"))) {
- continue;
- }
- $maj_latest[] = $maj_item;
- if (file_exists("$maj_data_directory/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
- continue;
- }
- if (file_exists("$maj_data_directory/items/$maj_item/album")) {
- $maj_albums[] = $maj_item;
- }
- $maj_random[] = $maj_item;
- $maj_archives[] = mb_substr($maj_item,0,6);
- if (file_exists("$maj_data_directory/nocat.txt") and file_exists("$maj_data_directory/items/$maj_item/categories") and !file_exists("$maj_data_directory/items/$maj_item/cat.txt") and (!isset($maj_req_category) or empty($maj_req_category)) and (!isset($maj_req_entry) or empty($maj_req_entry)) and (!isset($maj_req_author) or empty($maj_req_author))) {
- continue;
- }
- if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
- if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- if ($maj_req_entry != $maj_item) {
- continue;
- }
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_archive) and fnmatch("$maj_req_archive*",$maj_item)) {
- $maj_items[] = $maj_item;
- }
- if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
- $maj_items[] = $maj_item;
- }
- }
- else {
- $maj_items[] = $maj_item;
- }
- // non-admin stuff (end)
- }
- }
- }
- closedir($maj_dh_items);
- }
- sort($maj_grand);
- $maj_count_grand = count($maj_grand);
- if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- if (file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- unset($maj_items);
- }
- if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
- unset($maj_items);
- }
- }
- $maj_items = array_unique($maj_items);
- $maj_items = array_values($maj_items);
- if (file_exists("$maj_data_directory/old.txt")) {
- sort($maj_items);
- }
- else {
- rsort($maj_items);
- }
- $maj_count_items = count($maj_items);
- rsort($maj_latest);
- $maj_count_latest = count($maj_latest);
- rsort($maj_albums);
- rsort($maj_random);
- $maj_count_random = count($maj_random);
- rsort($maj_archives);
- include("css.php");
- ?>
- <link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="rss.php?ver=0.91">
- <link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss.php?ver=1.0">
- <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.php?ver=2.0">
- <?php
- if (file_exists("$maj_data_directory/center.txt")) {
- echo "<center>";
- }
- if (file_exists("$maj_data_directory/header.txt")) {
- $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
- if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
- include("$maj_data_directory/panels/$maj_header_panel/panel.php");
- }
- }
- echo "\r\n\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wtable\">\r\n\r\n";
- if (file_exists("$maj_data_directory/panels-l.txt") and file_exists("$maj_data_directory/panels-r.txt")) {
- unlink("$maj_data_directory/panels-l.txt");
- unlink("$maj_data_directory/panels-r.txt");
- }
- if (file_exists("$maj_data_directory/panels-l.txt") ) {
- echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wpanel\" height=\"$maj_wspace\"><div style=\"width: {$maj_wpanel}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wentry\" height=\"$maj_wspace\"><div style=\"width: {$maj_wentry}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
- }
- elseif (file_exists("$maj_data_directory/panels-r.txt")) {
- echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wentry\" height=\"$maj_wspace\"><div style=\"width: {$maj_wentry}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wpanel\" height=\"$maj_wspace\"><div style=\"width: {$maj_wpanel}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
- }
- else {
- echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wpanel\" height=\"$maj_wspace\"><div style=\"width: {$maj_wpanel}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wentry\" height=\"$maj_wspace\"><div style=\"width: {$maj_wentry}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wpanel\" height=\"$maj_wspace\"><div style=\"width: {$maj_wpanel}px; height: {$maj_wspace}px;\"></div></td>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_wspace}px;\"></div></td>\r\n</tr>\r\n\r\n";
- }
- if (file_exists("$maj_data_directory/panels")) {
- if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
- while (($maj_panel = readdir($maj_dh_panels)) !== false) {
- if ($maj_panel != "." && $maj_panel != "..") {
- if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/noquery.txt") and ($maj_uquery > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
- $maj_right_panels[] = $maj_panel;
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
- $maj_top_panels[] = $maj_panel;
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
- $maj_bottom_panels[] = $maj_panel;
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
- $maj_center_panels[] = $maj_panel;
- continue;
- }
- if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
- $maj_entry_panels[] = $maj_panel;
- continue;
- }
- if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
- continue;
- }
- if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
- continue;
- }
- $maj_left_panels[] = $maj_panel;
- }
- }
- closedir($maj_dh_panels);
- }
- sort($maj_left_panels);
- sort($maj_right_panels);
- sort($maj_top_panels);
- sort($maj_bottom_panels);
- sort($maj_center_panels);
- sort($maj_entry_panels);
- }
- echo "<tr>";
- if (!file_exists("$maj_data_directory/panels-r.txt")) {
- echo "<td width=\"$maj_wpanel\" valign=\"top\">\r\n";
- maj_profile();
- maj_navigation();
- maj_quick_links();
- if (file_exists("$maj_data_directory/panels-l.txt")) {
- maj_pending_comments();
- maj_unread_comments();
- maj_pending_members();
- maj_bb_stats();
- maj_search();
- maj_find();
- maj_categories();
- maj_statistics();
- maj_recent();
- maj_albums();
- maj_random();
- maj_archives();
- }
- maj_panels($maj_left_panels);
- if (file_exists("$maj_data_directory/panels-l.txt")) {
- maj_panels($maj_right_panels);
- maj_badges();
- }
- echo "</td>";
- }
- // main
- echo "\r\n\r\n<td valign=\"top\" width=\"$maj_wentry\">\r\n\r\n";
- maj_panels($maj_top_panels);
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-summary.txt") and !file_exists("$maj_data_directory/lite.txt") and ($maj_uquery == 0)) {
- if ($maj_count_latest > 0) {
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Latest Entries</div>";
- echo "<div class=\"panel_body\">";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"100%\">";
- echo "<tr><td bgcolor=\"#eeeeee\" align=\"center\">topic</td><td bgcolor=\"#eeeeee\" align=\"center\">author</td><td bgcolor=\"#eeeeee\" align=\"center\">views</td><td bgcolor=\"#eeeeee\" align=\"center\">comments</td><td bgcolor=\"#eeeeee\" align=\"center\">last post</td></tr>";
- $maj_increment_latest = 0;
- while ($maj_increment_latest <= 4) {
- $maj_latest_title = file_get_contents("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/title.txt");
- $maj_items_summary_comments = glob("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/comments/live/*");
- $maj_summary_comments = count($maj_items_summary_comments);
- rsort($maj_items_summary_comments);
- echo "<tr><td bgcolor=\"#ffffff\">";
- if (file_exists("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/member.txt") and (!isset($maj_logged_in_username))) {
- echo "<b>$maj_latest_title</b>";
- }
- else {
- echo "<a href=\"index.php?entry=$maj_latest[$maj_increment_latest]";
- if ($maj_summary_comments > 0) {
- echo "&show=comments";
- }
- echo "\">$maj_latest_title</a>";
- }
- echo "</td>";
- echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
- readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
- echo "\">";
- readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
- echo "</a></td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">";
- if (!file_exists("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt")) {
- echo 0;
- }
- else {
- readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt");
- }
- echo "</td>";
- if ($maj_summary_comments < 1) {
- $maj_iso_year = mb_substr($maj_latest[$maj_increment_latest],0,4);
- $maj_iso_month = mb_substr($maj_latest[$maj_increment_latest],4,2);
- $maj_iso_day = mb_substr($maj_latest[$maj_increment_latest],6,2);
- $maj_iso_last = $maj_iso_year . "-" . $maj_iso_month . "-" . $maj_iso_day;
- echo "<td bgcolor=\"#ffffff\" align=\"right\">0</td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$maj_iso_last</td>";
- }
- else {
- $maj_iso_year = mb_substr(basename($maj_items_summary_comments[0]),0,4);
- $maj_iso_month = mb_substr(basename($maj_items_summary_comments[0]),4,2);
- $maj_iso_day = mb_substr(basename($maj_items_summary_comments[0]),6,2);
- $maj_iso_last = $maj_iso_year . "-" . $maj_iso_month . "-" . $maj_iso_day;
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$maj_summary_comments</td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$maj_iso_last</td>";
- }
- unset($maj_items_summary_comments);
- $maj_increment_latest = $maj_increment_latest + 1;
- }
- }
- if ($maj_count_latest > 0) {
- echo "</table></div></div>";
- }
- }
- maj_panels($maj_center_panels);
- if (isset($maj_req_category) and !empty($maj_req_category)) {
- if (file_exists("$maj_data_directory/categories/$maj_req_category/book.txt")) {
- if (!file_exists("$maj_data_directory/old.txt")) {
- sort($maj_items);
- }
- else {
- rsort($maj_items);
- }
- }
- }
- if ((count($maj_top_panels) == 0) and (count($maj_center_panels) == 0) and (count($maj_bottom_panels) == 0) and ($maj_count_grand == 0)) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\">";
- echo "<tr><td width=\"$maj_wentry\"><div class=\"panel_wrapper\"><div class=\"panel_title\">Oops!</div>";
- echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
- echo "<td valign=\"middle\"><img src=\"images/oops.png\" width=\"36\" height=\"36\" border=\"0\"></td><td valign=\"middle\">";
- echo "No entries or central panels found. Perhaps this is a fresh install.";
- echo "</td></tr></table></div></div>";
- echo "</td></tr></table>";
- }
- if (($maj_count_items == 0) and ($maj_count_grand > 0)) {
- if (count($_GET) > 0) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\">";
- echo "<tr><td width=\"$maj_wentry\"><div class=\"panel_wrapper\"><div class=\"panel_title\">Oops!</div>";
- echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
- echo "<td valign=\"middle\"><img src=\"images/oops.png\" width=\"36\" height=\"36\" border=\"0\"></td><td valign=\"middle\">";
- echo "The entry you are looking for does not exist or is off limits to you.";
- echo "</td></tr></table></div></div>";
- echo "</td></tr></table>";
- }
- if ((count($_GET) == 0) and (count($maj_top_panels) == 0) and (count($maj_center_panels) == 0) and (count($maj_bottom_panels) == 0)) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\">";
- echo "<tr><td width=\"$maj_wentry\"><div class=\"panel_wrapper\"><div class=\"panel_title\">Oops!</div>";
- echo "<div class=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
- echo "<td valign=\"middle\"><img src=\"images/oops.png\" width=\"36\" height=\"36\" border=\"0\"></td><td valign=\"middle\">";
- echo "Login required. Entries are off limits without proper credentials.";
- echo "</td></tr></table></div></div>";
- echo "</td></tr></table>";
- }
- }
- $maj_start = $_REQUEST['start'];
- if (!isset($_REQUEST['start']) or empty($_REQUEST['start'])) {
- $maj_start = 0;
- }
- $maj_end = $maj_start + $maj_increase;
- $maj_disp = array_slice($maj_items,$maj_start,$maj_increase);
- foreach ($maj_disp as $maj_d) {
- if (file_exists("$maj_data_directory/items/$maj_d/border.txt")) {
- $maj_d_border = file_get_contents("$maj_data_directory/items/$maj_d/border.txt");
- }
- else {
- if (isset($maj_d_border)) {
- unset($maj_d_border);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-t.txt")) {
- $maj_d_bgcolor_t = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-t.txt");
- }
- else {
- if (isset($maj_d_bgcolor_t)) {
- unset($maj_d_bgcolor_t);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-b.txt")) {
- $maj_d_bgcolor_b = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-b.txt");
- }
- else {
- if (isset($maj_d_bgcolor_b)) {
- unset($maj_d_bgcolor_b);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-c.txt")) {
- $maj_d_bgcolor_c = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-c.txt");
- }
- else {
- if (isset($maj_d_bgcolor_c)) {
- unset($maj_d_bgcolor_c);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-f.txt")) {
- $maj_d_bgcolor_f = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-f.txt");
- }
- else {
- if (isset($maj_d_bgcolor_f)) {
- unset($maj_d_bgcolor_f);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/text-t.txt")) {
- $maj_d_text_t = file_get_contents("$maj_data_directory/items/$maj_d/text-t.txt");
- }
- else {
- if (isset($maj_d_text_t)) {
- unset($maj_d_text_t);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/text-b.txt")) {
- $maj_d_text_b = file_get_contents("$maj_data_directory/items/$maj_d/text-b.txt");
- }
- else {
- if (isset($maj_d_text_b)) {
- unset($maj_d_text_b);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/text-c.txt")) {
- $maj_d_text_c = file_get_contents("$maj_data_directory/items/$maj_d/text-c.txt");
- }
- else {
- if (isset($maj_d_text_c)) {
- unset($maj_d_text_c);
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/text-f.txt")) {
- $maj_d_text_f = file_get_contents("$maj_data_directory/items/$maj_d/text-f.txt");
- }
- else {
- if (isset($maj_d_text_f)) {
- unset($maj_d_text_f);
- }
- }
- echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t\t";
- if (!file_exists("$maj_data_directory/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
- echo '<div class="panel_title"';
- if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
- echo ' style="';
- }
- if (isset($maj_d_bgcolor_t)) {
- echo "background-color: $maj_d_bgcolor_t;";
- }
- if (isset($maj_d_text_t)) {
- echo "color: $maj_d_text_t;";
- }
- if (isset($maj_d_border)) {
- echo "border-color: $maj_d_border;";
- }
- if (isset($maj_d_border) or isset($maj_d_bgcolor_t) or isset($maj_d_text_t)) {
- echo '"';
- }
- echo '>';
- readfile("$maj_data_directory/items/$maj_d/title.txt");
- if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_d/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and !file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
- echo "<a href=\"wiki.php?entry=$maj_d\">";
- echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
- echo "</a>";
- }
- if (!file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
- echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- }
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=\"del.php?entry=$maj_d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("$maj_data_directory/items/$maj_d/private.txt") and !file_exists("$maj_data_directory/items/$maj_d/categories") and file_exists("$maj_data_directory/bb.txt") and (count(glob("$maj_data_directory/items/$maj_d/comments/live/*")) === 0) and (count(glob("$maj_data_directory/items/$maj_d/comments/pending/*")) === 0)) {
- echo "<a href=\"move.php?entry=$maj_d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
- echo "<a href=\"wiki.php?entry=$maj_d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
- }
- echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt")) {
- echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/private.txt")) {
- echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/member.txt")) {
- echo "<img src=\"images/widget.member.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"members-only entry\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/cat.txt")) {
- echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/categories/$maj_req_category")) {
- $maj_private_categories = "0";
- $maj_book_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_d/categories")) {
- if ($maj_dh_read_cat_dir = opendir("$maj_data_directory/items/$maj_d/categories")) {
- while (($maj_read_cat_dir = readdir($maj_dh_read_cat_dir)) !== false) {
- if ($maj_read_cat_dir != "." && $maj_read_cat_dir != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/book.txt")) {
- $maj_book_categories = $maj_book_categories + 1;
- }
- }
- }
- closedir($maj_dh_read_cat_dir);
- }
- }
- if ($maj_private_categories > 0) {
- echo "<img src=\"images/widget.hidden.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private category\">";
- }
- if (file_exists("$maj_data_directory/nocat.txt")) {
- echo "<img src=\"images/widget.isolated.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"isolated category\">";
- }
- if ($maj_book_categories > 0) {
- echo "<img src=\"images/widget.booked.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"book category\">";
- }
- echo "<img src=\"images/widget.filed.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"filed\">";
- }
- }
- echo "</div>\r\n\r\n";
- }
- echo "\t\t\t<div class=\"panel_entry_body\"";
- if (isset($maj_d_border) or isset($maj_d_bgcolor_b) or isset($maj_d_text_b)) {
- echo ' style="';
- }
- if (isset($maj_d_bgcolor_b)) {
- echo "background-color: $maj_d_bgcolor_b;";
- }
- if (isset($maj_d_text_b)) {
- echo "color: $maj_d_text_b;";
- }
- if (isset($maj_d_border)) {
- echo "border-color: $maj_d_border;";
- }
- if (isset($maj_d_border) or isset($maj_d_bgcolor_b) or isset($maj_d_text_b)) {
- echo '"';
- }
- echo '>';
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/author.txt") and !file_exists("$maj_data_directory/items/$maj_d/xavatar.txt")) {
- $maj_author = file_get_contents("$maj_data_directory/items/$maj_d/author.txt");
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"$maj_ablock\" valign=\"top\">";
- maj_avatar_image($maj_author,$maj_aimage);
- if ($maj_dh_author_posts = opendir("$maj_data_directory/items")) {
- while (($maj_author_post = readdir($maj_dh_author_posts)) !== false) {
- if ($maj_author_post != "." && $maj_author_post != "..") {
- if (file_exists("$maj_data_directory/items/$maj_author_post/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_author_post/categories")) {
- if ($maj_dh_entry_categories_posts = opendir("$maj_data_directory/items/$maj_author_post/categories")) {
- while (($maj_entry_category_posts = readdir($maj_dh_entry_categories_posts)) !== false) {
- if ($maj_entry_category_posts != "." && $maj_entry_category_posts != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_entry_category_posts/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_entry_categories_posts);
- }
- }
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_author_post/cat.txt")) {
- continue;
- }
- if (file_exists("$maj_data_directory/members/active/$maj_author") and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_author_post/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_author_post/author.txt") == $maj_author)) {
- $maj_items_posts[] = $maj_author_post;
- }
- }
- elseif (!file_exists("$maj_data_directory/members/active/$maj_author") and ($maj_admin_username == $maj_author) and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_author_post/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_author_post/author.txt") == $maj_author)) {
- $maj_items_posts[] = $maj_author_post;
- }
- }
- }
- }
- closedir($maj_dh_author_posts);
- }
- $maj_posts = count($maj_items_posts);
- if ($maj_posts == 1) {
- echo "$maj_posts post";
- }
- if ($maj_posts > 1) {
- echo "$maj_posts posts";
- }
- unset($maj_items_posts);
- echo "</td><td valign=\"top\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt")) {
- $maj_passwd = file_get_contents("$maj_data_directory/items/$maj_d/passwd.txt");
- }
- if (isset($_REQUEST['passwd']) and !empty($_REQUEST['passwd'])) {
- $maj_crypt_passwd = sha1($_REQUEST['passwd']);
- $maj_crypt_passwd = md5($maj_crypt_passwd);
- $maj_crypt_passwd = crypt($maj_crypt_passwd,$maj_crypt_passwd);
- }
- if (!file_exists("$maj_data_directory/items/$maj_d/xdate.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
- echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("$maj_data_directory/items/$maj_d/author.txt") and (file_exists("$maj_data_directory/bb.txt") and !file_exists("$maj_data_directory/avatar.txt")) or (file_exists("$maj_data_directory/items/$maj_d/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/avatar.txt"))))) {
- $maj_xavatar_author = file_get_contents("$maj_data_directory/items/$maj_d/author.txt");
- if (!file_exists("$maj_data_directory/items/$maj_d/xauthor.txt") or (file_exists("$maj_data_directory/items/$maj_d/xauthor.txt") and ($maj_logged_in_username == $maj_admin_username))) {
- echo "<a href=\"member.php?id=$maj_xavatar_author\" style=\"font-size: $maj_font_Spx;\">$maj_xavatar_author</a> - ";
- }
- }
- entry2date($maj_d);
- if ((isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or file_exists("$maj_data_directory/items/$maj_d/lastmod.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_d/revisions.txt")) {
- echo " (Revision ";
- readfile("$maj_data_directory/items/$maj_d/revisions.txt");
- echo " - ";
- echo date("l, M j, Y, g:i A",filemtime("$maj_data_directory/items/$maj_d/body.txt"));
- echo ")";
- }
- }
- echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
- }
- if (isset($maj_d_text_b)) {
- echo "<font style=\"color: $maj_d_text_b;\">";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=\"passwd.php?entry=$maj_d\">here</a> to enter it.";
- }
- else {
- $maj_entry_body = file_get_contents("$maj_data_directory/items/$maj_d/body.txt");
- if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
- $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("$maj_data_directory/pf-censor.txt")) {
- $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
- }
- else {
- $maj_censor = "[expletive]";
- }
- $maj_entry_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_entry_body);
- }
- if (file_exists("$maj_data_directory/items/$maj_d/maxlines.txt") and (!isset($maj_req_entry) or empty($maj_req_entry))) {
- $maj_entry_shorten = file_get_contents("$maj_data_directory/items/$maj_d/maxlines.txt");
- $maj_entry_lines = explode("\r",$maj_entry_body);
- if (count($maj_entry_lines) > $maj_entry_shorten) {
- $maj_entry_body = implode("",array_slice($maj_entry_lines,0,$maj_entry_shorten));
- $maj_entry_body = $maj_entry_body . "<br><br><a href=\"index.php?entry=$maj_d\">read more</a>";
- }
- }
- echo "$maj_entry_body";
- }
- if (($maj_admin_username == $maj_author) and file_exists("$maj_data_directory/sig.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-sig.txt")) {
- $maj_sig = file_get_contents("$maj_data_directory/sig.txt");
- echo "<br><br>--<br>$maj_sig";
- }
- elseif (file_exists("$maj_data_directory/members/active/$maj_author/sig.txt") and file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-sig.txt")) {
- $maj_sig = file_get_contents("$maj_data_directory/members/active/$maj_author/sig.txt");
- echo "<br><br>--<br>$maj_sig";
- }
- if ((file_exists("$maj_data_directory/gl.txt") and file_exists("$maj_data_directory/items/$maj_d/gl.txt")) or (file_exists("$maj_data_directory/fb.txt") and file_exists("$maj_data_directory/items/$maj_d/fb.txt"))) {
- if (isset($_SERVER['HTTPS'])) {
- $entry_url = "https://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), "/\\") . "/index.php?entry=$maj_d";
- }
- else {
- $entry_url = "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), "/\\") . "/index.php?entry=$maj_d";
- }
- }
- if (file_exists("$maj_data_directory/gl.txt") and file_exists("$maj_data_directory/items/$maj_d/gl.txt")) {
- echo "<p><g:plusone size=\"medium\" href=\"$entry_url\"></g:plusone></p>";
- }
- if (file_exists("$maj_data_directory/fb.txt") and file_exists("$maj_data_directory/items/$maj_d/fb.txt")) {
- echo "<p><div id=\"fb-root\"></div><script src=\"http://connect.facebook.net/en_US/all.js#xfbml=1\"></script><fb:like href=\"$entry_url\" send=\"false\" width=\"$maj_max_entry_width\" show_faces=\"false\" font=\"\"></fb:like></p>";
- }
- if (isset($maj_d_text_b)) {
- echo "</font>";
- }
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/author.txt") and !file_exists("$maj_data_directory/items/$maj_d/xavatar.txt")) {
- echo "</td></tr></table>";
- }
- echo "\r\n\t\t\t</div>";
- if (file_exists("$maj_data_directory/items/$maj_d/categories") and ($maj_logged_in_username == $maj_admin_username)) {
- if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_d/categories")) {
- while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
- if ($maj_entry_category != "." && $maj_entry_category != "..") {
- $maj_entry_categories[] = $maj_entry_category;
- }
- }
- closedir($maj_dh_entry_categories);
- }
- sort($maj_entry_categories);
- if (count($maj_entry_categories) > 0) {
- if (count($maj_entry_categories) > 1) {
- $maj_category_list = "categories";
- }
- else {
- $maj_category_list = "category";
- }
- foreach ($maj_entry_categories as $maj_filed_under) {
- $maj_category_list = $maj_category_list . " | <a href=\"index.php?category=$maj_filed_under\" class=\"status\">$maj_filed_under</a>";
- }
- echo "\r\n\r\n\t\t\t<div class=\"panel_category\"";
- if (isset($maj_d_border) or isset($maj_d_bgcolor_c) or isset($maj_d_text_c)) {
- echo ' style="';
- }
- if (isset($maj_d_bgcolor_c)) {
- echo "background-color: $maj_d_bgcolor_c;";
- }
- if (isset($maj_d_text_c)) {
- echo "color: $maj_d_text_c;";
- }
- if (isset($maj_d_border)) {
- echo "border-color: $maj_d_border;";
- }
- if (isset($maj_d_border) or isset($maj_d_bgcolor_c) or isset($maj_d_text_c)) {
- echo '"';
- }
- echo ">$maj_category_list</div>";
- }
- unset($maj_entry_categories);
- }
- echo "\r\n\r\n\t\t\t<div class=\"panel_footer\"";
- if (isset($maj_d_border) or isset($maj_d_bgcolor_f) or isset($maj_d_text_f)) {
- echo ' style="';
- }
- if (isset($maj_d_bgcolor_f)) {
- echo "background-color: $maj_d_bgcolor_f;";
- }
- if (isset($maj_d_text_f)) {
- echo "color: $maj_d_text_f;";
- }
- if (isset($maj_d_border)) {
- echo "border-color: $maj_d_border;";
- }
- if (isset($maj_d_border) or isset($maj_d_bgcolor_f) or isset($maj_d_text_f)) {
- echo '"';
- }
- echo ">\r\n\t\t\t\t";
- if (!file_exists("$maj_data_directory/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("$maj_data_directory/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("$maj_data_directory/items/$maj_d/ucomment.txt")) {
- if (!file_exists("$maj_data_directory/items/$maj_d/comments/live")) {
- echo "<a href=\"index.php?entry=$maj_d&show=comments\" class=\"status\">add comment</a>";
- }
- else {
- if ($maj_dh_comments = opendir("$maj_data_directory/items/$maj_d/comments/live")) {
- while (($maj_live_comment = readdir($maj_dh_comments)) !== false) {
- if ($maj_live_comment != "." && $maj_live_comment != "..") {
- $maj_live_comments[] = $maj_live_comment;
- }
- }
- closedir($maj_dh_comments);
- }
- $maj_count_live_comments = count($maj_live_comments);
- echo "<a href=\"index.php?entry=$maj_d&show=comments\" class=\"status\">";
- if ($maj_count_live_comments == 1) {
- echo "$maj_count_live_comments comment";
- }
- elseif ($maj_count_live_comments < 1) {
- echo "add comment";
- }
- else {
- echo "$maj_count_live_comments comments";
- }
- echo "</a>";
- unset($maj_live_comments);
- }
- }
- else {
- echo "<a href=\"index.php?entry=$maj_d\" class=\"status\">permalink</a>";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/views.txt")) {
- $maj_views_value = file_get_contents("$maj_data_directory/items/$maj_d/views.txt");
- if ($maj_views_value == 1) {
- echo " ($maj_views_value view) ";
- }
- elseif ($maj_views_value > 1) {
- echo " ($maj_views_value views) ";
- }
- else {
- echo " ";
- }
- }
- if (!file_exists("images/$maj_d/album")) {
- echo " ";
- }
- else {
- if ($maj_dh_album = opendir("images/$maj_d/album")) {
- while (($maj_entry_album = readdir($maj_dh_album)) !== false) {
- if ($maj_entry_album != "." && $maj_entry_album != "..") {
- $maj_items_album[] = $maj_entry_album;
- }
- }
- closedir($maj_dh_album);
- }
- $maj_album = count($maj_items_album);
- echo " | <a href=\"index.php?entry=$maj_d&show=album\" class=\"status\">";
- if ($maj_album == 1) {
- echo "$maj_album image";
- }
- elseif ($maj_album < 1) {
- echo "album";
- }
- else {
- echo "$maj_album images";
- }
- echo "</a>";
- unset($maj_items_album);
- }
- if (file_exists("images/$maj_d/album") and isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album)) {
- if (!file_exists("$maj_data_directory/items/$maj_d/album")) {
- mkdir("$maj_data_directory/items/$maj_d/album");
- }
- if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- $maj_album_views_value = file_get_contents("$maj_data_directory/items/$maj_d/album/views.txt");
- $maj_album_views_value = $maj_album_views_value + 1;
- }
- }
- $maj_album_views_value = file_get_contents("$maj_data_directory/items/$maj_d/album/views.txt");
- if ($maj_album_views_value == 1) {
- echo " ($maj_album_views_value view) ";
- }
- elseif ($maj_album_views_value > 1) {
- echo " ($maj_album_views_value views) ";
- }
- else {
- echo " ";
- }
- if (file_exists("media/$maj_d/videos")) {
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == videos)) {
- if (!file_exists("$maj_data_directory/items/$maj_d/media")) {
- mkdir("$maj_data_directory/items/$maj_d/media");
- }
- if (!file_exists("$maj_data_directory/items/$maj_d/media/videos")) {
- mkdir("$maj_data_directory/items/$maj_d/media/videos");
- }
- if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- if (!file_exists("$maj_data_directory/items/$maj_d/media/videos/views.txt")) {
- $maj_videos_views_value = 0;
- }
- else {
- $maj_videos_views_value = file_get_contents("$maj_data_directory/items/$maj_d/media/videos/views.txt");
- }
- $maj_videos_views_value = $maj_videos_views_value + 1;
- }
- }
- // remove the code below once a suitable clean-up procedure is created in the video uploader
- $maj_videos = glob("media/$maj_d/videos/*");
- foreach ($maj_videos as $maj_video) {
- if (!preg_match("/\.mp4$/i",$maj_video) and !preg_match("/\.ogv$/i",$maj_video) and !preg_match("/\.webm$/i",$maj_video)) {
- unlink("$maj_video");
- }
- unset($maj_video);
- }
- unset($maj_videos);
- // remove the code above once a suitable clean-up procedure is created in the video uploader
- $maj_videos = glob("media/$maj_d/videos/*");
- $maj_videos = preg_replace("/\.mp4$/i","",$maj_videos);
- $maj_videos = preg_replace("/\.ogv$/i","",$maj_videos);
- $maj_videos = preg_replace("/\.webm$/i","",$maj_videos);
- $maj_videos = array_unique($maj_videos);
- sort($maj_videos);
- $maj_videos_count = count($maj_videos);
- if ($maj_videos_count > 0) {
- echo " | <a href=\"index.php?entry=$maj_d&show=videos\" class=\"status\">$maj_videos_count ";
- if ($maj_videos_count == 1) {
- echo "video";
- }
- else {
- echo "videos";
- }
- echo "</a>";
- if (file_exists("$maj_data_directory/items/$maj_d/media/videos/views.txt")) {
- $maj_videos_views = file_get_contents("$maj_data_directory/items/$maj_d/media/videos/views.txt");
- if ($maj_videos_views > 0) {
- echo " ($maj_videos_views ";
- if ($maj_videos_views == 1) {
- echo "view";
- }
- else {
- echo "views";
- }
- echo ")";
- }
- }
- }
- }
- if (!file_exists("$maj_data_directory/items/$maj_d/filedrop/files")) {
- echo " ";
- }
- else {
- if ($maj_dh_filedrop = opendir("$maj_data_directory/items/$maj_d/filedrop/files")) {
- while (($maj_dl_file = readdir($maj_dh_filedrop)) !== false) {
- if ($maj_dl_file != "." && $maj_dl_file != "..") {
- $maj_items_filedrop[] = $maj_dl_file;
- }
- }
- closedir($maj_dh_filedrop);
- }
- $maj_filedrop = count($maj_items_filedrop);
- echo " | <a href=\"index.php?entry=$maj_d&show=filedrop\" class=\"status\">";
- if ($maj_filedrop == 1) {
- echo "$maj_filedrop file";
- }
- elseif ($maj_filedrop < 1) {
- echo "filedrop";
- }
- else {
- echo "$maj_filedrop files";
- }
- echo "</a> ";
- unset($maj_items_filedrop);
- }
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == filedrop)) {
- if (!file_exists("$maj_data_directory/items/$maj_d/filedrop")) {
- mkdir("$maj_data_directory/items/$maj_d/filedrop");
- }
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/files") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- $maj_filedrop_views_value = file_get_contents("$maj_data_directory/items/$maj_d/filedrop/views.txt");
- $maj_filedrop_views_value = $maj_filedrop_views_value + 1;
- }
- }
- $maj_filedrop_views_value = file_get_contents("$maj_data_directory/items/$maj_d/filedrop/views.txt");
- if ($maj_filedrop_views_value == 1) {
- echo " ($maj_filedrop_views_value view) ";
- }
- elseif ($maj_filedrop_views_value > 1) {
- echo " ($maj_filedrop_views_value views) ";
- }
- else {
- echo " ";
- }
- if (!file_exists("$maj_data_directory/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("$maj_data_directory/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("$maj_data_directory/items/$maj_d/ucomment.txt")) {
- echo "| <a href=\"index.php?entry=$maj_d\" class=\"status\">permalink</a>";
- }
- echo "\r\n\t\t\t</div>\r\n\t\t</div>\r\n\r\n";
- maj_panels($maj_entry_panels);
- if (file_exists("images/$maj_d/album") and (file_exists("$maj_data_directory/items/$maj_d/auto-album.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == album)))) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- echo '<div class="panel_wrapper"><div class="panel_title">Album';
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo '<a href=del.php?entry=';
- echo $maj_d;
- echo '&target=album><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete album"></a>';
- }
- echo '</div><div class=panel_body>';
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=album>here</a> to enter it.";
- }
- else {
- if (file_exists("images/$maj_d/thumbnails")) {
- if ($maj_dh_album = opendir("images/$maj_d/thumbnails")) {
- while (($maj_thumbnail_album = readdir($maj_dh_album)) !== false) {
- if ($maj_thumbnail_album != "." && $maj_thumbnail_album != "..") {
- $maj_current_thumbnail = "images/$maj_d/thumbnails/$maj_thumbnail_album";
- $maj_parent_image = str_replace("-thumbnail.jpg","",$maj_thumbnail_album);
- $maj_parent_image = "images/$maj_d/album/$maj_parent_image";
- if (file_exists($maj_current_thumbnail) and !file_exists($maj_parent_image)) {
- unlink($maj_current_thumbnail);
- }
- }
- }
- }
- }
- if (file_exists("$maj_data_directory/items/$maj_d/album/captions")) {
- if ($maj_dh_album = opendir("$maj_data_directory/items/$maj_d/album/captions")) {
- while (($maj_caption_album = readdir($maj_dh_album)) !== false) {
- if ($maj_caption_album != "." && $maj_caption_album != "..") {
- $maj_current_caption = "$maj_data_directory/items/$maj_d/album/captions/$maj_caption_album";
- $maj_parent_image = str_replace(".txt","",$maj_caption_album);
- $maj_parent_image = "images/$maj_d/album/$maj_parent_image";
- if (file_exists($maj_current_caption) and !file_exists($maj_parent_image)) {
- unlink($maj_current_caption);
- }
- }
- }
- }
- }
- if (file_exists("images/$maj_d/album")) {
- if ($maj_dh_album = opendir("images/$maj_d/album")) {
- while (($maj_entry_album = readdir($maj_dh_album)) !== false) {
- if ($maj_entry_album != "." && $maj_entry_album != "..") {
- $maj_sort_album[] = $maj_entry_album;
- }
- }
- closedir($maj_dh_album);
- }
- sort($maj_sort_album);
- $maj_count_album_entry = count($maj_sort_album);
- if ($maj_count_album_entry < 1) {
- rmdirr("images/$maj_d/album");
- rmdirr("images/$maj_d/thumbnails");
- }
- else {
- foreach($maj_sort_album as $maj_album_entry) {
- $maj_current_image = "images/$maj_d/album/$maj_album_entry";
- $maj_current_image_size = getimagesize($maj_current_image);
- $maj_current_width = $maj_current_image_size[0];
- $maj_current_height = $maj_current_image_size[1];
- $maj_max_width = 95;
- $maj_max_height = 71;
- if (($maj_current_width > $maj_max_width) || ($maj_current_height > $maj_max_height)) {
- if ($maj_current_height > $maj_current_width) {
- $maj_sizefactor = (double) ($maj_max_height / $maj_current_height);
- }
- else {
- $maj_sizefactor = (double) ($maj_max_width / $maj_current_width) ;
- }
- $maj_new_width = (int) ($maj_current_width * $maj_sizefactor);
- $maj_new_height = (int) ($maj_current_height * $maj_sizefactor);
- }
- else {
- $maj_new_width = $maj_current_width;
- $maj_new_height = $maj_current_height;
- }
- if (!file_exists("images/$maj_d/thumbnails/{$maj_album_entry}-thumbnail.jpg")) {
- $maj_work_thumb = imagecreatetruecolor($maj_new_width,$maj_new_height);
- $maj_get_mimetype = image_type_to_mime_type(exif_imagetype($maj_current_image));
- switch($maj_get_mimetype) {
- case "image/jpg":
- case "image/jpeg":
- $maj_work_image = imagecreatefromjpeg($maj_current_image);
- break;
- case "image/gif":
- $maj_work_image = imagecreatefromgif($maj_current_image);
- break;
- case "image/png":
- $maj_work_image = imagecreatefrompng($maj_current_image);
- break;
- }
- imagecopyresampled($maj_work_thumb,$maj_work_image,0,0,0,0,$maj_new_width,$maj_new_height,$maj_current_width,$maj_current_height);
- if (!file_exists("images/$maj_d/thumbnails")) {
- mkdir("images/$maj_d/thumbnails");
- }
- imagejpeg($maj_work_thumb,"images/$maj_d/thumbnails/{$maj_album_entry}-thumbnail.jpg",$maj_aimage);
- imagedestroy($maj_work_thumb);
- imagedestroy($maj_work_image);
- }
- echo "<a href=\"album.php?entry=$maj_d&show=$maj_album_entry\">";
- if (!file_exists("images/$maj_d/thumbnails/{$maj_album_entry}-thumbnail.jpg")) {
- echo "<img src=\"images/$maj_d/album/$maj_album_entry\" width=$maj_new_width height=$maj_new_height border=0 hspace=2 vspace=2";
- }
- else {
- echo "<img src=\"images/$maj_d/thumbnails/{$maj_album_entry}-thumbnail.jpg\" width=$maj_new_width height=$maj_new_height border=0 hspace=2 vspace=2";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/album/captions/{$maj_album_entry}.txt")) {
- echo ' alt="';
- $maj_img_alt = file_get_contents("$maj_data_directory/items/$maj_d/album/captions/{$maj_album_entry}.txt");
- $maj_img_alt = strip_tags($maj_img_alt);
- echo $maj_img_alt;
- echo '"';
- }
- echo "></a>";
- }
- unset($maj_sort_album);
- }
- }
- }
- echo '</div></div>';
- echo '</td></tr></table>';
- }
- if (file_exists("media/$maj_d/videos") and (file_exists("$maj_data_directory/items/$maj_d/auto-videos.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == videos)))) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- echo '<div class="panel_wrapper"><div class="panel_title">Videos</div>';
- echo '<div class="panel_body">';
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=videos>here</a> to enter it.";
- }
- else {
- foreach ($maj_videos as $maj_video) {
- $maj_video_show = basename($maj_video);
- echo "<a href=\"video.php?entry=$maj_d&show=$maj_video_show\">";
- echo "<video width=\"95\" height=\"71\" preload=\"meta\" style=\"margin: 2px;\">";
- if (file_exists("$maj_video.mp4")) {
- echo "<source src=\"$maj_video.mp4\" type=\"video/mp4\">";
- }
- if (file_exists("$maj_video.ogv")) {
- echo "<source src=\"$maj_video.ogv\" type=\"video/ogg\">";
- }
- if (file_exists("$maj_video.webm")) {
- echo "<source src=\"$maj_video.webm\" type=\"video/webm\">";
- }
- echo "</video>";
- echo "</a>";
- unset($maj_video);
- }
- }
- echo "</div></div></td></tr></table>";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop") and (file_exists("$maj_data_directory/items/$maj_d/auto-filedrop.txt") or (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == filedrop)))) {
- $maj_filedrop_files = glob("$maj_data_directory/items/$maj_d/filedrop/files/*",GLOB_NOSORT);
- if (count($maj_filedrop_files) > 0) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- echo "<div class=\"panel_wrapper\"><div class=\"panel_title\">Filedrop";
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo "<a href=del.php?entry=$maj_d&target=filedrop><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=\"delete filedrop\"></a>";
- }
- echo "</div><div class=panel_body>";
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=filedrop>here</a> to enter it.";
- }
- else {
- if ($maj_dh_count = opendir("$maj_data_directory/items/$maj_d/filedrop/count")) {
- while (($maj_dl_count = readdir($maj_dh_count)) !== false) {
- if ($maj_dl_count != "." && $maj_dl_count != "..") {
- $maj_dl_match = mb_substr("$maj_dl_count",0,-4);
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/count/$maj_dl_count") and !file_exists("$maj_data_directory/items/$maj_d/filedrop/files/$maj_dl_match")) {
- unlink("$maj_data_directory/items/$maj_d/filedrop/count/$maj_dl_count");
- }
- }
- }
- closedir($maj_dh_count);
- }
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/sort/new-on-top.txt")) {
- array_multisort(array_map("filemtime",$maj_filedrop_files),SORT_DESC,$maj_filedrop_files);
- }
- elseif (file_exists("$maj_data_directory/items/$maj_d/filedrop/sort/old-on-top.txt")) {
- array_multisort(array_map("filemtime",$maj_filedrop_files),SORT_ASC,$maj_filedrop_files);
- }
- else {
- sort($maj_filedrop_files);
- }
- foreach ($maj_filedrop_files as $maj_filedrop_file) {
- if (is_dir($maj_filedrop_file)) {
- continue;
- }
- $maj_filedrop_file = basename($maj_filedrop_file);
- echo "<table border=0 cellspacing=0 cellpadding=4><tr><td>";
- echo "<a href=\"index.php?entry=$maj_d&download=$maj_filedrop_file&type=filedrop\">";
- echo "<img src=images/filedrop.png width=36 height=36 border=0 alt=\"download file\"></a></td>";
- echo "<td><b>$maj_filedrop_file</b>";
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/sha1.txt")) {
- $maj_sha1 = sha1_file("$maj_data_directory/items/$maj_d/filedrop/files/$maj_filedrop_file");
- echo "<br>$maj_sha1 (<a href=\"http://www.faqs.org/rfcs/rfc3174\" target=\"_maj\">sha1</a>)";
- }
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/md5.txt")) {
- $maj_md5 = md5_file("$maj_data_directory/items/$maj_d/filedrop/files/$maj_filedrop_file");
- echo "<br>$maj_md5 (<a href=\"http://www.faqs.org/rfcs/rfc1321\" target=\"_maj\">md5</a>)";
- }
- $maj_size = filesize("$maj_data_directory/items/$maj_d/filedrop/files/$maj_filedrop_file");
- echo "<br>$maj_size_string";
- if (file_exists("$maj_data_directory/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt")) {
- $maj_filedrop_count = file_get_contents("$maj_data_directory/items/$maj_d/filedrop/count/{$maj_filedrop_file}.txt");
- echo "<br>$maj_filedrop_count";
- if ($maj_filedrop_count == 1) {
- echo " download";
- }
- if ($maj_filedrop_count > 1) {
- echo " downloads";
- }
- }
- echo "</td></tr></table>";
- }
- }
- }
- echo "</div></div>";
- echo '</td></tr></table>';
- }
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("$maj_data_directory/items/$maj_req_entry/ucomment.txt") or !file_exists("$maj_data_directory/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("$maj_data_directory/memcomment.txt") and isset($maj_logged_in_username)))) {
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- }
- else {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- if ($maj_dh_comments = opendir("$maj_data_directory/items/$maj_d/comments/live")) {
- while (($maj_live_comment = readdir($maj_dh_comments)) !== false) {
- if ($maj_live_comment != "." && $maj_live_comment != "..") {
- $maj_show_comments[] = $maj_live_comment;
- }
- }
- closedir($maj_dh_comments);
- }
- asort($maj_show_comments);
- foreach ($maj_show_comments as $maj_comment) {
- echo "<a name=\"$maj_comment\"></a>";
- echo '<div class="panel_wrapper"><div class="panel_title">';
- if (file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/url.txt");
- echo '>';
- }
- readfile("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/firstname.txt");
- echo ' ';
- readfile("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/lastname.txt");
- if (file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/url.txt")) {
- echo '</a>';
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo ' <';
- readfile("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/email.txt");
- echo '>';
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
- echo '<a href=move.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.move.png width=11 height=11 border=0 align=right alt="move comment"></a>';
- echo '<a href=edit.php?entry=' . $maj_d . '&comment=' . $maj_comment . '&type=live><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
- }
- echo '</div><div class=panel_body><table border=0 cellspacing=0 cellpadding=0 width=100%><tr>';
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/author.txt")) {
- echo "<td width=\"$maj_ablock\" valign=\"top\">";
- $maj_c_author = file_get_contents("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/author.txt");
- maj_avatar_image($maj_c_author,$maj_aimage);
- if ($maj_c_dh_posts = opendir("$maj_data_directory/items")) {
- while (($maj_c_entry_posts = readdir($maj_c_dh_posts)) !== false) {
- if (file_exists("$maj_data_directory/items/$maj_c_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- if (file_exists("$maj_data_directory/items/$maj_c_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
- continue;
- }
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_entry_c_entry_posts/categories")) {
- if ($maj_dh_cat2_c_entry_posts = opendir("$maj_data_directory/items/$maj_entry_c_entry_posts/categories")) {
- while (($maj_entry_cat2_c_entry_posts = readdir($maj_dh_cat2_c_entry_posts)) !== false) {
- if ($maj_entry_cat2_c_entry_posts != "." && $maj_entry_cat2_c_entry_posts != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_entry_cat2_c_entry_posts/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_cat2_c_entry_posts);
- }
- }
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_c_entry_posts/cat.txt")) {
- continue;
- }
- if ($maj_c_entry_posts != "." && $maj_c_entry_posts != "..") {
- if (file_exists("$maj_data_directory/members/active/$maj_c_author") and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_c_entry_posts/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_c_entry_posts/author.txt") == $maj_c_author)) {
- $maj_c_items_posts[] = $maj_c_entry_posts;
- }
- }
- elseif (!file_exists("$maj_data_directory/members/active/$maj_c_author") and ($maj_admin_username == $maj_c_author) and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_c_entry_posts/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_c_entry_posts/author.txt") == $maj_c_author)) {
- $maj_c_items_posts[] = $maj_c_entry_posts;
- }
- }
- }
- }
- closedir($maj_c_dh_posts);
- }
- $maj_c_posts = count($maj_c_items_posts);
- if ($maj_c_posts == 1) {
- echo "$maj_c_posts post";
- }
- if ($maj_c_posts > 1) {
- echo "$maj_c_posts posts";
- }
- unset($maj_c_items_posts);
- echo "</td>";
- }
- echo "<td valign=top>";
- echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/author.txt") and (file_exists("$maj_data_directory/bb.txt") and !file_exists("$maj_data_directory/avatar.txt")) or (file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/avatar.txt"))))) {
- $maj_cxavatar_author = file_get_contents("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/author.txt");
- echo "<a href=\"member.php?id=$maj_cxavatar_author\" style=\"font-size: $maj_font_Spx;\">$maj_cxavatar_author</a> - ";
- }
- entry2date($maj_comment);
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if (file_exists("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/revisions.txt")) {
- echo ' (Revision ';
- readfile("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/revisions.txt");
- echo ')';
- }
- }
- echo "</font><div style=\"height: 10px;\"></div>";
- $maj_entry_comment = file_get_contents("$maj_data_directory/items/$maj_d/comments/live/$maj_comment/comment.txt");
- if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
- $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("$maj_data_directory/pf-censor.txt")) {
- $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
- }
- else {
- $maj_censor = "[expletive]";
- }
- $maj_entry_comment = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_entry_comment);
- }
- echo $maj_entry_comment;
- echo '</tr></table></div></div>';
- }
- unset($maj_show_comments);
- echo '</td></tr></table>';
- if (isset($maj_logged_in_username)) {
- if (($maj_logged_in_username == $maj_admin_username) and file_exists("$maj_data_directory/comments/unread/$maj_d")) {
- rmdirr("$maj_data_directory/comments/unread/$maj_d");
- if (count(glob("$maj_data_directory/comments/unread/*")) < 1) {
- rmdirr("$maj_data_directory/comments/unread");
- }
- }
- else {
- if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$maj_d")) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/$maj_d");
- if (count(glob("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread/*")) < 1) {
- rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/comments/unread");
- }
- }
- }
- }
- }
- echo "<a name=\"end\"></a>";
- if (!file_exists("$maj_data_directory/nocomment.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) or (file_exists("$maj_data_directory/memcomment.txt") and isset($maj_logged_in_username)) or file_exists("$maj_data_directory/items/$maj_d/ucomment.txt")) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- if (!isset($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username"))) {
- if (isset($maj_req_show) and !empty($maj_req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == sha1($_POST['captcha_put'])) and (mb_ereg("@",$_POST['email'])) and (mb_ereg("\.",$_POST['email']))) {
- echo "<font style=\"font-size: $maj_font_Lpx;\"><b>Thanks!</b></font><p>Your comment has been submitted for approval. Please check back soon to see if it has been posted.</p>";
- }
- }
- echo "<font style=\"font-size: $maj_font_Lpx;\"><b>Add Comment</b></font>";
- if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
- echo "<p>This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$maj_d&show=comments>here</a> to enter it.</p>";
- }
- else {
- $maj_captcha_rand = str_rand(7);
- $maj_captcha_show = sha1($maj_captcha_rand);
- echo "<p>Fill out the form below";
- if (!isset($maj_logged_in_username)) {
- echo " and enter <b>$maj_captcha_rand</b> in the CAPTCHA field";
- }
- echo " to add your comment.";
- if ((!isset($maj_logged_in_username) and !file_exists("$maj_data_directory/xscreen.txt")) or (!file_exists("$maj_data_directory/xscreen.txt") and isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username))) {
- echo " Please wait for your comment to be approved and posted.";
- if (!isset($maj_logged_in_username) or (isset($maj_logged_in_username) and !file_exists("$maj_data_directory/members/active/$maj_logged_in_username"))) {
- echo " Comments with bogus contact information or spam will be discarded.";
- }
- }
- echo "</p>";
- ?>
- <table border=0 cellspacing=2 cellpadding=0>
- <form enctype="multipart/form-data" action="index.php?entry=<?php echo $maj_d; ?>&show=comments" method="post">
- <input type=hidden name=captcha_get value="<?php echo $maj_captcha_show; ?>">
- <tr>
- <?php
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- $maj_logged_in_author = explode(" ",file_get_contents("$maj_data_directory/author.txt"));
- $maj_logged_in_author_words = count($maj_logged_in_author);
- $maj_logged_in_author_last = $maj_logged_in_author_words - 1;
- if ($maj_logged_in_author_words == 2) {
- $maj_logged_in_author_fname = str_replace(",","",$maj_logged_in_author[0]);
- $maj_logged_in_author_lname = str_replace(",","",$maj_logged_in_author[1]);
- }
- if ($maj_logged_in_author_words > 2) {
- $maj_logged_in_author_mkfname = 0;
- while ($maj_logged_in_author_mkfname < $maj_logged_in_author_last) {
- $maj_logged_in_author_fname .= $maj_logged_in_author[$maj_logged_in_author_mkfname] . " ";
- $maj_logged_in_author_mkfname = $maj_logged_in_author_mkfname + 1;
- }
- $maj_logged_in_author_lname = $maj_logged_in_author[$maj_logged_in_author_last];
- }
- ?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>">
- <input type="hidden" name="firstname" value="<?php echo $maj_logged_in_author_fname; ?>"></td>
- <?php
- }
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- ?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $maj_logged_in_username; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("$maj_data_directory/members/active/$maj_logged_in_username/firstname.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <td width=75><nobr>First Name*</nobr></td><td width=300><input required class=input type=text autocomplete=off name=firstname maxlength=30></td>
- <?php
- }
- ?>
- <td rowspan=7 valign=top width=75 align=right>
- <table border=0 cellspacing=1 cellpadding=2>
- <tr><td><img src="images/smileys/crying.png" border="0"></td><td>:((</td><td >crying</td></tr>
- <tr><td><img src="images/smileys/frown.png" border="0"></td><td>:(</td><td>frown</td></tr>
- <tr><td><img src="images/smileys/indifferent.png" border="0"></td><td>:|</td><td>indifferent</td></tr>
- <tr><td><img src="images/smileys/laughing.png" border="0"></td><td>:D</td><td>laughing</td></tr>
- <tr><td><img src="images/smileys/lick.png" border="0"></td><td>:P</td><td>lick</td></tr>
- <tr><td><img src="images/smileys/ohno.png" border="0"></td><td>:O</td><td>oh no!</td></tr>
- <tr><td><img src="images/smileys/smile.png" border="0"></td><td>:)</td><td>smile</td></tr>
- <tr><td><img src="images/smileys/surprised.png" border="0"></td><td>=)</td><td>surprised</td></tr>
- <tr><td><img src="images/smileys/undecided.png" border="0"></td><td>:\</td><td>undecided</td></tr>
- <tr><td><img src="images/smileys/wink.png" border="0"></td><td>;)</td><td>wink</td></tr>
- </td></tr>
- </table>
- <?php
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- ?>
- <td width=75></td><td><input type=hidden name=lastname value="<?php echo $maj_logged_in_author_lname; ?>"></td>
- <?php
- }
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- ?>
- <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("$maj_data_directory/members/active/$maj_logged_in_username/lastname.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td><nobr>Last Name*</nobr></td><td><input required class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
- <?php
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if (file_exists("$maj_data_directory/email.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("$maj_data_directory/email.txt"); ?>"></td>
- <?php
- }
- else {
- echo "<tr><td><nobr>E-mail*</nobr></td><td colspan=2><input class=input type=email autocomplete=off name=email maxlength=60></td></tr>";
- }
- }
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("$maj_data_directory/members/active/$maj_logged_in_username/email.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td><nobr>E-mail*</nobr></td><td colspan=2><input required class=input type=email autocomplete=off name=email maxlength=60></td></tr>
- <?php
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("$maj_data_directory/url.txt"); ?>"></td>
- <?php
- }
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/url.txt")) { echo file_get_contents("$maj_data_directory/members/active/$maj_logged_in_username/url.txt"); } ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td><nobr>Website</nobr></td><td colspan=2><input class=input type=url autocomplete=off name=url maxlength=300></td></tr>
- <?php
- }
- ?>
- <tr><td><nobr>Comment*</nobr></td><td><textarea required class=input name=new_comment rows=15></textarea></td></tr>
- <?php
- if (isset($maj_logged_in_username)) {
- echo "<input type=hidden name=captcha_put value=\"$maj_captcha_rand\">";
- }
- else {
- echo "<tr><td><nobr>CAPTCHA*</nobr></td><td><input required class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
- }
- ?>
- <tr><td></td><td><input class="click" type="submit" value="click here to submit your comment"></td></tr>
- </form>
- </table>
- <?php
- }
- ?>
- <?php
- }
- }
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and isset($maj_req_entry) and !empty($maj_req_entry)) {
- if ($maj_dh_pending_comments = opendir("$maj_data_directory/items/$maj_d/comments/pending")) {
- while (($maj_entry_pending_comments = readdir($maj_dh_pending_comments)) !== false) {
- if ($maj_entry_pending_comments != "." && $maj_entry_pending_comments != "..") {
- $maj_show_pending_comments[] = $maj_entry_pending_comments;
- }
- }
- closedir($maj_dh_pending_comments);
- }
- asort($maj_show_pending_comments);
- $maj_count_pending_comments = count($maj_show_pending_comments);
- if ($maj_count_pending_comments > 0) {
- echo '<a name="pending"></a>';
- if ($maj_count_pending_comments == 1) {
- echo '<p><b>Pending Comment</b></p>';
- }
- else {
- echo '<p><b>Pending Comments</b></p>';
- }
- foreach ($maj_show_pending_comments as $maj_pending_comment) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wentry\"><tr><td>";
- echo '<div class="panel_wrapper"><div class="panel_title">';
- if (file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/url.txt");
- echo '>';
- }
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/firstname.txt");
- echo ' ';
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/lastname.txt");
- if (file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/url.txt")) {
- echo '</a>';
- }
- echo ' <';
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/email.txt");
- echo '>';
- echo '<a href=del.php?entry=' . $maj_d . '&comment=' . $maj_pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
- $maj_pending_comment_login_key = file_get_contents("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/key.txt");
- echo "<a href=\"index.php?entry=$maj_d&comment=$maj_pending_comment&key=$maj_pending_comment_login_key&action=approve\"><img src=\"images/widget.cat.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"post comment\"></a>";
- echo "<a href=\"move.php?entry=$maj_d&comment=$maj_pending_comment&type=pending\"><img src=\"images/widget.move.png\" width=\"11\" height=\"11\" border=\"0\" align=\"right\" alt=\"move comment\"></a>";
- echo '<a href=edit.php?entry=' . $maj_d . '&comment=' . $maj_pending_comment . '&type=pending><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
- echo '</div><div class=panel_body><table border=0 cellspacing=0 cellpadding=0 width=100%><tr>';
- if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/author.txt")) {
- echo "<td width=\"$maj_ablock\" valign=\"top\">";
- $maj_pc_author = file_get_contents("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
- maj_avatar_image($maj_pc_author,$maj_aimage);
- if ($maj_pc_dh_posts = opendir("$maj_data_directory/items")) {
- while (($maj_pc_entry_posts = readdir($maj_pc_dh_posts)) !== false) {
- if (file_exists("$maj_data_directory/items/$maj_pc_entry_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- if (file_exists("$maj_data_directory/items/$maj_pc_entry_posts/member.txt") and (!isset($maj_logged_in_username))) {
- continue;
- }
- $maj_private_categories = "0";
- if (file_exists("$maj_data_directory/items/$maj_entry_pc_entry_posts/categories")) {
- if ($maj_dh_cat2_pc_entry_posts = opendir("$maj_data_directory/items/$maj_entry_pc_entry_posts/categories")) {
- while (($maj_entry_cat2_pc_entry_posts = readdir($maj_dh_cat2_pc_entry_posts)) !== false) {
- if ($maj_entry_cat2_pc_entry_posts != "." && $maj_entry_cat2_pc_entry_posts != "..") {
- if (file_exists("$maj_data_directory/categories/$maj_entry_cat2_pc_entry_posts/private.txt")) {
- $maj_private_categories = $maj_private_categories + 1;
- }
- }
- }
- closedir($maj_dh_cat2_pc_entry_posts);
- }
- }
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_pc_entry_posts/cat.txt")) {
- continue;
- }
- if ($maj_pc_entry_posts != "." && $maj_pc_entry_posts != "..") {
- if (file_exists("$maj_data_directory/members/active/$maj_pc_author") and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_pc_entry_posts/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_pc_entry_posts/author.txt") == $maj_pc_author)) {
- $maj_pc_items_posts[] = $maj_pc_entry_posts;
- }
- }
- elseif (!file_exists("$maj_data_directory/members/active/$maj_pc_author") and ($maj_admin_username == $maj_pc_author) and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("$maj_data_directory/items/$maj_pc_entry_posts/author.txt") and (file_get_contents("$maj_data_directory/items/$maj_pc_entry_posts/author.txt") == $maj_pc_author)) {
- $maj_pc_items_posts[] = $maj_pc_entry_posts;
- }
- }
- }
- }
- closedir($maj_pc_dh_posts);
- }
- $maj_pc_posts = count($maj_pc_items_posts);
- if ($maj_pc_posts == 1) {
- echo "$maj_pc_posts post";
- }
- if ($maj_pc_posts > 1) {
- echo "$maj_pc_posts posts";
- }
- unset($maj_pc_items_posts);
- echo "</td>";
- }
- echo "<td valign=\"top\">";
- echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
- if ((file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (file_exists("$maj_data_directory/bb.txt") and !file_exists("$maj_data_directory/avatar.txt")) or (file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/author.txt") and (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/avatar.txt"))))) {
- $maj_pxavatar_author = file_get_contents("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
- echo "<a href=\"member.php?id=$maj_pxavatar_author\" style=\"font-size: $maj_font_Spx;\">$maj_pxavatar_author</a> - ";
- }
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/timestamp.txt");
- if (file_exists("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/revisions.txt")) {
- echo ' (Revision ';
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/revisions.txt");
- echo ')';
- }
- echo "</font><div style=\"height: 10px;\"></div>";
- readfile("$maj_data_directory/items/$maj_d/comments/pending/$maj_pending_comment/comment.txt");
- echo '</tr></table></div></div>';
- unset($maj_show_pending_comments);
- echo '</td></tr></table>';
- }
- }
- }
- }
- maj_panels($maj_bottom_panels);
- ?>
- <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
- <?php
- if (($maj_start >= $maj_increase) and ($maj_start != 0)) {
- echo "<td align=left><a href=\"index.php?";
- if (isset($maj_req_category) and !empty($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category")) {
- echo "category=$maj_req_category";
- }
- if (isset($maj_req_archive) and !empty($maj_req_archive)) {
- echo "archive=$maj_req_archive";
- }
- if (isset($maj_req_author) and !empty($maj_req_author) and file_exists("$maj_data_directory/members/active/$maj_req_author") and file_exists("$maj_data_directory/bb.txt")) {
- echo "author=$maj_req_author";
- }
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("$maj_data_directory/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("$maj_data_directory/bb.txt")) {
- echo "author=$maj_req_author";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "private")) {
- echo "find=private";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "member")) {
- echo "find=member";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "unfiled")) {
- echo "find=unfiled";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "passwd")) {
- echo "find=passwd";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "comments")) {
- echo "find=comments";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "album")) {
- echo "find=album";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "filedrop")) {
- echo "find=filedrop";
- }
- echo "&start=" . ($maj_start-$maj_increase) . "\">previous</a></td>";
- }
- if ($maj_end < sizeof($maj_items)) {
- echo "<td align=right><a href=\"index.php?";
- if (isset($maj_req_category) and !empty($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category")) {
- echo "category=$maj_req_category";
- }
- if (isset($maj_req_archive) and !empty($maj_req_archive)) {
- echo "archive=$maj_req_archive";
- }
- if (isset($maj_req_author) and !empty($maj_req_author) and file_exists("$maj_data_directory/members/active/$maj_req_author") and file_exists("$maj_data_directory/bb.txt")) {
- echo "author=$maj_req_author";
- }
- if (isset($maj_req_author) and !empty($maj_req_author) and !file_exists("$maj_data_directory/members/active/$maj_req_author") and ($maj_admin_username == $maj_req_author) and file_exists("$maj_data_directory/bb.txt")) {
- echo "author=$maj_req_author";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "private")) {
- echo "find=private";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "member")) {
- echo "find=member";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "unfiled")) {
- echo "find=unfiled";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "passwd")) {
- echo "find=passwd";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "comments")) {
- echo "find=comments";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "album")) {
- echo "find=album";
- }
- if (isset($maj_req_find) and !empty($maj_req_find) and ($maj_req_find == "filedrop")) {
- echo "find=filedrop";
- }
- echo "&start=" . ($maj_start+$maj_increase) . "\">next</a></td>";
- }
- echo "</tr></table></td>";
- // right side
- if (!file_exists("$maj_data_directory/panels-l.txt")) {
- echo "<td width=\"$maj_wpanel\" valign=\"top\">";
- if (file_exists("$maj_data_directory/panels-r.txt")) {
- maj_profile();
- maj_navigation();
- maj_quick_links();
- }
- maj_pending_comments();
- maj_unread_comments();
- maj_pending_members();
- maj_bb_stats();
- maj_search();
- maj_find();
- maj_categories();
- maj_statistics();
- maj_recent();
- maj_albums();
- maj_random();
- maj_archives();
- if (file_exists("$maj_data_directory/panels-r.txt")) {
- maj_panels($maj_left_panels);
- }
- maj_panels($maj_right_panels);
- maj_badges();
- echo "</td>";
- }
- echo "</tr>";
- if (file_exists("$maj_data_directory/panels-l.txt") or file_exists("$maj_data_directory/panels-r.txt")) {
- echo "<tr><td colspan=\"5\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
- }
- else {
- echo "<tr><td colspan=\"7\" height=\"$maj_wspace\"><div style=\"height: {$maj_wspace}px;\"></div></td></tr>";
- }
- echo "</table>";
- if (file_exists("$maj_data_directory/footer.txt")) {
- $maj_footer_panel = file_get_contents("$maj_data_directory/footer.txt");
- if (file_exists("$maj_data_directory/panels/$maj_footer_panel") and (!file_exists("$maj_data_directory/panels/$maj_footer_panel/private.txt") or isset($maj_logged_in_username))) {
- include("$maj_data_directory/panels/$maj_footer_panel/panel.php");
- }
- }
- if (file_exists("$maj_data_directory/center.txt")) {
- echo "</center>";
- }
- ?>