This commit has been accessed 593 times via Git panel.
commit 5a09e5df8f30e8a78bcf8d4662cd89fed2afed6c
tree 95add4a8c0553a900bc9ad9bfa016f3350d1acb3
parent f44c7e7b99adc400cbd937f390c758d341ddd7db
author Engels Antonio <engels@majcms.org> 1277314212 +0800
committer Engels Antonio <engels@majcms.org> 1277314212 +0800
maj-2.0-201006030700.zip
diff --git a/add.php b/add.php
index 6f36741..88a156c 100644
--- a/add.php
+++ b/add.php
@@ -186,10 +186,10 @@ if ($server_post_max_size > $server_memory_limit) {
if ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt")) { ?>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="image_input"> Select optional image.</p>
+<input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG entry image.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="file_input"> Select optional file.</p>
+<input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</p>
<?php } ?>
@@ -363,10 +363,10 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
</select> Enter antedate value in YYYY-MM-DD-HH-MM format.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="image_input"> Select optional image.</p>
+<input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG entry image.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="file_input"> Select optional file.</p>
+<input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</p>
<p><input autocomplete="off" type="password" name="passwd"> Enter optional password.</p>
<?php
@@ -569,9 +569,25 @@ $body_write_content = preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_
mkdir($item_dir);
-$title_write_content = ucfirst($_POST['title_input']);
+// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
+$title_write_content = ucwords($_POST['title_input']);
$title_write_content = str_replace('<','<',$title_write_content);
$title_write_content = str_replace('>','>',$title_write_content);
+$title_write_content = str_replace(' A ',' a ',$title_write_content);
+$title_write_content = str_replace(' An ',' an ',$title_write_content);
+$title_write_content = str_replace(' And ',' and ',$title_write_content);
+$title_write_content = str_replace(' As ',' as ',$title_write_content);
+$title_write_content = str_replace(' At ',' at ',$title_write_content);
+$title_write_content = str_replace(' But ',' but ',$title_write_content);
+$title_write_content = str_replace(' By ',' by ',$title_write_content);
+$title_write_content = str_replace(' For ',' for ',$title_write_content);
+$title_write_content = str_replace(' In ',' in ',$title_write_content);
+$title_write_content = str_replace(' Of ',' of ',$title_write_content);
+$title_write_content = str_replace(' On ',' on ',$title_write_content);
+$title_write_content = str_replace(' Or ',' or ',$title_write_content);
+$title_write_content = str_replace(' The ',' the ',$title_write_content);
+$title_write_content = str_replace(' To ',' to ',$title_write_content);
+
$title_file = $item_dir . '/title.txt';
$fp_title_txt = fopen($title_file,"w");
fwrite($fp_title_txt,$title_write_content);
@@ -729,7 +745,7 @@ if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'
}
}
-if (file_exists("data/bb.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
+if (file_exists("data/bb.txt") and file_exists("data/member.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
touch("data/items/$entry/member.txt");
}
diff --git a/cat.php b/cat.php
index 2c13521..58ff2bb 100644
--- a/cat.php
+++ b/cat.php
@@ -106,7 +106,25 @@ if (isset($_POST['new_id']) and !empty($_POST['new_id'])) {
}
if (isset($_POST['cat_del']) and !empty($_POST['cat_del']) and ($_POST['cat_del'] == "on")) {
+
rmdirr("data/categories/{$_POST['cat_id']}");
+
+ if (file_exists("data/items")) {
+
+ if ($dh_cat_del = opendir("data/items")) {
+
+ while (($entry_cat_del = readdir($dh_cat_del)) !== false) {
+
+ if ($entry_cat_del != "." && $entry_cat_del != "..") {
+
+ if (file_exists("data/items/$entry_cat_del/categories/{$_POST['cat_id']}")) {
+ rmdirr("data/items/$entry_cat_del/categories/{$_POST['cat_id']}");
+ }
+ }
+ }
+ closedir($dh_cat_del);
+ }
+ }
}
if ((!isset($_POST['cat_hide']) or !empty($_POST['cat_hide'])) and ($_POST['cat_edit'] == "on")) {
@@ -116,6 +134,9 @@ if ((!isset($_POST['cat_hide']) or !empty($_POST['cat_hide'])) and ($_POST['cat_
}
if (isset($_POST['cat_hide']) and !empty($_POST['cat_hide']) and ($_POST['cat_hide'] == "on")) {
+ if (file_exists("data/categories/{$_POST['cat_id']}/members")) {
+ rmdirr("data/categories/{$_POST['cat_id']}/members");
+ }
if (!file_exists("data/categories/{$_POST['cat_id']}/private.txt")) {
touch("data/categories/{$_POST['cat_id']}/private.txt");
}
@@ -297,10 +318,14 @@ a:active {
if ($count_cat > 0) {
- echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, accessible to you only. Override per entry if needed.";
+
+ echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
- echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td><td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
+ echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td>";
+
+ echo "<td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
foreach ($show_cat as $category) {
echo "<form enctype=\"multipart/form-data\" action=\"cat.php\" method=\"post\">";
@@ -315,12 +340,14 @@ a:active {
}
echo "></td>";
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_book\"";
if (file_exists("data/categories/$category/book.txt")) {
echo " checked";
}
echo "></td>";
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_del\"></td>";
echo "<td><input type=\"hidden\" name=\"cat_id\" value=\"$category\"><input type=\"hidden\" name=\"cat_edit\" value=\"on\"><input type=\"submit\" class=\"submit\" value=\"submit\"></td>";
echo "</tr></form>";
diff --git a/css.php b/css.php
new file mode 100644
index 0000000..202cc6a
--- /dev/null
+++ b/css.php
@@ -0,0 +1,715 @@
+<?php
+
+if (file_exists("data/fonts/body-size.txt")) {
+ $maj_body_px = file_get_contents("data/fonts/body-size.txt") . "px";
+}
+else {
+ $maj_body_px = "11px";
+}
+
+if (file_exists("data/fonts/input-size.txt")) {
+ $maj_input_px = file_get_contents("data/fonts/input-size.txt") . "px";
+}
+else {
+ $maj_input_px = "11px";
+}
+
+if (file_exists("data/fonts/panel-title-size.txt")) {
+ $maj_font_12px = file_get_contents("data/fonts/panel-title-size.txt") . "px";
+}
+else {
+ $maj_font_12px = "12px";
+}
+
+if (file_exists("data/fonts/panel-body-size.txt")) {
+ $maj_font_11px = file_get_contents("data/fonts/panel-body-size.txt") . "px";
+}
+else {
+ $maj_font_11px = "11px";
+}
+
+if (file_exists("data/fonts/panel-footer-size.txt")) {
+ $maj_font_10px = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
+}
+else {
+ $maj_font_10px = "10px";
+}
+
+?>
+
+<style>
+
+html {
+ font-size: <?php echo $maj_font_11px; ?>;
+}
+
+body {
+ margin: 0px 0px 10px 10px;
+ padding: 0px;
+ text-align: left;
+
+ font-size: <?php echo $maj_body_px; ?>;
+
+ color: <?php
+ if (file_exists("data/colors/font.txt")) {
+ $maj_font_color = file_get_contents("data/colors/font.txt");
+ echo $maj_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/body.txt")) {
+ $maj_font_body = file_get_contents("data/fonts/body.txt");
+ echo "{$maj_font_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ background-color: <?php
+ if (file_exists("data/colors/bg.txt")) {
+ $maj_background_color = file_get_contents("data/colors/bg.txt");
+ if ($maj_background_color == "transparent") {
+ echo "#ffffff";
+ }
+ else {
+ echo $maj_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: <?php echo $maj_font_11px; ?>;
+}
+
+a {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a:link {
+ color: <?php
+ if (file_exists("data/colors/link.txt")) {
+ $maj_a_link_color = file_get_contents("data/colors/link.txt");
+ echo $maj_a_link_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+}
+
+a:visited {
+ color: <?php
+ if (file_exists("data/colors/vlink.txt")) {
+ $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
+ echo $maj_a_visited_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+}
+
+a:hover {
+ color: <?php
+ if (file_exists("data/colors/hover.txt")) {
+ $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
+ echo $maj_a_hover_color;
+ }
+ else {
+ echo "#336699";
+ }
+ ?>;
+}
+
+a:active {
+ color: <?php
+ if (file_exists("data/colors/hover.txt")) {
+ $maj_a_active_color = file_get_contents("data/colors/hover.txt");
+ echo $maj_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 {
+ padding: 5px 5px 5px 5px;
+ margin: 0px 0px 0px 0px;
+ border-width: 1px 1px 0px 1px;
+ border-style: solid solid none solid;
+ font-weight: bold;
+
+ font-size: <?php echo $maj_font_12px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-title.txt")) {
+ $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+ echo "{$maj_font_panel_title},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pt-font.txt")) {
+ $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
+ echo $maj_panel_title_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ }
+ ?>;
+}
+
+.panel_body {
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$maj_font_panel_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pb-font.txt")) {
+ $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+ echo $maj_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")) {
+ $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_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")) {
+ $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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 {
+ text-align: right;
+
+ font-size: <?php echo $maj_font_10px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$maj_font_panel_footer},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+
+
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $maj_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")) {
+ $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_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")) {
+ $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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;';
+ }
+ ?>
+}
+
+.input {
+ width: 300px;
+ background: #ffffff;
+
+ font-size: <?php echo $maj_input_px; ?>;
+
+ color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_input_color = file_get_contents("data/colors/border.txt");
+ echo $maj_input_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ border: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_footer_border_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?> solid 1px;
+
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $maj_font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$maj_font_input},";
+ }
+ ?> arial,helvetica,sans-serif;
+}
+
+.search {
+ color: #666666;
+ background: #ffffff;
+ width: 100%;
+
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $maj_font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$maj_font_input},";
+ }
+ ?> arial,helvetica,sans-serif;
+}
+
+.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 {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb2b,.rb3b,.rb4b {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pb-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb2e,.rb3e,.rb4e {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb1t,.rb1b,.rb1e {
+ margin: 0 5px;
+
+ background: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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-size: <?php echo $maj_font_12px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-title.txt")) {
+ $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+ echo "{$maj_font_panel_title},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pt-font.txt")) {
+ $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
+ echo $maj_panel_title_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rbspace {
+ height: 3px;
+}
+
+.panel_entry_body {
+ margin: 0px 0px 0px 0px;
+
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$maj_font_panel_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pb-font.txt")) {
+ $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+ echo $maj_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")) {
+ $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_panel_body_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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 {
+ padding: 5px 5px 5px 5px;
+ margin: 0px 0px 0px 0px;
+ text-align: left;
+
+ font-size: <?php echo $maj_font_10px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$maj_font_panel_category},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $maj_panel_category_font_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_panel_category_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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;';
+ }
+ ?>
+}
+
+<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
+
+</style>
diff --git a/edit.php b/edit.php
index 1aab751..397fd7a 100644
--- a/edit.php
+++ b/edit.php
@@ -277,6 +277,23 @@ a:active {
<?php
+if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_POST['auth_toggle']) and !empty($_POST['auth_toggle'])) {
+
+ if (($_POST['auth_toggle'] == "ack") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+ mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ }
+ }
+
+ if (($_POST['auth_toggle'] == "nak") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+ rmdirr("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ }
+ }
+}
+
if (isset($_POST['category']) and !empty($_POST['category'])) {
if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
@@ -433,9 +450,9 @@ if (file_exists($revisions_file)) {
<tr><td><input autocomplete="off" type="file" name="album_image_input"> Upload optional album image. Enter optional caption below.</td></tr>
<tr><td><input autocomplete="off" type="text" name="caption" class="input_body"></td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
-<tr><td><input autocomplete="off" type="file" name="entry_image_input"> Upload optional entry image.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="entry_image_input"> Upload optional GIF, JPG, or PNG entry image.</td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
-<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</td></tr>
<?php
@@ -574,28 +591,36 @@ echo $body_read_content;
</td></tr></table>
-</td><td width="25"></td><td valign="top" width="150">
+</td><td width="25"></td><td valign="top">
<?php
- if (file_exists("data/categories")) {
- if ($dh_cat = opendir("data/categories")) {
+// improve category handling (20100221) - start
+
+if (file_exists("data/categories")) {
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- while (($entry_cat = readdir($dh_cat)) !== false) {
+ if ($dh_cat = opendir("data/categories")) {
+
+ while (($entry_cat = readdir($dh_cat)) !== false) {
- if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
+ if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
- if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
- $filed_cat[] = $entry_cat;
- }
+ if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
+ continue;
+ }
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
- $unfiled_cat[] = $entry_cat;
- }
+ if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ $filed_cat[] = $entry_cat;
+ }
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ $unfiled_cat[] = $entry_cat;
}
}
- closedir($dh_cat);
}
+ closedir($dh_cat);
sort($filed_cat);
sort($unfiled_cat);
@@ -605,52 +630,138 @@ echo $body_read_content;
$count_filed_cat = count($filed_cat);
$count_unfiled_cat = count($unfiled_cat);
+ }
- if ($count_filed_cat > 0) {
+ if ($count_filed_cat > 0) {
+
+ echo "<p><b>Filed Under</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($filed_cat as $filed_category) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
+ echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
+ }
+
+ echo "</table>";
+ }
+
+ echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+
+ if ($count_unfiled_cat > 0) {
+
+ echo "<p><b>Available Categories</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
- echo "<p><b>Filed Under</b></p>";
+ foreach ($unfiled_cat as $unfiled_category) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
+ echo "</form>";
+ }
+
+ echo "</table>";
+ }
+
+ echo "</td></tr></table><br>";
+}
+
+// improve category handling (20100221) - end
+
+// add member authorization (20100221) - start
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+if (file_exists("data/members/active")) {
- foreach ($filed_cat as $filed_category) {
- echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
- echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
- echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
- echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
- echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
- echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
- echo "</form>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
+
+ if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
+
+ while (($ack_member = readdir($dh_ack_members)) !== false) {
+
+ if ($ack_member != "." && $ack_member != "..") {
+ $ack_members[] = $ack_member;
}
+ }
+ closedir($dh_ack_members);
+ sort($ack_members);
+ reset($ack_members);
+ $count_ack_members = count($ack_members);
+ }
+
+ if ($dh_nak_members = opendir("data/members/active")) {
+
+ while (($nak_member = readdir($dh_nak_members)) !== false) {
- echo "</table>";
+ if ($nak_member != "." && $nak_member != "..") {
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ continue;
+ }
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ $nak_members[] = $nak_member;
+ }
+ }
}
+ closedir($dh_nak_members);
+ sort($nak_members);
+ reset($nak_members);
+ $count_nak_members = count($nak_members);
}
-?>
-</td><td width="25"></td><td valign="top" width="150">
+ if ($count_ack_members > 0) {
-<?php
+ echo "<p><b>Authorized Members</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-if ($count_unfiled_cat > 0) {
+ foreach ($ack_members as $ack_member) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"auth_member\" value=\"$ack_member\">";
+ echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"nak\">";
+ echo "<tr bgcolor=\"#ffffff\"><td><a href=\"member.php?id=$ack_member\">$ack_member</a></td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
+ }
+ echo "</table>";
+ }
+
+ echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+
+ if ($count_nak_members > 0) {
- echo "<p><b>Available Categories</b></p>";
+ echo "<p><b>Registered Members</b></p>";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
- foreach ($unfiled_cat as $unfiled_category) {
+ foreach ($nak_members as $nak_member) {
- echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
- echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
- echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
- echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
- echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
- echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
- echo "</form>";
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"auth_member\" value=\"$nak_member\">";
+ echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"ack\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\"><a href=\"member.php?id=$nak_member\">$nak_member</a></td></tr>";
+ echo "</form>";
+ }
+ echo "</table>";
}
- echo "</table>";
+ echo "</td></tr></table><br>";
}
+// add member authorization (20100221) - end
+
?>
</td></tr></table>
@@ -672,9 +783,25 @@ if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
copy("data/items/{$_REQUEST['entry']}/title.txt","data/items/{$_REQUEST['entry']}/title.old");
copy("data/items/{$_REQUEST['entry']}/body.txt","data/items/{$_REQUEST['entry']}/body.old");
-$title_write_content = ucfirst($_POST['title_input']);
+// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
+$title_write_content = ucwords($_POST['title_input']);
$title_write_content = str_replace('<','<',$title_write_content);
$title_write_content = str_replace('>','>',$title_write_content);
+$title_write_content = str_replace(' A ',' a ',$title_write_content);
+$title_write_content = str_replace(' An ',' an ',$title_write_content);
+$title_write_content = str_replace(' And ',' and ',$title_write_content);
+$title_write_content = str_replace(' As ',' as ',$title_write_content);
+$title_write_content = str_replace(' At ',' at ',$title_write_content);
+$title_write_content = str_replace(' But ',' but ',$title_write_content);
+$title_write_content = str_replace(' By ',' by ',$title_write_content);
+$title_write_content = str_replace(' For ',' for ',$title_write_content);
+$title_write_content = str_replace(' In ',' in ',$title_write_content);
+$title_write_content = str_replace(' Of ',' of ',$title_write_content);
+$title_write_content = str_replace(' On ',' on ',$title_write_content);
+$title_write_content = str_replace(' Or ',' or ',$title_write_content);
+$title_write_content = str_replace(' The ',' the ',$title_write_content);
+$title_write_content = str_replace(' To ',' to ',$title_write_content);
+
$open_title_file = fopen($title_file,"w");
fwrite($open_title_file,$title_write_content);
fclose($open_title_file);
diff --git a/images/button.maj.png b/images/button.maj.png
index e5f0abb..dfef3a4 100644
Binary files a/images/button.maj.png and b/images/button.maj.png differ
diff --git a/index.php b/index.php
index a0afee3..ddfd129 100644
--- a/index.php
+++ b/index.php
@@ -247,8 +247,11 @@ function go_download($maj_dl_file) {
$maj_buf = fread($maj_get_it,4096);
echo $maj_buf;
$maj_bytes_sent += strlen($maj_buf);
+ flush();
}
+ fclose($maj_get_it);
+
if ($maj_bytes_sent == $maj_dl_file_size) {
if (!file_exists($maj_count_path)) {
@@ -308,13 +311,13 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
unlink("$maj_live_dir/key.txt");
- // clean-up old latest comments dir
+ // clean-up old latest comments dir (start)
if (file_exists("data/comments/latest")) {
rmdirr("data/comments/latest");
}
- // clean-up old latest comments dir
+ // clean-up old latest comments dir (end)
if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
@@ -331,17 +334,20 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
while (($maj_unread_active_member = readdir($maj_dh_unread_active_members)) !== false) {
if ($maj_unread_active_member != "." && $maj_unread_active_member != "..") {
-
- if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
- mkdir("data/members/active/$maj_unread_active_member/comments");
- }
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread");
- }
-
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
+ if ((!file_exists("data/members/active/$maj_unread_active_member/vacation.txt") and !file_exists("data/items/$maj_req_entry/members")) or (!file_exists("data/members/active/$maj_unread_active_member/vacation.txt") and file_exists("data/items/$maj_req_entry/members") and file_exists("data/items/$maj_req_entry/members/$maj_unread_active_member"))) {
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments");
+ }
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments/unread");
+ }
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
+ }
}
}
}
@@ -399,7 +405,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_subject = str_replace("Re:","",$maj_ml_subject);
$maj_ml_subject = "Re: " . $maj_ml_subject;
- $maj_ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
+ $maj_ml_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
$maj_ml_body = file_get_contents("$maj_live_dir/comment.txt");
$maj_ml_body = str_replace('<br />',"\n",$maj_ml_body);
@@ -652,7 +658,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_from_email = '"' . $maj_from_email_author . '" <' . $maj_from_email . '>';
}
- $maj_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
+ $maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
$maj_commented_entry_title_file = "data/items/$maj_req_entry/title.txt";
$maj_fp_commented_entry_title = fopen($maj_commented_entry_title_file,"r");
@@ -714,7 +720,7 @@ else {
echo "<title>$maj_default_title</title>";
}
-if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
+if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")))) {
if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
@@ -740,9 +746,20 @@ if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ if (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")) {
- header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ if ($_SESSION['logged_in'] == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+
+ $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+
+ header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ }
+ }
+ else {
+ $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+
+ header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ }
}
}
}
@@ -815,720 +832,10 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
}
}
-if (file_exists("data/fonts/body-size.txt")) {
- $maj_body_px = file_get_contents("data/fonts/body-size.txt") . "px";
-}
-else {
- $maj_body_px = "11px";
-}
-
-if (file_exists("data/fonts/input-size.txt")) {
- $maj_input_px = file_get_contents("data/fonts/input-size.txt") . "px";
-}
-else {
- $maj_input_px = "11px";
-}
-
-if (file_exists("data/fonts/panel-title-size.txt")) {
- $maj_font_12px = file_get_contents("data/fonts/panel-title-size.txt") . "px";
-}
-else {
- $maj_font_12px = "12px";
-}
-
-if (file_exists("data/fonts/panel-body-size.txt")) {
- $maj_font_11px = file_get_contents("data/fonts/panel-body-size.txt") . "px";
-}
-else {
- $maj_font_11px = "11px";
-}
-
-if (file_exists("data/fonts/panel-footer-size.txt")) {
- $maj_font_10px = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
-}
-else {
- $maj_font_10px = "10px";
-}
+include("css.php");
?>
-<style>
-
-html {
- font-size: <?php echo $maj_font_11px; ?>;
-}
-
-body {
- margin: 0px 0px 10px 10px;
- padding: 0px;
- text-align: left;
-
- font-size: <?php echo $maj_body_px; ?>;
-
- color: <?php
- if (file_exists("data/colors/font.txt")) {
- $maj_font_color = file_get_contents("data/colors/font.txt");
- echo $maj_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $maj_font_body = file_get_contents("data/fonts/body.txt");
- echo "{$maj_font_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- background-color: <?php
- if (file_exists("data/colors/bg.txt")) {
- $maj_background_color = file_get_contents("data/colors/bg.txt");
- if ($maj_background_color == "transparent") {
- echo "#ffffff";
- }
- else {
- echo $maj_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: <?php echo $maj_font_11px; ?>;
-}
-
-a {
- font-weight: bold;
- text-decoration: none;
-}
-
-a:link {
- color: <?php
- if (file_exists("data/colors/link.txt")) {
- $maj_a_link_color = file_get_contents("data/colors/link.txt");
- echo $maj_a_link_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-}
-
-a:visited {
- color: <?php
- if (file_exists("data/colors/vlink.txt")) {
- $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
- echo $maj_a_visited_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-}
-
-a:hover {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
- echo $maj_a_hover_color;
- }
- else {
- echo "#336699";
- }
- ?>;
-}
-
-a:active {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $maj_a_active_color = file_get_contents("data/colors/hover.txt");
- echo $maj_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 {
- padding: 5px 5px 5px 5px;
- margin: 0px 0px 0px 0px;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
- font-weight: bold;
-
- font-size: <?php echo $maj_font_12px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$maj_font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $maj_panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
-}
-
-.panel_body {
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$maj_font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $maj_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")) {
- $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_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")) {
- $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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 {
- text-align: right;
-
- font-size: <?php echo $maj_font_10px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$maj_font_panel_footer},";
- }
- ?> arial,helvetica,sans-serif;
-
-
-
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $maj_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")) {
- $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_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")) {
- $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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;';
- }
- ?>
-}
-
-.input {
- width: 300px;
- background: #ffffff;
-
- font-size: <?php echo $maj_input_px; ?>;
-
- color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_input_color = file_get_contents("data/colors/border.txt");
- echo $maj_input_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- border: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_footer_border_color;
- }
- else {
- echo "#999999";
- }
- ?> solid 1px;
-
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $maj_font_input = file_get_contents("data/fonts/input.txt");
- echo "{$maj_font_input},";
- }
- ?> arial,helvetica,sans-serif;
-}
-
-.search {
- color: #666666;
- background: #ffffff;
- width: 100%;
-
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $maj_font_input = file_get_contents("data/fonts/input.txt");
- echo "{$maj_font_input},";
- }
- ?> arial,helvetica,sans-serif;
-}
-
-.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 {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb2b,.rb3b,.rb4b {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pb-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb2e,.rb3e,.rb4e {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb1t,.rb1b,.rb1e {
- margin: 0 5px;
-
- background: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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-size: <?php echo $maj_font_12px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$maj_font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $maj_panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rbspace {
- height: 3px;
-}
-
-.panel_entry_body {
- margin: 0px 0px 0px 0px;
-
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$maj_font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $maj_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")) {
- $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_panel_body_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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 {
- padding: 5px 5px 5px 5px;
- margin: 0px 0px 0px 0px;
- text-align: left;
-
- font-size: <?php echo $maj_font_10px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$maj_font_panel_category},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $maj_panel_category_font_color;
- }
- else {
- echo "#999999";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_panel_category_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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;';
- }
- ?>
-}
-
-<?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">
@@ -1638,7 +945,7 @@ else {
Navigation</div>
<div class="panel_body">
-<a class="navlink" href="index.php">Home</a><br>
+<a class="navlink" href=".">Home</a><br>
<?php
@@ -1776,6 +1083,10 @@ if (file_exists("data/panels")) {
continue;
}
+ if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($_SESSION['logged_in'])) {
+ continue;
+ }
+
if (file_exists("data/panels/$maj_panel/top.txt")) {
$maj_top_panels[] = $maj_panel;
continue;
@@ -2410,6 +1721,70 @@ if ($maj_dh_items = opendir("data/items")) {
if ($maj_item != "." && $maj_item != "..") {
+ if (file_exists("data/items/$maj_item/categories")) {
+
+ if ($maj_dh_egroups = opendir("data/items/$maj_item/categories")) {
+
+ while (($maj_egroup = readdir($maj_dh_egroups)) !== false) {
+
+ if ($maj_egroup != "." && $maj_egroup != "..") {
+
+ if (!file_exists("data/categories/$maj_egroup")) {
+ rmdirr("data/items/$maj_item/categories/$maj_egroup");
+ }
+
+ if (file_exists("data/categories/$maj_egroup/members")) {
+
+ if ($maj_dh_mgroups = opendir("data/categories/$maj_egroup/members")) {
+
+ while (($maj_mgroup = readdir($maj_dh_mgroups)) !== false) {
+
+ if ($maj_mgroup != "." && $maj_mgroup != "..") {
+
+ if (!file_exists("data/items/$maj_item/members/$maj_mgroup")) {
+
+ if (!file_exists("data/items/$maj_item/members")) {
+ mkdir("data/items/$maj_item/members");
+ }
+
+ mkdir("data/items/$maj_item/members/$maj_mgroup");
+ }
+ }
+ }
+ closedir($maj_dh_mgroups);
+ }
+ }
+ }
+ }
+ closedir($maj_dh_egroups);
+ }
+ }
+
+ if (file_exists("data/items/$maj_item/categories") and (count(glob("data/items/$maj_item/categories/*")) < 1)) {
+ rmdirr("data/items/$maj_item/categories");
+ }
+
+ if (file_exists("data/items/$maj_item/members")) {
+
+ if ($maj_dh_members = opendir("data/items/$maj_item/members")) {
+
+ while (($maj_member = readdir($maj_dh_members)) !== false) {
+
+ if ($maj_member != "." && $maj_member != "..") {
+
+ if (!file_exists("data/members/active/$maj_member")) {
+ rmdirr("data/items/$maj_item/members/$maj_member");
+ }
+ }
+ }
+ closedir("data/items/$maj_item/members");
+ }
+ }
+
+ if (file_exists("data/items/$maj_item/members") and (count(glob("data/items/$maj_item/members/*")) < 1)) {
+ rmdirr("data/items/$maj_item/members");
+ }
+
if (file_exists("data/items/$maj_item/comments/live") and (count(glob("data/items/$maj_item/comments/live/*")) < 1)) {
rmdirr("data/items/$maj_item/comments/live");
}
@@ -2438,8 +1813,9 @@ if ($maj_dh_items = opendir("data/items")) {
rmdirr("data/items/$maj_item/album/captions");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/count") and (count(glob("data/items/$maj_item/album/count/*")) < 1)) {
- rmdirr("data/items/$maj_item/album/count");
+ if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/views") and (count(glob("data/items/$maj_item/album/views/*")) < 1)) {
+ rmdirr("data/items/$maj_item/album/views");
+ unlink("data/items/$maj_item/album/views.txt");
}
if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album") and (count(glob("data/items/$maj_item/album/*")) < 1)) {
@@ -2548,6 +1924,10 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
+ if ((file_exists("data/items/$maj_item/members") and !isset($_SESSION['logged_in'])) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/{$_SESSION['logged_in']}"))) {
+ continue;
+ }
+
if (file_exists("data/items/$maj_item/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
@@ -2566,7 +1946,11 @@ if ($maj_dh_items = opendir("data/items")) {
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
- $maj_items[] = $maj_req_entry;
+
+ if ($maj_req_entry != $maj_item) {
+ continue;
+ }
+ $maj_items[] = $maj_item;
}
if (isset($maj_req_category) and file_exists("data/categories/$maj_req_category") and file_exists("data/items/$maj_item/categories/$maj_req_category")) {
@@ -3758,7 +3142,8 @@ foreach ($maj_disp as $maj_d) {
$maj_entry_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_entry_body);
}
- if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($_REQUEST['view']) or ($_REQUEST['view'] != "full"))) {
+ // if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($_REQUEST['view']) or ($_REQUEST['view'] != "full"))) {
+ if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($maj_req_entry) or empty($maj_req_entry))) {
$maj_entry_shorten = file_get_contents("data/items/$maj_d/maxlines.txt");
@@ -3766,7 +3151,7 @@ foreach ($maj_disp as $maj_d) {
if (count($maj_entry_lines) > $maj_entry_shorten) {
$maj_entry_body = implode("",array_slice($maj_entry_lines,0,$maj_entry_shorten));
- $maj_entry_body = $maj_entry_body . "<br><br><a href=\"index.php?entry=$maj_d&view=full\">read more</a>";
+ $maj_entry_body = $maj_entry_body . "<br><br><a href=\"index.php?entry=$maj_d\">read more</a>";
}
}
@@ -3874,7 +3259,7 @@ foreach ($maj_disp as $maj_d) {
echo '>';
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
if (!file_exists("data/items/$maj_d/comments/live")) {
echo "<a href=\"index.php?entry=$maj_d&show=comments\">add comment</a>";
@@ -4062,7 +3447,7 @@ foreach ($maj_disp as $maj_d) {
echo "| <a href=\"index.php?entry=$maj_d&show=pdf\">pdf</a> ";
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) {
+ if (($maj_req_show == pdf) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
$maj_pdf_views_value = file_get_contents("data/items/$maj_d/pdf/count/views.txt");
@@ -4086,7 +3471,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "| <a href=\"index.php?entry=$maj_d\">permalink</a>";
}
@@ -4741,7 +4126,7 @@ foreach ($maj_disp as $maj_d) {
echo '</td></tr></table>';
}
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
}
@@ -5183,7 +4568,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
@@ -5204,7 +4589,7 @@ foreach ($maj_disp as $maj_d) {
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")))) {
+ if (!isset($_SESSION['logged_in'])) {
echo " and enter <b>$maj_captcha_rand</b> in the CAPTCHA field";
}
@@ -5325,7 +4710,7 @@ foreach ($maj_disp as $maj_d) {
<tr><td><nobr>Comment*</nobr></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"))) {
+ if (isset($_SESSION['logged_in'])) {
echo "<input type=hidden name=captcha_put value=\"$maj_captcha_rand\">";
}
else {
@@ -5823,7 +5208,13 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
- $maj_unread_comments[] = $maj_unread_comment;
+
+ if (!file_exists("data/items/$maj_unread_comment")) {
+ rmdirr("data/comments/unread/$maj_unread_comment");
+ }
+ else {
+ $maj_unread_comments[] = $maj_unread_comment;
+ }
}
}
closedir($maj_dh_unread_comments);
@@ -5840,7 +5231,13 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
- $maj_unread_comments[] = $maj_unread_comment;
+
+ if (!file_exists("data/items/$maj_unread_comment")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_unread_comment");
+ }
+ else {
+ $maj_unread_comments[] = $maj_unread_comment;
+ }
}
}
closedir($maj_dh_unread_comments);
@@ -6635,24 +6032,10 @@ if ($maj_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>';
-
- $maj_validate_uri = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $maj_validate_uri = str_replace('//','/',$maj_validate_uri);
- $maj_validate_uri = "http://" . $maj_validate_uri;
-
- echo '<tr><td align="center"><a target="_button" href="http://jigsaw.w3.org/css-validator/validator?uri=' . $maj_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")) {
-
- $maj_sfx = file_get_contents("data/sfx.txt");
-
- echo "<tr><td align=\"center\"><a target=\"_button\" href=\"http://www.spreadfirefox.com/?q=affiliates&class=$maj_sfx&t=85\"><img src=\"images/button.firefox.png\" border=\"0\" width=\"80\" height=\"15\"></a></td></tr>";
- }
-
echo '</table>';
}
diff --git a/member.php b/member.php
index fe4a78f..da86883 100644
--- a/member.php
+++ b/member.php
@@ -41,6 +41,10 @@ if (isset($_REQUEST['id']) and ($_REQUEST['id'] != file_get_contents("data/usern
exit();
}
+if (!isset($_SESSION['logged_in']) and file_exists("data/nomem.txt")) {
+ header("Location: login.php");
+}
+
$id = $_REQUEST['id'];
$login_username = file_get_contents("data/username.txt");
diff --git a/rel.txt b/rel.txt
index 5e7b5d5..81b916d 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090629
\ No newline at end of file
+201006030700
diff --git a/rss.php b/rss.php
index 66a124f..a8ec743 100644
--- a/rss.php
+++ b/rss.php
@@ -1,10 +1,15 @@
<?php
+// 201001110322 - Valid RSS 0.91, 1.0, 2.0
+
error_reporting(E_ERROR);
if (get_magic_quotes_gpc()) {
+
function stripslashes_array($data) {
+
if (is_array($data)) {
+
foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
@@ -25,38 +30,32 @@ else {
}
if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
- $title_file = "data/title.txt";
- $fp_title = fopen($title_file, "r");
- $title = fread($fp_title, filesize($title_file));
- fclose($fp_title);
- $description_file = "data/profile.php";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
+
+ $title = file_get_contents("data/title.txt");
+ $title = strip_tags($title);
+ $title = htmlspecialchars($title,ENT_QUOTES);
+
+ $description = file_get_contents("data/profile.php");
$description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- $author_file = "data/author.txt";
- $fp_author = fopen($author_file, "r");
- $author = fread($fp_author, filesize($author_file));
- fclose($fp_author);
- $default_increase_file = "data/increase.txt";
- if (file_exists($default_increase_file)) {
- $fp_default_increase = fopen($default_increase_file, "r");
- $increase = fread($fp_default_increase, filesize($default_increase_file));
- fclose($fp_default_increase);
+ $description = htmlspecialchars($description,ENT_QUOTES);
+
+ if (file_exists("data/increase.txt")) {
+ $increase = file_get_contents("data/increase.txt");
}
else {
$increase = 5;
}
+
$link = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$link = str_replace('//', '/', $link);
$link = "http://" . $link;
+
$fix_link = array('//index.php', '///index.php');
- $dir = "data/items";
+
$feeds = $increase;
- if ($dh_rss_items = opendir($dir)) {
+ if ($dh_rss_items = opendir("data/items")) {
+
while (($entry_rss_items = readdir($dh_rss_items)) !== false) {
$today = date("YmdHis", time() + $offset);
@@ -87,7 +86,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
if (($private > 0) and !file_exists("data/items/$entry_rss_items/cat.txt")) {
continue;
}
-
+
if (file_exists("data/items/$entry_rss_items/passwd.txt")) {
continue;
}
@@ -104,7 +103,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
continue;
}
- if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt")) {
+ if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt") && !file_exists("data/items/$entry_rss_items/members")) {
$show_rss_items[] = $entry_rss_items;
}
}
@@ -113,6 +112,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
rsort($show_rss_items);
reset($show_rss_items);
+
$count_rss_items = count($show_rss_items);
if ($count_rss_items < $feeds) {
@@ -121,68 +121,36 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
if ($count_rss_items > 0) {
- if ($_REQUEST['ver'] == "0.91") {
- $rss091_file = fopen("data/rss-0.91.txt", "r");
- $rss091_count = fread($rss091_file, filesize("data/rss-0.91.txt"));
- fclose($rss091_file);
- $rss091_count = $rss091_count + 1;
- $rss091_file = fopen("data/rss-0.91.txt", "w");
- fwrite($rss091_file, $rss091_count);
- fclose($rss091_file);
- header('Content-type: application/xml');
- echo "<rss version=\"0.91\">\n";
+ header('Content-type: application/xml');
+
+ echo "<?xml version=\"1.0\"?>\n";
+
+ if ($_REQUEST['ver'] == "2.0") {
+
+ $rss20_count = fread("data/rss-2.0.txt");
+ $rss20_count = $rss20_count + 1;
+
+ $rss20_file = fopen("data/rss-2.0.txt", "w");
+ fwrite($rss20_file, $rss20_count);
+ fclose($rss20_file);
+
+ echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
echo "<channel>\n";
echo "<title>$title</title>\n";
echo "<link>$link</link>\n";
echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
-
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- echo $description;
- echo "</description>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</channel>\n";
- echo "</rss>";
+ echo "<atom:link href=\"{$link}rss.php?ver={$_REQUEST['ver']}\" rel=\"self\" type=\"application/rss+xml\" />\n";
}
if ($_REQUEST['ver'] == "1.0") {
- $rss10_file = fopen("data/rss-1.0.txt", "r");
- $rss10_count = fread($rss10_file, filesize("data/rss-1.0.txt"));
- fclose($rss10_file);
+
+ $rss10_count = file_get_contents("data/rss-1.0.txt");
$rss10_count = $rss10_count + 1;
+
$rss10_file = fopen("data/rss-1.0.txt", "w");
fwrite($rss10_file, $rss10_count);
fclose($rss10_file);
- header('Content-type: application/xml');
+
echo "<rdf:RDF\n";
echo "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
echo "xmlns=\"http://purl.org/rss/1.0/\"\n";
@@ -194,113 +162,94 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
echo "<description>$description</description>\n";
echo "<items>\n";
echo "<rdf:Seq>\n";
+
$increment_rss_entries = 0;
$show_rss_entries = $feeds - 1;
+
while ($increment_rss_entries <= $show_rss_entries) {
$link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
$link = str_replace($fix_link, '/index.php', $link);
echo "<rdf:li rdf:resource=\"$link\"/>\n";
$increment_rss_entries = $increment_rss_entries + 1;
}
+
echo "</rdf:Seq>\n";
echo "</items>\n";
echo "</channel>\n";
- $increment_rss_entries = 0;
- while ($increment_rss_entries <= $show_rss_entries) {
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<item rdf:about=\"$link\">\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>\n";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</rdf:RDF>";
}
- if ($_REQUEST['ver'] == "2.0") {
- $rss20_file = fopen("data/rss-2.0.txt", "r");
- $rss20_count = fread($rss20_file, filesize("data/rss-2.0.txt"));
- fclose($rss20_file);
- $rss20_count = $rss20_count + 1;
- $rss20_file = fopen("data/rss-2.0.txt", "w");
- fwrite($rss20_file, $rss20_count);
- fclose($rss20_file);
- header('Content-type: application/xml');
- echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
+ if ($_REQUEST['ver'] == "0.91") {
+
+ $rss091_count = file_get_contents("data/rss-0.91.txt");
+ $rss091_count = $rss091_count + 1;
+
+ $rss091_file = fopen("data/rss-0.91.txt", "w");
+ fwrite($rss091_file, $rss091_count);
+ fclose($rss091_file);
+
+ echo "<rss version=\"0.91\">\n";
echo "<channel>\n";
echo "<title>$title</title>\n";
echo "<link>$link</link>\n";
echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
+ }
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
+ $increment_rss_entries = 0;
+ $show_rss_entries = $feeds - 1;
+
+ while ($increment_rss_entries <= $show_rss_entries) {
+
+ $title = file_get_contents("data/items/$show_rss_items[$increment_rss_entries]/title.txt");
+ $title = strip_tags($title);
+ $title = htmlspecialchars($title,ENT_QUOTES);
+
+ $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
+ $link = str_replace($fix_link, '/index.php', $link);
+
+ $description = file_get_contents("data/items/$show_rss_items[$increment_rss_entries]/body.txt");
+ $description = strip_tags($description);
+ $description = htmlspecialchars($description,ENT_QUOTES);
+
+ 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");
}
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
+ else {
+ $censor = "[expletive]";
+ }
+ $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
+ }
+
+ if ($_REQUEST['ver'] == "1.0") {
+ echo "<item rdf:about=\"$link\">\n";
+ }
+ else {
+ echo "<item>\n";
}
+
+ echo "<title>$title</title>\n";
+ echo "<link>$link</link>\n";
+
+ if ($_REQUEST['ver'] != "1.0") {
+ echo "<guid>$link</guid>\n";
+ }
+
+ echo "<description>$description</description>\n";
+ echo "</item>\n";
+
+ $increment_rss_entries = $increment_rss_entries + 1;
+ }
+
+ if ($_REQUEST['ver'] != "1.0") {
echo "</channel>\n";
echo "</rss>";
}
-
+ else {
+ echo "</rdf:RDF>";
+ }
}
}
diff --git a/settings.php b/settings.php
index ac42561..11ac67d 100644
--- a/settings.php
+++ b/settings.php
@@ -91,20 +91,6 @@ if (!isset($_POST['offset']) or empty($_POST['offset']) or !is_numeric($_POST['o
}
}
-if (isset($_POST['sfx']) and !empty($_POST['sfx']) and is_numeric($_POST['sfx']) and (file_get_contents("data/sfx.txt") != $_POST['sfx'])) {
- $fp_sfx_txt = fopen("data/sfx.txt","w");
- fwrite($fp_sfx_txt,$_POST['sfx']);
- fclose($fp_sfx_txt);
-}
-
-if (!isset($_POST['sfx']) or empty($_POST['sfx']) or !is_numeric($_POST['sfx'])) {
- if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
- if (file_exists("data/sfx.txt")) {
- unlink("data/sfx.txt");
- }
- }
-}
-
if (isset($_POST['ping']) and !empty($_POST['ping']) and (file_get_contents("data/ping.txt") != $_POST['ping']) and (ereg("\.", $_POST['ping'])) and (ereg("http://", $_POST['ping']))) {
$ping_write_content = strtolower($_POST['ping']);
$ping_write_content = trim($ping_write_content);
@@ -424,6 +410,18 @@ if (!isset($_POST['member']) or empty($_POST['member'])) {
}
}
+if (isset($_POST['nomem']) and !empty($_POST['nomem']) and ($_POST['nomem'] == "on") and !file_exists("data/nomem.txt")) {
+ touch("data/nomem.txt");
+}
+
+if (!isset($_POST['nomem']) or empty($_POST['nomem'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/nomem.txt")) {
+ unlink("data/nomem.txt");
+ }
+ }
+}
+
if (isset($_POST['ml']) and !empty($_POST['ml']) and ($_POST['ml'] == "on") and !file_exists("data/ml.txt")) {
touch("data/ml.txt");
}
@@ -1116,7 +1114,6 @@ a:active {
<tr><td>username*</td><td><input autocomplete="off" class="input" type="text" name="username" value="<?php readfile("data/username.txt"); ?>"></td></tr>
<tr><td>entries per page</td><td><input autocomplete="off" class="input" type="text" name="increase" value="<?php readfile("data/increase.txt"); ?>"></td></tr>
<tr><td>timezone offset in seconds</td><td><input autocomplete="off" class="input" type="text" name="offset" value="<?php readfile("data/offset.txt"); ?>"></td></tr>
-<tr><td>spread firefox <a href="http://www.spreadfirefox.com/?q=user/register&r=76458" target="_maj">affiliate</a> id</td><td><input autocomplete="off" class="input" type="text" name="sfx" value="<?php readfile("data/sfx.txt"); ?>"></td></tr>
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
@@ -1132,7 +1129,7 @@ a:active {
echo $toggles_rowspan;
-?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</td></tr>
+?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments. Override per entry.</td></tr>
<?php if (!file_exists("data/lite.txt")) { ?>
<tr><td><input type="checkbox" name="memcomment" <?php if (file_exists("data/memcomment.txt")) { echo checked; } ?>> Do not prevent members from posting comments.</td></tr>
@@ -1283,6 +1280,8 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
<?php if (!file_exists("data/lite.txt")) { ?>
+<tr><td>wiki</td><td><input type="checkbox" name="wiki" <?php if (file_exists("data/wiki.txt")) { echo checked; } ?>> Enable wiki-style editing.</td></tr>
+
<tr><td>profanity filter</td><td><input type="checkbox" name="pf" <?php if (file_exists("data/pf.txt")) { echo checked; } ?>> Enable profanity filter.</td></tr>
<?php if (file_exists("data/pf.txt")) { ?>
@@ -1298,21 +1297,25 @@ if (file_exists("data/pf-censor.txt")) {
<?php } ?>
-<tr><td>wiki</td><td><input type="checkbox" name="wiki" <?php if (file_exists("data/wiki.txt")) { echo checked; } ?>> Enable wiki-style editing.</td></tr>
<?php
-$bb_rowspan = "10";
-
-if (file_exists("data/bb.txt") and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+if (file_exists("data/bb.txt")) {
- $bb_rowspan = $bb_rowspan + 1;
+ $bb_rowspan = "11";
-}
+ if (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png")) {
+
+ $bb_rowspan = $bb_rowspan + 1;
+ }
-if (file_exists("data/avatar.txt")) {
+ if (file_exists("data/avatar.txt")) {
- $bb_rowspan = $bb_rowspan + 3;
+ $bb_rowspan = $bb_rowspan + 3;
+ }
+}
+else {
+ $bb_rowspan = "0";
}
?>
@@ -1324,6 +1327,7 @@ if (file_exists("data/avatar.txt")) {
<tr><td><input type="checkbox" name="xapp" <?php if (file_exists("data/xapp.txt")) { echo checked; } ?>> Enable automatic activation of confirmed users.</td></tr>
<tr><td><input type="checkbox" name="reset" <?php if (file_exists("data/reset.txt")) { echo checked; } ?>> Enable password reset requests.</td></tr>
<tr><td><input type="checkbox" name="member" <?php if (file_exists("data/member.txt")) { echo checked; } ?>> Only members can view posts of other members.</td></tr>
+<tr><td><input type="checkbox" name="nomem" <?php if (file_exists("data/nomem.txt")) { echo checked; } ?>> Only members can view member list and member info.</td></tr>
<tr><td><input type="checkbox" name="stats" <?php if (file_exists("data/bb-stats.txt")) { echo checked; } ?>> Enable statistics panel.</td></tr>
<tr><td><input type="checkbox" name="summary" <?php if (file_exists("data/bb-summary.txt")) { echo checked; } ?>> Enable summary panel.</td></tr>
<tr><td><input type="checkbox" name="rank" <?php if (file_exists("data/rank.txt")) { echo checked; } ?>> Enable ranks.</td></tr>
tree 95add4a8c0553a900bc9ad9bfa016f3350d1acb3
parent f44c7e7b99adc400cbd937f390c758d341ddd7db
author Engels Antonio <engels@majcms.org> 1277314212 +0800
committer Engels Antonio <engels@majcms.org> 1277314212 +0800
maj-2.0-201006030700.zip
diff --git a/add.php b/add.php
index 6f36741..88a156c 100644
--- a/add.php
+++ b/add.php
@@ -186,10 +186,10 @@ if ($server_post_max_size > $server_memory_limit) {
if ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/{$_SESSION['logged_in']}/ul.txt")) { ?>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="image_input"> Select optional image.</p>
+<input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG entry image.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="file_input"> Select optional file.</p>
+<input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</p>
<?php } ?>
@@ -363,10 +363,10 @@ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
</select> Enter antedate value in YYYY-MM-DD-HH-MM format.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="image_input"> Select optional image.</p>
+<input autocomplete="off" type="file" name="image_input"> Upload optional GIF, JPG, or PNG entry image.</p>
<p><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
-<input autocomplete="off" type="file" name="file_input"> Select optional file.</p>
+<input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</p>
<p><input autocomplete="off" type="password" name="passwd"> Enter optional password.</p>
<?php
@@ -569,9 +569,25 @@ $body_write_content = preg_replace("/<([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([_
mkdir($item_dir);
-$title_write_content = ucfirst($_POST['title_input']);
+// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
+$title_write_content = ucwords($_POST['title_input']);
$title_write_content = str_replace('<','<',$title_write_content);
$title_write_content = str_replace('>','>',$title_write_content);
+$title_write_content = str_replace(' A ',' a ',$title_write_content);
+$title_write_content = str_replace(' An ',' an ',$title_write_content);
+$title_write_content = str_replace(' And ',' and ',$title_write_content);
+$title_write_content = str_replace(' As ',' as ',$title_write_content);
+$title_write_content = str_replace(' At ',' at ',$title_write_content);
+$title_write_content = str_replace(' But ',' but ',$title_write_content);
+$title_write_content = str_replace(' By ',' by ',$title_write_content);
+$title_write_content = str_replace(' For ',' for ',$title_write_content);
+$title_write_content = str_replace(' In ',' in ',$title_write_content);
+$title_write_content = str_replace(' Of ',' of ',$title_write_content);
+$title_write_content = str_replace(' On ',' on ',$title_write_content);
+$title_write_content = str_replace(' Or ',' or ',$title_write_content);
+$title_write_content = str_replace(' The ',' the ',$title_write_content);
+$title_write_content = str_replace(' To ',' to ',$title_write_content);
+
$title_file = $item_dir . '/title.txt';
$fp_title_txt = fopen($title_file,"w");
fwrite($fp_title_txt,$title_write_content);
@@ -729,7 +745,7 @@ if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'
}
}
-if (file_exists("data/bb.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
+if (file_exists("data/bb.txt") and file_exists("data/member.txt") and (($_SESSION['logged_in'] != file_get_contents("data/username.txt")) or (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")))) {
touch("data/items/$entry/member.txt");
}
diff --git a/cat.php b/cat.php
index 2c13521..58ff2bb 100644
--- a/cat.php
+++ b/cat.php
@@ -106,7 +106,25 @@ if (isset($_POST['new_id']) and !empty($_POST['new_id'])) {
}
if (isset($_POST['cat_del']) and !empty($_POST['cat_del']) and ($_POST['cat_del'] == "on")) {
+
rmdirr("data/categories/{$_POST['cat_id']}");
+
+ if (file_exists("data/items")) {
+
+ if ($dh_cat_del = opendir("data/items")) {
+
+ while (($entry_cat_del = readdir($dh_cat_del)) !== false) {
+
+ if ($entry_cat_del != "." && $entry_cat_del != "..") {
+
+ if (file_exists("data/items/$entry_cat_del/categories/{$_POST['cat_id']}")) {
+ rmdirr("data/items/$entry_cat_del/categories/{$_POST['cat_id']}");
+ }
+ }
+ }
+ closedir($dh_cat_del);
+ }
+ }
}
if ((!isset($_POST['cat_hide']) or !empty($_POST['cat_hide'])) and ($_POST['cat_edit'] == "on")) {
@@ -116,6 +134,9 @@ if ((!isset($_POST['cat_hide']) or !empty($_POST['cat_hide'])) and ($_POST['cat_
}
if (isset($_POST['cat_hide']) and !empty($_POST['cat_hide']) and ($_POST['cat_hide'] == "on")) {
+ if (file_exists("data/categories/{$_POST['cat_id']}/members")) {
+ rmdirr("data/categories/{$_POST['cat_id']}/members");
+ }
if (!file_exists("data/categories/{$_POST['cat_id']}/private.txt")) {
touch("data/categories/{$_POST['cat_id']}/private.txt");
}
@@ -297,10 +318,14 @@ a:active {
if ($count_cat > 0) {
- echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, invisible to visitors. Override per entry if needed.<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, accessible to you only. Override per entry if needed.";
+
+ echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
- echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td><td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
+ echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td>";
+
+ echo "<td align=\"center\">book</td><td align=\"center\">delete</td><td></td></tr>";
foreach ($show_cat as $category) {
echo "<form enctype=\"multipart/form-data\" action=\"cat.php\" method=\"post\">";
@@ -315,12 +340,14 @@ a:active {
}
echo "></td>";
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_book\"";
if (file_exists("data/categories/$category/book.txt")) {
echo " checked";
}
echo "></td>";
+
echo "<td align=\"center\"><input type=\"checkbox\" name=\"cat_del\"></td>";
echo "<td><input type=\"hidden\" name=\"cat_id\" value=\"$category\"><input type=\"hidden\" name=\"cat_edit\" value=\"on\"><input type=\"submit\" class=\"submit\" value=\"submit\"></td>";
echo "</tr></form>";
diff --git a/css.php b/css.php
new file mode 100644
index 0000000..202cc6a
--- /dev/null
+++ b/css.php
@@ -0,0 +1,715 @@
+<?php
+
+if (file_exists("data/fonts/body-size.txt")) {
+ $maj_body_px = file_get_contents("data/fonts/body-size.txt") . "px";
+}
+else {
+ $maj_body_px = "11px";
+}
+
+if (file_exists("data/fonts/input-size.txt")) {
+ $maj_input_px = file_get_contents("data/fonts/input-size.txt") . "px";
+}
+else {
+ $maj_input_px = "11px";
+}
+
+if (file_exists("data/fonts/panel-title-size.txt")) {
+ $maj_font_12px = file_get_contents("data/fonts/panel-title-size.txt") . "px";
+}
+else {
+ $maj_font_12px = "12px";
+}
+
+if (file_exists("data/fonts/panel-body-size.txt")) {
+ $maj_font_11px = file_get_contents("data/fonts/panel-body-size.txt") . "px";
+}
+else {
+ $maj_font_11px = "11px";
+}
+
+if (file_exists("data/fonts/panel-footer-size.txt")) {
+ $maj_font_10px = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
+}
+else {
+ $maj_font_10px = "10px";
+}
+
+?>
+
+<style>
+
+html {
+ font-size: <?php echo $maj_font_11px; ?>;
+}
+
+body {
+ margin: 0px 0px 10px 10px;
+ padding: 0px;
+ text-align: left;
+
+ font-size: <?php echo $maj_body_px; ?>;
+
+ color: <?php
+ if (file_exists("data/colors/font.txt")) {
+ $maj_font_color = file_get_contents("data/colors/font.txt");
+ echo $maj_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/body.txt")) {
+ $maj_font_body = file_get_contents("data/fonts/body.txt");
+ echo "{$maj_font_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ background-color: <?php
+ if (file_exists("data/colors/bg.txt")) {
+ $maj_background_color = file_get_contents("data/colors/bg.txt");
+ if ($maj_background_color == "transparent") {
+ echo "#ffffff";
+ }
+ else {
+ echo $maj_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: <?php echo $maj_font_11px; ?>;
+}
+
+a {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a:link {
+ color: <?php
+ if (file_exists("data/colors/link.txt")) {
+ $maj_a_link_color = file_get_contents("data/colors/link.txt");
+ echo $maj_a_link_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+}
+
+a:visited {
+ color: <?php
+ if (file_exists("data/colors/vlink.txt")) {
+ $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
+ echo $maj_a_visited_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+}
+
+a:hover {
+ color: <?php
+ if (file_exists("data/colors/hover.txt")) {
+ $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
+ echo $maj_a_hover_color;
+ }
+ else {
+ echo "#336699";
+ }
+ ?>;
+}
+
+a:active {
+ color: <?php
+ if (file_exists("data/colors/hover.txt")) {
+ $maj_a_active_color = file_get_contents("data/colors/hover.txt");
+ echo $maj_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 {
+ padding: 5px 5px 5px 5px;
+ margin: 0px 0px 0px 0px;
+ border-width: 1px 1px 0px 1px;
+ border-style: solid solid none solid;
+ font-weight: bold;
+
+ font-size: <?php echo $maj_font_12px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-title.txt")) {
+ $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+ echo "{$maj_font_panel_title},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pt-font.txt")) {
+ $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
+ echo $maj_panel_title_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ }
+ ?>;
+}
+
+.panel_body {
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$maj_font_panel_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pb-font.txt")) {
+ $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+ echo $maj_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")) {
+ $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_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")) {
+ $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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 {
+ text-align: right;
+
+ font-size: <?php echo $maj_font_10px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$maj_font_panel_footer},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+
+
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $maj_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")) {
+ $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_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")) {
+ $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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;';
+ }
+ ?>
+}
+
+.input {
+ width: 300px;
+ background: #ffffff;
+
+ font-size: <?php echo $maj_input_px; ?>;
+
+ color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_input_color = file_get_contents("data/colors/border.txt");
+ echo $maj_input_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ border: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_footer_border_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?> solid 1px;
+
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $maj_font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$maj_font_input},";
+ }
+ ?> arial,helvetica,sans-serif;
+}
+
+.search {
+ color: #666666;
+ background: #ffffff;
+ width: 100%;
+
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/input.txt")) {
+ $maj_font_input = file_get_contents("data/fonts/input.txt");
+ echo "{$maj_font_input},";
+ }
+ ?> arial,helvetica,sans-serif;
+}
+
+.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 {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb2b,.rb3b,.rb4b {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pb-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb2e,.rb3e,.rb4e {
+ border-left: 1px solid;
+ border-right: 1px solid;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rb1t,.rb1b,.rb1e {
+ margin: 0 5px;
+
+ background: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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-size: <?php echo $maj_font_12px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-title.txt")) {
+ $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
+ echo "{$maj_font_panel_title},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pt-font.txt")) {
+ $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
+ echo $maj_panel_title_font_color;
+ }
+ else {
+ echo "#666666";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pt-bg.txt")) {
+ $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
+ echo $maj_panel_title_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_panel_title_border_color;
+ }
+ else {
+ echo "#cccccc";
+ };
+ ?>;
+}
+
+.rbspace {
+ height: 3px;
+}
+
+.panel_entry_body {
+ margin: 0px 0px 0px 0px;
+
+ font-size: <?php echo $maj_font_11px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$maj_font_panel_body},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pb-font.txt")) {
+ $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
+ echo $maj_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")) {
+ $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
+ echo $maj_panel_body_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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 {
+ padding: 5px 5px 5px 5px;
+ margin: 0px 0px 0px 0px;
+ text-align: left;
+
+ font-size: <?php echo $maj_font_10px; ?>;
+
+ font-family: <?php
+ if (file_exists("data/fonts/panel-footer.txt")) {
+ $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
+ echo "{$maj_font_panel_category},";
+ }
+ ?> arial,helvetica,sans-serif;
+
+ color: <?php
+ if (file_exists("data/colors/pf-font.txt")) {
+ $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
+ echo $maj_panel_category_font_color;
+ }
+ else {
+ echo "#999999";
+ }
+ ?>;
+
+ background-color: <?php
+ if (file_exists("data/colors/pf-bg.txt")) {
+ $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
+ echo $maj_panel_category_background_color;
+ }
+ else {
+ echo "transparent";
+ }
+ ?>;
+
+ border-color: <?php
+ if (file_exists("data/colors/border.txt")) {
+ $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
+ echo $maj_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;';
+ }
+ ?>
+}
+
+<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
+
+</style>
diff --git a/edit.php b/edit.php
index 1aab751..397fd7a 100644
--- a/edit.php
+++ b/edit.php
@@ -277,6 +277,23 @@ a:active {
<?php
+if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_POST['auth_toggle']) and !empty($_POST['auth_toggle'])) {
+
+ if (($_POST['auth_toggle'] == "ack") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+ mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ }
+ }
+
+ if (($_POST['auth_toggle'] == "nak") and file_exists("data/members/active/{$_POST['auth_member']}")) {
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
+ rmdirr("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ }
+ }
+}
+
if (isset($_POST['category']) and !empty($_POST['category'])) {
if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
@@ -433,9 +450,9 @@ if (file_exists($revisions_file)) {
<tr><td><input autocomplete="off" type="file" name="album_image_input"> Upload optional album image. Enter optional caption below.</td></tr>
<tr><td><input autocomplete="off" type="text" name="caption" class="input_body"></td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
-<tr><td><input autocomplete="off" type="file" name="entry_image_input"> Upload optional entry image.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="entry_image_input"> Upload optional GIF, JPG, or PNG entry image.</td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php echo $max_file_size; ?>"></td></tr>
-<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="file_input"> Upload optional file. Max size supported by server is <?php echo ($max_file_size/(1024*1024)); ?>MB.</td></tr>
<?php
@@ -574,28 +591,36 @@ echo $body_read_content;
</td></tr></table>
-</td><td width="25"></td><td valign="top" width="150">
+</td><td width="25"></td><td valign="top">
<?php
- if (file_exists("data/categories")) {
- if ($dh_cat = opendir("data/categories")) {
+// improve category handling (20100221) - start
+
+if (file_exists("data/categories")) {
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- while (($entry_cat = readdir($dh_cat)) !== false) {
+ if ($dh_cat = opendir("data/categories")) {
+
+ while (($entry_cat = readdir($dh_cat)) !== false) {
- if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
+ if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
- if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
- $filed_cat[] = $entry_cat;
- }
+ if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
+ continue;
+ }
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
- $unfiled_cat[] = $entry_cat;
- }
+ if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ $filed_cat[] = $entry_cat;
+ }
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ $unfiled_cat[] = $entry_cat;
}
}
- closedir($dh_cat);
}
+ closedir($dh_cat);
sort($filed_cat);
sort($unfiled_cat);
@@ -605,52 +630,138 @@ echo $body_read_content;
$count_filed_cat = count($filed_cat);
$count_unfiled_cat = count($unfiled_cat);
+ }
- if ($count_filed_cat > 0) {
+ if ($count_filed_cat > 0) {
+
+ echo "<p><b>Filed Under</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+
+ foreach ($filed_cat as $filed_category) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
+ echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
+ }
+
+ echo "</table>";
+ }
+
+ echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+
+ if ($count_unfiled_cat > 0) {
+
+ echo "<p><b>Available Categories</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
- echo "<p><b>Filed Under</b></p>";
+ foreach ($unfiled_cat as $unfiled_category) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
+ echo "</form>";
+ }
+
+ echo "</table>";
+ }
+
+ echo "</td></tr></table><br>";
+}
+
+// improve category handling (20100221) - end
+
+// add member authorization (20100221) - start
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+if (file_exists("data/members/active")) {
- foreach ($filed_cat as $filed_category) {
- echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
- echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
- echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
- echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
- echo "<tr bgcolor=\"#ffffff\"><td><a href=\"index.php?category=$filed_category\">$filed_category</a></td>";
- echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
- echo "</form>";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
+
+ if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
+
+ while (($ack_member = readdir($dh_ack_members)) !== false) {
+
+ if ($ack_member != "." && $ack_member != "..") {
+ $ack_members[] = $ack_member;
}
+ }
+ closedir($dh_ack_members);
+ sort($ack_members);
+ reset($ack_members);
+ $count_ack_members = count($ack_members);
+ }
+
+ if ($dh_nak_members = opendir("data/members/active")) {
+
+ while (($nak_member = readdir($dh_nak_members)) !== false) {
- echo "</table>";
+ if ($nak_member != "." && $nak_member != "..") {
+
+ if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ continue;
+ }
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ $nak_members[] = $nak_member;
+ }
+ }
}
+ closedir($dh_nak_members);
+ sort($nak_members);
+ reset($nak_members);
+ $count_nak_members = count($nak_members);
}
-?>
-</td><td width="25"></td><td valign="top" width="150">
+ if ($count_ack_members > 0) {
-<?php
+ echo "<p><b>Authorized Members</b></p>";
+
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
-if ($count_unfiled_cat > 0) {
+ foreach ($ack_members as $ack_member) {
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"auth_member\" value=\"$ack_member\">";
+ echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"nak\">";
+ echo "<tr bgcolor=\"#ffffff\"><td><a href=\"member.php?id=$ack_member\">$ack_member</a></td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
+ }
+ echo "</table>";
+ }
+
+ echo "</td><td width=\"25\"></td><td valign=\"top\" width=\"150\">";
+
+ if ($count_nak_members > 0) {
- echo "<p><b>Available Categories</b></p>";
+ echo "<p><b>Registered Members</b></p>";
- echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
- foreach ($unfiled_cat as $unfiled_category) {
+ foreach ($nak_members as $nak_member) {
- echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
- echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
- echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
- echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
- echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
- echo "<td align=\"right\"><a href=\"index.php?category=$unfiled_category\">$unfiled_category</a></td></tr>";
- echo "</form>";
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"auth_member\" value=\"$nak_member\">";
+ echo "<input type=\"hidden\" name=\"auth_toggle\" value=\"ack\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\"><a href=\"member.php?id=$nak_member\">$nak_member</a></td></tr>";
+ echo "</form>";
+ }
+ echo "</table>";
}
- echo "</table>";
+ echo "</td></tr></table><br>";
}
+// add member authorization (20100221) - end
+
?>
</td></tr></table>
@@ -672,9 +783,25 @@ if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
copy("data/items/{$_REQUEST['entry']}/title.txt","data/items/{$_REQUEST['entry']}/title.old");
copy("data/items/{$_REQUEST['entry']}/body.txt","data/items/{$_REQUEST['entry']}/body.old");
-$title_write_content = ucfirst($_POST['title_input']);
+// 20100113 - auto-captialize title except articles, prepositions and conjunctions less tha 4 letters, and particle "to"
+$title_write_content = ucwords($_POST['title_input']);
$title_write_content = str_replace('<','<',$title_write_content);
$title_write_content = str_replace('>','>',$title_write_content);
+$title_write_content = str_replace(' A ',' a ',$title_write_content);
+$title_write_content = str_replace(' An ',' an ',$title_write_content);
+$title_write_content = str_replace(' And ',' and ',$title_write_content);
+$title_write_content = str_replace(' As ',' as ',$title_write_content);
+$title_write_content = str_replace(' At ',' at ',$title_write_content);
+$title_write_content = str_replace(' But ',' but ',$title_write_content);
+$title_write_content = str_replace(' By ',' by ',$title_write_content);
+$title_write_content = str_replace(' For ',' for ',$title_write_content);
+$title_write_content = str_replace(' In ',' in ',$title_write_content);
+$title_write_content = str_replace(' Of ',' of ',$title_write_content);
+$title_write_content = str_replace(' On ',' on ',$title_write_content);
+$title_write_content = str_replace(' Or ',' or ',$title_write_content);
+$title_write_content = str_replace(' The ',' the ',$title_write_content);
+$title_write_content = str_replace(' To ',' to ',$title_write_content);
+
$open_title_file = fopen($title_file,"w");
fwrite($open_title_file,$title_write_content);
fclose($open_title_file);
diff --git a/images/button.maj.png b/images/button.maj.png
index e5f0abb..dfef3a4 100644
Binary files a/images/button.maj.png and b/images/button.maj.png differ
diff --git a/index.php b/index.php
index a0afee3..ddfd129 100644
--- a/index.php
+++ b/index.php
@@ -247,8 +247,11 @@ function go_download($maj_dl_file) {
$maj_buf = fread($maj_get_it,4096);
echo $maj_buf;
$maj_bytes_sent += strlen($maj_buf);
+ flush();
}
+ fclose($maj_get_it);
+
if ($maj_bytes_sent == $maj_dl_file_size) {
if (!file_exists($maj_count_path)) {
@@ -308,13 +311,13 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
unlink("$maj_live_dir/key.txt");
- // clean-up old latest comments dir
+ // clean-up old latest comments dir (start)
if (file_exists("data/comments/latest")) {
rmdirr("data/comments/latest");
}
- // clean-up old latest comments dir
+ // clean-up old latest comments dir (end)
if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
@@ -331,17 +334,20 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
while (($maj_unread_active_member = readdir($maj_dh_unread_active_members)) !== false) {
if ($maj_unread_active_member != "." && $maj_unread_active_member != "..") {
-
- if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
- mkdir("data/members/active/$maj_unread_active_member/comments");
- }
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread");
- }
-
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
+ if ((!file_exists("data/members/active/$maj_unread_active_member/vacation.txt") and !file_exists("data/items/$maj_req_entry/members")) or (!file_exists("data/members/active/$maj_unread_active_member/vacation.txt") and file_exists("data/items/$maj_req_entry/members") and file_exists("data/items/$maj_req_entry/members/$maj_unread_active_member"))) {
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments");
+ }
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments/unread");
+ }
+
+ if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
+ mkdir("data/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
+ }
}
}
}
@@ -399,7 +405,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_subject = str_replace("Re:","",$maj_ml_subject);
$maj_ml_subject = "Re: " . $maj_ml_subject;
- $maj_ml_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
+ $maj_ml_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
$maj_ml_body = file_get_contents("$maj_live_dir/comment.txt");
$maj_ml_body = str_replace('<br />',"\n",$maj_ml_body);
@@ -652,7 +658,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_from_email = '"' . $maj_from_email_author . '" <' . $maj_from_email . '>';
}
- $maj_mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
+ $maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
$maj_commented_entry_title_file = "data/items/$maj_req_entry/title.txt";
$maj_fp_commented_entry_title = fopen($maj_commented_entry_title_file,"r");
@@ -714,7 +720,7 @@ else {
echo "<title>$maj_default_title</title>";
}
-if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
+if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")))) {
if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
@@ -740,9 +746,20 @@ if (file_exists("data/comments/pending") and file_exists("data/xscreen.txt")) {
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ if (isset($_SESSION['logged_in']) and file_exists("data/members/active/{$_SESSION['logged_in']}/xscreen.txt")) {
- header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ if ($_SESSION['logged_in'] == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+
+ $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+
+ header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ }
+ }
+ else {
+ $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+
+ header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
+ }
}
}
}
@@ -815,720 +832,10 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
}
}
-if (file_exists("data/fonts/body-size.txt")) {
- $maj_body_px = file_get_contents("data/fonts/body-size.txt") . "px";
-}
-else {
- $maj_body_px = "11px";
-}
-
-if (file_exists("data/fonts/input-size.txt")) {
- $maj_input_px = file_get_contents("data/fonts/input-size.txt") . "px";
-}
-else {
- $maj_input_px = "11px";
-}
-
-if (file_exists("data/fonts/panel-title-size.txt")) {
- $maj_font_12px = file_get_contents("data/fonts/panel-title-size.txt") . "px";
-}
-else {
- $maj_font_12px = "12px";
-}
-
-if (file_exists("data/fonts/panel-body-size.txt")) {
- $maj_font_11px = file_get_contents("data/fonts/panel-body-size.txt") . "px";
-}
-else {
- $maj_font_11px = "11px";
-}
-
-if (file_exists("data/fonts/panel-footer-size.txt")) {
- $maj_font_10px = file_get_contents("data/fonts/panel-footer-size.txt") . "px";
-}
-else {
- $maj_font_10px = "10px";
-}
+include("css.php");
?>
-<style>
-
-html {
- font-size: <?php echo $maj_font_11px; ?>;
-}
-
-body {
- margin: 0px 0px 10px 10px;
- padding: 0px;
- text-align: left;
-
- font-size: <?php echo $maj_body_px; ?>;
-
- color: <?php
- if (file_exists("data/colors/font.txt")) {
- $maj_font_color = file_get_contents("data/colors/font.txt");
- echo $maj_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $maj_font_body = file_get_contents("data/fonts/body.txt");
- echo "{$maj_font_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- background-color: <?php
- if (file_exists("data/colors/bg.txt")) {
- $maj_background_color = file_get_contents("data/colors/bg.txt");
- if ($maj_background_color == "transparent") {
- echo "#ffffff";
- }
- else {
- echo $maj_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: <?php echo $maj_font_11px; ?>;
-}
-
-a {
- font-weight: bold;
- text-decoration: none;
-}
-
-a:link {
- color: <?php
- if (file_exists("data/colors/link.txt")) {
- $maj_a_link_color = file_get_contents("data/colors/link.txt");
- echo $maj_a_link_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-}
-
-a:visited {
- color: <?php
- if (file_exists("data/colors/vlink.txt")) {
- $maj_a_visited_color = file_get_contents("data/colors/vlink.txt");
- echo $maj_a_visited_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-}
-
-a:hover {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $maj_a_hover_color = file_get_contents("data/colors/hover.txt");
- echo $maj_a_hover_color;
- }
- else {
- echo "#336699";
- }
- ?>;
-}
-
-a:active {
- color: <?php
- if (file_exists("data/colors/hover.txt")) {
- $maj_a_active_color = file_get_contents("data/colors/hover.txt");
- echo $maj_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 {
- padding: 5px 5px 5px 5px;
- margin: 0px 0px 0px 0px;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
- font-weight: bold;
-
- font-size: <?php echo $maj_font_12px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$maj_font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $maj_panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- }
- ?>;
-}
-
-.panel_body {
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$maj_font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $maj_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")) {
- $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_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")) {
- $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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 {
- text-align: right;
-
- font-size: <?php echo $maj_font_10px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $maj_font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$maj_font_panel_footer},";
- }
- ?> arial,helvetica,sans-serif;
-
-
-
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $maj_panel_footer_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $maj_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")) {
- $maj_panel_footer_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_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")) {
- $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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;';
- }
- ?>
-}
-
-.input {
- width: 300px;
- background: #ffffff;
-
- font-size: <?php echo $maj_input_px; ?>;
-
- color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_input_color = file_get_contents("data/colors/border.txt");
- echo $maj_input_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- border: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_footer_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_footer_border_color;
- }
- else {
- echo "#999999";
- }
- ?> solid 1px;
-
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $maj_font_input = file_get_contents("data/fonts/input.txt");
- echo "{$maj_font_input},";
- }
- ?> arial,helvetica,sans-serif;
-}
-
-.search {
- color: #666666;
- background: #ffffff;
- width: 100%;
-
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/input.txt")) {
- $maj_font_input = file_get_contents("data/fonts/input.txt");
- echo "{$maj_font_input},";
- }
- ?> arial,helvetica,sans-serif;
-}
-
-.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 {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb2b,.rb3b,.rb4b {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pb-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb2e,.rb3e,.rb4e {
- border-left: 1px solid;
- border-right: 1px solid;
-
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rb1t,.rb1b,.rb1e {
- margin: 0 5px;
-
- background: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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-size: <?php echo $maj_font_12px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $maj_font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$maj_font_panel_title},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pt-font.txt")) {
- $maj_panel_title_font_color = file_get_contents("data/colors/pt-font.txt");
- echo $maj_panel_title_font_color;
- }
- else {
- echo "#666666";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pt-bg.txt")) {
- $maj_panel_title_background_color = file_get_contents("data/colors/pt-bg.txt");
- echo $maj_panel_title_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_title_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_panel_title_border_color;
- }
- else {
- echo "#cccccc";
- };
- ?>;
-}
-
-.rbspace {
- height: 3px;
-}
-
-.panel_entry_body {
- margin: 0px 0px 0px 0px;
-
- font-size: <?php echo $maj_font_11px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $maj_font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$maj_font_panel_body},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pb-font.txt")) {
- $maj_panel_body_font_color = file_get_contents("data/colors/pb-font.txt");
- echo $maj_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")) {
- $maj_panel_body_background_color = file_get_contents("data/colors/pb-bg.txt");
- echo $maj_panel_body_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_body_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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 {
- padding: 5px 5px 5px 5px;
- margin: 0px 0px 0px 0px;
- text-align: left;
-
- font-size: <?php echo $maj_font_10px; ?>;
-
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $maj_font_panel_category = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$maj_font_panel_category},";
- }
- ?> arial,helvetica,sans-serif;
-
- color: <?php
- if (file_exists("data/colors/pf-font.txt")) {
- $maj_panel_category_font_color = file_get_contents("data/colors/pf-font.txt");
- echo $maj_panel_category_font_color;
- }
- else {
- echo "#999999";
- }
- ?>;
-
- background-color: <?php
- if (file_exists("data/colors/pf-bg.txt")) {
- $maj_panel_category_background_color = file_get_contents("data/colors/pf-bg.txt");
- echo $maj_panel_category_background_color;
- }
- else {
- echo "transparent";
- }
- ?>;
-
- border-color: <?php
- if (file_exists("data/colors/border.txt")) {
- $maj_panel_category_border_color = file_get_contents("data/colors/border.txt");
- echo $maj_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;';
- }
- ?>
-}
-
-<?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">
@@ -1638,7 +945,7 @@ else {
Navigation</div>
<div class="panel_body">
-<a class="navlink" href="index.php">Home</a><br>
+<a class="navlink" href=".">Home</a><br>
<?php
@@ -1776,6 +1083,10 @@ if (file_exists("data/panels")) {
continue;
}
+ if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($_SESSION['logged_in'])) {
+ continue;
+ }
+
if (file_exists("data/panels/$maj_panel/top.txt")) {
$maj_top_panels[] = $maj_panel;
continue;
@@ -2410,6 +1721,70 @@ if ($maj_dh_items = opendir("data/items")) {
if ($maj_item != "." && $maj_item != "..") {
+ if (file_exists("data/items/$maj_item/categories")) {
+
+ if ($maj_dh_egroups = opendir("data/items/$maj_item/categories")) {
+
+ while (($maj_egroup = readdir($maj_dh_egroups)) !== false) {
+
+ if ($maj_egroup != "." && $maj_egroup != "..") {
+
+ if (!file_exists("data/categories/$maj_egroup")) {
+ rmdirr("data/items/$maj_item/categories/$maj_egroup");
+ }
+
+ if (file_exists("data/categories/$maj_egroup/members")) {
+
+ if ($maj_dh_mgroups = opendir("data/categories/$maj_egroup/members")) {
+
+ while (($maj_mgroup = readdir($maj_dh_mgroups)) !== false) {
+
+ if ($maj_mgroup != "." && $maj_mgroup != "..") {
+
+ if (!file_exists("data/items/$maj_item/members/$maj_mgroup")) {
+
+ if (!file_exists("data/items/$maj_item/members")) {
+ mkdir("data/items/$maj_item/members");
+ }
+
+ mkdir("data/items/$maj_item/members/$maj_mgroup");
+ }
+ }
+ }
+ closedir($maj_dh_mgroups);
+ }
+ }
+ }
+ }
+ closedir($maj_dh_egroups);
+ }
+ }
+
+ if (file_exists("data/items/$maj_item/categories") and (count(glob("data/items/$maj_item/categories/*")) < 1)) {
+ rmdirr("data/items/$maj_item/categories");
+ }
+
+ if (file_exists("data/items/$maj_item/members")) {
+
+ if ($maj_dh_members = opendir("data/items/$maj_item/members")) {
+
+ while (($maj_member = readdir($maj_dh_members)) !== false) {
+
+ if ($maj_member != "." && $maj_member != "..") {
+
+ if (!file_exists("data/members/active/$maj_member")) {
+ rmdirr("data/items/$maj_item/members/$maj_member");
+ }
+ }
+ }
+ closedir("data/items/$maj_item/members");
+ }
+ }
+
+ if (file_exists("data/items/$maj_item/members") and (count(glob("data/items/$maj_item/members/*")) < 1)) {
+ rmdirr("data/items/$maj_item/members");
+ }
+
if (file_exists("data/items/$maj_item/comments/live") and (count(glob("data/items/$maj_item/comments/live/*")) < 1)) {
rmdirr("data/items/$maj_item/comments/live");
}
@@ -2438,8 +1813,9 @@ if ($maj_dh_items = opendir("data/items")) {
rmdirr("data/items/$maj_item/album/captions");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/count") and (count(glob("data/items/$maj_item/album/count/*")) < 1)) {
- rmdirr("data/items/$maj_item/album/count");
+ if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/views") and (count(glob("data/items/$maj_item/album/views/*")) < 1)) {
+ rmdirr("data/items/$maj_item/album/views");
+ unlink("data/items/$maj_item/album/views.txt");
}
if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album") and (count(glob("data/items/$maj_item/album/*")) < 1)) {
@@ -2548,6 +1924,10 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
+ if ((file_exists("data/items/$maj_item/members") and !isset($_SESSION['logged_in'])) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/{$_SESSION['logged_in']}"))) {
+ continue;
+ }
+
if (file_exists("data/items/$maj_item/member.txt") and (!isset($_SESSION['logged_in']))) {
continue;
}
@@ -2566,7 +1946,11 @@ if ($maj_dh_items = opendir("data/items")) {
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
- $maj_items[] = $maj_req_entry;
+
+ if ($maj_req_entry != $maj_item) {
+ continue;
+ }
+ $maj_items[] = $maj_item;
}
if (isset($maj_req_category) and file_exists("data/categories/$maj_req_category") and file_exists("data/items/$maj_item/categories/$maj_req_category")) {
@@ -3758,7 +3142,8 @@ foreach ($maj_disp as $maj_d) {
$maj_entry_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_entry_body);
}
- if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($_REQUEST['view']) or ($_REQUEST['view'] != "full"))) {
+ // if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($_REQUEST['view']) or ($_REQUEST['view'] != "full"))) {
+ if (file_exists("data/items/$maj_d/maxlines.txt") and (!isset($maj_req_entry) or empty($maj_req_entry))) {
$maj_entry_shorten = file_get_contents("data/items/$maj_d/maxlines.txt");
@@ -3766,7 +3151,7 @@ foreach ($maj_disp as $maj_d) {
if (count($maj_entry_lines) > $maj_entry_shorten) {
$maj_entry_body = implode("",array_slice($maj_entry_lines,0,$maj_entry_shorten));
- $maj_entry_body = $maj_entry_body . "<br><br><a href=\"index.php?entry=$maj_d&view=full\">read more</a>";
+ $maj_entry_body = $maj_entry_body . "<br><br><a href=\"index.php?entry=$maj_d\">read more</a>";
}
}
@@ -3874,7 +3259,7 @@ foreach ($maj_disp as $maj_d) {
echo '>';
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
if (!file_exists("data/items/$maj_d/comments/live")) {
echo "<a href=\"index.php?entry=$maj_d&show=comments\">add comment</a>";
@@ -4062,7 +3447,7 @@ foreach ($maj_disp as $maj_d) {
echo "| <a href=\"index.php?entry=$maj_d&show=pdf\">pdf</a> ";
- if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) {
+ if (($maj_req_show == pdf) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username))) {
$maj_pdf_views_value = file_get_contents("data/items/$maj_d/pdf/count/views.txt");
@@ -4086,7 +3471,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "| <a href=\"index.php?entry=$maj_d\">permalink</a>";
}
@@ -4741,7 +4126,7 @@ foreach ($maj_disp as $maj_d) {
echo '</td></tr></table>';
}
- if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
+ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($maj_req_show) and !empty($maj_req_show) and ($maj_req_show == comments) and (file_exists("data/items/$maj_req_entry/ucomment.txt") or !file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])))) {
if (file_exists("data/items/$maj_d/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $maj_login_username)) and (!isset($_REQUEST['passwd']) or ($maj_crypt_passwd != $maj_passwd))) {
}
@@ -5183,7 +4568,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
+ if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in'])) or file_exists("data/items/$maj_d/ucomment.txt")) {
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$maj_wmain\"><tr><td>";
@@ -5204,7 +4589,7 @@ foreach ($maj_disp as $maj_d) {
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")))) {
+ if (!isset($_SESSION['logged_in'])) {
echo " and enter <b>$maj_captcha_rand</b> in the CAPTCHA field";
}
@@ -5325,7 +4710,7 @@ foreach ($maj_disp as $maj_d) {
<tr><td><nobr>Comment*</nobr></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"))) {
+ if (isset($_SESSION['logged_in'])) {
echo "<input type=hidden name=captcha_put value=\"$maj_captcha_rand\">";
}
else {
@@ -5823,7 +5208,13 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
- $maj_unread_comments[] = $maj_unread_comment;
+
+ if (!file_exists("data/items/$maj_unread_comment")) {
+ rmdirr("data/comments/unread/$maj_unread_comment");
+ }
+ else {
+ $maj_unread_comments[] = $maj_unread_comment;
+ }
}
}
closedir($maj_dh_unread_comments);
@@ -5840,7 +5231,13 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
while (($maj_unread_comment = readdir($maj_dh_unread_comments)) !== false) {
if ($maj_unread_comment != "." && $maj_unread_comment != "..") {
- $maj_unread_comments[] = $maj_unread_comment;
+
+ if (!file_exists("data/items/$maj_unread_comment")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$maj_unread_comment");
+ }
+ else {
+ $maj_unread_comments[] = $maj_unread_comment;
+ }
}
}
closedir($maj_dh_unread_comments);
@@ -6635,24 +6032,10 @@ if ($maj_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>';
-
- $maj_validate_uri = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $maj_validate_uri = str_replace('//','/',$maj_validate_uri);
- $maj_validate_uri = "http://" . $maj_validate_uri;
-
- echo '<tr><td align="center"><a target="_button" href="http://jigsaw.w3.org/css-validator/validator?uri=' . $maj_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")) {
-
- $maj_sfx = file_get_contents("data/sfx.txt");
-
- echo "<tr><td align=\"center\"><a target=\"_button\" href=\"http://www.spreadfirefox.com/?q=affiliates&class=$maj_sfx&t=85\"><img src=\"images/button.firefox.png\" border=\"0\" width=\"80\" height=\"15\"></a></td></tr>";
- }
-
echo '</table>';
}
diff --git a/member.php b/member.php
index fe4a78f..da86883 100644
--- a/member.php
+++ b/member.php
@@ -41,6 +41,10 @@ if (isset($_REQUEST['id']) and ($_REQUEST['id'] != file_get_contents("data/usern
exit();
}
+if (!isset($_SESSION['logged_in']) and file_exists("data/nomem.txt")) {
+ header("Location: login.php");
+}
+
$id = $_REQUEST['id'];
$login_username = file_get_contents("data/username.txt");
diff --git a/rel.txt b/rel.txt
index 5e7b5d5..81b916d 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090629
\ No newline at end of file
+201006030700
diff --git a/rss.php b/rss.php
index 66a124f..a8ec743 100644
--- a/rss.php
+++ b/rss.php
@@ -1,10 +1,15 @@
<?php
+// 201001110322 - Valid RSS 0.91, 1.0, 2.0
+
error_reporting(E_ERROR);
if (get_magic_quotes_gpc()) {
+
function stripslashes_array($data) {
+
if (is_array($data)) {
+
foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
@@ -25,38 +30,32 @@ else {
}
if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
- $title_file = "data/title.txt";
- $fp_title = fopen($title_file, "r");
- $title = fread($fp_title, filesize($title_file));
- fclose($fp_title);
- $description_file = "data/profile.php";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
+
+ $title = file_get_contents("data/title.txt");
+ $title = strip_tags($title);
+ $title = htmlspecialchars($title,ENT_QUOTES);
+
+ $description = file_get_contents("data/profile.php");
$description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- $author_file = "data/author.txt";
- $fp_author = fopen($author_file, "r");
- $author = fread($fp_author, filesize($author_file));
- fclose($fp_author);
- $default_increase_file = "data/increase.txt";
- if (file_exists($default_increase_file)) {
- $fp_default_increase = fopen($default_increase_file, "r");
- $increase = fread($fp_default_increase, filesize($default_increase_file));
- fclose($fp_default_increase);
+ $description = htmlspecialchars($description,ENT_QUOTES);
+
+ if (file_exists("data/increase.txt")) {
+ $increase = file_get_contents("data/increase.txt");
}
else {
$increase = 5;
}
+
$link = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$link = str_replace('//', '/', $link);
$link = "http://" . $link;
+
$fix_link = array('//index.php', '///index.php');
- $dir = "data/items";
+
$feeds = $increase;
- if ($dh_rss_items = opendir($dir)) {
+ if ($dh_rss_items = opendir("data/items")) {
+
while (($entry_rss_items = readdir($dh_rss_items)) !== false) {
$today = date("YmdHis", time() + $offset);
@@ -87,7 +86,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
if (($private > 0) and !file_exists("data/items/$entry_rss_items/cat.txt")) {
continue;
}
-
+
if (file_exists("data/items/$entry_rss_items/passwd.txt")) {
continue;
}
@@ -104,7 +103,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
continue;
}
- if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt")) {
+ if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt") && !file_exists("data/items/$entry_rss_items/members")) {
$show_rss_items[] = $entry_rss_items;
}
}
@@ -113,6 +112,7 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
rsort($show_rss_items);
reset($show_rss_items);
+
$count_rss_items = count($show_rss_items);
if ($count_rss_items < $feeds) {
@@ -121,68 +121,36 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
if ($count_rss_items > 0) {
- if ($_REQUEST['ver'] == "0.91") {
- $rss091_file = fopen("data/rss-0.91.txt", "r");
- $rss091_count = fread($rss091_file, filesize("data/rss-0.91.txt"));
- fclose($rss091_file);
- $rss091_count = $rss091_count + 1;
- $rss091_file = fopen("data/rss-0.91.txt", "w");
- fwrite($rss091_file, $rss091_count);
- fclose($rss091_file);
- header('Content-type: application/xml');
- echo "<rss version=\"0.91\">\n";
+ header('Content-type: application/xml');
+
+ echo "<?xml version=\"1.0\"?>\n";
+
+ if ($_REQUEST['ver'] == "2.0") {
+
+ $rss20_count = fread("data/rss-2.0.txt");
+ $rss20_count = $rss20_count + 1;
+
+ $rss20_file = fopen("data/rss-2.0.txt", "w");
+ fwrite($rss20_file, $rss20_count);
+ fclose($rss20_file);
+
+ echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
echo "<channel>\n";
echo "<title>$title</title>\n";
echo "<link>$link</link>\n";
echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
-
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- echo $description;
- echo "</description>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</channel>\n";
- echo "</rss>";
+ echo "<atom:link href=\"{$link}rss.php?ver={$_REQUEST['ver']}\" rel=\"self\" type=\"application/rss+xml\" />\n";
}
if ($_REQUEST['ver'] == "1.0") {
- $rss10_file = fopen("data/rss-1.0.txt", "r");
- $rss10_count = fread($rss10_file, filesize("data/rss-1.0.txt"));
- fclose($rss10_file);
+
+ $rss10_count = file_get_contents("data/rss-1.0.txt");
$rss10_count = $rss10_count + 1;
+
$rss10_file = fopen("data/rss-1.0.txt", "w");
fwrite($rss10_file, $rss10_count);
fclose($rss10_file);
- header('Content-type: application/xml');
+
echo "<rdf:RDF\n";
echo "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
echo "xmlns=\"http://purl.org/rss/1.0/\"\n";
@@ -194,113 +162,94 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
echo "<description>$description</description>\n";
echo "<items>\n";
echo "<rdf:Seq>\n";
+
$increment_rss_entries = 0;
$show_rss_entries = $feeds - 1;
+
while ($increment_rss_entries <= $show_rss_entries) {
$link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
$link = str_replace($fix_link, '/index.php', $link);
echo "<rdf:li rdf:resource=\"$link\"/>\n";
$increment_rss_entries = $increment_rss_entries + 1;
}
+
echo "</rdf:Seq>\n";
echo "</items>\n";
echo "</channel>\n";
- $increment_rss_entries = 0;
- while ($increment_rss_entries <= $show_rss_entries) {
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<item rdf:about=\"$link\">\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>\n";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</rdf:RDF>";
}
- if ($_REQUEST['ver'] == "2.0") {
- $rss20_file = fopen("data/rss-2.0.txt", "r");
- $rss20_count = fread($rss20_file, filesize("data/rss-2.0.txt"));
- fclose($rss20_file);
- $rss20_count = $rss20_count + 1;
- $rss20_file = fopen("data/rss-2.0.txt", "w");
- fwrite($rss20_file, $rss20_count);
- fclose($rss20_file);
- header('Content-type: application/xml');
- echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
+ if ($_REQUEST['ver'] == "0.91") {
+
+ $rss091_count = file_get_contents("data/rss-0.91.txt");
+ $rss091_count = $rss091_count + 1;
+
+ $rss091_file = fopen("data/rss-0.91.txt", "w");
+ fwrite($rss091_file, $rss091_count);
+ fclose($rss091_file);
+
+ echo "<rss version=\"0.91\">\n";
echo "<channel>\n";
echo "<title>$title</title>\n";
echo "<link>$link</link>\n";
echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
+ }
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $fp_description = fopen($description_file, "r");
- $description = fread($fp_description, filesize($description_file));
- fclose($fp_description);
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $description = str_replace("&","&",$description);
- 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]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
+ $increment_rss_entries = 0;
+ $show_rss_entries = $feeds - 1;
+
+ while ($increment_rss_entries <= $show_rss_entries) {
+
+ $title = file_get_contents("data/items/$show_rss_items[$increment_rss_entries]/title.txt");
+ $title = strip_tags($title);
+ $title = htmlspecialchars($title,ENT_QUOTES);
+
+ $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
+ $link = str_replace($fix_link, '/index.php', $link);
+
+ $description = file_get_contents("data/items/$show_rss_items[$increment_rss_entries]/body.txt");
+ $description = strip_tags($description);
+ $description = htmlspecialchars($description,ENT_QUOTES);
+
+ 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");
}
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
+ else {
+ $censor = "[expletive]";
+ }
+ $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
+ }
+
+ if ($_REQUEST['ver'] == "1.0") {
+ echo "<item rdf:about=\"$link\">\n";
+ }
+ else {
+ echo "<item>\n";
}
+
+ echo "<title>$title</title>\n";
+ echo "<link>$link</link>\n";
+
+ if ($_REQUEST['ver'] != "1.0") {
+ echo "<guid>$link</guid>\n";
+ }
+
+ echo "<description>$description</description>\n";
+ echo "</item>\n";
+
+ $increment_rss_entries = $increment_rss_entries + 1;
+ }
+
+ if ($_REQUEST['ver'] != "1.0") {
echo "</channel>\n";
echo "</rss>";
}
-
+ else {
+ echo "</rdf:RDF>";
+ }
}
}
diff --git a/settings.php b/settings.php
index ac42561..11ac67d 100644
--- a/settings.php
+++ b/settings.php
@@ -91,20 +91,6 @@ if (!isset($_POST['offset']) or empty($_POST['offset']) or !is_numeric($_POST['o
}
}
-if (isset($_POST['sfx']) and !empty($_POST['sfx']) and is_numeric($_POST['sfx']) and (file_get_contents("data/sfx.txt") != $_POST['sfx'])) {
- $fp_sfx_txt = fopen("data/sfx.txt","w");
- fwrite($fp_sfx_txt,$_POST['sfx']);
- fclose($fp_sfx_txt);
-}
-
-if (!isset($_POST['sfx']) or empty($_POST['sfx']) or !is_numeric($_POST['sfx'])) {
- if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
- if (file_exists("data/sfx.txt")) {
- unlink("data/sfx.txt");
- }
- }
-}
-
if (isset($_POST['ping']) and !empty($_POST['ping']) and (file_get_contents("data/ping.txt") != $_POST['ping']) and (ereg("\.", $_POST['ping'])) and (ereg("http://", $_POST['ping']))) {
$ping_write_content = strtolower($_POST['ping']);
$ping_write_content = trim($ping_write_content);
@@ -424,6 +410,18 @@ if (!isset($_POST['member']) or empty($_POST['member'])) {
}
}
+if (isset($_POST['nomem']) and !empty($_POST['nomem']) and ($_POST['nomem'] == "on") and !file_exists("data/nomem.txt")) {
+ touch("data/nomem.txt");
+}
+
+if (!isset($_POST['nomem']) or empty($_POST['nomem'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/nomem.txt")) {
+ unlink("data/nomem.txt");
+ }
+ }
+}
+
if (isset($_POST['ml']) and !empty($_POST['ml']) and ($_POST['ml'] == "on") and !file_exists("data/ml.txt")) {
touch("data/ml.txt");
}
@@ -1116,7 +1114,6 @@ a:active {
<tr><td>username*</td><td><input autocomplete="off" class="input" type="text" name="username" value="<?php readfile("data/username.txt"); ?>"></td></tr>
<tr><td>entries per page</td><td><input autocomplete="off" class="input" type="text" name="increase" value="<?php readfile("data/increase.txt"); ?>"></td></tr>
<tr><td>timezone offset in seconds</td><td><input autocomplete="off" class="input" type="text" name="offset" value="<?php readfile("data/offset.txt"); ?>"></td></tr>
-<tr><td>spread firefox <a href="http://www.spreadfirefox.com/?q=user/register&r=76458" target="_maj">affiliate</a> id</td><td><input autocomplete="off" class="input" type="text" name="sfx" value="<?php readfile("data/sfx.txt"); ?>"></td></tr>
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
@@ -1132,7 +1129,7 @@ a:active {
echo $toggles_rowspan;
-?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</td></tr>
+?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments. Override per entry.</td></tr>
<?php if (!file_exists("data/lite.txt")) { ?>
<tr><td><input type="checkbox" name="memcomment" <?php if (file_exists("data/memcomment.txt")) { echo checked; } ?>> Do not prevent members from posting comments.</td></tr>
@@ -1283,6 +1280,8 @@ if (file_exists("images/background.gif") or file_exists("images/background.jpg")
<?php if (!file_exists("data/lite.txt")) { ?>
+<tr><td>wiki</td><td><input type="checkbox" name="wiki" <?php if (file_exists("data/wiki.txt")) { echo checked; } ?>> Enable wiki-style editing.</td></tr>
+
<tr><td>profanity filter</td><td><input type="checkbox" name="pf" <?php if (file_exists("data/pf.txt")) { echo checked; } ?>> Enable profanity filter.</td></tr>
<?php if (file_exists("data/pf.txt")) { ?>
@@ -1298,21 +1297,25 @@ if (file_exists("data/pf-censor.txt")) {
<?php } ?>
-<tr><td>wiki</td><td><input type="checkbox" name="wiki" <?php if (file_exists("data/wiki.txt")) { echo checked; } ?>> Enable wiki-style editing.</td></tr>
<?php
-$bb_rowspan = "10";
-
-if (file_exists("data/bb.txt") and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+if (file_exists("data/bb.txt")) {
- $bb_rowspan = $bb_rowspan + 1;
+ $bb_rowspan = "11";
-}
+ if (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png")) {
+
+ $bb_rowspan = $bb_rowspan + 1;
+ }
-if (file_exists("data/avatar.txt")) {
+ if (file_exists("data/avatar.txt")) {
- $bb_rowspan = $bb_rowspan + 3;
+ $bb_rowspan = $bb_rowspan + 3;
+ }
+}
+else {
+ $bb_rowspan = "0";
}
?>
@@ -1324,6 +1327,7 @@ if (file_exists("data/avatar.txt")) {
<tr><td><input type="checkbox" name="xapp" <?php if (file_exists("data/xapp.txt")) { echo checked; } ?>> Enable automatic activation of confirmed users.</td></tr>
<tr><td><input type="checkbox" name="reset" <?php if (file_exists("data/reset.txt")) { echo checked; } ?>> Enable password reset requests.</td></tr>
<tr><td><input type="checkbox" name="member" <?php if (file_exists("data/member.txt")) { echo checked; } ?>> Only members can view posts of other members.</td></tr>
+<tr><td><input type="checkbox" name="nomem" <?php if (file_exists("data/nomem.txt")) { echo checked; } ?>> Only members can view member list and member info.</td></tr>
<tr><td><input type="checkbox" name="stats" <?php if (file_exists("data/bb-stats.txt")) { echo checked; } ?>> Enable statistics panel.</td></tr>
<tr><td><input type="checkbox" name="summary" <?php if (file_exists("data/bb-summary.txt")) { echo checked; } ?>> Enable summary panel.</td></tr>
<tr><td><input type="checkbox" name="rank" <?php if (file_exists("data/rank.txt")) { echo checked; } ?>> Enable ranks.</td></tr>