This blob has been accessed 500 times via Git panel.
- <?php
- ini_set("session.use_trans_sid","0");
- session_start();
- header("Cache-control: private");
- error_reporting(E_ERROR);
- if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
- }
- if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)) {
- foreach ($data as $key => $value) {
- $data[$key] = stripslashes_array($value);
- }
- return $data;
- }
- else {
- return stripslashes($data);
- }
- }
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $req_entry = trim($_REQUEST['entry']);
- }
- if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
- $req_show = trim($_REQUEST['show']);
- }
- if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
- $req_find = trim($_REQUEST['find']);
- $req_find = str_replace(" ","-",$req_find);
- $req_find = strtolower($req_find);
- $req_find = strip_tags($req_find);
- }
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $req_category = trim($_REQUEST['category']);
- $req_category = str_replace(" ","-",$req_category);
- $req_category = strtolower($req_category);
- $req_category = strip_tags($req_category);
- }
- if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
- $req_archive = trim($_REQUEST['archive']);
- }
- if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
- $req_author = trim($_REQUEST['author']);
- $req_author = str_replace(" ","-",$req_author);
- $req_author = strtolower($req_author);
- $req_author = strip_tags($req_author);
- }
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
- }
- else {
- $offset = 0;
- }
- if (file_exists("data/increase.txt")) {
- $increase = file_get_contents("data/increase.txt");
- }
- else {
- $increase = 5;
- }
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
- $wmain = "610";
- }
- else {
- $wmain = "525";
- }
- $wside = "175";
- $wspace = "10";
- $wtable = $wside + $wspace + $wmain + $wspace + $wside;
- $default_blog_title = "My Activity Journal";
- $default_username = "maj";
- $default_password = "php";
- $default_blog_profile = 'This cool site is powered by <a href="http://maj.sourceforge.net/" target="_maj">My Activity Journal</a>, a simple, <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://www.opensource.org/licenses/gpl-license.php" target="_maj">Open Source</a> blog written from scratch as a spare time family project by <a href="http://psylocke.org/" target="_maj">Psylocke</a>, <a href="http://gaffud.com/" target="_maj">Magie</a>, and <a href="http://engels.mortega.net/" target="_maj">Engels</a> Antonio.';
- $default_blog_author = "My Activity Journal";
- if (!file_exists("data")) {
- mkdir("data");
- }
- if (!file_exists("data/.htaccess")) {
- $htaccess = "Order deny,allow\nDeny from all";
- }
- if (!file_exists("data/title.txt")) {
- }
- if (!file_exists("data/username.txt")) {
- }
- if (!file_exists("data/password.txt")) {
- $default_password = sha1($default_password);
- $default_password = md5($default_password);
- $default_password = crypt($default_password,$default_password);
- }
- if (!file_exists("data/profile.php")) {
- }
- if (!file_exists("data/author.txt")) {
- }
- $default_title = file_get_contents("data/title.txt");
- $login_username = file_get_contents("data/username.txt");
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- if (file_exists("data/hits.txt")) {
- $global_hits_count = file_get_contents("data/hits.txt");
- }
- else {
- $global_hits_count = "0";
- }
- $global_hits_count = $global_hits_count + 1;
- }
- if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
- if (file_exists("data/google.txt")) {
- $google_hits_count = file_get_contents("data/google.txt");
- }
- else {
- $google_hits_count = "0";
- }
- $google_hits_count = $google_hits_count + 1;
- }
- function str_rand($length = 8,$seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $str = '';
- list($usec,$sec) = explode(' ',microtime());
- $seed = (float) $sec + ((float) $usec * 100000);
- mt_srand($seed);
- for ($i = 0; $length > $i; $i++) {
- $str .= $seeds{mt_rand(0,$seeds_count - 1)};
- }
- return $str;
- }
- function rmdirr($recurse_dirname) {
- if (!file_exists($recurse_dirname)) {
- return false;
- }
- if (is_file($recurse_dirname)) {
- return unlink($recurse_dirname);
- }
- $recurse_dir = dir($recurse_dirname);
- while (false !== $recurse_entry = $recurse_dir->read()) {
- if ($recurse_entry == '.' || $recurse_entry == '..') {
- continue;
- }
- rmdirr("$recurse_dirname/$recurse_entry");
- }
- $recurse_dir->close();
- return rmdir($recurse_dirname);
- }
- if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
- ini_set("zlib.output_compression","off");
- $dl_file = str_replace("../","",@$_REQUEST['download']);
- go_download($dl_file);
- die();
- }
- function go_download($dl_file) {
- $req_entry = trim($_REQUEST['entry']);
- if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pdf")) {
- $dl_path = "data/items/$req_entry/pdf/file";
- $count_path = "data/items/$req_entry/pdf/count";
- $count_file = "dl.txt";
- }
- if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "filedrop")) {
- $dl_path = "data/items/$req_entry/filedrop/files";
- $count_path = "data/items/$req_entry/filedrop/count";
- $count_file = "{$dl_file}.txt";
- }
- $dl_file_size = filesize("$dl_path/$dl_file");
- header("Cache-Control: ");
- header("Pragma: ");
- header("Content-type: application/octet-stream");
- header("Content-Disposition: attachment; filename=$dl_file");
- header("Content-length: $dl_file_size");
- echo $buf;
- }
- if ($bytes_sent == $dl_file_size) {
- if (!file_exists($count_path)) {
- mkdir($count_path);
- }
- $unique_downloads = "$count_path/$count_file";
- if (file_exists($unique_downloads)) {
- $count_unique_downloads = file_get_contents($unique_downloads);
- }
- else {
- $count_unique_downloads = "0";
- }
- $count_unique_downloads = $count_unique_downloads + 1;
- }
- }
- function entry2date($f_entry) {
- $f_entry_year = substr($f_entry,0,4);
- $f_entry_month = substr($f_entry,4,2);
- $f_entry_day = substr($f_entry,6,2);
- $f_entry_hour = substr($f_entry,8,2);
- $f_entry_min = substr($f_entry,10,2);
- $f_entry_sec = substr($f_entry,12,2);
- echo date("l, M j, Y, g:i A",mktime($f_entry_hour,$f_entry_min,$f_entry_sec,$f_entry_month,$f_entry_day,$f_entry_year));
- }
- if (isset($req_entry) and !empty($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'])) {
- $comment_dir = "data/items/$req_entry/comments/pending/{$_REQUEST['comment']}";
- $login_key = file_get_contents("$comment_dir/key.txt");
- if ($_REQUEST['key'] == $login_key) {
- if ($_REQUEST['action'] == "approve") {
- $live_dir = "data/items/$req_entry/comments/live/{$_REQUEST['comment']}";
- if (!file_exists("data/items/$req_entry/comments/live")) {
- mkdir("data/items/$req_entry/comments/live");
- }
- if (!file_exists("data/items/$req_entry/comments/live/{$_REQUEST['comment']}")) {
- mkdir("data/items/$req_entry/comments/live/{$_REQUEST['comment']}");
- }
- unlink("$live_dir/key.txt");
- // clean-up old latest comments dir
- if (file_exists("data/comments/latest")) {
- rmdirr("data/comments/latest");
- }
- // clean-up old latest comments dir
- if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
- if (!file_exists("data/comments/unread")) {
- mkdir("data/comments/unread");
- }
- if (!file_exists("data/comments/unread/$req_entry")) {
- mkdir("data/comments/unread/$req_entry");
- }
- if ($dh_unread_active_members = opendir("data/members/active")) {
- while (($unread_active_member = readdir($dh_unread_active_members)) !== false) {
- if ($unread_active_member != "." && $unread_active_member != "..") {
- if (!file_exists("data/members/active/$unread_active_member/comments")) {
- mkdir("data/members/active/$unread_active_member/comments");
- }
- if (!file_exists("data/members/active/$unread_active_member/comments/unread")) {
- mkdir("data/members/active/$unread_active_member/comments/unread");
- }
- if (!file_exists("data/members/active/$unread_active_member/comments/unread/$req_entry")) {
- mkdir("data/members/active/$unread_active_member/comments/unread/$req_entry");
- }
- }
- }
- closedir($dh_unread_active_members);
- }
- }
- $private_categories = "0";
- if (file_exists("data/items/$req_entry/categories")) {
- if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
- while (($entry_category = readdir($dh_entry_categories)) !== false) {
- if ($entry_category != "." && $entry_category != "..") {
- if (file_exists("data/categories/$entry_category/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_entry_categories);
- }
- }
- if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$req_entry/private.txt") and ($private_categories == "0")) {
- if (file_exists("data/ml-reply2.txt")) {
- $ml_reply2 = file_get_contents("data/ml-reply2.txt");
- }
- if (file_exists("data/ml-from.txt")) {
- $ml_from = $ml_reply2;
- }
- else {
- $ml_from = file_get_contents("$live_dir/email.txt");
- }
- $ml_from = str_replace(" at ","@",$ml_from);
- $ml_from_firstname = file_get_contents("$live_dir/firstname.txt");
- $ml_from_lastname = file_get_contents("$live_dir/lastname.txt");
- $ml_from = '"' . "$ml_from_firstname $ml_from_lastname" . '" <' . $ml_from . '>';
- $ml_subject = file_get_contents("data/items/$req_entry/title.txt");
- if (file_exists("data/ml-prepend.txt")) {
- $ml_prepend = file_get_contents("data/ml-prepend.txt");
- $ml_subject = str_replace($ml_prepend,"",$ml_subject);
- $ml_subject = $ml_prepend . " " . $ml_subject;
- }
- $ml_subject = str_replace("Re:","",$ml_subject);
- $ml_subject = "Re: " . $ml_subject;
- $ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $ml_body = file_get_contents("$live_dir/comment.txt");
- $ml_body = str_replace('<br />',"\n",$ml_body);
- $ml_body = str_replace('<img src="images/smileys/crying.png" border="0">',':((',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/frown.png" border="0">',':(',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/indifferent.png" border="0">',':|',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/laughing.png" border="0">',':D',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/lick.png" border="0">',':P',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/ohno.png" border="0">',':O',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/smile.png" border="0">',':)',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/surprised.png" border="0">','=)',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/undecided.png" border="0">',':\\',$ml_body);
- $ml_body = str_replace('<img src="images/smileys/wink.png" border="0">',';)',$ml_body);
- $ml_body = str_replace('&','&',$ml_body);
- $ml_body = str_replace('<','<',$ml_body);
- $ml_body = str_replace('>','>',$ml_body);
- $ml_body = str_replace('®','(R)',$ml_body);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $ml_body = preg_replace("/\b($badwords)\b/i",$censor,$ml_body);
- }
- if (file_exists("data/ml-header.txt")) {
- $ml_header = file_get_contents("data/ml-header.txt");
- $ml_body = $ml_header . "\n\n" . $ml_body;
- }
- $ml_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $ml_url = str_replace('//','/',$ml_url);
- $ml_url = "http://$ml_url/index.php?entry=$req_entry&show=comments";
- $ml_body = $ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $ml_url;
- if (file_exists("data/items/$req_entry/member.txt")) {
- $ml_body = $ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
- }
- if (file_exists("data/ml-footer.txt")) {
- $ml_footer = file_get_contents("data/ml-footer.txt");
- $ml_body = $ml_body . "\n\n" . $ml_footer;
- }
- if ($dh_ml_member = opendir("data/members/active")) {
- while (($ml_member = readdir($dh_ml_member)) !== false) {
- if ($ml_member != "." && $ml_member != "..") {
- if (file_exists("data/members/active/$ml_member/noml.txt")) {
- continue;
- }
- if (file_exists("data/members/active/$ml_member/vacation.txt")) {
- continue;
- }
- $ml_to_firstname = file_get_contents("data/members/active/$ml_member/firstname.txt");
- $ml_to_lastname = file_get_contents("data/members/active/$ml_member/lastname.txt");
- $ml_to = file_get_contents("data/members/active/$ml_member/email.txt");
- $ml_to = '"' . "$ml_to_firstname $ml_to_lastname" . '" <'. $ml_to . '>';
- if (file_exists("data/ml-reply2.txt")) {
- mail($ml_to,$ml_subject,$ml_body,
- "From: $ml_from\r\n" .
- "Reply-To: $ml_reply2\r\n" .
- "References: $req_entry\r\n" .
- "X-Mailer: $ml_mailer");
- }
- else {
- mail($ml_to,$ml_subject,$ml_body,
- "From: $ml_from\r\n" .
- "References: $req_entry\r\n" .
- "X-Mailer: $ml_mailer");
- }
- }
- }
- closedir($dh_ml_member);
- }
- }
- }
- if ($_REQUEST['action'] == "delete") {
- rmdirr($comment_dir);
- }
- $pending_comment_flag_dir = $req_entry;
- $comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$pending_comment_flag_dir/count.txt"));
- if ($comment_count_value <= 1) {
- rmdirr("data/comments/pending/$pending_comment_flag_dir");
- }
- else {
- $comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$pending_comment_flag_dir/count.txt"));
- $comment_count_value = $comment_count_value - 1;
- }
- header("Location: index.php?entry=$req_entry&show=comments");
- }
- }
- if (isset($req_entry) and !empty($req_entry)) {
- if (file_exists("data/items/$req_entry")) {
- $title = file_get_contents("data/items/$req_entry/title.txt");
- echo "<title>$title</title>";
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- if (file_exists("data/items/$req_entry/views.txt")) {
- $count_views = file_get_contents("data/items/$req_entry/views.txt");
- }
- else {
- $count_views = "0";
- }
- $count_views = $count_views + 1;
- }
- if (isset($req_show) and !empty($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'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- if (!file_exists("data/items/$req_entry/comments")) {
- mkdir("data/items/$req_entry/comments");
- }
- if (!file_exists("data/items/$req_entry/comments/pending")) {
- mkdir("data/items/$req_entry/comments/pending");
- }
- if (!file_exists("data/items/$req_entry/comments/live")) {
- mkdir("data/items/$req_entry/comments/live");
- }
- mkdir("data/items/$req_entry/comments/pending/$comment_entry_dir");
- $body_content = ucfirst($_POST['new_comment']);
- $body_content = htmlentities($body_content,ENT_NOQUOTES);
- $body_content = str_replace("\n",'<br />',$body_content);
- $body_content = trim($body_content);
- $body_content = str_replace(':((','<img src="images/smileys/crying.png" border="0">',$body_content);
- $body_content = str_replace(':(','<img src="images/smileys/frown.png" border="0">',$body_content);
- $body_content = str_replace(':|','<img src="images/smileys/indifferent.png" border="0">',$body_content);
- $body_content = str_replace(':D','<img src="images/smileys/laughing.png" border="0">',$body_content);
- $body_content = str_replace(':P','<img src="images/smileys/lick.png" border="0">',$body_content);
- $body_content = str_replace(':O','<img src="images/smileys/ohno.png" border="0">',$body_content);
- $body_content = str_replace(':)','<img src="images/smileys/smile.png" border="0">',$body_content);
- $body_content = str_replace('=)','<img src="images/smileys/surprised.png" border="0">',$body_content);
- $body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$body_content);
- $body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$body_content);
- $fp_timestamp_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/timestamp.txt","w");
- $fp_firstname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/firstname.txt","w");
- $firstname = strtolower($_POST['firstname']);
- $firstname = ucwords($firstname);
- $firstname = trim($firstname);
- $firstname = htmlentities($firstname,ENT_NOQUOTES);
- $fp_lastname_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/lastname.txt","w");
- $lastname = strtolower($_POST['lastname']);
- $lastname = ucwords($lastname);
- $lastname = trim($lastname);
- $lastname = htmlentities($lastname,ENT_NOQUOTES);
- $email = strtolower($_POST['email']);
- $email = trim($email);
- $email = htmlentities($email,ENT_NOQUOTES);
- if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.",$_POST['url']))) {
- $url = str_replace("http://","",$_POST['url']);
- $url = strtolower($url);
- $url = trim($url);
- $url = "http://" . $url;
- $url = htmlentities($url,ENT_NOQUOTES);
- }
- if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $fp_cauthor_txt = fopen("data/items/$req_entry/comments/pending/$comment_entry_dir/author.txt","w");
- }
- $key_rand = str_rand(14);
- $comment_quote = ucfirst($_POST['new_comment']);
- $sig_author_file = "data/author.txt";
- $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $sig_url = str_replace('//','/',$sig_url);
- $sig_url = "http://" . $sig_url;
- $email_to = strtolower($_POST['email']);
- $email_to = '"' . "$firstname $lastname" . '" <' . $email_to . '>';
- if (file_exists("data/email.txt")) {
- $from_email_author = file_get_contents("data/author.txt");
- $from_email = file_get_contents("data/email.txt");
- $from_email = '"' . $from_email_author . '" <' . $from_email . '>';
- }
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $commented_entry_title_file = "data/items/$req_entry/title.txt";
- if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
- $comment_thanks = "Hi $firstname,\n\nThanks for submitting the following comment last $timestamp:\n\n\"$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{$sig_url}index.php?entry=$req_entry&show=comments\n\nThanks again! =)\n\n--\n$sig_author\n$sig_url\n";
- $comment_thanks = wordwrap($comment_thanks);
- mail($email_to,"Thanks for sharing your thoughts!",$comment_thanks,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
- "X-Mailer: $mailer");
- }
- if (file_exists("data/email.txt") and !file_exists("data/xscreen.txt")) {
- $comment_notice = "The following comment was submitted by $email_to last $timestamp for the entry \"$commented_entry_title\":\n\n\"$comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$sig_url}index.php?entry=$req_entry&comment={$comment_entry_dir}&key={$key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
- $comment_notice = wordwrap($comment_notice);
- mail($from_email,"Pending Comment",$comment_notice,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
- "X-Mailer: $mailer");
- }
- if (!file_exists("data/comments")) {
- mkdir("data/comments");
- }
- if (!file_exists("data/comments/pending")) {
- mkdir("data/comments/pending");
- }
- $pending_comment_flag = $req_entry;
- if (!file_exists("data/comments/pending/$pending_comment_flag")) {
- mkdir("data/comments/pending/$pending_comment_flag");
- }
- if (file_exists("data/comments/pending/$pending_comment_flag/count.txt")) {
- $comment_count_value = file_get_contents("data/comments/pending/$pending_comment_flag/count.txt");
- }
- else {
- $comment_count_value = "0";
- }
- $comment_count_value = $comment_count_value + 1;
- }
- }
- }
- else {
- echo "<title>$default_title</title>";
- }
- if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
- if ($dh_xscreen_comments = opendir("data/comments/pending")) {
- while (($xscreen_comment = readdir($dh_xscreen_comments)) !== false) {
- if ($xscreen_comment != "." && $xscreen_comment != "..") {
- $xscreen_comments[] = $xscreen_comment;
- }
- }
- closedir($dh_xscreen_comments);
- }
- rsort($xscreen_comments);
- reset($xscreen_comments);
- if (count($xscreen_comments) > 0) {
- foreach ($xscreen_comments as $xscreen_dir) {
- if ($dh_xscreen_pending = opendir("data/items/$xscreen_dir/comments/pending")) {
- while (($xscreen_entry = readdir($dh_xscreen_pending)) !== false) {
- if ($xscreen_entry != "." && $xscreen_entry != "..") {
- $xscreen_key = file_get_contents("data/items/$xscreen_dir/comments/pending/$xscreen_entry/key.txt");
- header("Location: index.php?entry={$xscreen_dir}&comment={$xscreen_entry}&key={$xscreen_key}&action=approve");
- }
- }
- }
- }
- }
- }
- if (isset($req_entry) and !empty($req_entry) and file_exists("data/items/$req_entry")) {
- $private_categories = "0";
- if (file_exists("data/items/$req_entry/categories")) {
- if ($dh_entry_categories = opendir("data/items/$req_entry/categories")) {
- while (($entry_category = readdir($dh_entry_categories)) !== false) {
- if ($entry_category != "." && $entry_category != "..") {
- if (file_exists("data/categories/$entry_category/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_entry_categories);
- }
- }
- if ($private_categories == "0") {
- if (!file_exists("data/items/$req_entry/passwd.txt")) {
- if (!file_exists("data/items/$req_entry/private.txt")) {
- $description = file_get_contents("data/items/$req_entry/body.txt");
- $description = strip_tags($description);
- $description = html_entity_decode($description);
- $description = str_replace("&","&",$description);
- $description = str_replace("<","<",$description);
- $description = str_replace(">",">",$description);
- $description = str_replace("<br />"," ",$description);
- $description = str_replace("<br>"," ",$description);
- $description = str_replace("\r"," ",$description);
- $description = str_replace("\n"," ",$description);
- $description = str_replace(chr(10)," ",$description);
- $description = str_replace(chr(13)," ",$description);
- $description = trim($description);
- $description = substr($description,0,210);
- $description = htmlentities($description,ENT_NOQUOTES);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- echo "<meta name=\"description\" content=\"{$description}\">";
- }
- }
- }
- }
- ?>
- <style>
- body {
- color: <?php
- if (file_exists("data/colors/font.txt")) {
- $font_color = file_get_contents("data/colors/font.txt");
- echo $font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- margin: 0px 0px 10px 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
- ?> arial,helvetica,sans-serif;
- background-color: <?php
- if (file_exists("data/colors/bg.txt")) {
- $background_color = file_get_contents("data/colors/bg.txt");
- if ($background_color == "transparent") {
- echo "#ffffff";
- }
- else {
- echo $background_color;
- }
- }
- else {
- echo "#ffffff";
- }
- ?>;
- <?php
- if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>
- background-image: url('images/background.gif');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>
- background-image: url('images/background.jpg');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) { ?>
- background-image: url('images/background.png');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- ?>
- }
- p,td {
- font-size: 11px;
- }
- a {
- font-weight: bold;
- text-decoration: none;
- }
- a:link {
- color: <?php
- if (file_exists("data/colors/link.txt")) {
- $a_link_color = file_get_contents("data/colors/link.txt");
- echo $a_link_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- }
- a:visited {
- color: <?php
- if (file_exists("data/colors/vlink.txt")) {
- $a_visited_color = file_get_contents("data/colors/vlink.txt");
- echo $a_visited_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- }
- a:hover {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $a_hover_color = file_get_contents("data/colors/hover.txt");
- echo $a_hover_color;
- }
- else {
- echo "#336699";
- }
- ?>;
- }
- a:active {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $a_active_color = file_get_contents("data/colors/hover.txt");
- echo $a_active_color;
- }
- else {
- echo "#336699";
- }
- ?>;
- }
- a.navlink:link,a.navlink:visited,a.navlink:active,a.navlink:hover {
- font-weight: normal;
- text-decoration: none;
- }
- #panel_title {
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- padding: 5px 5px 5px 5px;
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- margin: 0px 0px 0px 0px;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
- }
- #panel_body {
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 11px;
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $panel_body_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'padding: 5px 5px 2px 5px;';
- }
- else {
- echo 'padding: 5px 5px 5px 5px;';
- }
- ?>
- background-color: <?php
- if (file_exists("data/colors/pb-bg.txt")) {
- $panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $panel_body_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'margin: 0px 0px 0px 0px;';
- }
- else {
- echo 'margin: 0px 0px 10px 0px;';
- }
- ?>
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_body_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'border-width: 1px 1px 0px 1px;';
- echo 'border-style: solid solid none solid;';
- }
- else {
- echo 'border-width: 1px 1px 1px 1px;';
- echo 'border-style: solid solid solid solid;';
- }
- ?>
- }
- #panel_footer {
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$font_panel_footer},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 10px;
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $panel_footer_font_color;
- }
- else {
- echo "#999999";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'padding: 5px 5px 2px 5px;';
- }
- else {
- echo 'padding: 5px 5px 5px 5px;';
- }
- ?>
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $panel_footer_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'margin: 0px 0px 0px 0px;';
- }
- else {
- echo 'margin: 0px 0px 10px 0px;';
- }
- ?>
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_footer_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'border-width: 1px 1px 0px 1px;';
- echo 'border-style: solid solid none solid;';
- }
- else {
- echo 'border-width: 0px 1px 1px 1px;';
- echo 'border-style: none solid solid solid;';
- }
- ?>
- text-align: right;
- }
- .input {
- color: <?php
- if (file_exists("data/colors/border.txt")) {
- $input_color = file_get_contents("data/colors/border.txt");
- echo $input_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- background: #ffffff;
- border: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_footer_border_color;
- }
- else {
- echo "#999999";
- }
- ?> solid 1px;
- width: 300px;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 11px;
- }
- .search {
- color: #666666;
- background: #ffffff;
- width: 100%;
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $font_input = file_get_contents("data/fonts/input.txt");
- echo "{$font_input},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 11px;
- }
- #panel_free {
- padding: 0px 0px 0px 0px;
- margin: 0px 0px 10px 0px;
- }
- .rbtop {
- display: block;
- background: transparent;
- font-size: 1px;
- margin: 0px 0px 0px 0px;
- }
- .rbbottom {
- display: block;
- background: transparent;
- font-size: 1px;
- margin: 0px 0px 10px 0px;
- }
- .rb1t,.rb2t,.rb3t,.rb4t,.rb1b,.rb2b,.rb3b,.rb4b,.rb1e,.rb2e,.rb3e,.rb4e {
- display: block;
- overflow: hidden;
- }
- .rb1t,.rb2t,.rb3t,.rb1b,.rb2b,.rb3b,.rb1e,.rb2e,.rb3e {
- height: 1px;
- }
- .rb2t,.rb3t,.rb4t {
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- border-left: 1px solid;
- border-right: 1px solid;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
- }
- .rb2b,.rb3b,.rb4b {
- background-color: <?php
- if (file_exists("data/colors/pb-bg.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- border-left: 1px solid;
- border-right: 1px solid;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
- }
- .rb2e,.rb3e,.rb4e {
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- border-left: 1px solid;
- border-right: 1px solid;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
- }
- .rb1t,.rb1b,.rb1e {
- margin: 0 5px;
- background: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
- }
- .rb2t,.rb2b,.rb2e {
- margin: 0 3px;
- border-width: 0 2px;
- }
- .rb3t,.rb3b,.rb3e {
- margin: 0 2px;
- }
- .rb4t,.rb4b,.rb4e {
- height: 2px;
- margin: 0 1px;
- }
- .xtitle {
- display: block;
- border:0 solid;
- border-width:0 1px;
- padding: 1px 5px 5px 5px;
- font-weight: bold;
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
- }
- .rbspace {
- height: 3px;
- }
- #panel_entry_body {
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 11px;
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $panel_body_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'padding: 5px 5px 2px 5px;';
- }
- else {
- echo 'padding: 5px 5px 5px 5px;';
- }
- ?>
- background-color: <?php
- if (file_exists("data/colors/pb-bg.txt")) {
- $panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $panel_body_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- margin: 0px 0px 0px 0px;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_body_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'border-width: 1px 1px 0px 1px;';
- echo 'border-style: solid solid none solid;';
- }
- else {
- echo 'border-width: 1px 1px 1px 1px;';
- echo 'border-style: solid solid solid solid;';
- }
- ?>
- }
- #panel_category {
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$font_panel_category},";
- }
- ?> arial,helvetica,sans-serif;
- font-size: 10px;
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $panel_category_font_color;
- }
- else {
- echo "#999999";
- }
- ?>;
- padding: 5px 5px 5px 5px;
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $panel_category_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
- margin: 0px 0px 0px 0px;
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $panel_category_border_color = file_get_contents("data/colors/border.txt");
- echo $panel_category_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
- <?php
- if (file_exists("data/round.txt")) {
- echo 'border-width: 1px 1px 0px 1px;';
- echo 'border-style: solid solid none solid;';
- }
- else {
- echo 'border-width: 0px 1px 1px 1px;';
- echo 'border-style: none solid solid solid;';
- }
- ?>
- text-align: left;
- }
- <?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
- </style>
- <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("data/center.txt")) {
- echo "<center>";
- }
- if (file_exists("data/header.txt")) {
- $header_panel = file_get_contents("data/header.txt");
- if (file_exists("data/panels/$header_panel") and (!file_exists("data/panels/$header_panel/private.txt") or isset($_SESSION['logged_in']))) {
- include("data/panels/$header_panel/panel.php");
- }
- }
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wtable\">";
- echo "<tr><td width=\"$wside\" height=\"$wspace\"></td><td width=\"$wspace\" height=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td><td width=\"$wmain\" height=\"$wspace\"></td><td width=\"$wspace\" height=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td><td width=\"$wside\" height=\"$wspace\"></td></tr>";
- echo "<tr><td width=\"$wside\" valign=\"top\">";
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
- }
- else {
- echo "<div id=\"panel_title\">";
- }
- ?>
- Profile</div>
- <?php
- if (file_exists("images/profile.gif")) {
- $profile_gif_image_size = getimagesize("images/profile.gif");
- $profile_gif_image_width = $profile_gif_image_size[0];
- $profile_gif_image_height = $profile_gif_image_size[1];
- $max_profile_gif_image_width = 163;
- if ($profile_gif_image_width > $max_profile_gif_image_width) {
- $sizefactor = (double) ($max_profile_gif_image_width / $profile_gif_image_width) ;
- $profile_gif_image_width = (int) ($profile_gif_image_width * $sizefactor);
- $profile_gif_image_height = (int) ($profile_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/profile.gif\" border=\"0\" width=\"$profile_gif_image_width\" height=\"$profile_gif_image_height\" align=\"left\">";
- }
- if (file_exists("images/profile.jpg")) {
- $profile_jpg_image_size = getimagesize("images/profile.jpg");
- $profile_jpg_image_width = $profile_jpg_image_size[0];
- $profile_jpg_image_height = $profile_jpg_image_size[1];
- $max_profile_jpg_image_width = 163;
- if ($profile_jpg_image_width > $max_profile_jpg_image_width) {
- $sizefactor = (double) ($max_profile_jpg_image_width / $profile_jpg_image_width) ;
- $profile_jpg_image_width = (int) ($profile_jpg_image_width * $sizefactor);
- $profile_jpg_image_height = (int) ($profile_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/profile.jpg\" border=\"0\" width=\"$profile_jpg_image_width\" height=\"$profile_jpg_image_height\" align=\"left\">";
- }
- if (file_exists("images/profile.png")) {
- $profile_png_image_size = getimagesize("images/profile.png");
- $profile_png_image_width = $profile_png_image_size[0];
- $profile_png_image_height = $profile_png_image_size[1];
- $max_profile_png_image_width = 163;
- if ($profile_png_image_width > $max_profile_png_image_width) {
- $sizefactor = (double) ($max_profile_png_image_width / $profile_png_image_width) ;
- $profile_png_image_width = (int) ($profile_png_image_width * $sizefactor);
- $profile_png_image_height = (int) ($profile_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/profile.png\" border=\"0\" width=\"$profile_png_image_width\" height=\"$profile_png_image_height\" align=\"left\">";
- }
- include("data/profile.php");
- ?>
- </div>
- <?php
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- ?>
- Navigation</div>
- <a class="navlink" href="index.php">Home</a><br>
- <?php
- if (file_exists("data/bb.txt") and file_exists("data/members/active")) {
- echo '<a class="navlink" href="member.php?id=all">Members</a><br>';
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a class="navlink" href="add.php">Add Entry</a><br>';
- echo '<a class="navlink" href="settings.php">Settings</a><br>';
- echo '<a class="navlink" href="panels.php">Panels</a><br>';
- echo '<a class="navlink" href="cat.php">Categories</a><br>';
- echo '<a class="navlink" href="colors.php">Colors</a><br>';
- echo '<a class="navlink" href="fonts.php">Fonts</a><br>';
- echo '<a class="navlink" href="login.php">Logout</a>';
- }
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$req_category")) {
- if (!file_exists("data/categories/$req_category")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/categories/$req_category");
- }
- }
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") or file_exists("data/members/active/{$_SESSION['logged_in']}/categories/$req_category")) {
- echo '<a class="navlink" href="add.php">Add Entry</a><br>';
- }
- echo '<a class="navlink" href="options.php">Options</a><br>';
- echo '<a class="navlink" href="login.php">Logout</a>';
- }
- else {
- if (file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
- echo '<a class="navlink" href="reg.php">Register</a><br>';
- }
- echo '<a class="navlink" href="login.php">Login</a>';
- }
- ?>
- </div>
- <?php
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- if (file_exists("data/sticky")) {
- if ($dh_sticky = opendir("data/sticky")) {
- while (($sticky_entry = readdir($dh_sticky)) !== false) {
- if (file_exists("data/items/$sticky_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if (file_exists("data/items/$sticky_entry/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$sticky_entry/categories")) {
- if ($dh_sticky_categories = opendir("data/items/$sticky_entry/categories")) {
- while (($sticky_category = readdir($dh_sticky_categories)) !== false) {
- if ($sticky_category != "." && $sticky_category != "..") {
- if (file_exists("data/categories/$sticky_category/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_sticky_categories);
- }
- }
- if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$sticky_entry/cat.txt")) {
- continue;
- }
- if ($sticky_entry != "." && $sticky_entry != "..") {
- $sticky_entries[] = $sticky_entry;
- }
- }
- closedir($dh_sticky);
- }
- sort($sticky_entries);
- reset($sticky_entries);
- $count_sticky_list = count($sticky_entries);
- if ($count_sticky_list > 0) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Quick Links</div>';
- echo '<div id="panel_body">';
- foreach ($sticky_entries as $sticky_list_entry) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$sticky_list_entry\">";
- readfile("data/items/$sticky_list_entry/title.txt");
- echo "</a><br>";
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- if (file_exists("data/panels")) {
- if ($dh_panels = opendir("data/panels")) {
- while (($panel = readdir($dh_panels)) !== false) {
- if ($panel != "." && $panel != "..") {
- if (file_exists("data/panels/$panel/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if (file_exists("data/panels/$panel/top.txt")) {
- $top_panels[] = $panel;
- continue;
- }
- if (file_exists("data/panels/$panel/center.txt")) {
- $center_panels[] = $panel;
- continue;
- }
- if (file_exists("data/panels/$panel/entry.txt")) {
- $entry_panels[] = $panel;
- continue;
- }
- if (file_exists("data/panels/$panel/right.txt")) {
- $right_panels[] = $panel;
- continue;
- }
- if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $panel)) {
- continue;
- }
- if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $panel)) {
- continue;
- }
- $left_panels[] = $panel;
- }
- }
- closedir($dh_panels);
- }
- sort($left_panels);
- reset($left_panels);
- $count_left_panels = count($left_panels);
- sort($top_panels);
- reset($top_panels);
- $count_top_panels = count($top_panels);
- sort($center_panels);
- reset($center_panels);
- $count_center_panels = count($center_panels);
- sort($entry_panels);
- reset($entry_panels);
- $count_entry_panels = count($entry_panels);
- sort($right_panels);
- reset($right_panels);
- $count_right_panels = count($right_panels);
- if ($count_left_panels > 0) {
- foreach ($left_panels as $left_panel) {
- if (!file_exists("data/panels/$left_panel/free.txt")) {
- if (file_exists("data/panels/$left_panel/border.txt")) {
- $left_panel_border = file_get_contents("data/panels/$left_panel/border.txt");
- }
- else {
- if (isset($left_panel_border)) {
- unset($left_panel_border);
- }
- }
- if (file_exists("data/panels/$left_panel/bgcolor-t.txt")) {
- $left_panel_bgcolor_t = file_get_contents("data/panels/$left_panel/bgcolor-t.txt");
- }
- else {
- if (isset($left_panel_bgcolor_t)) {
- unset($left_panel_bgcolor_t);
- }
- }
- if (file_exists("data/panels/$left_panel/bgcolor-c.txt")) {
- $left_panel_bgcolor_c = file_get_contents("data/panels/$left_panel/bgcolor-c.txt");
- }
- else {
- if (isset($left_panel_bgcolor_c)) {
- unset($left_panel_bgcolor_c);
- }
- }
- if (file_exists("data/panels/$left_panel/text-t.txt")) {
- $left_panel_text_t = file_get_contents("data/panels/$left_panel/text-t.txt");
- }
- else {
- if (isset($left_panel_text_t)) {
- unset($left_panel_text_t);
- }
- }
- if (file_exists("data/panels/$left_panel/text-c.txt")) {
- $left_panel_text_c = file_get_contents("data/panels/$left_panel/text-c.txt");
- }
- else {
- if (isset($left_panel_text_c)) {
- unset($left_panel_text_c);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($left_panel_border)) {
- echo " style=\"background-color: $left_panel_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_t)) {
- echo "background-color: $left_panel_bgcolor_t;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_t)) {
- echo "background-color: $left_panel_bgcolor_t;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_t)) {
- echo "background-color: $left_panel_bgcolor_t;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t) or isset($left_panel_text_t)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_t)) {
- echo "background-color: $left_panel_bgcolor_t;";
- }
- if (isset($left_panel_text_t)) {
- echo "color: $left_panel_text_t;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t) or isset($left_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t) or isset($left_panel_text_t)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_t)) {
- echo "background-color: $left_panel_bgcolor_t;";
- }
- if (isset($left_panel_text_t)) {
- echo "color: $left_panel_text_t;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_t) or isset($left_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/panels/$left_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"panels.php#{$left_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
- if (file_exists("data/panels/$left_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
- echo '</div>';
- echo '<div id="panel_body"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c) or isset($left_panel_text_c)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_c)) {
- echo "background-color: $left_panel_bgcolor_c;";
- }
- if (isset($left_panel_text_c)) {
- echo "color: $left_panel_text_c;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c) or isset($left_panel_text_c)) {
- echo '"';
- }
- echo '>';
- }
- if (file_exists("data/panels/$left_panel/free.txt")) {
- echo '<div id=panel_free>';
- }
- include("data/panels/$left_panel/panel.php");
- echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$left_panel/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_c)) {
- echo "background-color: $left_panel_bgcolor_c;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb3b"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_c)) {
- echo "background-color: $left_panel_bgcolor_c;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb2b"';
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($left_panel_bgcolor_c)) {
- echo "background-color: $left_panel_bgcolor_c;";
- }
- if (isset($left_panel_border)) {
- echo "border-color: $left_panel_border;";
- }
- if (isset($left_panel_border) or isset($left_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb1b"';
- if (isset($left_panel_border)) {
- echo " style=\"background-color: $left_panel_border;\"";
- }
- echo '></b></b>';
- }
- }
- }
- }
- echo "</td><td width=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td>";
- // main
- echo "<td valign=\"top\" width=\"$wmain\">";
- if ($count_top_panels > 0) {
- foreach ($top_panels as $top_panel) {
- if (!file_exists("data/panels/$top_panel/free.txt")) {
- if (file_exists("data/panels/$top_panel/border.txt")) {
- $top_panel_border = file_get_contents("data/panels/$top_panel/border.txt");
- }
- else {
- if (isset($top_panel_border)) {
- unset($top_panel_border);
- }
- }
- if (file_exists("data/panels/$top_panel/bgcolor-t.txt")) {
- $top_panel_bgcolor_t = file_get_contents("data/panels/$top_panel/bgcolor-t.txt");
- }
- else {
- if (isset($top_panel_bgcolor_t)) {
- unset($top_panel_bgcolor_t);
- }
- }
- if (file_exists("data/panels/$top_panel/bgcolor-c.txt")) {
- $top_panel_bgcolor_c = file_get_contents("data/panels/$top_panel/bgcolor-c.txt");
- }
- else {
- if (isset($top_panel_bgcolor_c)) {
- unset($top_panel_bgcolor_c);
- }
- }
- if (file_exists("data/panels/$top_panel/text-t.txt")) {
- $top_panel_text_t = file_get_contents("data/panels/$top_panel/text-t.txt");
- }
- else {
- if (isset($top_panel_text_t)) {
- unset($top_panel_text_t);
- }
- }
- if (file_exists("data/panels/$top_panel/text-c.txt")) {
- $top_panel_text_c = file_get_contents("data/panels/$top_panel/text-c.txt");
- }
- else {
- if (isset($top_panel_text_c)) {
- unset($top_panel_text_c);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($top_panel_border)) {
- echo " style=\"background-color: $top_panel_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_t)) {
- echo "background-color: $top_panel_bgcolor_t;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_t)) {
- echo "background-color: $top_panel_bgcolor_t;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_t)) {
- echo "background-color: $top_panel_bgcolor_t;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t) or isset($top_panel_text_t)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_t)) {
- echo "background-color: $top_panel_bgcolor_t;";
- }
- if (isset($top_panel_text_t)) {
- echo "color: $top_panel_text_t;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t) or isset($top_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t) or isset($top_panel_text_t)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_t)) {
- echo "background-color: $top_panel_bgcolor_t;";
- }
- if (isset($top_panel_text_t)) {
- echo "color: $top_panel_text_t;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_t) or isset($top_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/panels/$top_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"panels.php#{$top_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
- if (file_exists("data/panels/$top_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
- echo '</div>';
- echo '<div id="panel_body"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c) or isset($top_panel_text_c)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_c)) {
- echo "background-color: $top_panel_bgcolor_c;";
- }
- if (isset($top_panel_text_c)) {
- echo "color: $top_panel_text_c;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c) or isset($top_panel_text_c)) {
- echo '"';
- }
- echo '>';
- }
- if (file_exists("data/panels/$top_panel/free.txt")) {
- echo '<div id=panel_free>';
- }
- include("data/panels/$top_panel/panel.php");
- echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$top_panel/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_c)) {
- echo "background-color: $top_panel_bgcolor_c;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb3b"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_c)) {
- echo "background-color: $top_panel_bgcolor_c;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb2b"';
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($top_panel_bgcolor_c)) {
- echo "background-color: $top_panel_bgcolor_c;";
- }
- if (isset($top_panel_border)) {
- echo "border-color: $top_panel_border;";
- }
- if (isset($top_panel_border) or isset($top_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb1b"';
- if (isset($top_panel_border)) {
- echo " style=\"background-color: $top_panel_border;\"";
- }
- echo '></b></b>';
- }
- }
- }
- // clean-up (start)
- if (file_exists("data/albums")) {
- rmdirr("data/albums");
- }
- // clean-up (end)
- // global entry items (start)
- if ($dh_items = opendir("data/items")) {
- while (($item = readdir($dh_items)) !== false) {
- if ($item != "." && $item != "..") {
- if (file_exists("data/items/$item/comments/live") and (count(glob("data/items/$item/comments/live/*")) < 1)) {
- rmdirr("data/items/$item/comments/live");
- }
- if (file_exists("data/items/$item/comments/pending") and (count(glob("data/items/$item/comments/pending/*")) < 1)) {
- rmdirr("data/items/$item/comments/pending");
- }
- if (file_exists("data/items/$item/comments") and (count(glob("data/items/$item/comments/*")) < 1)) {
- rmdirr("data/items/$item/comments");
- }
- if (file_exists("data/items/$item/filedrop/files") and (count(glob("data/items/$item/filedrop/files/*")) < 1)) {
- rmdirr("data/items/$item/filedrop/files");
- }
- if (file_exists("data/items/$item/filedrop/count") and (count(glob("data/items/$item/filedrop/count/*")) < 1)) {
- rmdirr("data/items/$item/filedrop/count");
- }
- if (file_exists("data/items/$item/filedrop") and (count(glob("data/items/$item/filedrop/*")) < 1)) {
- rmdirr("data/items/$item/filedrop");
- }
- if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/captions") and (count(glob("data/items/$item/album/captions/*")) < 1)) {
- rmdirr("data/items/$item/album/captions");
- }
- if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album/count") and (count(glob("data/items/$item/album/count/*")) < 1)) {
- rmdirr("data/items/$item/album/count");
- }
- if ((!file_exists("images/$item/album") or (count(glob("images/$item/album/*")) < 1)) and file_exists("data/items/$item/album") and (count(glob("data/items/$item/album/*")) < 1)) {
- rmdirr("data/items/$item/album");
- }
- if (file_exists("images/$item/album") and (count(glob("images/$item/album/*")) < 1)) {
- rmdirr("images/$item/album");
- }
- if (file_exists("images/$item") and (count(glob("images/$item/*")) < 1)) {
- rmdirr("images/$item");
- }
- if (file_exists("images/$item/categories") and (count(glob("images/$item/categories/*")) < 1)) {
- rmdirr("images/$item/categories");
- }
- $grand[] = $item;
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
- if (isset($req_entry) and file_exists("data/items/$req_entry")) {
- $items[] = $req_entry;
- }
- if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
- $items[] = $item;
- }
- if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
- $items[] = $item;
- }
- if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
- $items[] = $item;
- }
- if (isset($req_find)) {
- if ((($req_find == "private") or ($req_find == "member") or ($req_find == "passwd")) and file_exists("data/items/$item/{$req_find}.txt")) {
- $items[] = $item;
- }
- if ((($req_find == "comments") or ($req_find == "filedrop") or ($req_find == "album")) and file_exists("data/items/$item/$req_find")) {
- $items[] = $item;
- }
- if (($req_find == "unfiled") and !file_exists("data/items/$item/categories")) {
- $items[] = $item;
- }
- }
- }
- else {
- $items[] = $item;
- }
- $latest[] = $item;
- if (file_exists("data/items/$item/album")) {
- $albums[] = $item;
- }
- $random[] = $item;
- $archives[] = substr($item,0,6);
- }
- else {
- // non-admin stuff (start)
- if ($item > $today) {
- continue;
- }
- if (file_exists("data/items/$item/private.txt")) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$item/categories")) {
- if ($dh_entry_categories = opendir("data/items/$item/categories")) {
- while (($item_category = readdir($dh_entry_categories)) !== false) {
- if ($item_category != "." && $item_category != "..") {
- if (file_exists("data/categories/$item_category/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_entry_categories);
- }
- }
- if (($private_categories > 0) and !file_exists("data/items/$item/cat.txt")) {
- continue;
- }
- $latest[] = $item;
- if (file_exists("data/items/$item/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
- if (file_exists("data/items/$item/album")) {
- $albums[] = $item;
- }
- $random[] = $item;
- $archives[] = substr($item,0,6);
- if (file_exists("data/nocat.txt") and file_exists("data/items/$item/categories") and !file_exists("data/items/$item/cat.txt") and (!isset($req_category) or empty($req_category)) and (!isset($req_entry) or empty($req_entry)) and (!isset($req_author) or empty($req_author))) {
- continue;
- }
- if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
- if (isset($req_entry) and file_exists("data/items/$req_entry")) {
- $items[] = $req_entry;
- }
- if (isset($req_category) and file_exists("data/categories/$req_category") and file_exists("data/items/$item/categories/$req_category")) {
- $items[] = $item;
- }
- if (isset($req_archive) and fnmatch("$req_archive*",$item)) {
- $items[] = $item;
- }
- if (isset($req_author) and (file_exists("data/members/active/$req_author") or (file_get_contents("data/username.txt") == $req_author)) and (file_get_contents("data/items/$item/author.txt") == $req_author)) {
- $items[] = $item;
- }
- }
- else {
- $items[] = $item;
- }
- // non-admin stuff (end)
- }
- }
- }
- closedir($dh_items);
- }
- sort($grand);
- reset($grand);
- $count_grand = count($grand);
- if (isset($req_entry) and file_exists("data/items/$req_entry")) {
- if (file_exists("data/items/$req_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- unset($items);
- }
- if (file_exists("data/items/$req_entry/member.txt") and !isset($_SESSION['logged_in'])) {
- unset($items);
- }
- }
- $items = array_unique($items);
- $items = array_values($items);
- if (file_exists("data/old.txt")) {
- sort($items);
- }
- else {
- rsort($items);
- }
- reset($items);
- $count_items = count($items);
- rsort($latest);
- reset($latest);
- $count_latest = count($latest);
- rsort($albums);
- reset($albums);
- $count_albums = count($albums);
- rsort($random);
- reset($random);
- $count_random = count($random);
- rsort($archives);
- reset($archives);
- $count_archives = count($archives);
- if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($req_entry) and !isset($req_category) and !isset($_REQUEST['start']) and !isset($req_author) and !isset($req_archive) and !isset($req_find)) {
- if ($count_latest > 0) {
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
- }
- else {
- echo "<div id=\"panel_title\">";
- }
- echo "Latest Entries</div><div id=\"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>";
- $increment_latest = 0;
- while ($increment_latest <= 4) {
- echo "<tr><td bgcolor=\"#ffffff\"><a href=\"index.php?entry=$latest[$increment_latest]";
- if ($dh_summary_comments = opendir("data/items/$latest[$increment_latest]/comments/live")) {
- while (($entry_summary_comments = readdir($dh_summary_comments)) !== false) {
- if ($entry_summary_comments != "." && $entry_summary_comments != "..") {
- $items_summary_comments[] = $entry_summary_comments;
- }
- }
- closedir($dh_summary_comments);
- }
- rsort($items_summary_comments);
- $summary_comments = count($items_summary_comments);
- if ($summary_comments > 0) {
- echo "&show=comments";
- }
- echo "\">";
- readfile("data/items/$latest[$increment_latest]/title.txt");
- echo "</a></td>";
- echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
- readfile("data/items/$latest[$increment_latest]/author.txt");
- echo "\">";
- readfile("data/items/$latest[$increment_latest]/author.txt");
- echo "</a></td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">";
- if (!file_exists("data/items/$latest[$increment_latest]/views.txt")) {
- echo 0;
- }
- else {
- readfile("data/items/$latest[$increment_latest]/views.txt");
- }
- echo "</td>";
- if ($summary_comments < 1) {
- $iso_year = substr($latest[$increment_latest],0,4);
- $iso_month = substr($latest[$increment_latest],4,2);
- $iso_day = substr($latest[$increment_latest],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
- echo "<td bgcolor=\"#ffffff\" align=\"right\">0</td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
- }
- else {
- $iso_year = substr($items_summary_comments[0],0,4);
- $iso_month = substr($items_summary_comments[0],4,2);
- $iso_day = substr($items_summary_comments[0],6,2);
- $iso_last = $iso_year . "-" . $iso_month . "-" . $iso_day;
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$summary_comments</td>";
- echo "<td bgcolor=\"#ffffff\" align=\"right\">$iso_last</td>";
- }
- unset($items_summary_comments);
- $increment_latest = $increment_latest + 1;
- }
- }
- if ($count_latest > 0) {
- echo "</table></div>";
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
- }
- }
- }
- if ($count_center_panels > 0) {
- foreach ($center_panels as $center_panel) {
- if (!file_exists("data/panels/$center_panel/free.txt")) {
- if (file_exists("data/panels/$center_panel/border.txt")) {
- $center_panel_border = file_get_contents("data/panels/$center_panel/border.txt");
- }
- else {
- if (isset($center_panel_border)) {
- unset($center_panel_border);
- }
- }
- if (file_exists("data/panels/$center_panel/bgcolor-t.txt")) {
- $center_panel_bgcolor_t = file_get_contents("data/panels/$center_panel/bgcolor-t.txt");
- }
- else {
- if (isset($center_panel_bgcolor_t)) {
- unset($center_panel_bgcolor_t);
- }
- }
- if (file_exists("data/panels/$center_panel/bgcolor-c.txt")) {
- $center_panel_bgcolor_c = file_get_contents("data/panels/$center_panel/bgcolor-c.txt");
- }
- else {
- if (isset($center_panel_bgcolor_c)) {
- unset($center_panel_bgcolor_c);
- }
- }
- if (file_exists("data/panels/$center_panel/text-t.txt")) {
- $center_panel_text_t = file_get_contents("data/panels/$center_panel/text-t.txt");
- }
- else {
- if (isset($center_panel_text_t)) {
- unset($center_panel_text_t);
- }
- }
- if (file_exists("data/panels/$center_panel/text-c.txt")) {
- $center_panel_text_c = file_get_contents("data/panels/$center_panel/text-c.txt");
- }
- else {
- if (isset($center_panel_text_c)) {
- unset($center_panel_text_c);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($center_panel_border)) {
- echo " style=\"background-color: $center_panel_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_t)) {
- echo "background-color: $center_panel_bgcolor_t;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_t)) {
- echo "background-color: $center_panel_bgcolor_t;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_t)) {
- echo "background-color: $center_panel_bgcolor_t;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t) or isset($center_panel_text_t)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_t)) {
- echo "background-color: $center_panel_bgcolor_t;";
- }
- if (isset($center_panel_text_t)) {
- echo "color: $center_panel_text_t;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t) or isset($center_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t) or isset($center_panel_text_t)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_t)) {
- echo "background-color: $center_panel_bgcolor_t;";
- }
- if (isset($center_panel_text_t)) {
- echo "color: $center_panel_text_t;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_t) or isset($center_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/panels/$center_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"panels.php#{$center_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
- if (file_exists("data/panels/$center_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
- echo '</div>';
- echo '<div id="panel_body"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c) or isset($center_panel_text_c)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_c)) {
- echo "background-color: $center_panel_bgcolor_c;";
- }
- if (isset($center_panel_text_c)) {
- echo "color: $center_panel_text_c;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c) or isset($center_panel_text_c)) {
- echo '"';
- }
- echo '>';
- }
- if (file_exists("data/panels/$center_panel/free.txt")) {
- echo '<div id=panel_free>';
- }
- include("data/panels/$center_panel/panel.php");
- echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$center_panel/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_c)) {
- echo "background-color: $center_panel_bgcolor_c;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb3b"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_c)) {
- echo "background-color: $center_panel_bgcolor_c;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb2b"';
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($center_panel_bgcolor_c)) {
- echo "background-color: $center_panel_bgcolor_c;";
- }
- if (isset($center_panel_border)) {
- echo "border-color: $center_panel_border;";
- }
- if (isset($center_panel_border) or isset($center_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb1b"';
- if (isset($center_panel_border)) {
- echo " style=\"background-color: $center_panel_border;\"";
- }
- echo '></b></b>';
- }
- }
- }
- if (isset($req_category) and !empty($req_category)) {
- if (file_exists("data/categories/$req_category/book.txt")) {
- sort($items);
- reset($items);
- }
- }
- if ($count_items == 0) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"$wmain\">";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "Oops!</div><div id=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>";
- if (($count_grand == 0) and (count($_GET) == 0)) {
- echo "No entries found. Perhaps this is a fresh install.";
- }
- else {
- if (count($_GET) > 0) {
- echo "The entry you are looking for does not exist or is off limits to you.";
- }
- else {
- echo "Login required. Entries are off limits without proper credentials.";
- }
- }
- echo '</td></tr></table></div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- echo "</td></tr></table>";
- }
- $start = $_REQUEST['start'];
- if (!isset($_REQUEST['start']) or empty($_REQUEST['start'])) {
- $start = 0;
- }
- $end = $start + $increase;
- $disp = array_slice($items,$start,$increase);
- foreach ($disp as $d) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"$wmain\">";
- if (file_exists("data/items/$d/border.txt")) {
- $d_border = file_get_contents("data/items/$d/border.txt");
- }
- else {
- if (isset($d_border)) {
- unset($d_border);
- }
- }
- if (file_exists("data/items/$d/bgcolor-t.txt")) {
- $d_bgcolor_t = file_get_contents("data/items/$d/bgcolor-t.txt");
- }
- else {
- if (isset($d_bgcolor_t)) {
- unset($d_bgcolor_t);
- }
- }
- if (file_exists("data/items/$d/bgcolor-b.txt")) {
- $d_bgcolor_b = file_get_contents("data/items/$d/bgcolor-b.txt");
- }
- else {
- if (isset($d_bgcolor_b)) {
- unset($d_bgcolor_b);
- }
- }
- if (file_exists("data/items/$d/bgcolor-c.txt")) {
- $d_bgcolor_c = file_get_contents("data/items/$d/bgcolor-c.txt");
- }
- else {
- if (isset($d_bgcolor_c)) {
- unset($d_bgcolor_c);
- }
- }
- if (file_exists("data/items/$d/bgcolor-f.txt")) {
- $d_bgcolor_f = file_get_contents("data/items/$d/bgcolor-f.txt");
- }
- else {
- if (isset($d_bgcolor_f)) {
- unset($d_bgcolor_f);
- }
- }
- if (file_exists("data/items/$d/text-t.txt")) {
- $d_text_t = file_get_contents("data/items/$d/text-t.txt");
- }
- else {
- if (isset($d_text_t)) {
- unset($d_text_t);
- }
- }
- if (file_exists("data/items/$d/text-b.txt")) {
- $d_text_b = file_get_contents("data/items/$d/text-b.txt");
- }
- else {
- if (isset($d_text_b)) {
- unset($d_text_b);
- }
- }
- if (file_exists("data/items/$d/text-c.txt")) {
- $d_text_c = file_get_contents("data/items/$d/text-c.txt");
- }
- else {
- if (isset($d_text_c)) {
- unset($d_text_c);
- }
- }
- if (file_exists("data/items/$d/text-f.txt")) {
- $d_text_f = file_get_contents("data/items/$d/text-f.txt");
- }
- else {
- if (isset($d_text_f)) {
- unset($d_text_f);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($d_border)) {
- echo " style=\"background-color: $d_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_t)) {
- echo "background-color: $d_bgcolor_t;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_t)) {
- echo "background-color: $d_bgcolor_t;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_t)) {
- echo "background-color: $d_bgcolor_t;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($d_border) or isset($d_bgcolor_t) or isset($d_text_t)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_t)) {
- echo "background-color: $d_bgcolor_t;";
- }
- if (isset($d_text_t)) {
- echo "color: $d_text_t;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_t) or isset($d_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($d_border) or isset($d_bgcolor_t) or isset($d_text_t)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_t)) {
- echo "background-color: $d_bgcolor_t;";
- }
- if (isset($d_text_t)) {
- echo "color: $d_text_t;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_t) or isset($d_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/items/$d/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/wiki.txt") and (file_exists("data/items/$d/edit.txt") or (file_get_contents("data/items/$d/author.txt") == $_SESSION['logged_in'])) and file_exists("data/members/active/{$_SESSION['logged_in']}/rw.txt") and !file_exists("data/items/$d/passwd.txt")) {
- if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=\"wiki.php?entry=$d\">";
- echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
- echo "</a>";
- }
- echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"del.php?entry=$d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("data/items/$d/private.txt") and !file_exists("data/items/$d/categories") and file_exists("data/bb.txt") and (count(glob("data/items/$d/comments/live/*")) === 0) and (count(glob("data/items/$d/comments/pending/*")) === 0)) {
- echo "<a href=\"move.php?entry=$d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
- }
- if (file_exists("data/items/$d/wiki/delta") and (count(glob("data/items/$d/wiki/delta/*")) > 0)) {
- echo "<a href=\"wiki.php?entry=$d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
- }
- echo "<a href=\"edit.php?entry=$d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- if (file_exists("data/items/$d/passwd.txt")) {
- echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
- }
- if (file_exists("data/items/$d/private.txt")) {
- echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
- }
- if (file_exists("data/items/$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("data/items/$d/cat.txt")) {
- echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
- }
- if (file_exists("data/items/$d/categories/$req_category")) {
- $private_categories = "0";
- $book_categories = "0";
- if (file_exists("data/items/$d/categories")) {
- if ($dh_read_cat_dir = opendir("data/items/$d/categories")) {
- while (($read_cat_dir = readdir($dh_read_cat_dir)) !== false) {
- if ($read_cat_dir != "." && $read_cat_dir != "..") {
- if (file_exists("data/categories/$read_cat_dir/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- if (file_exists("data/categories/$read_cat_dir/book.txt")) {
- $book_categories = $book_categories + 1;
- }
- }
- }
- closedir($dh_read_cat_dir);
- }
- }
- if ($private_categories > 0) {
- echo "<img src=\"images/widget.hidden.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private category\">";
- }
- if (file_exists("data/nocat.txt")) {
- echo "<img src=\"images/widget.isolated.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"isolated category\">";
- }
- if ($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><div id=\"panel_entry_body\"";
- if (isset($d_border) or isset($d_bgcolor_b) or isset($d_text_b)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_b)) {
- echo "background-color: $d_bgcolor_b;";
- }
- if (isset($d_text_b)) {
- echo "color: $d_text_b;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_b) or isset($d_text_b)) {
- echo '"';
- }
- echo '>';
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/author.txt")) {
- echo "<td width=\"85\" valign=\"top\">";
- $author = file_get_contents("data/items/$d/author.txt");
- echo "<a href=\"member.php?id=$author\">";
- if ((file_get_contents("data/username.txt") == $author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
- if (file_exists("images/avatar.gif")) {
- $avatar_gif_image_size = getimagesize("images/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
- $max_avatar_gif_image_width = 80;
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
- if (file_exists("images/avatar.jpg")) {
- $avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
- $max_avatar_jpg_image_width = 80;
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
- if (file_exists("images/avatar.png")) {
- $avatar_png_image_size = getimagesize("images/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
- $max_avatar_png_image_width = 80;
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
- }
- elseif (file_exists("images/members/$author/avatar.jpg") or file_exists("images/members/$author/avatar.gif") or file_exists("images/members/$author/avatar.png")) {
- if (file_exists("images/members/$author/avatar.gif")) {
- $avatar_gif_image_size = getimagesize("images/members/$author/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
- $max_avatar_gif_image_width = 80;
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$author/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
- if (file_exists("images/members/$author/avatar.jpg")) {
- $avatar_jpg_image_size = getimagesize("images/members/$author/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
- $max_avatar_jpg_image_width = 80;
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$author/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
- if (file_exists("images/members/$author/avatar.png")) {
- $avatar_png_image_size = getimagesize("images/members/$author/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
- $max_avatar_png_image_width = 80;
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$author/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
- }
- echo "<b>$author</b></a><br>";
- if ((file_get_contents("data/username.txt") == $author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$author/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/$author/rank.txt");
- echo "$rank<br>";
- }
- elseif (!file_exists("data/members/active/$author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
- if ($dh_author_posts = opendir("data/items")) {
- while (($author_post = readdir($dh_author_posts)) !== false) {
- if ($author_post != "." && $author_post != "..") {
- if (file_exists("data/items/$author_post/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$author_post/categories")) {
- if ($dh_entry_categories_posts = opendir("data/items/$author_post/categories")) {
- while (($entry_category_posts = readdir($dh_entry_categories_posts)) !== false) {
- if ($entry_category_posts != "." && $entry_category_posts != "..") {
- if (file_exists("data/categories/$entry_category_posts/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_entry_categories_posts);
- }
- }
- if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$author_post/cat.txt")) {
- continue;
- }
- if (file_exists("data/members/active/$author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
- $items_posts[] = $author_post;
- }
- }
- elseif (!file_exists("data/members/active/$author") and (file_get_contents("data/username.txt") == $author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$author_post/author.txt") and (file_get_contents("data/items/$author_post/author.txt") == $author)) {
- $items_posts[] = $author_post;
- }
- }
- }
- }
- closedir($dh_author_posts);
- }
- $posts = count($items_posts);
- if ($posts == 1) {
- echo "$posts post";
- }
- if ($posts > 1) {
- echo "$posts posts";
- }
- unset($items_posts);
- echo "</td><td width=513 valign=top>";
- }
- else {
- echo "<td width=598 valign=top>";
- }
- if (file_exists("data/items/$d/passwd.txt")) {
- $passwd = file_get_contents("data/items/$d/passwd.txt");
- }
- if (isset($_REQUEST['passwd']) and !empty($_REQUEST['passwd'])) {
- $crypt_passwd = sha1($_REQUEST['passwd']);
- $crypt_passwd = md5($crypt_passwd);
- $crypt_passwd = crypt($crypt_passwd,$crypt_passwd);
- }
- echo "<font style=\"font-size: 10px; color: #999999;\">";
- if ((file_exists("data/items/$d/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
- $xavatar_author = file_get_contents("data/items/$d/author.txt");
- echo "$xavatar_author - ";
- }
- entry2date($d);
- if ((isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) or file_exists("data/items/$d/lastmod.txt")) {
- if (file_exists("data/items/$d/revisions.txt")) {
- echo " (Revision ";
- readfile("data/items/$d/revisions.txt");
- echo " - ";
- echo date("l, M j, Y, g:i A",filemtime("data/items/$d/body.txt"));
- echo ")";
- }
- }
- echo "</font><font style=\"font-size: 5px;\"><br><br></font>";
- if (isset($d_text_b)) {
- echo "<font style=\"color: $d_text_b;\">";
- }
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=\"passwd.php?entry=$d\">here</a> to enter it.";
- }
- else {
- $entry_body = file_get_contents("data/items/$d/body.txt");
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $entry_body = preg_replace("/\b($badwords)\b/i",$censor,$entry_body);
- }
- if (file_exists("data/items/$d/shorten.txt")) {
- $entry_shorten = file_get_contents("data/items/$d/shorten.txt");
- $entry_lines = explode("\r",$entry_body);
- if (count($entry_lines) > $entry_shorten) {
- $entry_body = implode("",array_slice($entry_lines,0,$entry_shorten));
- }
- }
- echo $entry_body;
- }
- if ((file_get_contents("data/username.txt") == $author) and file_exists("data/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
- $sig = file_get_contents("data/sig.txt");
- echo "<br><br>--<br>$sig";
- }
- elseif (file_exists("data/members/active/$author/sig.txt") and file_exists("data/bb.txt") and file_exists("data/bb-sig.txt")) {
- $sig = file_get_contents("data/members/active/$author/sig.txt");
- echo "<br><br>--<br>$sig";
- }
- if (isset($d_text_b)) {
- echo "</font>";
- }
- echo "</td></tr></table>";
- if (file_exists("data/round.txt")) {
- echo "<div class=\"rbspace\"></div>";
- }
- echo "</div>";
- if (file_exists("data/items/$d/categories") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- if ($dh_entry_categories = opendir("data/items/$d/categories")) {
- while (($entry_category = readdir($dh_entry_categories)) !== false) {
- if ($entry_category != "." && $entry_category != "..") {
- $entry_categories[] = $entry_category;
- }
- }
- closedir($dh_entry_categories);
- }
- sort($entry_categories);
- reset($entry_categories);
- if (count($entry_categories) > 0) {
- if (count($entry_categories) > 1) {
- $category_list = "categories";
- }
- else {
- $category_list = "category";
- }
- foreach ($entry_categories as $filed_under) {
- $category_list = $category_list . " | <a href=\"index.php?category=$filed_under\">$filed_under</a>";
- }
- echo "<div id=\"panel_category\"";
- if (isset($d_border) or isset($d_bgcolor_c) or isset($d_text_c)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_c)) {
- echo "background-color: $d_bgcolor_c;";
- }
- if (isset($d_text_c)) {
- echo "color: $d_text_c;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_c) or isset($d_text_c)) {
- echo '"';
- }
- echo ">$category_list</div>";
- }
- unset($entry_categories);
- }
- echo "<div id=\"panel_footer\"";
- if (isset($d_border) or isset($d_bgcolor_f) or isset($d_text_f)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_f)) {
- echo "background-color: $d_bgcolor_f;";
- }
- if (isset($d_text_f)) {
- echo "color: $d_text_f;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_f) or isset($d_text_f)) {
- echo '"';
- }
- echo '>';
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- if (!file_exists("data/items/$d/comments/live")) {
- echo "<a href=\"index.php?entry=$d&show=comments\">add comment</a>";
- }
- else {
- if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($live_comment = readdir($dh_comments)) !== false) {
- if ($live_comment != "." && $live_comment != "..") {
- $live_comments[] = $live_comment;
- }
- }
- closedir($dh_comments);
- }
- $count_live_comments = count($live_comments);
- echo "<a href=\"index.php?entry=$d&show=comments\">";
- if ($count_live_comments == 1) {
- echo "$count_live_comments comment";
- }
- elseif ($count_live_comments < 1) {
- echo "add comment";
- }
- else {
- echo "$count_live_comments comments";
- }
- echo "</a>";
- unset($live_comments);
- }
- }
- else {
- echo "<a href=\"index.php?entry=$d\">permalink</a>";
- }
- if (file_exists("data/items/$d/views.txt")) {
- $views_value = file_get_contents("data/items/$d/views.txt");
- if ($views_value == 1) {
- echo " ( $views_value view ) ";
- }
- elseif ($views_value > 1) {
- echo " ( $views_value views ) ";
- }
- else {
- echo " ";
- }
- }
- if (!file_exists("images/$d/album")) {
- echo " ";
- }
- else {
- if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != "..") {
- $items_album[] = $entry_album;
- }
- }
- closedir($dh_album);
- }
- $album = count($items_album);
- echo " | <a href=\"index.php?entry=$d&show=album\">";
- if ($album == 1) {
- echo "$album image";
- }
- elseif ($album < 1) {
- echo "album";
- }
- else {
- echo "$album images";
- }
- echo "</a>";
- unset($items_album);
- }
- if (file_exists("images/$d/album") and isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album)) {
- if (!file_exists("data/items/$d/album")) {
- mkdir("data/items/$d/album");
- }
- if ((!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $album_views_value = file_get_contents("data/items/$d/album/views.txt");
- $album_views_value = $album_views_value + 1;
- }
- }
- $album_views_value = file_get_contents("data/items/$d/album/views.txt");
- if ($album_views_value == 1) {
- echo " ( $album_views_value view ) ";
- }
- elseif ($album_views_value > 1) {
- echo " ( $album_views_value views ) ";
- }
- else {
- echo " ";
- }
- if (!file_exists("data/items/$d/filedrop/files")) {
- echo " ";
- }
- else {
- if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
- while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != "..") {
- $items_filedrop[] = $dl_file;
- }
- }
- closedir($dh_filedrop);
- }
- $filedrop = count($items_filedrop);
- echo " | <a href=\"index.php?entry=$d&show=filedrop\">";
- if ($filedrop == 1) {
- echo "$filedrop file";
- }
- elseif ($filedrop < 1) {
- echo "filedrop";
- }
- else {
- echo "$filedrop files";
- }
- echo "</a> ";
- unset($items_filedrop);
- }
- if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop)) {
- if (!file_exists("data/items/$d/filedrop")) {
- mkdir("data/items/$d/filedrop");
- }
- if (file_exists("data/items/$d/filedrop/files") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
- $filedrop_views_value = $filedrop_views_value + 1;
- }
- }
- $filedrop_views_value = file_get_contents("data/items/$d/filedrop/views.txt");
- if ($filedrop_views_value == 1) {
- echo " ( $filedrop_views_value view ) ";
- }
- elseif ($filedrop_views_value > 1) {
- echo " ( $filedrop_views_value views ) ";
- }
- else {
- echo " ";
- }
- if (!file_exists("data/nopdf.txt") and file_exists("data/items/$d/pdf/file")) {
- echo "| <a href=\"index.php?entry=$d&show=pdf\">pdf</a> ";
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
- $pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
- $pdf_views_value = $pdf_views_value + 1;
- }
- $pdf_views_value = file_get_contents("data/items/$d/pdf/count/views.txt");
- if ($pdf_views_value == 1) {
- echo " ( $pdf_views_value view ) ";
- }
- elseif ($pdf_views_value > 1) {
- echo " ( $pdf_views_value views ) ";
- }
- else {
- echo " ";
- }
- }
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo "| <a href=\"index.php?entry=$d\">permalink</a>";
- }
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4e"';
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_f)) {
- echo "background-color: $d_bgcolor_f;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo '"';
- }
- echo '></b><b class="rb3e"';
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_f)) {
- echo "background-color: $d_bgcolor_f;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo '"';
- }
- echo '></b><b class="rb2e"';
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo ' style="';
- }
- if (isset($d_bgcolor_f)) {
- echo "background-color: $d_bgcolor_f;";
- }
- if (isset($d_border)) {
- echo "border-color: $d_border;";
- }
- if (isset($d_border) or isset($d_bgcolor_f)) {
- echo '"';
- }
- echo '></b><b class="rb1e"';
- if (isset($d_border)) {
- echo " style=\"background-color: $d_border;\"";
- }
- echo '></b></b>';
- }
- echo "</td></tr></table>";
- if ($count_entry_panels > 0) {
- foreach ($entry_panels as $entry_panel) {
- if (!file_exists("data/panels/$entry_panel/free.txt")) {
- if (file_exists("data/panels/$entry_panel/border.txt")) {
- $entry_panel_border = file_get_contents("data/panels/$entry_panel/border.txt");
- }
- else {
- if (isset($entry_panel_border)) {
- unset($entry_panel_border);
- }
- }
- if (file_exists("data/panels/$entry_panel/bgcolor-t.txt")) {
- $entry_panel_bgcolor_t = file_get_contents("data/panels/$entry_panel/bgcolor-t.txt");
- }
- else {
- if (isset($entry_panel_bgcolor_t)) {
- unset($entry_panel_bgcolor_t);
- }
- }
- if (file_exists("data/panels/$entry_panel/bgcolor-c.txt")) {
- $entry_panel_bgcolor_c = file_get_contents("data/panels/$entry_panel/bgcolor-c.txt");
- }
- else {
- if (isset($entry_panel_bgcolor_c)) {
- unset($entry_panel_bgcolor_c);
- }
- }
- if (file_exists("data/panels/$entry_panel/text-t.txt")) {
- $entry_panel_text_t = file_get_contents("data/panels/$entry_panel/text-t.txt");
- }
- else {
- if (isset($entry_panel_text_t)) {
- unset($entry_panel_text_t);
- }
- }
- if (file_exists("data/panels/$entry_panel/text-c.txt")) {
- $entry_panel_text_c = file_get_contents("data/panels/$entry_panel/text-c.txt");
- }
- else {
- if (isset($entry_panel_text_c)) {
- unset($entry_panel_text_c);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($entry_panel_border)) {
- echo " style=\"background-color: $entry_panel_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_t)) {
- echo "background-color: $entry_panel_bgcolor_t;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_t)) {
- echo "background-color: $entry_panel_bgcolor_t;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_t)) {
- echo "background-color: $entry_panel_bgcolor_t;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t) or isset($entry_panel_text_t)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_t)) {
- echo "background-color: $entry_panel_bgcolor_t;";
- }
- if (isset($entry_panel_text_t)) {
- echo "color: $entry_panel_text_t;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t) or isset($entry_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t) or isset($entry_panel_text_t)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_t)) {
- echo "background-color: $entry_panel_bgcolor_t;";
- }
- if (isset($entry_panel_text_t)) {
- echo "color: $entry_panel_text_t;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_t) or isset($entry_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/panels/$entry_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"panels.php#{$entry_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
- if (file_exists("data/panels/$entry_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
- echo '</div>';
- echo '<div id="panel_body"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c) or isset($entry_panel_text_c)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_c)) {
- echo "background-color: $entry_panel_bgcolor_c;";
- }
- if (isset($entry_panel_text_c)) {
- echo "color: $entry_panel_text_c;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c) or isset($entry_panel_text_c)) {
- echo '"';
- }
- echo '>';
- }
- if (file_exists("data/panels/$entry_panel/free.txt")) {
- echo '<div id=panel_free>';
- }
- include("data/panels/$entry_panel/panel.php");
- echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$entry_panel/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_c)) {
- echo "background-color: $entry_panel_bgcolor_c;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb3b"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_c)) {
- echo "background-color: $entry_panel_bgcolor_c;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb2b"';
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($entry_panel_bgcolor_c)) {
- echo "background-color: $entry_panel_bgcolor_c;";
- }
- if (isset($entry_panel_border)) {
- echo "border-color: $entry_panel_border;";
- }
- if (isset($entry_panel_border) or isset($entry_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb1b"';
- if (isset($entry_panel_border)) {
- echo " style=\"background-color: $entry_panel_border;\"";
- }
- echo '></b></b>';
- }
- }
- }
- if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == album) and file_exists("images/$d/album")) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Album';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $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 id=panel_body>';
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$d&show=album>here</a> to enter it.";
- }
- else {
- if (file_exists("images/$d/thumbnails")) {
- if ($dh_album = opendir("images/$d/thumbnails")) {
- while (($thumbnail_album = readdir($dh_album)) !== false) {
- if ($thumbnail_album != "." && $thumbnail_album != "..") {
- $current_thumbnail = "images/$d/thumbnails/$thumbnail_album";
- $parent_image = str_replace("-thumbnail.jpg","",$thumbnail_album);
- $parent_image = "images/$d/album/$parent_image";
- if (file_exists($current_thumbnail) and !file_exists($parent_image)) {
- unlink($current_thumbnail);
- }
- }
- }
- }
- }
- if (file_exists("data/items/$d/album/captions")) {
- if ($dh_album = opendir("data/items/$d/album/captions")) {
- while (($caption_album = readdir($dh_album)) !== false) {
- if ($caption_album != "." && $caption_album != "..") {
- $current_caption = "data/items/$d/album/captions/$caption_album";
- $parent_image = str_replace(".txt","",$caption_album);
- $parent_image = "images/$d/album/$parent_image";
- if (file_exists($current_caption) and !file_exists($parent_image)) {
- unlink($current_caption);
- }
- }
- }
- }
- }
- if (file_exists("images/$d/album")) {
- if ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != "..") {
- $sort_album[] = $entry_album;
- }
- }
- closedir($dh_album);
- }
- sort($sort_album);
- reset($sort_album);
- $count_album_entry = count($sort_album);
- if ($count_album_entry < 1) {
- rmdirr("images/$d/album");
- rmdirr("images/$d/thumbnails");
- }
- else {
- foreach($sort_album as $album_entry) {
- $current_image = "images/$d/album/$album_entry";
- $current_image_size = getimagesize($current_image);
- $current_width = $current_image_size[0];
- $current_height = $current_image_size[1];
- $max_width = 98;
- $max_height = 73;
- if (($current_width > $max_width) || ($current_height > $max_height)) {
- if ($current_height > $current_width) {
- $sizefactor = (double) ($max_height / $current_height);
- }
- else {
- $sizefactor = (double) ($max_width / $current_width) ;
- }
- $new_width = (int) ($current_width * $sizefactor);
- $new_height = (int) ($current_height * $sizefactor);
- }
- else {
- $new_width = $current_width;
- $new_height = $current_height;
- }
- if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
- $work_thumb = imagecreatetruecolor($new_width,$new_height);
- $get_mimetype = image_type_to_mime_type(exif_imagetype($current_image));
- switch($get_mimetype) {
- case "image/jpg":
- case "image/jpeg":
- $work_image = imagecreatefromjpeg($current_image);
- break;
- case "image/gif":
- $work_image = imagecreatefromgif($current_image);
- break;
- case "image/png":
- $work_image = imagecreatefrompng($current_image);
- break;
- }
- imagecopyresampled($work_thumb,$work_image,0,0,0,0,$new_width,$new_height,$current_width,$current_height);
- if (!file_exists("images/$d/thumbnails")) {
- mkdir("images/$d/thumbnails");
- }
- imagejpeg($work_thumb,"images/$d/thumbnails/{$album_entry}-thumbnail.jpg",80);
- }
- echo "<a href=\"album.php?entry=$d&show=$album_entry\">";
- if (!file_exists("images/$d/thumbnails/{$album_entry}-thumbnail.jpg")) {
- echo "<img src=\"images/$d/album/$album_entry\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
- }
- else {
- echo "<img src=\"images/$d/thumbnails/{$album_entry}-thumbnail.jpg\" width=$new_width height=$new_height border=0 hspace=2 vspace=2";
- }
- if (file_exists("data/items/$d/album/captions/{$album_entry}.txt")) {
- echo ' alt="';
- $img_alt = file_get_contents("data/items/$d/album/captions/{$album_entry}.txt");
- $img_alt = strip_tags($img_alt);
- echo $img_alt;
- echo '"';
- }
- echo "></a>";
- }
- }
- }
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- echo '</td></tr></table>';
- }
- if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == filedrop) and file_exists("data/items/$d/filedrop/files")) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo "<div id=panel_title>";
- }
- echo "Filedrop";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=del.php?entry=$d&target=filedrop><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=\"delete filedrop\"></a>";
- }
- echo "</div><div id=panel_body>";
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$d&show=filedrop>here</a> to enter it.";
- }
- else {
- if ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
- while (($dl_file = readdir($dh_filedrop)) !== false) {
- if ($dl_file != "." && $dl_file != "..") {
- $filedrop_files[] = $dl_file;
- }
- }
- closedir($dh_filedrop);
- }
- reset($filedrop_files);
- sort($filedrop_files);
- foreach ($filedrop_files as $filedrop_file) {
- echo "<table border=0 cellspacing=0 cellpadding=4><tr><td>";
- echo "<a href=\"index.php?entry=$d&download=$filedrop_file&type=filedrop\">";
- echo "<img src=images/filedrop.png width=36 height=36 border=0 alt=\"download file\"></a></td>";
- echo "<td><b>$filedrop_file</b>";
- if (file_exists("data/items/$d/filedrop/sha1.txt")) {
- $sha1 = sha1_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br>$sha1 (<a href=\"http://www.faqs.org/rfcs/rfc3174\" target=\"_maj\">sha1</a>)";
- }
- if (file_exists("data/items/$d/filedrop/md5.txt")) {
- $md5 = md5_file("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br>$md5 (<a href=\"http://www.faqs.org/rfcs/rfc1321\" target=\"_maj\">md5</a>)";
- }
- $size = filesize("data/items/$d/filedrop/files/$filedrop_file");
- echo "<br>$size_string";
- $filedrop_count_file = "data/items/$d/filedrop/count/$filedrop_file" . '.txt';
- if (file_exists($filedrop_count_file)) {
- echo "<br>$filedrop_count";
- if ($filedrop_count == 1) {
- echo " download";
- }
- if ($filedrop_count > 1) {
- echo " downloads";
- }
- }
- echo "</td></tr></table>";
- }
- }
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- echo '</td></tr></table>';
- }
- if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == pdf) and file_exists("data/items/$d/pdf/file")) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'PDF';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $d;
- echo '&target=pdf><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete pdf"></a>';
- }
- echo '</div><div id=panel_body>';
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$d&show=pdf>here</a> to enter it.";
- }
- else {
- if ($dh_pdf = opendir("data/items/$d/pdf/file")) {
- while (($dl_file = readdir($dh_pdf)) !== false) {
- if ($dl_file != "." && $dl_file != "..") {
- echo '<table border=0 cellspacing=0 cellpadding=4><tr><td>';
- echo "<a href=\"index.php?entry=$d&download=$dl_file&type=pdf\">";
- echo '<img src=images/pdf.png width=36 height=36 border=0 alt="download file"></a></td>';
- echo '<td><b>';
- echo $dl_file;
- echo'</b><br>';
- $size = filesize("data/items/$d/pdf/file/$dl_file");
- echo $size_string;
- $pdf_count_file = "data/items/$d/pdf/count/dl.txt";
- if (file_exists($pdf_count_file)) {
- echo '<br>';
- echo $pdf_count;
- if ($pdf_count == 1) {
- echo ' download';
- }
- if ($pdf_count > 1) {
- echo ' downloads';
- }
- }
- echo '</td></tr></table>';
- }
- }
- closedir($dh_pdf);
- }
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- echo '</td></tr></table>';
- }
- if (isset($req_entry) and !empty($req_entry) and isset($req_show) and !empty($req_show) and ($req_show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- }
- else {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if ($dh_comments = opendir("data/items/$d/comments/live")) {
- while (($live_comment = readdir($dh_comments)) !== false) {
- if ($live_comment != "." && $live_comment != "..") {
- $show_comments[] = $live_comment;
- }
- }
- closedir($dh_comments);
- }
- asort($show_comments);
- reset($show_comments);
- foreach ($show_comments as $comment) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- if (file_exists("data/items/$d/comments/live/$comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("data/items/$d/comments/live/$comment/url.txt");
- echo '>';
- }
- readfile("data/items/$d/comments/live/$comment/firstname.txt");
- echo ' ';
- readfile("data/items/$d/comments/live/$comment/lastname.txt");
- if (file_exists("data/items/$d/comments/live/$comment/url.txt")) {
- echo '</a>';
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo ' <';
- readfile("data/items/$d/comments/live/$comment/email.txt");
- echo '>';
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=' . $d . '&comment=' . $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=' . $d . '&comment=' . $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=' . $d . '&comment=' . $comment . '&type=live><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
- }
- echo '</div><div id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/live/$comment/author.txt")) {
- echo "<td width=85 valign=top>";
- $c_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
- echo "<a href=member.php?id=$c_author>";
- if ((file_get_contents("data/username.txt") == $c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
- if (file_exists("images/avatar.gif")) {
- $c_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $c_avatar_gif_image_width = $c_avatar_gif_image_size[0];
- $c_avatar_gif_image_height = $c_avatar_gif_image_size[1];
- $c_max_avatar_gif_image_width = 80;
- if ($c_avatar_gif_image_width > $c_max_avatar_gif_image_width) {
- $sizefactor = (double) ($c_max_avatar_gif_image_width / $c_avatar_gif_image_width) ;
- $c_avatar_gif_image_width = (int) ($c_avatar_gif_image_width * $sizefactor);
- $c_avatar_gif_image_height = (int) ($c_avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.gif border=0 width=";
- echo $c_avatar_gif_image_width;
- echo " height=";
- echo $c_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $c_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $c_avatar_jpg_image_width = $c_avatar_jpg_image_size[0];
- $c_avatar_jpg_image_height = $c_avatar_jpg_image_size[1];
- $c_max_avatar_jpg_image_width = 80;
- if ($c_avatar_jpg_image_width > $c_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($c_max_avatar_jpg_image_width / $c_avatar_jpg_image_width) ;
- $c_avatar_jpg_image_width = (int) ($c_avatar_jpg_image_width * $sizefactor);
- $c_avatar_jpg_image_height = (int) ($c_avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $c_avatar_jpg_image_width;
- echo " height=";
- echo $c_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $c_avatar_png_image_size = getimagesize("images/avatar.png");
- $c_avatar_png_image_width = $c_avatar_png_image_size[0];
- $c_avatar_png_image_height = $c_avatar_png_image_size[1];
- $c_max_avatar_png_image_width = 80;
- if ($c_avatar_png_image_width > $c_max_avatar_png_image_width) {
- $sizefactor = (double) ($c_max_avatar_png_image_width / $c_avatar_png_image_width) ;
- $c_avatar_png_image_width = (int) ($c_avatar_png_image_width * $sizefactor);
- $c_avatar_png_image_height = (int) ($c_avatar_png_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.png border=0 width=";
- echo $c_avatar_png_image_width;
- echo " height=";
- echo $c_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$c_author/avatar.jpg") or file_exists("images/members/$c_author/avatar.gif") or file_exists("images/members/$c_author/avatar.png")) {
- if (file_exists("images/members/$c_author/avatar.gif")) {
- $c_avatar_gif_image_size = getimagesize("images/members/$c_author/avatar.gif");
- $c_avatar_gif_image_width = $c_avatar_gif_image_size[0];
- $c_avatar_gif_image_height = $c_avatar_gif_image_size[1];
- $c_max_avatar_gif_image_width = 80;
- if ($c_avatar_gif_image_width > $c_max_avatar_gif_image_width) {
- $sizefactor = (double) ($c_max_avatar_gif_image_width / $c_avatar_gif_image_width) ;
- $c_avatar_gif_image_width = (int) ($c_avatar_gif_image_width * $sizefactor);
- $c_avatar_gif_image_height = (int) ($c_avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=images/members/$c_author/avatar.gif border=0 width=";
- echo $c_avatar_gif_image_width;
- echo " height=";
- echo $c_avatar_gif_image_height;
- }
- if (file_exists("images/members/$c_author/avatar.jpg")) {
- $c_avatar_jpg_image_size = getimagesize("images/members/$c_author/avatar.jpg");
- $c_avatar_jpg_image_width = $c_avatar_jpg_image_size[0];
- $c_avatar_jpg_image_height = $c_avatar_jpg_image_size[1];
- $c_max_avatar_jpg_image_width = 80;
- if ($c_avatar_jpg_image_width > $c_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($c_max_avatar_jpg_image_width / $c_avatar_jpg_image_width) ;
- $c_avatar_jpg_image_width = (int) ($c_avatar_jpg_image_width * $sizefactor);
- $c_avatar_jpg_image_height = (int) ($c_avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=images/members/$c_author/avatar.jpg border=0 width=";
- echo $c_avatar_jpg_image_width;
- echo " height=";
- echo $c_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$c_author/avatar.png")) {
- $c_avatar_png_image_size = getimagesize("images/members/$c_author/avatar.png");
- $c_avatar_png_image_width = $c_avatar_png_image_size[0];
- $c_avatar_png_image_height = $c_avatar_png_image_size[1];
- $c_max_avatar_png_image_width = 80;
- if ($c_avatar_png_image_width > $c_max_avatar_png_image_width) {
- $sizefactor = (double) ($c_max_avatar_png_image_width / $c_avatar_png_image_width) ;
- $c_avatar_png_image_width = (int) ($c_avatar_png_image_width * $sizefactor);
- $c_avatar_png_image_height = (int) ($c_avatar_png_image_height * $sizefactor);
- }
- echo "<img src=images/members/$c_author/avatar.png border=0 width=";
- echo $c_avatar_png_image_width;
- echo " height=";
- echo $c_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$c_author</a><br>";
- if ((file_get_contents("data/username.txt") == $c_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$c_author/rank.txt") and file_exists("data/rank.txt")) {
- $c_rank = file_get_contents("data/members/active/$c_author/rank.txt");
- echo "$c_rank<br>";
- }
- elseif (!file_exists("data/members/active/$c_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
- if ($c_dh_posts = opendir("data/items")) {
- while (($c_entry_posts = readdir($c_dh_posts)) !== false) {
- if (file_exists("data/items/$c_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if (file_exists("data/items/$c_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$entry_c_entry_posts/categories")) {
- if ($dh_cat2_c_entry_posts = opendir("data/items/$entry_c_entry_posts/categories")) {
- while (($entry_cat2_c_entry_posts = readdir($dh_cat2_c_entry_posts)) !== false) {
- if ($entry_cat2_c_entry_posts != "." && $entry_cat2_c_entry_posts != "..") {
- if (file_exists("data/categories/$entry_cat2_c_entry_posts/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_cat2_c_entry_posts);
- }
- }
- if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$c_entry_posts/cat.txt")) {
- continue;
- }
- if ($c_entry_posts != "." && $c_entry_posts != "..") {
- if (file_exists("data/members/active/$c_author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$c_entry_posts/author.txt") and (file_get_contents("data/items/$c_entry_posts/author.txt") == $c_author)) {
- $c_items_posts[] = $c_entry_posts;
- }
- }
- elseif (!file_exists("data/members/active/$c_author") and (file_get_contents("data/username.txt") == $c_author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$c_entry_posts/author.txt") and (file_get_contents("data/items/$c_entry_posts/author.txt") == $c_author)) {
- $c_items_posts[] = $c_entry_posts;
- }
- }
- }
- }
- closedir($c_dh_posts);
- }
- $c_posts = count($c_items_posts);
- if ($c_posts == 1) {
- echo "$c_posts post";
- }
- if ($c_posts > 1) {
- echo "$c_posts posts";
- }
- unset($c_items_posts);
- echo "</td><td width=513 valign=top>";
- }
- else {
- echo "<td width=598 valign=top>";
- }
- echo '<font style="font-size: 10px; color: #999999;">';
- if ((file_exists("data/items/$d/comments/live/$comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/comments/live/$comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
- $cxavatar_author = file_get_contents("data/items/$d/comments/live/$comment/author.txt");
- echo "<a href=member.php?id=$cxavatar_author>$cxavatar_author</a> - ";
- }
- entry2date($comment);
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("data/items/$d/comments/live/$comment/revisions.txt")) {
- echo ' (Revision ';
- readfile("data/items/$d/comments/live/$comment/revisions.txt");
- echo ')';
- }
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
- $entry_comment = file_get_contents("data/items/$d/comments/live/$comment/comment.txt");
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt"))))) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $entry_comment = preg_replace("/\b($badwords)\b/i",$censor,$entry_comment);
- }
- echo $entry_comment;
- echo '</tr></table></div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- unset($show_comments);
- echo '</td></tr></table>';
- if (isset($_SESSION['logged_in'])) {
- if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread/$d")) {
- rmdirr("data/comments/unread/$d");
- if (count(glob("data/comments/unread/*")) < 1) {
- rmdirr("data/comments/unread");
- }
- }
- else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d")) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d");
- if (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) < 1) {
- rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
- }
- }
- }
- }
- }
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}")))) {
- if (isset($req_show) and !empty($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'] == $_POST['captcha_put']) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- echo "<font style=\"font-size: 12px;\"><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: 12px;"><b>Add Comment</b></font>';
- if (file_exists("data/items/$d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and (!isset($_REQUEST['passwd']) or ($crypt_passwd != $passwd))) {
- echo "<p>This entry is password protected. If you know the magic word, click <a href=passwd.php?entry=$d&show=comments>here</a> to enter it.</p>";
- }
- else {
- $captcha_rand = str_rand(7);
- echo "<p>Fill out the form below";
- if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
- echo " and enter <b>$captcha_rand</b> in the anti-spam field";
- }
- echo " to add your comment.";
- if ((!isset($_SESSION['logged_in']) and !file_exists("data/xscreen.txt")) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
- echo " Note that it will not be posted immediately, but will be ";
- if (file_exists("data/email.txt")) {
- echo "e-mailed";
- }
- else {
- echo "sent";
- }
- echo " to me first.";
- if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and !file_exists("data/members/active/{$_SESSION['logged_in']}"))) {
- echo " Comments with bogus contact information will be discarded.";
- }
- }
- echo "</p>";
- ?>
- <table border=0 cellspacing=2 cellpadding=0 width=500>
- <form enctype="multipart/form-data" action="index.php?entry=<?php echo $d; ?>&show=comments" method="post">
- <input type=hidden name=captcha_get value="<?php echo $captcha_rand; ?>">
- <tr>
- <?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- ?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php $logged_in_author = explode(" ",file_get_contents("data/author.txt")); echo trim(str_replace(",","",$logged_in_author[0])); ?>"></td>
- <?php
- }
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
- ?>
- <td width=75></td><td><input type=hidden name=cauthor value="<?php echo $_SESSION['logged_in']; ?>"><input type=hidden name=firstname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/firstname.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <td width=75>First Name*</td><td width=300><input 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($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- ?>
- <td width=75></td><td><input type=hidden name=lastname value="<?php echo trim(str_replace(",","",$logged_in_author[1])); ?>"></td>
- <?php
- }
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
- ?>
- <td width=75></td><td><input type=hidden name=lastname value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/lastname.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td>Last Name*</td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
- <?php
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- if (file_exists("data/email.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/email.txt"); ?>"></td>
- <?php
- }
- else {
- echo "<tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>";
- }
- }
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=email value="<?php echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/email.txt"); ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td>E-mail*</td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
- <?php
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=url value="<?php file_get_contents("data/url.txt"); ?>"></td>
- <?php
- }
- elseif (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")) and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/bb.txt")) {
- ?>
- <td width=75></td><td colspan=2><input type=hidden name=url value="<?php if (file_exists("data/members/active/{$_SESSION['logged_in']}/url.txt")) { echo file_get_contents("data/members/active/{$_SESSION['logged_in']}/url.txt"); } ?>"></td>
- <?php
- }
- else {
- ?>
- <tr><td>Website</td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
- <?php
- }
- ?>
- <tr><td>Comment*</td><td><textarea class=input name=new_comment rows=15></textarea></td></tr>
- <?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
- echo "<input type=hidden name=captcha_put value=\"$captcha_rand\">";
- }
- else {
- echo "<tr><td>Anti-Spam*</td><td><input class=input type=text autocomplete=off name=captcha_put maxlength=7></td></tr>";
- }
- ?>
- <tr><td></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
- </form>
- </table>
- <?php
- }
- ?>
- </td></tr></table>
- <?php
- }
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($req_entry) and !empty($req_entry)) {
- if ($dh_pending_comments = opendir("data/items/$d/comments/pending")) {
- while (($entry_pending_comments = readdir($dh_pending_comments)) !== false) {
- if ($entry_pending_comments != "." && $entry_pending_comments != "..") {
- $show_pending_comments[] = $entry_pending_comments;
- }
- }
- closedir($dh_pending_comments);
- }
- asort($show_pending_comments);
- reset($show_pending_comments);
- $count_pending_comments = count($show_pending_comments);
- if ($count_pending_comments > 0) {
- if ($count_pending_comments == 1) {
- echo '<p><b>Pending Comment</b></p>';
- }
- else {
- echo '<p><b>Pending Comments</b></p>';
- }
- foreach ($show_pending_comments as $pending_comment) {
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wmain\"><tr><td>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '<a target=_maj href=';
- readfile("data/items/$d/comments/pending/$pending_comment/url.txt");
- echo '>';
- }
- readfile("data/items/$d/comments/pending/$pending_comment/firstname.txt");
- echo ' ';
- readfile("data/items/$d/comments/pending/$pending_comment/lastname.txt");
- if (file_exists("data/items/$d/comments/pending/$pending_comment/url.txt")) {
- echo '</a>';
- }
- echo ' <';
- readfile("data/items/$d/comments/pending/$pending_comment/email.txt");
- echo '>';
- echo '<a href=del.php?entry=' . $d . '&comment=' . $pending_comment . '&type=pending><img src=images/widget.del.png width=11 height=11 border=0 align=right alt="delete comment"></a>';
- $pending_comment_key_file = "data/items/$d/comments/pending/$pending_comment/key.txt";
- $pending_comment_login_key = fread($open_pending_comment_key_file,filesize($pending_comment_key_file));
- echo "<a href=\"index.php?entry=$d&comment=$pending_comment&key=$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=$d&comment=$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=' . $d . '&comment=' . $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 id=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$d/comments/pending/$pending_comment/author.txt")) {
- echo "<td width=85 valign=top>";
- $pc_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
- echo "<a href=member.php?id=$pc_author>";
- if ((file_get_contents("data/username.txt") == $pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
- if (file_exists("images/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
- $pc_max_avatar_gif_image_width = 80;
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
- $pc_max_avatar_jpg_image_width = 80;
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
- $pc_max_avatar_png_image_width = 80;
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
- }
- echo "<img src=images/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$pc_author/avatar.jpg") or file_exists("images/members/$pc_author/avatar.gif") or file_exists("images/members/$pc_author/avatar.png")) {
- if (file_exists("images/members/$pc_author/avatar.gif")) {
- $pc_avatar_gif_image_size = getimagesize("images/members/$pc_author/avatar.gif");
- $pc_avatar_gif_image_width = $pc_avatar_gif_image_size[0];
- $pc_avatar_gif_image_height = $pc_avatar_gif_image_size[1];
- $pc_max_avatar_gif_image_width = 80;
- if ($pc_avatar_gif_image_width > $pc_max_avatar_gif_image_width) {
- $sizefactor = (double) ($pc_max_avatar_gif_image_width / $pc_avatar_gif_image_width) ;
- $pc_avatar_gif_image_width = (int) ($pc_avatar_gif_image_width * $sizefactor);
- $pc_avatar_gif_image_height = (int) ($pc_avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=images/members/$pc_author/avatar.gif border=0 width=";
- echo $pc_avatar_gif_image_width;
- echo " height=";
- echo $pc_avatar_gif_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.jpg")) {
- $pc_avatar_jpg_image_size = getimagesize("images/members/$pc_author/avatar.jpg");
- $pc_avatar_jpg_image_width = $pc_avatar_jpg_image_size[0];
- $pc_avatar_jpg_image_height = $pc_avatar_jpg_image_size[1];
- $pc_max_avatar_jpg_image_width = 80;
- if ($pc_avatar_jpg_image_width > $pc_max_avatar_jpg_image_width) {
- $sizefactor = (double) ($pc_max_avatar_jpg_image_width / $pc_avatar_jpg_image_width) ;
- $pc_avatar_jpg_image_width = (int) ($pc_avatar_jpg_image_width * $sizefactor);
- $pc_avatar_jpg_image_height = (int) ($pc_avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=images/members/$pc_author/avatar.jpg border=0 width=";
- echo $pc_avatar_jpg_image_width;
- echo " height=";
- echo $pc_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$pc_author/avatar.png")) {
- $pc_avatar_png_image_size = getimagesize("images/members/$pc_author/avatar.png");
- $pc_avatar_png_image_width = $pc_avatar_png_image_size[0];
- $pc_avatar_png_image_height = $pc_avatar_png_image_size[1];
- $pc_max_avatar_png_image_width = 80;
- if ($pc_avatar_png_image_width > $pc_max_avatar_png_image_width) {
- $sizefactor = (double) ($pc_max_avatar_png_image_width / $pc_avatar_png_image_width) ;
- $pc_avatar_png_image_width = (int) ($pc_avatar_png_image_width * $sizefactor);
- $pc_avatar_png_image_height = (int) ($pc_avatar_png_image_height * $sizefactor);
- }
- echo "<img src=images/members/$pc_author/avatar.png border=0 width=";
- echo $pc_avatar_png_image_width;
- echo " height=";
- echo $pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$pc_author</a><br>";
- if ((file_get_contents("data/username.txt") == $pc_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- $pc_rank = file_get_contents("data/members/active/$pc_author/rank.txt");
- echo "$pc_rank<br>";
- }
- elseif (!file_exists("data/members/active/$pc_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
- if ($pc_dh_posts = opendir("data/items")) {
- while (($pc_entry_posts = readdir($pc_dh_posts)) !== false) {
- if (file_exists("data/items/$pc_entry_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if (file_exists("data/items/$pc_entry_posts/member.txt") and (!isset($_SESSION['logged_in']))) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$entry_pc_entry_posts/categories")) {
- if ($dh_cat2_pc_entry_posts = opendir("data/items/$entry_pc_entry_posts/categories")) {
- while (($entry_cat2_pc_entry_posts = readdir($dh_cat2_pc_entry_posts)) !== false) {
- if ($entry_cat2_pc_entry_posts != "." && $entry_cat2_pc_entry_posts != "..") {
- if (file_exists("data/categories/$entry_cat2_pc_entry_posts/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_cat2_pc_entry_posts);
- }
- }
- if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$pc_entry_posts/cat.txt")) {
- continue;
- }
- if ($pc_entry_posts != "." && $pc_entry_posts != "..") {
- if (file_exists("data/members/active/$pc_author") and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
- }
- }
- elseif (!file_exists("data/members/active/$pc_author") and (file_get_contents("data/username.txt") == $pc_author) and file_exists("data/bb.txt")) {
- if (file_exists("data/items/$pc_entry_posts/author.txt") and (file_get_contents("data/items/$pc_entry_posts/author.txt") == $pc_author)) {
- $pc_items_posts[] = $pc_entry_posts;
- }
- }
- }
- }
- closedir($pc_dh_posts);
- }
- $pc_posts = count($pc_items_posts);
- if ($pc_posts == 1) {
- echo "$pc_posts post";
- }
- if ($pc_posts > 1) {
- echo "$pc_posts posts";
- }
- unset($pc_items_posts);
- echo "</td><td width=513 valign=top>";
- }
- else {
- echo "<td width=598 valign=top>";
- }
- echo '<font style="font-size: 10px; color: #999999;">';
- if ((file_exists("data/items/$d/comments/pending/$pending_comment/author.txt") and (file_exists("data/bb.txt") and !file_exists("data/avatar.txt")) or (file_exists("data/items/$d/comments/pending/$pending_comment/author.txt") and (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and !file_exists("data/avatar.txt"))))) {
- $pxavatar_author = file_get_contents("data/items/$d/comments/pending/$pending_comment/author.txt");
- echo "<a href=member.php?id=$pxavatar_author>$pxavatar_author</a> - ";
- }
- readfile("data/items/$d/comments/pending/$pending_comment/timestamp.txt");
- if (file_exists("data/items/$d/comments/pending/$pending_comment/revisions.txt")) {
- echo ' (Revision ';
- readfile("data/items/$d/comments/pending/$pending_comment/revisions.txt");
- echo ')';
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
- readfile("data/items/$d/comments/pending/$pending_comment/comment.txt");
- echo '</tr></table></div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- unset($show_pending_comments);
- echo '</td></tr></table>';
- }
- }
- }
- }
- ?>
- <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
- <?php
- if (($start >= $increase) and ($start != 0)) {
- echo "<td align=left><a href=\"index.php?";
- if (isset($req_category) and !empty($req_category) and file_exists("data/categories/$req_category")) {
- echo "category=$req_category";
- }
- if (isset($req_archive) and !empty($req_archive)) {
- echo "archive=$req_archive";
- }
- if (isset($req_author) and !empty($req_author) and file_exists("data/members/active/$req_author") and file_exists("data/bb.txt")) {
- echo "author=$req_author";
- }
- if (isset($req_author) and !empty($req_author) and !file_exists("data/members/active/$req_author") and (file_get_contents("data/username.txt") == $req_author) and file_exists("data/bb.txt")) {
- echo "author=$req_author";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "private")) {
- echo "find=private";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "member")) {
- echo "find=member";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "unfiled")) {
- echo "find=unfiled";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "passwd")) {
- echo "find=passwd";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "comments")) {
- echo "find=comments";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "album")) {
- echo "find=album";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "filedrop")) {
- echo "find=filedrop";
- }
- echo "&start=" . ($start-$increase) . "\">previous</a></td>";
- }
- if ($end < sizeof($items)) {
- echo "<td align=right><a href=\"index.php?";
- if (isset($req_category) and !empty($req_category) and file_exists("data/categories/$req_category")) {
- echo "category=$req_category";
- }
- if (isset($req_archive) and !empty($req_archive)) {
- echo "archive=$req_archive";
- }
- if (isset($req_author) and !empty($req_author) and file_exists("data/members/active/$req_author") and file_exists("data/bb.txt")) {
- echo "author=$req_author";
- }
- if (isset($req_author) and !empty($req_author) and !file_exists("data/members/active/$req_author") and (file_get_contents("data/username.txt") == $req_author) and file_exists("data/bb.txt")) {
- echo "author=$req_author";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "private")) {
- echo "find=private";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "member")) {
- echo "find=member";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "unfiled")) {
- echo "find=unfiled";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "passwd")) {
- echo "find=passwd";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "comments")) {
- echo "find=comments";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "album")) {
- echo "find=album";
- }
- if (isset($req_find) and !empty($req_find) and ($req_find == "filedrop")) {
- echo "find=filedrop";
- }
- echo "&start=" . ($start+$increase) . "\">next</a></td>";
- }
- // right side
- echo "</tr></table></td><td width=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td><td width=\"$wside\" valign=\"top\">";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if ($dh_pending_comment_flags = opendir("data/comments/pending")) {
- while (($entry_pending_comment_flags = readdir($dh_pending_comment_flags)) !== false) {
- if ($entry_pending_comment_flags != "." && $entry_pending_comment_flags != "..") {
- $show_pending_comment_flags[] = $entry_pending_comment_flags;
- }
- }
- closedir($dh_pending_comment_flags);
- }
- rsort($show_pending_comment_flags);
- reset($show_pending_comment_flags);
- $count_pending_comment_flags = count($show_pending_comment_flags);
- if (($count_latest > 0) and ($count_pending_comment_flags > 0)) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Pending Comments</div>';
- echo '<div id="panel_body">';
- if ($dh_list_pending_comment_flags = opendir("data/comments/pending")) {
- while (($entry_list_pending_comment_flags = readdir($dh_list_pending_comment_flags)) !== false) {
- if ($entry_list_pending_comment_flags != "." && $entry_list_pending_comment_flags != "..") {
- echo "<a href=\"index.php?entry=$entry_list_pending_comment_flags&show=comments\">";
- readfile("data/items/$entry_list_pending_comment_flags/title.txt");
- echo '</a><br><font style="font-size: 10px; color: #999999;">';
- $fp_comment_count_txt = fopen("data/comments/pending/$entry_list_pending_comment_flags/count.txt","r");
- $comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$entry_list_pending_comment_flags/count.txt"));
- if ($comment_count_value == 1) {
- echo ' ( ' . $comment_count_value . ' comment ) ';
- }
- elseif ($comment_count_value > 1) {
- echo ' ( ' . $comment_count_value . ' comments ) ';
- }
- else {
- echo '';
- }
- echo '</font><br>';
- }
- }
- closedir($dh_list_pending_comment_flags);
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
- if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
- if (file_exists("data/comments/unread") and (count(glob("data/comments/unread/*")) > 0)) {
- if ($dh_unread_comments = opendir("data/comments/unread")) {
- while (($unread_comment = readdir($dh_unread_comments)) !== false) {
- if ($unread_comment != "." && $unread_comment != "..") {
- $unread_comments[] = $unread_comment;
- }
- }
- closedir($dh_unread_comments);
- }
- }
- }
- else {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread") and (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) > 0)) {
- if ($dh_unread_comments = opendir("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
- while (($unread_comment = readdir($dh_unread_comments)) !== false) {
- if ($unread_comment != "." && $unread_comment != "..") {
- $unread_comments[] = $unread_comment;
- }
- }
- closedir($dh_unread_comments);
- }
- }
- }
- }
- sort($unread_comments);
- reset($unread_comments);
- if (count($unread_comments) > 0) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Unread Comments</div><div id=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
- foreach ($unread_comments as $unread_comment) {
- $unread_comment_title = file_get_contents("data/items/$unread_comment/title.txt");
- echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$unread_comment&show=comments\">$unread_comment_title</a></td></tr>";
- }
- echo '</table></div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and file_exists("data/members/confirmed") and !file_exists("data/xapp.txt") and file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
- if ($dh_pending_list = opendir("data/members/confirmed")) {
- while (($entry_pending_list = readdir($dh_pending_list)) !== false) {
- if ($entry_pending_list != "." && $entry_pending_list != "..") {
- $show_pending_list[] = $entry_pending_list;
- }
- }
- closedir($dh_pending_list);
- }
- sort($show_pending_list);
- reset($show_pending_list);
- $count_pending_list = count($show_pending_list);
- if ($count_pending_list > 0) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "Pending Member";
- if ($count_pending_list > 1) {
- echo "s";
- }
- echo "</div><div id=panel_body>Please approve or deny $count_pending_list pending membership request";
- if ($count_pending_list > 1) {
- echo "s";
- }
- echo " below.</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- foreach ($show_pending_list as $pending_list_entry) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "$pending_list_entry";
- echo '<a href=reg.php?username=';
- echo $pending_list_entry;
- echo '&key=';
- readfile("data/members/confirmed/$pending_list_entry/key.txt");
- echo '&action=deny><img src=images/widget.del.png border=0 width=11 height=11 align=right alt=deny></a><a href=reg.php?username=';
- echo $pending_list_entry;
- echo '&key=';
- readfile("data/members/confirmed/$pending_list_entry/key.txt");
- echo '&action=approve><img src=images/widget.cat.png border=0 width=11 height=11 align=right alt=approve></a></div>';
- echo "<div id=panel_body>";
- if (file_exists("data/members/confirmed/$pending_list_entry/url.txt")) {
- echo "<a href=\"";
- readfile("data/members/confirmed/$pending_list_entry/url.txt");
- echo "\" target=_pending>";
- }
- readfile("data/members/confirmed/$pending_list_entry/firstname.txt");
- echo " ";
- readfile("data/members/confirmed/$pending_list_entry/lastname.txt");
- if (file_exists("data/members/confirmed/$pending_list_entry/url.txt")) {
- echo "</a>";
- }
- echo "<br>";
- $pending_email = file_get_contents("data/members/confirmed/$pending_list_entry/email.txt");
- $pending_email = wordwrap($pending_email,30);
- echo $pending_email;
- if (file_exists("data/members/confirmed/$pending_list_entry/timestamp.txt")) {
- $confirmed = file_get_contents("data/members/confirmed/$pending_list_entry/timestamp.txt");
- $confirmed_year = substr($confirmed,0,4);
- $confirmed_month = substr($confirmed,4,2);
- $confirmed_day = substr($confirmed,6,2);
- $confirmed_hh = substr($confirmed,8,2);
- $confirmed_mm = substr($confirmed,10,2);
- $email_confirmed = date("d M Y H:i",mktime($confirmed_hh,$confirmed_mm,0,$confirmed_month,$confirmed_day,$confirmed_year));
- echo "<br>$email_confirmed";
- }
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- }
- if (file_exists("data/bb.txt") and file_exists("data/bb-stats.txt")) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "Bulletin Board</div><div id=panel_body>";
- if (file_exists("data/members/active") and file_exists("data/bb.txt")) {
- if ($dh_active_list = opendir("data/members/active")) {
- while (($entry_active_list = readdir($dh_active_list)) !== false) {
- if ($entry_active_list != "." && $entry_active_list != "..") {
- $show_active_list[] = $entry_active_list;
- }
- }
- closedir($dh_active_list);
- }
- sort($show_active_list);
- reset($show_active_list);
- $count_active_list = count($show_active_list);
- if ($count_active_list > 0) {
- echo "Registered Members: $count_active_list";
- }
- }
- if (file_exists("data/items")) {
- if ($dh_mempost_list = opendir("data/items")) {
- while (($entry_mempost_list = readdir($dh_mempost_list)) !== false) {
- if (file_exists("data/items/$entry_mempost_list/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- $private_categories = "0";
- if (file_exists("data/items/$entry_mempost_list/categories")) {
- if ($dh_entry_categories_mempost_list = opendir("data/items/$entry_mempost_list/categories")) {
- while (($entry_category_mempost_list = readdir($dh_entry_categories_mempost_list)) !== false) {
- if ($entry_category_mempost_list != "." && $entry_category_mempost_list != "..") {
- if (file_exists("data/categories/$entry_category_mempost_list/private.txt")) {
- $private_categories = $private_categories + 1;
- }
- }
- }
- closedir($dh_entry_categories_mempost_list);
- }
- }
- if (($private_categories > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$entry_mempost_list/cat.txt")) {
- continue;
- }
- if ($entry_mempost_list != "." && $entry_mempost_list != "..") {
- $entry_mempost_list = substr("$entry_mempost_list",0,6);
- $show_mempost_list[] = $entry_mempost_list;
- }
- }
- closedir($dh_mempost_list);
- }
- rsort($show_mempost_list);
- $count_mempost_list = count($show_mempost_list);
- echo "<br>Total Posts: $count_mempost_list";
- unset($show_mempost_list);
- }
- if (file_exists("data/bb-new.txt")) {
- $bb_new = file_get_contents("data/bb-new.txt");
- echo "<br>Newest User: <a href=member.php?id=$bb_new>$bb_new</a>";
- }
- if (file_exists("data/bb-last.txt")) {
- $bb_last = file_get_contents("data/bb-last.txt");
- echo "<br>Latest Login: <a href=member.php?id=$bb_last>$bb_last</a>";
- }
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if ($count_grand > 0) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- ?>
- Search</div>
- <form enctype="multipart/form-data" action="dig.php" method="post">
- <input type="text" class="search" name="search" autocomplete="off" maxlength="55">
- </form>
- </div>
- <?php
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "Find Entries</div><div id=panel_body>";
- echo "<a class=\"navlink\" href=\"index.php?find=private\">Private</a>";
- if (file_exists("data/bb.txt")) {
- echo "<br><a class=\"navlink\" href=\"index.php?find=member\">Members-Only</a>";
- }
- echo "<br><a class=\"navlink\" href=\"index.php?find=unfiled\">Unfiled</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=passwd\">Password Protected</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=comments\">With Comments</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=filedrop\">With Attached Files</a>";
- echo "<br><a class=\"navlink\" href=\"index.php?find=album\">With Photo Album</a>";
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if (file_exists("data/categories")) {
- if ($dh_categories = opendir("data/categories")) {
- while (($entry_categories = readdir($dh_categories)) !== false) {
- if (file_exists("data/xcat.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if (file_exists("data/categories/$entry_categories/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- if ($entry_categories != "." && $entry_categories != "..") {
- $show_categories[] = $entry_categories;
- }
- }
- closedir($dh_categories);
- }
- sort($show_categories);
- reset($show_categories);
- $count_categories = count($show_categories);
- if ($count_categories > 0) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Categories</div><div id=panel_body>';
- foreach ($show_categories as $category) {
- echo "<a class=\"navlink\" href=\"index.php?category=$category\">";
- if (file_exists("data/categories/$category/title.txt")) {
- $category_title = file_get_contents("data/categories/$category/title.txt");
- }
- else {
- $category_title = ucfirst(str_replace("_"," ",$category));
- }
- echo $category_title;
- echo "</a><br>";
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Statistics</div><div id=panel_body>';
- echo "Total Entries: $count_latest";
- if (file_exists("data/hits.txt")) {
- echo '<br>Site Hits: ';
- readfile("data/hits.txt");
- }
- if (file_exists("data/google.txt")) {
- echo '<br>Google Visits: ';
- readfile("data/google.txt");
- }
- if (file_exists("data/rss-0.91.txt")) {
- echo '<br>RSS 0.91 Hits: ';
- readfile("data/rss-0.91.txt");
- }
- if (file_exists("data/rss-1.0.txt")) {
- echo '<br>RSS 1.0 Hits: ';
- readfile("data/rss-1.0.txt");
- }
- if (file_exists("data/rss-2.0.txt")) {
- echo '<br>RSS 2.0 Hits: ';
- readfile("data/rss-2.0.txt");
- }
- if (file_exists("data/sitemap.txt")) {
- echo '<br>Sitemap Requests: ';
- readfile("data/sitemap.txt");
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if (($count_latest > 0) and ($count_latest > $increase) and (!file_exists("data/xrecent.txt") or isset($_SESSION['logged_in']))) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo 'Recent Entries</div><div id=panel_body>';
- $increment_recent_entries = "0";
- if ($count_latest < 10) {
- $max_recent_entries = $count_latest;
- }
- else {
- $max_recent_entries = "10";
- }
- while ($increment_recent_entries < $max_recent_entries) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$latest[$increment_recent_entries]\">";
- readfile("data/items/$latest[$increment_recent_entries]/title.txt");
- echo "</a><br>";
- $increment_recent_entries = $increment_recent_entries + 1;
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if ($count_albums > 0) {
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
- }
- else {
- echo "<div id=\"panel_title\">";
- }
- echo "Albums</div><div id=\"panel_body\">";
- foreach ($albums as $album) {
- echo "<a class=\"navlink\" href=\"index.php?entry=$album&show=album\">";
- readfile("data/items/$album/title.txt");
- echo "</a><br>";
- }
- echo '</div>';
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- if (!file_exists("data/xrand.txt")) {
- shuffle($random);
- reset($random);
- if (file_exists("data/increase.txt")) {
- $limit_random = file_get_contents("data/increase.txt");
- }
- else {
- $limit_random = 5;
- }
- if ($count_random > $limit_random) {
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
- echo "Random Entries</div><div id=\"panel_body\">";
- $increment_random = 0;
- if ($count_random <= $limit_random * 2) {
- $show_random = $count_random - 1;
- }
- else {
- $show_random = $limit_random * 2 - 1;
- }
- while ($increment_random <= $show_random) {
- echo "<a class=\"navlink\" href=\"index.php?entry={$random[$increment_random]}\">";
- readfile("data/items/$random[$increment_random]/title.txt");
- echo "</a><br>";
- $increment_random = $increment_random + 1;
- }
- }
- if ($count_random > $limit_random) {
- echo "</div>";
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
- }
- }
- ?>
- <?php
- if (($count_archives > 0) and ($count_latest > $increase) and ($count_latest > 0) and (!file_exists("data/xarc.txt") or isset($_SESSION['logged_in']))) {
- $archive_entries = implode(" ",$archives);
- $unique_archive_list = array_unique($archives);
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
- }
- else {
- echo "<div id=\"panel_title\">";
- }
- echo "Archives ($count_archives)</div>";
- echo "<div id=\"panel_body\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
- foreach ($unique_archive_list as $archive_list_entry) {
- $archive_list_value = substr($archive_list_entry,0,6);
- $archive_list_year = substr($archive_list_entry,0,4);
- $archive_list_month = substr($archive_list_entry,4,2);
- $archive_list_num = substr_count($archive_entries,$archive_list_entry);
- echo "<tr><td><a class=\"navlink\" href=\"index.php?archive=$archive_list_value\"><nobr>$archive_list_month $archive_list_year</nobr></a></td><td align=right>$archive_list_num</td></tr>";
- }
- echo "</table></div>";
- if (file_exists("data/round.txt")) {
- echo "<b class=\"rbbottom\"><b class=\"rb4b\"></b><b class=\"rb3b\"></b><b class=\"rb2b\"></b><b class=\"rb1b\"></b></b>";
- }
- }
- if ($count_right_panels > 0) {
- foreach ($right_panels as $right_panel) {
- if (!file_exists("data/panels/$right_panel/free.txt")) {
- if (file_exists("data/panels/$right_panel/border.txt")) {
- $right_panel_border = file_get_contents("data/panels/$right_panel/border.txt");
- }
- else {
- if (isset($right_panel_border)) {
- unset($right_panel_border);
- }
- }
- if (file_exists("data/panels/$right_panel/bgcolor-t.txt")) {
- $right_panel_bgcolor_t = file_get_contents("data/panels/$right_panel/bgcolor-t.txt");
- }
- else {
- if (isset($right_panel_bgcolor_t)) {
- unset($right_panel_bgcolor_t);
- }
- }
- if (file_exists("data/panels/$right_panel/bgcolor-c.txt")) {
- $right_panel_bgcolor_c = file_get_contents("data/panels/$right_panel/bgcolor-c.txt");
- }
- else {
- if (isset($right_panel_bgcolor_c)) {
- unset($right_panel_bgcolor_c);
- }
- }
- if (file_exists("data/panels/$right_panel/text-t.txt")) {
- $right_panel_text_t = file_get_contents("data/panels/$right_panel/text-t.txt");
- }
- else {
- if (isset($right_panel_text_t)) {
- unset($right_panel_text_t);
- }
- }
- if (file_exists("data/panels/$right_panel/text-c.txt")) {
- $right_panel_text_c = file_get_contents("data/panels/$right_panel/text-c.txt");
- }
- else {
- if (isset($right_panel_text_c)) {
- unset($right_panel_text_c);
- }
- }
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"';
- if (isset($right_panel_border)) {
- echo " style=\"background-color: $right_panel_border;\"";
- }
- echo '></b><b class="rb2t"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_t)) {
- echo "background-color: $right_panel_bgcolor_t;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb3t"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_t)) {
- echo "background-color: $right_panel_bgcolor_t;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b><b class="rb4t"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_t)) {
- echo "background-color: $right_panel_bgcolor_t;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t)) {
- echo '"';
- }
- echo '></b></b><div class="xtitle"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t) or isset($right_panel_text_t)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_t)) {
- echo "background-color: $right_panel_bgcolor_t;";
- }
- if (isset($right_panel_text_t)) {
- echo "color: $right_panel_text_t;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t) or isset($right_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- else {
- echo '<div id="panel_title"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t) or isset($right_panel_text_t)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_t)) {
- echo "background-color: $right_panel_bgcolor_t;";
- }
- if (isset($right_panel_text_t)) {
- echo "color: $right_panel_text_t;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_t) or isset($right_panel_text_t)) {
- echo '"';
- }
- echo '>';
- }
- readfile("data/panels/$right_panel/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo "<a href=\"panels.php#{$right_panel}\">";
- echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
- }
- if (file_exists("data/panels/$right_panel/private.txt")) {
- echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
- }
- echo '</div>';
- echo '<div id="panel_body"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c) or isset($right_panel_text_c)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_c)) {
- echo "background-color: $right_panel_bgcolor_c;";
- }
- if (isset($right_panel_text_c)) {
- echo "color: $right_panel_text_c;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c) or isset($right_panel_text_c)) {
- echo '"';
- }
- echo '>';
- }
- if (file_exists("data/panels/$right_panel/free.txt")) {
- echo '<div id=panel_free>';
- }
- include("data/panels/$right_panel/panel.php");
- echo '</div>';
- if (file_exists("data/round.txt") and !file_exists("data/panels/$right_panel/free.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_c)) {
- echo "background-color: $right_panel_bgcolor_c;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb3b"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_c)) {
- echo "background-color: $right_panel_bgcolor_c;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb2b"';
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo ' style="';
- }
- if (isset($right_panel_bgcolor_c)) {
- echo "background-color: $right_panel_bgcolor_c;";
- }
- if (isset($right_panel_border)) {
- echo "border-color: $right_panel_border;";
- }
- if (isset($right_panel_border) or isset($right_panel_bgcolor_c)) {
- echo '"';
- }
- echo '></b><b class="rb1b"';
- if (isset($right_panel_border)) {
- echo " style=\"background-color: $right_panel_border;\"";
- }
- echo '></b></b>';
- }
- }
- }
- if ($count_latest > 0) {
- echo '<table border="0" cellspacing="2" cellpadding="0" width="100%">';
- echo '<tr><td align="center"><a target="_button" href="http://maj.sourceforge.net/"><img src="images/button.maj.png" border="0" width="80" height="15"></a></td></tr>';
- echo '<tr><td align="center"><a target="_button" href="http://php.net/"><img src="images/button.php.png" border="0" width="80" height="15"></a></td></tr>';
- $validate_uri = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $validate_uri = str_replace('//','/',$validate_uri);
- $validate_uri = "http://" . $validate_uri;
- echo '<tr><td align="center"><a target="_button" href="http://jigsaw.w3.org/css-validator/validator?uri=' . $validate_uri . '"><img src="images/button.w3c.css.png" border="0" width="80" height="15"></a></td></tr>';
- echo '<tr><td align="center"><a target="_button" href="rss.php?ver=0.91"><img src="images/button.rss-0.91.png" border="0" width="80" height="15"></a></td></tr>';
- echo '<tr><td align="center"><a target="_button" href="rss.php?ver=1.0"><img src="images/button.rss-1.0.png" border="0" width="80" height="15"></a></td></tr>';
- echo '<tr><td align="center"><a target="_button" href="rss.php?ver=2.0"><img src="images/button.rss-2.0.png" border="0" width="80" height="15"></a></td></tr>';
- echo '<tr><td align="center"><a target="_button" href="sitemap.php"><img src="images/button.sitemap.png" border="0" width="80" height="15"></a></td></tr>';
- if (file_exists("data/sfx.txt")) {
- $sfx = file_get_contents("data/sfx.txt");
- echo "<tr><td align=\"center\"><a target=\"_button\" href=\"http://www.spreadfirefox.com/?q=affiliates&id=$sfx&t=85\"><img src=\"images/button.firefox.png\" border=\"0\" width=\"80\" height=\"15\"></a></td></tr>";
- }
- echo '</table>';
- }
- echo "</td></tr>";
- echo "<tr><td width=\"$wside\" height=\"$wspace\"></td><td width=\"$wspace\" height=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td><td width=\"$wmain\" height=\"$wspace\"></td><td width=\"$wspace\" height=\"$wspace\"><div style=\"width: {$wspace}px;\"></div></td><td width=\"$wside\" height=\"$wspace\"></td></tr>";
- echo "</table>";
- if (file_exists("data/footer.txt")) {
- $footer_panel = file_get_contents("data/footer.txt");
- if (file_exists("data/panels/$footer_panel") and (!file_exists("data/panels/$footer_panel/private.txt") or isset($_SESSION['logged_in']))) {
- include("data/panels/$footer_panel/panel.php");
- }
- }
- if (file_exists("data/center.txt")) {
- echo "</center>";
- }
- ?>