This blob has been accessed 377 times via Git panel.
- <?php
- session_start();
- header("Cache-control: private");
- $dir = "data/items";
- $default_title = file_get_contents("data/title.txt");
- 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;
- }
- $default_blog_title = "My Activity Journal";
- $default_username = "maj";
- $default_password = "php";
- $default_blog_profile = "This cool site is powered by <a href=http://engels.mortega.net/index.php?entry=20050521000019 target=_blank>My Activity Journal</a>, a dead-simple, <a href=http://php.net/ target=_blank>PHP</a>-based, <a href=http://www.opensource.org/licenses/gpl-license.php target=_blank>GPL</a>'ed blog written from scratch as a spare time family project by <a href=http://engels.mortega.net/ target=_blank>Engels</a>, <a href=http://gaffud.com/ target=_blank>Magie</a>, and <a href=http://psylocke.org/ target=_blank>Psylocke</a> Antonio.";
- $default_blog_author = "My Activity Journal";
- $default_blog_email = "root@localhost";
- if (!file_exists("data")) {
- mkdir("data");
- chmod("data", 0777);
- chmod("images/smileys", 0777);
- }
- if (!file_exists("data/.htaccess")) {
- $htaccess = "Order deny,allow\nDeny from all";
- }
- if (!file_exists("data/title.txt")) {
- chmod("data/title.txt", 0666);
- }
- if (!file_exists("data/username.txt")) {
- chmod("data/username.txt", 0666);
- }
- if (!file_exists("data/password.txt")) {
- $default_password = sha1($default_password);
- $default_password = md5($default_password);
- $default_password = crypt($default_password, $default_password);
- chmod("data/password.txt", 0666);
- }
- if (!file_exists("data/profile.php")) {
- chmod("data/profile.php", 0666);
- }
- if (!file_exists("data/author.txt")) {
- chmod("data/author.txt", 0666);
- }
- if (!file_exists("data/email.txt")) {
- chmod("data/email.txt", 0666);
- }
- $username_file = 'data/username.txt';
- if (!isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- $global_hits_count = $global_hits_count + 1;
- chmod("data/hits.txt", 0666);
- }
- $agent = $_SERVER['HTTP_USER_AGENT'];
- if (@ereg("Google", $agent)) {
- $google_hits_count = $google_hits_count + 1;
- chmod("data/google.txt", 0666);
- }
- 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');
- $file = str_replace('../','', @$_REQUEST['download']);
- go_download($file);
- die();
- }
- function go_download($entry_filedrop) {
- $d = $_REQUEST['entry'];
- header("Cache-Control: ");
- header("Pragma: ");
- header("Content-type: application/octet-stream");
- header("Content-Disposition: attachment; filename=\"" . $entry_filedrop . "\"");
- header("Content-length: " . filesize("data/items/$d/filedrop/files/$entry_filedrop"));
- echo $buf;
- }
- if ($bytes_sent==filesize("data/items/$d/filedrop/files/$entry_filedrop")) {
- $filedrop_dl_count_dir = 'data/items/' . $_REQUEST['entry'] . '/filedrop/count';
- if (!file_exists($filedrop_dl_count_dir)) {
- mkdir($filedrop_dl_count_dir);
- chmod($filedrop_dl_count_dir, 0777);
- }
- $unique_downloads = $filedrop_dl_count_dir . '/' . $entry_filedrop . '.txt';
- $count_unique_downloads = $count_unique_downloads + 1;
- chmod($unique_downloads, 0666);
- }
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['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/' . $_REQUEST['entry'] .'/comments/pending/' . $_REQUEST['comment'];
- $key_file = $comment_dir . '/key.txt';
- if ($_REQUEST['key'] == $login_key) {
- if ($_REQUEST['action'] == "approve") {
- $live_dir = 'data/items/' . $_REQUEST['entry'] .'/comments/live/' . $_REQUEST['comment'];
- unlink("$live_dir/key.txt");
- }
- if ($_REQUEST['action'] == "delete") {
- rmdirr($comment_dir);
- }
- $pending_comment_flag_dir = $_REQUEST['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;
- chmod("data/comments/pending/$pending_comment_flag_dir/count.txt", 0666);
- }
- header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '?entry=' . $_REQUEST['entry'] . '&show=comments');
- }
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $check = $dir . '/' . $_REQUEST['entry'];
- if (file_exists("$check")) {
- $filter = $_REQUEST['entry'];
- echo '<title>';
- $title = $check . '/title.txt';
- readfile($title);
- echo '</title>';
- $views = $check . '/views.txt';
- if (!isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- $count_views = $count_views + 1;
- chmod($views, 0666);
- }
- if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_REQUEST['capcha_put']) and !empty($_REQUEST['capcha_get']) and isset($_REQUEST['firstname']) and !empty($_REQUEST['firstname']) and isset($_REQUEST['lastname']) and !empty($_REQUEST['lastname']) and isset($_REQUEST['email']) and !empty($_REQUEST['email']) and isset($_REQUEST['new_comment']) and !empty($_REQUEST['new_comment']) and isset($_REQUEST['capcha_put']) and !empty($_REQUEST['capcha_put']) and ($_REQUEST['capcha_get'] == $_REQUEST['capcha_put']) and (ereg("@", $_REQUEST['email'])) and (ereg("\.", $_REQUEST['email']))) {
- if (!file_exists("$check/comments")) {
- mkdir("$check/comments");
- chmod("$check/comments", 0777);
- }
- if (!file_exists("$check/comments/pending")) {
- mkdir("$check/comments/pending");
- chmod("$check/comments/pending", 0777);
- }
- if (!file_exists("$check/comments/live")) {
- mkdir("$check/comments/live");
- chmod("$check/comments/live", 0777);
- }
- // GNU date format
- //$timestamp = date("D M j H:i:s \P\H\T Y", time() + $offset);
- // Simple PHP Blog format
- mkdir("$check/comments/pending/$comment_entry_dir");
- chmod("$check/comments/pending/$comment_entry_dir", 0777);
- $body_content = ucfirst($_REQUEST['new_comment']);
- $body_content = htmlentities($body_content, ENT_NOQUOTES);
- // $body_content = str_replace('href=', 'rel=nofollow target=_blank href=', $body_content);
- $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);
- chmod($fp_body_txt, 0666);
- chmod($fp_timestamp_txt, 0666);
- chmod($fp_firstname_txt, 0666);
- $firstname = ucwords($_REQUEST['firstname']);
- $firstname = trim($firstname);
- $firstname = htmlentities($firstname, ENT_NOQUOTES);
- chmod($fp_lastname_txt, 0666);
- $lastname = ucwords($_REQUEST['lastname']);
- $lastname = trim($lastname);
- $lastname = htmlentities($lastname, ENT_NOQUOTES);
- chmod($fp_email_txt, 0666);
- $email = str_replace('@', ' at ', $_REQUEST['email']);
- $email = strtolower($email);
- $email = trim($email);
- $email = htmlentities($email, ENT_NOQUOTES);
- if (isset($_REQUEST['url']) and !empty($_REQUEST['url']) and (ereg("\.", $_REQUEST['url']))) {
- chmod($fp_url_txt, 0666);
- $url = str_replace('http://', '', $_REQUEST['url']);
- $url = strtolower($url);
- $url = trim($url);
- $url = 'http://' . $url;
- $url = htmlentities($url, ENT_NOQUOTES);
- }
- $key_rand = str_rand(14);
- chmod($fp_key_txt, 0666);
- $comment_quote = ucfirst($_REQUEST['new_comment']);
- $comment_quote = htmlentities($comment_quote, ENT_NOQUOTES);
- $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($_REQUEST['email']);
- $email_to = $firstname . " " . $lastname . ' <' . $email_to . '>';
- $from_email_file = "data/email.txt";
- $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
- $commented_entry_title_file = "data/items/{$_REQUEST['entry']}/title.txt";
- if (!file_exists("data/nak.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={$_REQUEST['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 posting a comment on my blog!", $comment_thanks,
- "From: $from_email\r\n" .
- "Reply-To: $from_email\r\n" .
- "X-Mailer: $mailer");
- }
- $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={$_REQUEST['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={$_REQUEST['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 Blog 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");
- chmod("data/comments", 0777);
- }
- if (!file_exists("data/comments/pending")) {
- mkdir("data/comments/pending");
- chmod("data/comments/pending", 0777);
- }
- $pending_comment_flag = $_REQUEST['entry'];
- if (!file_exists("data/comments/pending/$pending_comment_flag")) {
- mkdir("data/comments/pending/$pending_comment_flag");
- chmod("data/comments/pending/$pending_comment_flag", 0777);
- }
- $comment_count_value = fread($fp_comment_count_txt,filesize("data/comments/pending/$pending_comment_flag/count.txt"));
- $comment_count_value = $comment_count_value + 1;
- chmod("data/comments/pending/$pending_comment_flag/count.txt", 0666);
- }
- }
- else {
- echo '<title>' . $default_title . '</title>';
- $filter = "*";
- }
- }
- else {
- echo '<title>' . $default_title . '</title>';
- $filter = "*";
- }
- ?>
- <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: 10px;
- padding: 0px;
- text-align: left;
- font-family: verdana, helvetica, sans-serif;
- background-color: <?php
- if (file_exists("data/colors/background.txt")) {
- $background_color = file_get_contents("data/colors/background.txt");
- 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/a-link.txt")) {
- $a_link_color = file_get_contents("data/colors/a-link.txt");
- echo $a_link_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- }
- a:visited
- {
- color: <?php
- if (file_exists("data/colors/a-visited.txt")) {
- $a_visited_color = file_get_contents("data/colors/a-visited.txt");
- echo $a_visited_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- }
- a:hover
- {
- color: <?php
- if (file_exists("data/colors/a-hover.txt")) {
- $a_hover_color = file_get_contents("data/colors/a-hover.txt");
- echo $a_hover_color;
- }
- else {
- echo "#336699";
- }
- ?>;
- }
- a:active {
- color: <?php
- if (file_exists("data/colors/a-active.txt")) {
- $a_active_color = file_get_contents("data/colors/a-active.txt");
- echo $a_active_color;
- }
- else {
- echo "#336699";
- }
- ?>;
- }
- #panel_title
- {
- font-family: verdana, helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: <?php
- if (file_exists("data/colors/panel-title-font.txt")) {
- $panel_title_font_color = file_get_contents("data/colors/panel-title-font.txt");
- echo $panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- padding: 5px 5px 5px 5px;
- background-color: <?php
- if (file_exists("data/colors/panel-title-background.txt")) {
- $panel_title_background_color = file_get_contents("data/colors/panel-title-background.txt");
- echo $panel_title_background_color;
- }
- else {
- echo "#FFFFFF";
- }
- ?>;
- margin: 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: verdana, helvetica, sans-serif;
- font-size: 11px;
- color: <?php
- if (file_exists("data/colors/panel-body-font.txt")) {
- $panel_body_font_color = file_get_contents("data/colors/panel-body-font.txt");
- echo $panel_body_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- padding: 5px 5px 5px 5px;
- background-color: <?php
- if (file_exists("data/colors/panel-body-background.txt")) {
- $panel_body_background_color = file_get_contents("data/colors/panel-body-background.txt");
- echo $panel_body_background_color;
- }
- else {
- echo "#FFFFFF";
- }
- ?>;
- margin: 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";
- }
- ?>;
- border-width: 1px 1px 1px 1px;
- border-style: solid solid solid solid;
- }
- #panel_footer
- {
- font-family: verdana, helvetica, sans-serif;
- font-size: 11px;
- color: <?php
- if (file_exists("data/colors/panel-footer-font.txt")) {
- $panel_footer_font_color = file_get_contents("data/colors/panel-footer-font.txt");
- echo $panel_footer_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
- padding: 5px 5px 5px 5px;
- background-color: <?php
- if (file_exists("data/colors/panel-footer-background.txt")) {
- $panel_footer_background_color = file_get_contents("data/colors/panel-footer-background.txt");
- echo $panel_footer_background_color;
- }
- else {
- echo "#FFFFFF";
- }
- ?>;
- margin: 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";
- }
- ?>;
- border-width: 0px 1px 1px 1px;
- border-style: none solid solid solid;
- }
- .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: verdana,helvetica,sans-serif;
- font-size: 11px;
- }
- .search {
- color: #666666;
- background: #FFFFFF;
- width: 100%;
- font-family: verdana,helvetica,sans-serif;
- font-size: 11px;
- }
- </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("header.php")) {
- include("header.php");
- echo '<p></p>';
- }
- ?>
- <table border=0 cellspacing=0 cellpadding=0 width=905>
- <tr><td width=175 valign=top>
- <?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=";
- echo $profile_gif_image_width;
- echo " height=";
- echo $profile_gif_image_height;
- echo " 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=";
- echo $profile_jpg_image_width;
- echo " height=";
- echo $profile_jpg_image_height;
- echo " 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=";
- echo $profile_png_image_width;
- echo " height=";
- echo $profile_png_image_height;
- echo " align=left>";
- }
- include("data/profile.php");
- ?>
- </div>
- <p></p>
- <a href="<?php echo $_SERVER['PHP_SELF']; ?>">Home</a><br>
- <?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=add.php>Add Entry</a><br>';
- echo '<a href=settings.php>Settings</a><br>';
- echo '<a href=cat.php>Categories</a><br>';
- echo '<a href=login.php>Logout</a>';
- }
- else {
- echo '<a href=login.php>Login</a>';
- }
- ?>
- </div>
- <p></p>
- <?php
- if (file_exists("data/sticky")) {
- if ($dh_sticky_list = opendir("data/sticky")) {
- while (($entry_sticky_list = readdir($dh_sticky_list)) !== false) {
- if (file_exists("data/items/$entry_sticky_list/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- $get_cat_dir = file_get_contents("data/items/$entry_sticky_list/category.txt");
- if (file_exists("data/categories/$get_cat_dir/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and !file_exists("data/items/$entry_sticky_list/cat.txt")) {
- continue;
- }
- if ($entry_sticky_list != "." && $entry_sticky_list != ".." && fnmatch("*", $entry_sticky_list)) {
- $show_sticky_list[] = $entry_sticky_list;
- }
- }
- closedir($dh_sticky_list);
- }
- sort($show_sticky_list);
- reset($show_sticky_list);
- $count_sticky_list = count($show_sticky_list);
- if ($count_sticky_list > 0) {
- echo '<div id=panel_title>Links</div>';
- echo '<div id=panel_body>';
- foreach ($show_sticky_list as $sticky_list_entry) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=';
- echo $sticky_list_entry;
- echo '>';
- readfile("data/items/$sticky_list_entry/title.txt");
- echo '</a><br>';
- }
- echo '</div>';
- }
- }
- ?>
- <p></p>
- </td><td width=15></td><td valign=top>
- <?php
- if (is_dir($dir)) {
- if ($dh = opendir($dir)) {
- while (($entry_main = readdir($dh)) !== false) {
- if (file_exists("data/items/$entry_main/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- $cat_dir = file_get_contents("data/items/$entry_main/category.txt");
- if (file_exists("data/categories/$cat_dir/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and !file_exists("data/items/$entry_main/cat.txt")) {
- continue;
- }
- if (file_exists("data/nocat.txt") and file_exists("data/items/$entry_main/category.txt") and !file_exists("data/items/$entry_main/cat.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and (!isset($_REQUEST['category']) or empty($_REQUEST['category'])) and (!isset($_REQUEST['entry']) or empty($_REQUEST['entry']))) {
- continue;
- }
- if ($entry_main != "." && $entry_main != ".." && fnmatch($filter, $entry_main)) {
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and file_exists(strip_tags(strtolower(str_replace(" ", "-", "data/categories/{$_REQUEST['category']}"))))) {
- $category = str_replace(" ", "-", $_REQUEST['category']);
- $category = strtolower($category);
- $category = strip_tags($category);
- if (file_exists("data/items/$entry_main/category.txt") and (file_get_contents("data/items/$entry_main/category.txt") == "$category")) {
- $items[] = $entry_main;
- }
- }
- else {
- $items[] = $entry_main;
- }
- }
- }
- closedir($dh);
- }
- }
- if (!file_exists("data/old.txt")) {
- rsort($items);
- }
- if (file_exists("data/old.txt")) {
- sort($items);
- }
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $category = str_replace(" ", "-", $_REQUEST['category']);
- $category = strtolower($category);
- $category = strip_tags($category);
- if (file_exists("data/categories/$category/book.txt")) {
- sort($items);
- }
- }
- reset($items);
- $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) {
- if (file_exists("$dir/$d/category.txt")) {
- $category_check = 'data/categories/' . file_get_contents("$dir/$d/category.txt");
- if (!file_exists($category_check)) {
- unlink("$dir/$d/category.txt");
- }
- }
- if (file_exists("$dir/$d/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- echo '<p><table border=0 cellspacing=0 cellpadding=0 bgcolor=#CCCCCC style="background-color: transparent;"><tr><td width=525><div id=panel_title>';
- readfile("$dir/$d/title.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $d;
- echo '><img src=images/widget.del.png border=0 width=11 height=11 align=right alt="delete entry"></a>';
- echo '<a href=edit.php?entry=';
- echo $d;
- echo '><img src=images/widget.edit.png border=0 width=11 height=11 align=right alt="edit entry"></a>';
- if (file_exists("$dir/$d/private.txt")) {
- echo '<img src=images/widget.private.png border=0 width=11 height=11 align=right alt="private entry">';
- }
- if (file_exists("$dir/$d/cat.txt")) {
- echo '<img src=images/widget.cat.png border=0 width=11 height=11 align=right alt="always display">';
- }
- if (file_exists("$dir/$d/category.txt")) {
- $read_cat_dir = file_get_contents("$dir/$d/category.txt");
- if (file_exists("data/categories/$read_cat_dir/private.txt")) {
- echo '<img src=images/widget.hidden.png border=0 width=11 height=11 align=right alt="category hidden">';
- }
- if (file_exists("data/nocat.txt")) {
- echo '<img src=images/widget.isolated.png border=0 width=11 height=11 align=right alt="category isolated">';
- }
- if (file_exists("data/categories/$read_cat_dir/book.txt")) {
- echo '<img src=images/widget.booked.png border=0 width=11 height=11 align=right alt="category booked">';
- }
- echo '<img src=images/widget.filed.png border=0 width=11 height=11 align=right alt="filed under ';
- readfile("$dir/$d/category.txt");
- echo '">';
- }
- }
- echo '</div><div id=panel_body>';
- echo '<font style="font-size: 10px; color: #999999;">';
- readfile("$dir/$d/date.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("$dir/$d/revisions.txt")) {
- echo ' (Revision ';
- readfile("$dir/$d/revisions.txt");
- echo ')';
- }
- if (file_exists("$dir/$d/category.txt")) {
- echo ' Filed under ';
- $category_key = file_get_contents("$dir/$d/category.txt");
- $category_key = strtolower($category_key);
- if (file_exists("data/categories/{$category_key}/title.txt")) {
- $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
- echo "$category_key ($category_dsp)";
- }
- else {
- echo "$category_key";
- }
- }
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
- readfile("$dir/$d/body.txt");
- echo '</div><div id=panel_footer>';
- echo '<table border=0 cellspacing=0 cellpadding=0 width=513><tr><td align=right>';
- echo '<font style="font-size: 10px; color: #999999;">';
- if (!file_exists("data/nocomment.txt")) {
- if (!file_exists("$dir/$d/comments/live")) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>add comment</a>';
- }
- else {
- if ($dh_comments = opendir("$dir/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*", $entry_comments)) {
- $items_comments[] = $entry_comments;
- }
- }
- closedir($dh_comments);
- }
- $comments = count($items_comments);
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&show=comments>';
- if ($comments == 1) {
- echo $comments . ' comment';
- }
- elseif ($comments < 1) {
- echo 'add comment';
- }
- else {
- echo $comments . ' comments';
- }
- echo '</a>';
- unset($items_comments);
- }
- }
- else {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a>';
- }
- if (file_exists("$dir/$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 != ".." && fnmatch("*", $entry_album)) {
- $items_album[] = $entry_album;
- }
- }
- closedir($dh_album);
- }
- $album = count($items_album);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?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($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['show']) and !empty($_REQUEST['show']) and ($_REQUEST['show'] == album)) {
- if (!file_exists("$dir/$d/album")) {
- mkdir("$dir/$d/album", 0777);
- chmod("$dir/$d/album", 0777);
- }
- if (!isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- $album_views_value = $album_views_value + 1;
- chmod("$dir/$d/album/views.txt", 0666);
- }
- }
- 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 (($entry_filedrop = readdir($dh_filedrop)) !== false) {
- if ($entry_filedrop != "." && $entry_filedrop != ".." && fnmatch("*", $entry_filedrop)) {
- $items_filedrop[] = $entry_filedrop;
- }
- }
- closedir($dh_filedrop);
- }
- $filedrop = count($items_filedrop);
- echo ' | <a href=' . $_SERVER['PHP_SELF'] . '?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($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['show']) and !empty($_REQUEST['show']) and ($_REQUEST['show'] == filedrop)) {
- if (!file_exists("$dir/$d/filedrop")) {
- mkdir("$dir/$d/filedrop", 0777);
- chmod("$dir/$d/filedrop", 0777);
- }
- if (!isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- $filedrop_views_value = $filedrop_views_value + 1;
- chmod("$dir/$d/filedrop/views.txt", 0666);
- }
- }
- 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/nocomment.txt")) {
- echo '| <a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '>permalink</a>';
- }
- echo '</font></td></tr></table></div>';
- echo '</td></tr></table></p>';
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['show']) and !empty($_REQUEST['show']) and ($_REQUEST['show'] == album)) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=525><tr><td>';
- echo '<div id=panel_title>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 ($dh_album = opendir("images/$d/album")) {
- while (($entry_album = readdir($dh_album)) !== false) {
- if ($entry_album != "." && $entry_album != ".." && fnmatch("*", $entry_album)) {
- $current_image = "images/$d/album/$entry_album";
- $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);
- /* auto-thumbnails (20060213) - In maj-0.14-20060131, album thumbnails were simply the original images displayed with smaller "width=" and "height=" values. Album index loading was painfully slow since the browser had to download the original images from the server. This should speed things up. We placed the "function" here instead of edit.php or add.php to make auto-thumbnail generation available for maj-0.14-20060131 users who may already have existing albums. */
- if (!file_exists("images/$d/thumbnails/{$entry_album}-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", 0777);
- chmod("images/$d/thumbnails", 0777);
- }
- imagejpeg($work_thumb, "images/$d/thumbnails/{$entry_album}-thumbnail.jpg", 80);
- }
- echo "<a href=images/$d/album/$entry_album>";
- echo "<img src=images/$d/thumbnails/{$entry_album}-thumbnail.jpg width=$new_width height=$new_height border=0 hspace=2 vspace=2";
- if (file_exists("data/items/$d/album/captions/{$entry_album}.txt")) {
- echo ' alt="';
- readfile("data/items/$d/album/captions/{$entry_album}.txt");
- echo '"';
- }
- echo "></a>";
- }
- }
- closedir($dh_album);
- }
- echo '</div></td></tr></table></p>';
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['show']) and !empty($_REQUEST['show']) and ($_REQUEST['show'] == filedrop)) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=525><tr><td>';
- echo '<div id=panel_title>Filedrop';
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<a href=del.php?entry=';
- echo $d;
- echo '&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 ($dh_filedrop = opendir("data/items/$d/filedrop/files")) {
- while (($entry_filedrop = readdir($dh_filedrop)) !== false) {
- if ($entry_filedrop != "." && $entry_filedrop != ".." && fnmatch("*", $entry_filedrop)) {
- echo '<table border=0 cellspacing=0 cellpadding=4><tr><td>';
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $d . '&download=' . $entry_filedrop. '>';
- echo '<img src=images/filedrop.png width=36 height=36 border=0 alt="download file"></a></td>';
- echo '<td><p><b>';
- echo $entry_filedrop;
- echo'</b><br>';
- $size = filesize("data/items/$d/filedrop/files/$entry_filedrop");
- echo $size_string;
- $filedrop_count_file = "data/items/$d/filedrop/count/$entry_filedrop" . '.txt';
- if (file_exists($filedrop_count_file)) {
- echo '<br>';
- echo $filedrop_count;
- if ($filedrop_count == 1) {
- echo ' download';
- }
- if ($filedrop_count > 1) {
- echo ' downloads';
- }
- }
- echo '</p></td></tr></table>';
- }
- }
- closedir($dh_filedrop);
- }
- echo '</div></td></tr></table></p>';
- }
- if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['show']) and !empty($_REQUEST['show']) and ($_REQUEST['show'] == comments)) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0 width=525><tr><td>';
- if ($dh_comments = opendir("$dir/$d/comments/live")) {
- while (($entry_comments = readdir($dh_comments)) !== false) {
- if ($entry_comments != "." && $entry_comments != ".." && fnmatch("*", $entry_comments)) { $show_comments[] = $entry_comments;
- }
- }
- closedir($dh_comments);
- }
- asort($show_comments);
- reset($show_comments);
- foreach ($show_comments as $comment) {
- echo '<div id=panel_title>';
- if (file_exists("$dir/$d/comments/live/$comment/url.txt")) {
- echo '<a rel=nofollow target=_blank href=';
- readfile("$dir/$d/comments/live/$comment/url.txt");
- echo '>';
- }
- readfile("$dir/$d/comments/live/$comment/firstname.txt");
- echo ' ';
- readfile("$dir/$d/comments/live/$comment/lastname.txt");
- if (file_exists("$dir/$d/comments/live/$comment/url.txt")) {
- echo '</a>';
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo ' <';
- readfile("$dir/$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=10 height=10 border=0 align=right alt="delete comment"></a>';
- echo '<a href=edit.php?entry=' . $d . '&comment=' . $comment . '><img src=images/widget.edit.png width=11 height=11 border=0 align=right alt="edit comment"></a>';
- }
- echo '</div>';
- echo '<div id=panel_body>';
- echo '<font style="font-size: 10px; color: #999999;">';
- readfile("$dir/$d/comments/live/$comment/timestamp.txt");
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- if (file_exists("$dir/$d/comments/live/$comment/revisions.txt")) {
- echo ' (Revision ';
- readfile("$dir/$d/comments/live/$comment/revisions.txt");
- echo ')';
- }
- }
- echo '</font><font style="font-size: 5px;"><br><br></font>';
- readfile("$dir/$d/comments/live/$comment/comment.txt");
- echo '</div><p></p>';
- }
- unset($show_comments);
- echo '</td></tr></table></p>';
- if (!file_exists("data/nocomment.txt")) {
- echo '<table border=0 cellspacing=0 cellpadding=0 width=525><tr><td>';
- echo '<p></p><p><font style="font-size: 12px;"><b>Add Comment</b></font></p>';
- $capcha_rand = str_rand(7);
- echo '<p>Fill out the form below and enter <b>' . $capcha_rand . '</b> in the anti-spam field to add your comment. Note that it will not be posted immediately, but will be e-mailed to me first.<br><br>';
- ?>
- <table border=0 cellspacing=2 cellpadding=0 width=500>
- <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>?entry=<?php echo $d; ?>&show=comments" method="post">
- <input type=hidden name=capcha_get value="<?php echo $capcha_rand; ?>">
- <tr><td width=75><p>First Name*</p></td><td width=300><input class=input type=text autocomplete=off name=firstname maxlength=30></td><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><p>:((</p></td><td ><p>crying</p></td></tr>
- <tr><td><img src=images/smileys/frown.png border=0></td><td><p>:(</p></td><td><p>frown</p></td></tr>
- <tr><td><img src=images/smileys/indifferent.png border=0></td><td><p>:|</p></td><td><p>indifferent</p></td></tr>
- <tr><td><img src=images/smileys/laughing.png border=0></td><td><p>:D</p></td><td><p>laughing</p></td></tr>
- <tr><td><img src=images/smileys/lick.png border=0></td><td><p>:P</p></td><td><p>lick</p></td></tr>
- <tr><td><img src=images/smileys/ohno.png border=0></td><td><p>:O</p></td><td><p>oh no!</p></td></tr>
- <tr><td><img src=images/smileys/smile.png border=0></td><td><p>:)</p></td><td><p>smile</p></td></tr>
- <tr><td><img src=images/smileys/surprised.png border=0></td><td><p>=)</p></td><td><p>surprised</p></td></tr>
- <tr><td><img src=images/smileys/undecided.png border=0></td><td><p>:\</p></td><td><p>undecided</p></td></tr>
- <tr><td><img src=images/smileys/wink.png border=0></td><td><p>;)</p></td><td><p>wink</p></td></tr>
- </td></tr>
- </table>
- <tr><td><p>Last Name*</p></td><td><input class=input type=text autocomplete=off name=lastname maxlength=30></td></tr>
- <tr><td><p>E-mail*</p></td><td colspan=2><input class=input type=text autocomplete=off name=email maxlength=60></td></tr>
- <tr><td><p>Website</p></td><td colspan=2><input class=input type=text autocomplete=off name=url maxlength=300></td></tr>
- <tr><td ><p>Comment*</p></td><td ><textarea class=input name=new_comment rows=10></textarea></td></tr>
- <tr><td><p>Anti-Spam*</p></td><td><input class=input type=text autocomplete=off name=capcha_put maxlength=7></td></tr>
- <tr><td><p></p></td><td><input class=input type=submit value="click here to submit your comment"></td></tr>
- </form>
- </table>
- </td></tr></table></p>
- <?php
- }
- if (!isset($_SESSION['logged_in'])) {
- if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_REQUEST['capcha_put']) and !empty($_REQUEST['capcha_get']) and isset($_REQUEST['firstname']) and !empty($_REQUEST['firstname']) and isset($_REQUEST['lastname']) and !empty($_REQUEST['lastname']) and isset($_REQUEST['email']) and !empty($_REQUEST['email']) and isset($_REQUEST['new_comment']) and !empty($_REQUEST['new_comment']) and isset($_REQUEST['capcha_put']) and !empty($_REQUEST['capcha_put']) and ($_REQUEST['capcha_get'] == $_REQUEST['capcha_put']) and (ereg("@", $_REQUEST['email'])) and (ereg("\.", $_REQUEST['email']))) {
- echo '<p><table border=0 cellspacing=0 cellpadding=0><tr><td><p><font style="font-size: 12px;"><b>Thanks!</b></font></p><p>Your comment has been submitted for approval.<br>Please check back soon to see if it has been posted.</p></td></tr></table>';
- }
- }
- ?>
- <?php
- }
- }
- ?>
- <?php
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username) and isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- if ($dh_pending_comments = opendir("$dir/$d/comments/pending")) {
- while (($entry_pending_comments = readdir($dh_pending_comments)) !== false) {
- if ($entry_pending_comments != "." && $entry_pending_comments != ".." && fnmatch("*", $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 '<p><table border=0 cellspacing=0 cellpadding=0 width=525><tr><td>';
- echo '<div id=panel_title>';
- if (file_exists("$dir/$d/comments/pending/$pending_comment/url.txt")) {
- echo '<a rel=nofollow target=_blank href=';
- readfile("$dir/$d/comments/pending/$pending_comment/url.txt");
- echo '>';
- }
- readfile("$dir/$d/comments/pending/$pending_comment/firstname.txt");
- echo ' ';
- readfile("$dir/$d/comments/pending/$pending_comment/lastname.txt");
- if (file_exists("$dir/$d/comments/pending/$pending_comment/url.txt")) {
- echo '</a>';
- }
- echo ' <';
- readfile("$dir/$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=10 height=10 border=0 align=right alt="delete comment"></a>';
- $pending_comment_key_file = "$dir/$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=' . $_SERVER['PHP_SELF'] . '?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 '</div>';
- echo '<div id=panel_body>';
- echo '<font style="font-size: 10px; color: #999999;">';
- readfile("$dir/$d/comments/pending/$pending_comment/timestamp.txt");
- echo '</font><font style="font-size: 5px;"><br><br></font>';
- readfile("$dir/$d/comments/pending/$pending_comment/comment.txt");
- echo '</div><p></p>';
- unset($show_pending_comments);
- echo '</td></tr></table></p>';
- }
- }
- }
- ?>
- <p><table border=0 cellspacing=0 cellpadding=0 width=100%><tr>
- <?php
- if (($start >= $increase) and ($start != 0)) {
- echo "<td align=left><p><a href=\"" . $_SERVER['PHP_SELF'] . "?";
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
- echo "category={$_REQUEST['category']}&";
- }
- echo "start=" . ($start-$increase) . "\">previous</a></p></td>";
- }
- if ($end < sizeof($items)) {
- echo "<td align=right><p><a href=\"" . $_SERVER['PHP_SELF'] . "?";
- if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
- echo "category={$_REQUEST['category']}&";
- }
- echo "start=" . ($start+$increase) . "\">next</a></p></td>";
- }
- ?>
- </tr></table></p>
- </td>
- <td width=15></td>
- <td width=175 valign=top>
- <?php
- if ($dh_latest_items = opendir($dir)) {
- while (($entry_latest_items = readdir($dh_latest_items)) !== false) {
- if (file_exists("data/items/$entry_latest_items/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- $cat_dir = file_get_contents("data/items/$entry_latest_items/category.txt");
- if (file_exists("data/categories/$cat_dir/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and !file_exists("data/items/$entry_latest_items/cat.txt")) {
- continue;
- }
- if (file_exists("data/nocat.txt") and file_exists("data/items/$entry_latest_items/category.txt") and !file_exists("data/items/$entry_latest_items/cat.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- if ($entry_latest_items != "." && $entry_latest_items != ".." && fnmatch("*", $entry_latest_items)) {
- $show_latest_items[] = $entry_latest_items;
- }
- }
- closedir($dh_latest_items);
- }
- rsort($show_latest_items);
- reset($show_latest_items);
- $count_latest_items = count($show_latest_items);
- if ($count_latest_items > 0) {
- echo '<div id=panel_title>Recent Entries</div><div id=panel_body>';
- $increment_recent_entries = 0;
- if (($count_latest_items <= $increase) or ($count_latest_items <= $increase * 2)) {
- $increase = $count_latest_items;
- $show_recent_entries = $increase - 1;
- }
- else {
- $show_recent_entries = $increase * 2 - 1;
- }
- while ($increment_recent_entries <= $show_recent_entries) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=' . $show_latest_items[$increment_recent_entries] . '>';
- readfile("$dir/$show_latest_items[$increment_recent_entries]/title.txt");
- echo '</a><br>';
- $increment_recent_entries = $increment_recent_entries + 1;
- }
- }
- if ($count_latest_items > 0) {
- echo '</div>';
- ?>
- <p></p>
- <form enctype="multipart/form-data" action="dig.php" method="post">
- <input type=text class=search name=search autocomplete=off maxlength=55>
- </div>
- </form>
- <?php
- 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']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- if (file_exists("data/categories/$entry_categories/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- if ($entry_categories != "." && $entry_categories != ".." && fnmatch("*", $entry_categories)) {
- $show_categories[] = $entry_categories;
- }
- }
- closedir($dh_categories);
- }
- sort($show_categories);
- reset($show_categories);
- $count_categories = count($show_categories);
- if ($count_categories > 0) {
- echo '<p></p><div id=panel_title>Categories</div><div id=panel_body>';
- foreach ($show_categories as $category) {
- echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?category=" . $category . "\">";
- if (file_exists("data/categories/$category/title.txt")) {
- $category_title = file_get_contents("data/categories/$category/title.txt");
- }
- else {
- $category_title = ucfirst($category);
- }
- echo $category_title;
- echo "</a><br />";
- }
- echo '</div>';
- }
- }
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
- echo '<p></p><div id=panel_title>Statistics</div><div id=panel_body>';
- echo "Total Entries: $count_latest_items";
- 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>';
- }
- }
- ?>
- <p></p>
- <?php
- 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 != ".." && fnmatch("*", $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_items > 0) and ($count_pending_comment_flags > 0)) {
- echo '<div id=panel_title>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 != ".." && fnmatch("*", $entry_list_pending_comment_flags)) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?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>';
- }
- }
- ?>
- <p></p>
- <?php
- if (file_exists("data/albums")) {
- if ($dh_album_list = opendir("data/albums")) {
- while (($entry_album_list = readdir($dh_album_list)) !== false) {
- if (file_exists("data/items/$entry_album_list/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username)) {
- continue;
- }
- $pull_cat_dir = file_get_contents("data/items/$entry_album_list/category.txt");
- if (file_exists("data/categories/$pull_cat_dir/private.txt") and !isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $login_username) and !file_exists("data/items/$entry_album_list/cat.txt")) {
- continue;
- }
- if ($entry_album_list != "." && $entry_album_list != ".." && fnmatch("*", $entry_album_list)) {
- $show_album_list[] = $entry_album_list;
- }
- }
- closedir($dh_album_list);
- }
- rsort($show_album_list);
- reset($show_album_list);
- $count_album_list = count($show_album_list);
- if ($count_album_list > 0) {
- echo '<div id=panel_title>Albums</div>';
- echo '<div id=panel_body>';
- foreach ($show_album_list as $album_list_entry) {
- echo '<a href=' . $_SERVER['PHP_SELF'] . '?entry=';
- echo $album_list_entry;
- echo '&show=album>';
- readfile("data/items/$album_list_entry/title.txt");
- echo '</a><br>';
- }
- echo '</div>';
- }
- }
- ?>
- <p></p>
- <?php
- if ($count_latest_items > 0) {
- echo '<p><table border=0 cellspacing=2 cellpadding=0 width=100%>';
- echo '<tr><td align=center><a target="_button" href="http://engels.mortega.net/index.php?entry=20050521000019"><img src=images/button.maj.png border=0 width=80 height=15></a></td></tr>';
- echo '<tr><td align=center><a target="_button" rel="nofollow" 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" rel="nofollow" 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")) {
- echo '<tr><td align=center><a target="_button" rel="nofollow" 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></p>';
- }
- ?>
- <p></p>
- </td></tr>
- </table>
- <?php
- if (file_exists("footer.php")) {
- echo '<p></p>';
- include("footer.php");
- }
- ?>