This commit has been accessed 339 times via Git panel.
commit d7f17aa258773e9a244eec522258cd9656e52689
tree 17f105a709f8c5ba79b5ffd03ac9e1ceeeaccda4
parent c4d3e1d4e896ca7fc9aab000589e760b24b6c413
author Magie Antonio <magie@majcms.org> 1309806034 +0800
committer Magie Antonio <magie@majcms.org> 1309806034 +0800
Clean up edit.php and associated files
Remove scarcely used PDF support
diff --git a/add.php b/add.php
index 844b423..70f092f 100644
--- a/add.php
+++ b/add.php
@@ -416,7 +416,6 @@ a:active {
?>
<p><input type="checkbox" name="sticky">Put entry title in Quick Links box.<br>
-<input type="checkbox" name="pdf">Allow PDF generation for this entry.<br>
<input type="checkbox" name="display">Always display. If this is not a private entry, it will be displayed even if its category is hidden or isolated.<br>
<input type="checkbox" name="private" <?php
if (file_exists("data/ml.txt")) {
@@ -756,51 +755,6 @@ a:active {
}
}
- if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
- if (!file_exists("data/items/$entry/pdf")) {
- mkdir("data/items/$entry/pdf");
- }
- if (!file_exists("data/items/$entry/pdf/file")) {
- mkdir("data/items/$entry/pdf/file");
- }
- if (!file_exists("data/items/$entry/pdf/count")) {
- mkdir("data/items/$entry/pdf/count");
- }
-
- $author_file = "data/author.txt";
- $title_file = "data/items/$entry/title.txt";
- $date_file = "data/items/$entry/date.txt";
- $body_file = "data/items/$entry/body.txt";
-
- $author = file_get_contents($author_file);
- $title = file_get_contents($title_file);
- $date = file_get_contents($date_file);
-
- $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
- $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
- $link = str_replace("add.php?entry=", "index.php?entry=", $link);
-
- $body = file_get_contents($body_file);
- $body = str_replace("\n", "<br />", $body);
-
- $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-
- $filename = strtolower($title);
- $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
- $filename = str_replace(" ", "-", $filename);
- $filename = "data/items/$entry/pdf/file/$filename";
-
- $pdf = new PDF();
- $pdf->AddPage();
- $pdf->SetTitle($title);
- $pdf->SetAuthor($author);
- $pdf->SetFont('Helvetica', 'B', 14);
- $pdf->WriteHTML($title);
- $pdf->SetFont('Helvetica', '', 10);
- $pdf->WriteHTML($html);
- $pdf->Output($filename);
- }
-
if (isset($_POST['category']) and !empty($_POST['category']) and file_exists("data/categories/{$_POST['category']}")) {
if (!file_exists("data/items/$entry/categories")) {
mkdir("data/items/$entry/categories");
diff --git a/core.php b/core.php
index ba59561..b9d6f18 100644
--- a/core.php
+++ b/core.php
@@ -1,7 +1,9 @@
<?php
-$maj_default_title = file_get_contents("data/title.txt");
-$maj_admin_username = file_get_contents("data/username.txt");
+$maj_data_directory = "data";
+
+$maj_default_title = file_get_contents("$maj_data_directory/title.txt");
+$maj_admin_username = file_get_contents("$maj_data_directory/username.txt");
if (isset($_SESSION['logged_in'])) {
$maj_logged_in_username = $_SESSION['logged_in'];
@@ -62,21 +64,21 @@ if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
$maj_req_author = strip_tags($maj_req_author);
}
-if (file_exists("data/offset.txt")) {
- $maj_offset = file_get_contents("data/offset.txt");
+if (file_exists("$maj_data_directory/offset.txt")) {
+ $maj_offset = file_get_contents("$maj_data_directory/offset.txt");
}
else {
$maj_offset = 0;
}
-if (file_exists("data/increase.txt")) {
- $maj_increase = file_get_contents("data/increase.txt");
+if (file_exists("$maj_data_directory/increase.txt")) {
+ $maj_increase = file_get_contents("$maj_data_directory/increase.txt");
}
else {
$maj_increase = 5;
}
-if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_wside = "160";
$maj_wmain = "600";
}
@@ -99,42 +101,42 @@ if (!file_exists("data")) {
mkdir("data");
}
-if (!file_exists("data/.htaccess")) {
+if (!file_exists("$maj_data_directory/.htaccess")) {
$maj_htaccess = "Order deny,allow\nDeny from all";
- $maj_fp_htaccess_txt = fopen("data/.htaccess","w");
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/.htaccess","w");
fwrite($maj_fp_htaccess_txt,$maj_htaccess);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/title.txt")) {
- $maj_fp_default_title_txt = fopen("data/title.txt","w");
+if (!file_exists("$maj_data_directory/title.txt")) {
+ $maj_fp_default_title_txt = fopen("$maj_data_directory/title.txt","w");
fwrite($maj_fp_default_title_txt,$maj_default_blog_title);
fclose($maj_fp_default_title_txt);
}
-if (!file_exists("data/username.txt")) {
- $maj_fp_htaccess_txt = fopen("data/username.txt","w");
+if (!file_exists("$maj_data_directory/username.txt")) {
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/username.txt","w");
fwrite($maj_fp_htaccess_txt,$maj_default_username);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/password.txt")) {
+if (!file_exists("$maj_data_directory/password.txt")) {
$maj_default_password = sha1($maj_default_password);
$maj_default_password = md5($maj_default_password);
$maj_default_password = crypt($maj_default_password,$maj_default_password);
- $maj_fp_htaccess_txt = fopen("data/password.txt","w");
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/password.txt","w");
fwrite($maj_fp_htaccess_txt,$maj_default_password);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/profile.php")) {
- $maj_fp_default_profile_txt = fopen("data/profile.php","w");
+if (!file_exists("$maj_data_directory/profile.php")) {
+ $maj_fp_default_profile_txt = fopen("$maj_data_directory/profile.php","w");
fwrite($maj_fp_default_profile_txt,$maj_default_blog_profile);
fclose($maj_fp_default_profile_txt);
}
-if (!file_exists("data/author.txt")) {
- $maj_fp_default_author_txt = fopen("data/author.txt","w");
+if (!file_exists("$maj_data_directory/author.txt")) {
+ $maj_fp_default_author_txt = fopen("$maj_data_directory/author.txt","w");
fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
fclose($maj_fp_default_author_txt);
}
@@ -199,6 +201,20 @@ function return_bytes($val) {
return $val;
}
}
+
+$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+$server_post_max_size = return_bytes(ini_get('post_max_size'));
+$server_memory_limit = return_bytes(ini_get('memory_limit'));
+
+$max_file_size = $server_upload_max_filesize;
+
+if ($server_upload_max_filesize > $server_post_max_size) {
+ $max_file_size = $server_post_max_size;
+}
+
+if ($server_post_max_size > $server_memory_limit) {
+ $max_file_size = $server_memory_limit;
+}
function entry2date($entry) {
@@ -336,109 +352,6 @@ function format_body_put($data) {
return $data;
}
-
-require("fpdf.php");
-
-class PDF extends FPDF {
-
- var $B;
- var $I;
- var $U;
- var $HREF;
-
- function PDF($orientation = 'P', $unit = 'mm', $format = 'letter') {
- $this->FPDF($orientation, $unit, $format);
- $this->B = 0;
- $this->I = 0;
- $this->U = 0;
- $this->HREF = '';
- }
-
- function WriteHTML($html) {
- $html = str_replace("\n", ' ', $html);
- $a = preg_split('/<(.*)>/U', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
-
- foreach ($a as $i => $e) {
-
- if ($i % 2 == 0) {
-
- if ($this->HREF) {
- $this->PutLink($this->HREF, $e);
- }
- else {
- $this->Write(5, $e);
- }
- }
- else {
- if ($e{0} == '/') {
- $this->CloseTag(strtoupper(substr($e, 1)));
- }
- else {
- $a2 = explode(' ', $e);
- $tag = strtoupper(array_shift($a2));
- $attr = array();
-
- foreach ($a2 as $v) {
-
- if (ereg('^([^=]*)=["\']?([^"\']*)["\']?$', $v, $a3)) {
- $attr[strtoupper($a3[1])] = $a3[2];
- }
- $this->OpenTag($tag, $attr);
- }
- }
- }
- }
- }
-
- function OpenTag($tag, $attr) {
-
- if ($tag == 'B' or $tag == 'I' or $tag == 'U') {
- $this->SetStyle($tag, true);
- }
-
- if ($tag == 'A') {
- $this->HREF = $attr['HREF'];
- }
-
- if ($tag == 'BR') {
- $this->Ln(5);
- }
- }
-
- function CloseTag($tag) {
-
- if ($tag == 'B' or $tag == 'I' or $tag == 'U') {
- $this->SetStyle($tag, false);
- }
-
- if ($tag == 'A') {
- $this->HREF = '';
- }
- }
-
- function SetStyle($tag, $enable) {
-
- $this->$tag += ($enable ? 1 : -1);
- $style = '';
-
- foreach (array('B', 'I', 'U') as $s) {
-
- if ($this->$s > 0) {
- $style .= $s;
- }
- }
- $this->SetFont('', $style);
- }
-
- function PutLink($URL, $txt) {
-
- $this->SetTextColor(0, 0, 255);
- $this->SetStyle('U', true);
- $this->Write(5, $txt, $URL);
- $this->SetStyle('U', false);
- $this->SetTextColor(0);
- }
-}
function show_maj_avatar_image($author_username,$max_img_width=80) {
@@ -460,7 +373,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-gif.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-gif.txt")) {
$avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
@@ -504,7 +417,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-jpg.txt")) {
$avatar_jpg_image_resize = imagecreatetruecolor($avatar_jpg_image_width,$avatar_jpg_image_height);
$avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
@@ -534,7 +447,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-png.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-png.txt")) {
$avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
@@ -571,7 +484,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-gif.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-gif.txt")) {
$avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
@@ -615,7 +528,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-jpg.txt")) {
$avatar_jpg_image_resize = imagecreatetruecolor($avatar_jpg_image_width,$avatar_jpg_image_height);
$avatar_jpg_image_original = imagecreatefromjpeg("images/members/$author_username/avatar.jpg");
@@ -644,7 +557,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-png.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-png.txt")) {
$avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
@@ -670,14 +583,14 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
echo "<b>$author_username</b></a><br>";
- if (($maj_admin_username == $author_username) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $author_username) and file_exists("$maj_data_directory/rank.txt")) {
echo "administrator<br>";
}
- elseif (file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/$author_username/rank.txt");
+ elseif (file_exists("$maj_data_directory/members/active/$author_username/rank.txt") and file_exists("$maj_data_directory/rank.txt")) {
+ $rank = file_get_contents("$maj_data_directory/members/active/$author_username/rank.txt");
echo "$rank<br>";
}
- elseif (!file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
+ elseif (!file_exists("$maj_data_directory/members/active/$author_username/rank.txt") and file_exists("$maj_data_directory/rank.txt")) {
echo "member<br>";
}
}
diff --git a/del.php b/del.php
index 7dacf68..3439ff8 100644
--- a/del.php
+++ b/del.php
@@ -49,11 +49,6 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
rmdirr("data/items/{$_REQUEST['entry']}/filedrop");
header("Location: index.php?entry={$_REQUEST['entry']}");
}
-
- if ($_REQUEST['target'] == "pdf") {
- rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
}
if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
diff --git a/edit.php b/edit.php
index a8af112..4d2745f 100644
--- a/edit.php
+++ b/edit.php
@@ -7,39 +7,33 @@
require("core.php");
- if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
- }
-
- $login_username = file_get_contents("data/username.txt");
-
if (isset($_POST['title_input']) and isset($_POST['body_input'])) {
- header("Location: edit.php?entry={$_REQUEST['entry']}");
+ header("Location: edit.php?entry=$maj_req_entry");
}
- if (!isset($_REQUEST['entry'])) {
+ if (!isset($maj_req_entry)) {
exit();
}
- if (!file_exists("data/items/{$_REQUEST['entry']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry")) {
exit();
}
- if (!isset($_SESSION['logged_in'])) {
+ if (!isset($maj_logged_in_username)) {
exit();
}
$do = 0;
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") and file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") and file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_req_entry/author.txt") == $maj_logged_in_username))) {
$do = 1;
}
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
$do = 0;
}
- if ($_SESSION['logged_in'] == $login_username) {
+ if ($maj_logged_in_username == $maj_admin_username) {
$do = 1;
}
@@ -47,209 +41,62 @@
exit();
}
- $title_file = "data/items/{$_REQUEST['entry']}/title.txt";
- $body_file = "data/items/{$_REQUEST['entry']}/body.txt";
- $date_file = "data/items/{$_REQUEST['entry']}/date.txt";
- $img_file = "data/items/{$_REQUEST['entry']}/image.txt";
- $revisions_file = "data/items/{$_REQUEST['entry']}/revisions.txt";
+ $title_file = "$maj_data_directory/items/$maj_req_entry/title.txt";
+ $body_file = "$maj_data_directory/items/$maj_req_entry/body.txt";
+ $date_file = "$maj_data_directory/items/$maj_req_entry/date.txt";
+ $img_file = "$maj_data_directory/items/$maj_req_entry/image.txt";
+ $revisions_file = "$maj_data_directory/items/$maj_req_entry/revisions.txt";
- $server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
- $server_post_max_size = return_bytes(ini_get('post_max_size'));
- $server_memory_limit = return_bytes(ini_get('memory_limit'));
-
- $max_file_size = $server_upload_max_filesize;
-
- if ($server_upload_max_filesize > $server_post_max_size) {
- $max_file_size = $server_post_max_size;
- }
-
- if ($server_post_max_size > $server_memory_limit) {
- $max_file_size = $server_memory_limit;
- }
?>
<title>Edit</title>
-<style>
-
-body {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
-?> arial, helvetica, sans-serif;
- background-color: #ffffff;
-}
-
-p, td {
- font-size: 11px;
-}
-
-a {
- font-weight: bold;
- text-decoration: none;
-}
-
-a:link, a:visited {
- color: #666666;
-}
-
-a:hover {
- color: #336699;
-}
-
-a:active {
- color: #336699;
-}
-
-.input_title {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 520px;
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- font-weight: bold
-}
-
-.input_body {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 520px;
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px
-}
-
-#panel_title {
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
-}
-
-#panel_body {
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 1px 1px 1px 1px;
- border-style: solid solid solid solid;
-}
-
-#panel_footer {
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$font_panel_footer},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 0px 1px 1px 1px;
- border-style: none solid solid solid;
-}
-
-.input_cat {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 40px;
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px
-}
-
<?php
- if (file_exists("data/css.txt")) {
- readfile("data/css.txt");
- }
-?>
-</style>
+ include("css.php");
+
+?>
<?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")) {
- mkdir("data/items/{$_REQUEST['entry']}/members");
+ if (($_POST['auth_toggle'] == "ack") and file_exists("$maj_data_directory/members/active/{$_POST['auth_member']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
- mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/imembers")) {
- mkdir("data/items/{$_REQUEST['entry']}/imembers");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/imembers")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/imembers");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
- mkdir("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/imembers/{$_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 (($_POST['auth_toggle'] == "nak") and file_exists("$maj_data_directory/members/active/{$_POST['auth_member']}")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}");
}
}
}
- if (isset($_POST['category']) and !empty($_POST['category'])) {
- if (file_exists("data/categories/{$_REQUEST['category']}/members")) {
- if ($dh_cat_members = opendir("data/categories/{$_REQUEST['category']}/members")) {
+ if (isset($maj_req_category) and !empty($maj_req_category)) {
+ if (file_exists("$maj_data_directory/categories/$maj_req_category/members")) {
+ if ($dh_cat_members = opendir("$maj_data_directory/categories/$maj_req_category/members")) {
while (($get_cat_member = readdir($dh_cat_members)) !== false) {
if ($get_cat_member != "." && $get_cat_member != "..") {
- if (file_exists("data/members/active/$get_cat_member")) {
+ if (file_exists("$maj_data_directory/members/active/$get_cat_member")) {
$get_cat_members[] = $get_cat_member;
} else {
- rmdirr("data/categories/{$_REQUEST['category']}/members/$get_cat_member");
+ rmdirr("$maj_data_directory/categories/$maj_req_category/members/$get_cat_member");
}
}
}
@@ -257,15 +104,15 @@ a:active {
}
}
- if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ if (($_POST['do'] == "unfile") and file_exists("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category");
- if (count(glob("data/items/{$_REQUEST['entry']}/categories/*")) < 1) {
- rmdirr("data/items/{$_REQUEST['entry']}/categories");
+ if (count(glob("$maj_data_directory/items/$maj_req_entry/categories/*")) < 1) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/categories");
}
- if (file_exists("data/categories")) {
- if ($dh_get_categories = opendir("data/categories")) {
+ if (file_exists("$maj_data_directory/categories")) {
+ if ($dh_get_categories = opendir("$maj_data_directory/categories")) {
while (($get_category = readdir($dh_get_categories)) !== false) {
if ($get_category != "." && $get_category != "..") {
$get_categories[] = $get_category;
@@ -278,28 +125,28 @@ a:active {
$count_mem = 0;
foreach ($get_categories as $get_category) {
- if (file_exists("data/categories/$get_category/members/$get_cat_mem") and ($_REQUEST['category'] != $get_category) and file_exists("data/items/{$_REQUEST['entry']}/categories/$get_category")) {
+ if (file_exists("$maj_data_directory/categories/$get_category/members/$get_cat_mem") and ($maj_req_category != $get_category) and file_exists("$maj_data_directory/items/$maj_req_entry/categories/$get_category")) {
$count_mem = $count_mem + 1;
}
}
- if (($count_mem < 1) and !file_exists("data/items/{$_REQUEST['entry']}/imembers/$get_cat_mem")) {
- rmdirr("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+ if (($count_mem < 1) and !file_exists("$maj_data_directory/items/$maj_req_entry/imembers/$get_cat_mem")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem");
}
}
}
}
- if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
- mkdir("data/items/{$_REQUEST['entry']}/categories");
+ if (($_POST['do'] == "file") and !file_exists("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/categories");
}
- mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ mkdir("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category");
foreach ($get_cat_members as $get_cat_mem) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/$get_cat_mem")) {
- mkdir("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem");
}
}
}
@@ -318,12 +165,12 @@ a:active {
$comment_txt = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $comment_txt);
$comment_txt = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $comment_txt);
$comment_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $comment_txt);
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+ $comment_txt_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
$open_comment_txt_file = fopen($comment_txt_file, "w");
fwrite($open_comment_txt_file, $comment_txt);
fclose($open_comment_txt_file);
- $comment_revisions_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
+ $comment_revisions_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
$fp_comment_revisions_file = fopen($comment_revisions_file, "r");
$comment_revisions_count = fread($fp_comment_revisions_file, filesize($comment_revisions_file));
fclose($fp_comment_revisions_file);
@@ -335,28 +182,28 @@ a:active {
}
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
exit();
}
?>
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="520">
- <div id="panel_title"><?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt");
+ <div class="panel_title"><?php
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt");
?> <?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt");
?> <<?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt");
?>></div>
- <div id="panel_body"><?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt");
+ <div class="panel_body"><?php
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt");
?></div>
- <div id="panel_footer"><font style="font-size: 10px; color: #999999;">
+ <div class="panel_footer"><font style="font-size: 10px; color: #999999;">
<?php
entry2date($_REQUEST['comment']);
- if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
echo " (Revision ";
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
echo ")";
}
?>
@@ -365,8 +212,8 @@ a:active {
<table border="0" cellspacing="2" cellpadding="0">
<form enctype="multipart/form-data" action="edit.php" method="post">
- <tr><td><textarea class="input_body" name="comment_txt" rows="10"><?php
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+ <tr><td><textarea class="input" name="comment_txt" rows="10"><?php
+ $comment_txt_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
$open_comment_txt_file = fopen($comment_txt_file, "r");
$read_comment_txt_file = fread($open_comment_txt_file, filesize($comment_txt_file));
fclose($open_comment_txt_file);
@@ -386,7 +233,7 @@ a:active {
echo $comment_smiley2emoticon;
?></textarea></td></tr>
<tr><td><input type="hidden" name="entry" value="<?php
- echo $_REQUEST['entry'];
+ echo $maj_req_entry;
?>"></td></tr>
<tr><td><input type="hidden" name="comment" value="<?php
echo $_REQUEST['comment'];
@@ -394,17 +241,17 @@ a:active {
<tr><td><input type="hidden" name="type" value="<?php
echo $_REQUEST['type'];
?>"></td></tr>
- <tr><td><input class="input_body" type="submit" value="click here to update this comment"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to update this comment"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php?entry=<?php
- echo $_REQUEST['entry'];
+ echo $maj_req_entry;
?>&show=comments" method="post">
- <tr><td><input class="input_body" type="submit" value="click here to view posted entry"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to view posted entry"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php" method="post">
- <tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -413,53 +260,60 @@ a:active {
}
?>
-<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
+<table border="0" cellspacing="0" cellpadding="0">
+
+<tr>
+<td rowspan="2" width="<?php echo $maj_wspace; ?>"><div style="width: <?php echo $maj_wspace; ?>px;"></div></td>
+<td colspan="3" height="<?php echo $maj_wspace; ?>"><div style="height: <?php echo $maj_wspace; ?>px;"></div></td>
+<td rowspan="2" width="<?php echo $maj_wspace; ?>"><div style="width: <?php echo $maj_wspace; ?>px;"></div></td>
+</tr>
+
+<tr><td valign="top">
+
+<table border="0" cellspacing="0" cellpadding="0"><tr><td width="520">
-<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="520">
+<div class="panel_wrapper">
-<div id="panel_title"><?php
+<div class="panel_title"><?php
readfile($title_file);
?></div>
-<div id="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php
- readfile($body_file);
-?></td></tr></table></div>
-<div id="panel_footer"><font style="font-size: 10px; color: #999999;"><?php
- if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
- readfile("data/items/{$_REQUEST['entry']}/author.txt");
+<div class="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php
+
+ echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
+
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/author.txt")) {
+ readfile("$maj_data_directory/items/$maj_req_entry/author.txt");
echo " - ";
}
- entry2date($_REQUEST['entry']);
+ entry2date($maj_req_entry);
if (file_exists($revisions_file)) {
echo ' (Revision ';
readfile($revisions_file);
echo " - ";
- echo date("l, M j, Y, g:i A", filemtime("data/items/{$_REQUEST['entry']}/body.txt"));
+ echo date("l, M j, Y, g:i A", filemtime("$maj_data_directory/items/$maj_req_entry/body.txt"));
echo ')';
}
-?>
-</font></div>
+ echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
+
+ readfile($body_file);
+?></td></tr></table></div></div>
</td></tr></table>
<form enctype="multipart/form-data" action="edit.php" method="post">
-<p><table border="0" cellspacing="2" cellpadding="0" bgcolor="#ffffff">
+<table border="0" cellspacing="2" cellpadding="0" bgcolor="#ffffff">
<?php
- if (($_SESSION['logged_in'] == $login_username) or (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-ul.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt"))) {
+ if (($maj_logged_in_username == $maj_admin_username) or (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-ul.txt") and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt"))) {
?>
<input type="hidden" name="max_file_size" value="<?php
echo $max_file_size;
?>">
-<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 GIF, JPG, or PNG entry image.</td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php
echo $max_file_size;
@@ -468,36 +322,42 @@ a:active {
echo($max_file_size / (1024 * 1024));
?>MB.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="album_image_input"> Upload optional album image.</td></tr>
+<tr><td><input autocomplete="off" type="text" name="caption" class="input"> Enter optional album image caption.</td></tr>
+<tr><td><input type="hidden" name="max_file_size" value="<?php
+ echo $max_file_size;
+?>"></td></tr>
+
<?php
}
- if ($_SESSION['logged_in'] == $login_username) {
+ if ($maj_logged_in_username == $maj_admin_username) {
?>
- <tr><td><input autocomplete="off" type="password" name="passwd" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+ <tr><td><input class="input" autocomplete="off" type="password" name="passwd" <?php
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
echo "value=\"password\"";
}
?>
> <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
echo "Enter new password or clear field to disable password protection.";
} else {
- echo "Enter optional password.";
+ echo "Enter optional entry access password.";
}
?></td></tr>
- <tr><td><input autocomplete="off" type="text" name="maxlines" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+ <tr><td><input class="input" autocomplete="off" type="text" name="maxlines" <?php
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
echo "value=\"";
- readfile("data/items/{$_REQUEST['entry']}/maxlines.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/maxlines.txt");
echo "\"";
}
?>
> <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
echo "Enter new maximum lines for initial display or clear field to disable.";
} else {
echo "Enter optional maximum lines for initial display.";
@@ -505,39 +365,34 @@ a:active {
?></td></tr>
<tr><td><input type="checkbox" name="sticky" <?php
- $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+ $sticky_sem = 'data/sticky/' . $maj_req_entry;
if (file_exists($sticky_sem)) {
echo checked;
}
?>>Put entry title in Quick Links box.</td></tr>
- <tr><td><input type="checkbox" name="pdf" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- echo checked;
- }
-?>>Allow PDF generation for this entry.</td></tr>
<tr><td><input type="checkbox" name="display" <?php
- $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+ $display_sem = "$maj_data_directory/items/$maj_req_entry/cat.txt";
if (file_exists($display_sem)) {
echo checked;
}
?>>Always display. If this is not a private entry, it will be displayed even if its category is hidden or isolated.</td></tr>
<tr><td><input type="checkbox" name="private" <?php
- $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
+ $private_sem = "$maj_data_directory/items/$maj_req_entry/private.txt";
if (file_exists($private_sem)) {
echo checked;
}
?>>Private entry. This entry will unconditionally be invisible to visitors<?php
- if (file_exists("data/ml.txt")) {
+ if (file_exists("$maj_data_directory/ml.txt")) {
echo " and to the mailing list";
}
?>, even if always display is set.</td></tr>
<?php
- if (file_exists("data/bb.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt")) {
?>
<tr><td><input type="checkbox" name="member" <?php
- $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+ $member_sem = "$maj_data_directory/items/$maj_req_entry/member.txt";
if (file_exists($member_sem)) {
echo checked;
}
@@ -548,17 +403,17 @@ a:active {
?>
<?php
- if (file_exists("data/bb.txt") and file_exists("data/wiki.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/wiki.txt")) {
?>
<tr><td><input type="checkbox" name="edit" <?php
- $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+ $edit_sem = "$maj_data_directory/items/$maj_req_entry/edit.txt";
if (file_exists($edit_sem)) {
echo checked;
}
?>>Registered members can edit this entry.</td></tr>
<tr><td><input type="checkbox" name="lock" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
echo checked;
}
?>>Only the administrator can edit this entry. </td></tr>
@@ -568,7 +423,7 @@ a:active {
?>
<tr><td><input type="checkbox" name="xtitle" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/xtitle.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/xtitle.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -579,7 +434,7 @@ a:active {
?>
<tr><td><input type="checkbox" name="xdate" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/xdate.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/xdate.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -587,11 +442,11 @@ a:active {
<?php
-if (!file_exists("data/avatar.txt")) {
+if (!file_exists("$maj_data_directory/avatar.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"xauthor\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/xauthor.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/xauthor.txt")) {
echo checked;
}
@@ -600,7 +455,7 @@ if (!file_exists("data/avatar.txt")) {
else {
echo "<tr><td><input type=\"checkbox\" name=\"xavatar\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/xavatar.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/xavatar.txt")) {
echo checked;
}
@@ -611,7 +466,7 @@ else {
<tr><td><input type="checkbox" name="lastmod" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/lastmod.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -619,26 +474,26 @@ else {
<?php
-if (file_exists("data/fb.txt")) {
+if (file_exists("$maj_data_directory/fb.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"fb\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/fb.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/fb.txt")) {
echo checked;
}
echo ">Enable Facebook support.</td></tr>";
}
-if (file_exists("images/{$_REQUEST['entry']}/album")) {
+if (file_exists("images/$maj_req_entry/album")) {
- $count_album_images = count(glob("images/{$_REQUEST['entry']}/album/*"));
+ $count_album_images = count(glob("images/$maj_req_entry/album/*"));
if ($count_album_images < 1) {
- rmdirr("images/{$_REQUEST['entry']}/album");
+ rmdirr("images/$maj_req_entry/album");
}
else {
- if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"auto_album\" checked>";
}
else {
@@ -646,10 +501,10 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if ($count_album_images > 1) {
- echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images images</a>).</td></tr>";
+ echo "Automatically display album (<a href=\"index.php?entry=$maj_req_entry&show=album\">$count_album_images images</a>).</td></tr>";
}
else {
- echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images image</a>).</td></tr>";
+ echo "Automatically display album (<a href=\"index.php?entry=$maj_req_entry&show=album\">$count_album_images image</a>).</td></tr>";
}
}
}
@@ -658,17 +513,13 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
</table></p>
-<input type="hidden" name="entry" value="<?php
- echo $_REQUEST['entry'];
-?>">
+<input type="hidden" name="entry" value="<?php echo $maj_req_entry; ?>">
<table border="0" cellspacing="0" cellpadding="0"><tr><td>
<table border="0" cellspacing="2" cellpadding="0">
-<tr><td><input required autocomplete="off" class="input_title" type="text" name="title_input" value="<?php
- readfile($title_file);
-?>"></td></tr>
-<tr><td><textarea class="input_body" name="body_input" rows="15" required>
+<tr><td><input required autocomplete="off" class="input" style="width: 520px; font-size: <?php echo $maj_font_Lpx; ?>; font-weight: bold;" type="text" name="title_input" value="<?php readfile($title_file); ?>"></td></tr>
+<tr><td><textarea class="input" style="width: 520px; font-size: <?php echo $maj_font_Mpx; ?>;" name="body_input" rows="15" required>
<?php
$open_body_file = fopen($body_file, "r");
$read_body_file = fread($open_body_file, filesize($body_file));
@@ -693,17 +544,15 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
echo $body_read_content;
?>
</textarea></td></tr>
-<tr><td><input class="input_body" type="submit" value="click here to update this entry"></td></tr>
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to update this entry"></td></tr>
</form>
-<form enctype="multipart/form-data" action="index.php?entry=<?php
- echo $_REQUEST['entry'];
-?>" method="post">
-<tr><td><input class=input_body type=submit value="click here to view posted entry"></td></tr>
+<form enctype="multipart/form-data" action="index.php?entry=<?php echo $maj_req_entry; ?>" method="post">
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to view posted entry"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php" method="post">
-<tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -730,21 +579,21 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
<?php
// improve category handling (20100221) - start
- if (file_exists("data/categories")) {
+ if (file_exists("$maj_data_directory/categories")) {
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- if ($dh_cat = opendir("data/categories")) {
+ if ($dh_cat = opendir("$maj_data_directory/categories")) {
while (($entry_cat = readdir($dh_cat)) !== false) {
if ($entry_cat != "." && $entry_cat != "..") {
- if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
+ if (file_exists("$maj_data_directory/categories/$entry_cat/private.txt") and ($maj_admin_username != $maj_logged_in_username)) {
continue;
}
- if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories/$entry_cat")) {
$filed_cat[] = $entry_cat;
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/categories/$entry_cat")) {
$unfiled_cat[] = $entry_cat;
}
}
@@ -768,7 +617,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
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=\"entry\" value=\"$maj_req_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>";
@@ -788,7 +637,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
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=\"entry\" value=\"$maj_req_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>";
@@ -806,16 +655,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
// add member authorization (20100221) - start
- if (file_exists("data/members/active")) {
+ if (file_exists("$maj_data_directory/members/active")) {
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
+ if ($dh_ack_members = opendir("$maj_data_directory/items/$maj_req_entry/members")) {
while (($ack_member = readdir($dh_ack_members)) !== false) {
if ($ack_member != "." && $ack_member != "..") {
- if (file_exists("data/members/active/$ack_member")) {
+ if (file_exists("$maj_data_directory/members/active/$ack_member")) {
$ack_members[] = $ack_member;
} else {
- rmdirr("data/items/{$_REQUEST['entry']}/members/$ack_member");
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/$ack_member");
}
}
}
@@ -825,14 +674,14 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$count_ack_members = count($ack_members);
}
- if ($dh_nak_members = opendir("data/members/active")) {
+ if ($dh_nak_members = opendir("$maj_data_directory/members/active")) {
while (($nak_member = readdir($dh_nak_members)) !== false) {
if ($nak_member != "." && $nak_member != "..") {
- if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/members/$nak_member")) {
continue;
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/$nak_member")) {
$nak_members[] = $nak_member;
}
}
@@ -850,12 +699,12 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
foreach ($ack_members as $ack_member) {
- if ($_SESSION['logged_in'] == $nak_member) {
+ if ($maj_logged_in_username == $nak_member) {
continue;
}
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=\"entry\" value=\"$maj_req_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>";
@@ -874,12 +723,12 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
foreach ($nak_members as $nak_member) {
- if ($_SESSION['logged_in'] == $nak_member) {
+ if ($maj_logged_in_username == $nak_member) {
continue;
}
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=\"entry\" value=\"$maj_req_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>";
@@ -902,16 +751,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
exit();
}
- if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
- unlink("data/items/{$_REQUEST['entry']}/title.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/title.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/title.old");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
- unlink("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/body.old")) {
+ unlink("$maj_data_directory/items/$maj_req_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");
+ copy("$maj_data_directory/items/$maj_req_entry/title.txt", "$maj_data_directory/items/$maj_req_entry/title.old");
+ copy("$maj_data_directory/items/$maj_req_entry/body.txt", "$maj_data_directory/items/$maj_req_entry/body.old");
$title_write_content = format_title_put($_POST['title_input']);
$body_write_content = format_body_put($_POST['body_input']);
@@ -932,33 +781,33 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (($_FILES['album_image_input']['type'] == "image/gif") || ($_FILES['album_image_input']['type'] == "image/pjpeg") || ($_FILES['album_image_input']['type'] == "image/jpeg") || ($_FILES['album_image_input']['type'] == "image/png")) {
$album_image_input_name = str_replace(" ", "_", $_FILES['album_image_input']['name']);
- if (!file_exists("images/{$_REQUEST['entry']}/album/$album_image_input_name")) {
- if (!file_exists("images/{$_REQUEST['entry']}")) {
- mkdir("images/{$_REQUEST['entry']}");
+ if (!file_exists("images/$maj_req_entry/album/$album_image_input_name")) {
+ if (!file_exists("images/$maj_req_entry")) {
+ mkdir("images/$maj_req_entry");
}
- if (!file_exists("images/{$_REQUEST['entry']}/album")) {
- mkdir("images/{$_REQUEST['entry']}/album");
+ if (!file_exists("images/$maj_req_entry/album")) {
+ mkdir("images/$maj_req_entry/album");
}
- if (!file_exists("data/albums")) {
- mkdir("data/albums");
+ if (!file_exists("$maj_data_directory/albums")) {
+ mkdir("$maj_data_directory/albums");
}
- if (!file_exists("data/albums/{$_REQUEST['entry']}")) {
- mkdir("data/albums/{$_REQUEST['entry']}");
+ if (!file_exists("$maj_data_directory/albums/$maj_req_entry")) {
+ mkdir("$maj_data_directory/albums/$maj_req_entry");
}
if (isset($_POST['caption']) and !empty($_POST['caption'])) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/album")) {
- mkdir("data/items/{$_REQUEST['entry']}/album");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/album");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions")) {
- mkdir("data/items/{$_REQUEST['entry']}/album/captions");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album/captions")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/album/captions");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album/captions/{$album_image_input_name}.txt")) {
$caption_txt = ucfirst($_POST['caption']);
$caption_txt = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_txt);
$caption_txt = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_txt);
@@ -990,14 +839,14 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$caption_txt = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $caption_txt);
$caption_txt = str_replace('</highlight>', '</span>', $caption_txt);
- $fp_caption_txt = fopen("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt", "w");
+ $fp_caption_txt = fopen("$maj_data_directory/items/$maj_req_entry/album/captions/{$album_image_input_name}.txt", "w");
fwrite($fp_caption_txt, $caption_txt);
fclose($fp_caption_txt);
}
}
- $res = copy($_FILES['album_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/album/$album_image_input_name");
+ $res = copy($_FILES['album_image_input']['tmp_name'], "images/$maj_req_entry/album/$album_image_input_name");
unlink($_FILES['album_image_input']['tmp_name']);
} else {
unlink($_FILES['album_image_input']['tmp_name']);
@@ -1020,16 +869,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$entry_image_input_name = str_replace(" ", "_", $_FILES['entry_image_input']['name']);
- if (!file_exists("images/{$_REQUEST['entry']}/$entry_image_input_name")) {
- if (!file_exists("images/{$_REQUEST['entry']}")) {
- mkdir("images/{$_REQUEST['entry']}");
+ if (!file_exists("images/$maj_req_entry/$entry_image_input_name")) {
+ if (!file_exists("images/$maj_req_entry")) {
+ mkdir("images/$maj_req_entry");
}
- $res = copy($_FILES['entry_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/$entry_image_input_name");
+ $res = copy($_FILES['entry_image_input']['tmp_name'], "images/$maj_req_entry/$entry_image_input_name");
unlink($_FILES['entry_image_input']['tmp_name']);
- $entry_image_size = getimagesize("images/{$_REQUEST['entry']}/$entry_image_input_name");
+ $entry_image_size = getimagesize("images/$maj_req_entry/$entry_image_input_name");
$entry_image_width = $entry_image_size[0];
$entry_image_height = $entry_image_size[1];
@@ -1041,7 +890,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$entry_image_height = (int)($entry_image_height * $sizefactor);
}
- $body_write_content = "<img src=\"images/{$_REQUEST['entry']}/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$body_write_content";
+ $body_write_content = "<img src=\"images/$maj_req_entry/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$body_write_content";
} else {
unlink($_FILES['entry_image_input']['tmp_name']);
}
@@ -1059,23 +908,23 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
if (is_uploaded_file($_FILES['file_input']['tmp_name'])) {
if ($_FILES['file_input']['size'] <= $max_file_size) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop")) {
- mkdir("data/items/{$_REQUEST['entry']}/filedrop");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/filedrop");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files")) {
- mkdir("data/items/{$_REQUEST['entry']}/filedrop/files");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop/files")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/filedrop/files");
}
$file_input_name = str_replace(" ", "_", $_FILES['file_input']['name']);
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name")) {
- $res = copy($_FILES['file_input']['tmp_name'], "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name")) {
+ $res = copy($_FILES['file_input']['tmp_name'], "$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name");
unlink($_FILES['file_input']['tmp_name']);
- $fp_file_txt = fopen("data/items/{$_REQUEST['entry']}/filedrop/{$file_input_name}.txt", "w");
- fwrite($fp_file_txt, "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+ $fp_file_txt = fopen("$maj_data_directory/items/$maj_req_entry/filedrop/{$file_input_name}.txt", "w");
+ fwrite($fp_file_txt, "$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name");
fclose($fp_file_txt);
} else {
unlink($_FILES['file_input']['tmp_name']);
@@ -1088,49 +937,49 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- if (file_exists("data/wiki.txt")) {
- $old_title = file_get_contents("data/items/{$_REQUEST['entry']}/title.old");
- $old_body = file_get_contents("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/wiki.txt")) {
+ $old_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.old");
+ $old_body = file_get_contents("$maj_data_directory/items/$maj_req_entry/body.old");
if (($old_title != $title_write_content) or ($old_body != $body_write_content)) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki/delta");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki/delta")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki/delta");
}
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
+ if (file_exists("$maj_data_directory/offset.txt")) {
+ $offset = file_get_contents("$maj_data_directory/offset.txt");
} else {
$offset = 0;
}
$ddate = date("YmdHis", time() + $offset);
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate");
}
- $new_body = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/body.txt", "w");
+ $new_body = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/body.txt", "w");
fwrite($new_body, $body_write_content);
fclose($new_body);
- $new_title = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/title.txt", "w");
+ $new_title = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/title.txt", "w");
fwrite($new_title, $title_write_content);
fclose($new_title);
- copy("data/items/{$_REQUEST['entry']}/title.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/ptitle.txt");
- copy("data/items/{$_REQUEST['entry']}/body.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/prev.txt");
- copy("data/items/{$_REQUEST['entry']}/date.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/date.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/title.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/ptitle.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/body.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/prev.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/date.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/date.txt");
- if (file_exists("data/items/{$_REQUEST['entry']}/contrib.txt")) {
- copy("data/items/{$_REQUEST['entry']}/contrib.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/contrib.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/contrib.txt")) {
+ copy("$maj_data_directory/items/$maj_req_entry/contrib.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/contrib.txt");
}
- $open_editor_file = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/editor.txt", "w");
- fwrite($open_editor_file, $_SESSION['logged_in']);
+ $open_editor_file = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/editor.txt", "w");
+ fwrite($open_editor_file, $maj_logged_in_username);
fclose($open_editor_file);
}
}
@@ -1143,18 +992,18 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
fwrite($open_body_file, $body_write_content);
fclose($open_body_file);
- if (file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
- $open_contrib_file = fopen("data/items/{$_REQUEST['entry']}/contrib.txt", "w");
- fwrite($open_contrib_file, $_SESSION['logged_in']);
+ if (file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_req_entry/author.txt") == $maj_logged_in_username))) {
+ $open_contrib_file = fopen("$maj_data_directory/items/$maj_req_entry/contrib.txt", "w");
+ fwrite($open_contrib_file, $maj_logged_in_username);
fclose($open_contrib_file);
}
- if ($_SESSION['logged_in'] == $login_username) {
- $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+ if ($maj_logged_in_username == $maj_admin_username) {
+ $sticky_sem = 'data/sticky/' . $maj_req_entry;
if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
- if (!file_exists("data/sticky")) {
- mkdir("data/sticky");
+ if (!file_exists("$maj_data_directory/sticky")) {
+ mkdir("$maj_data_directory/sticky");
}
if (!file_exists($sticky_sem)) {
touch($sticky_sem);
@@ -1166,7 +1015,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+ $display_sem = "$maj_data_directory/items/$maj_req_entry/cat.txt";
if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
if (!file_exists($display_sem)) {
@@ -1179,7 +1028,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
+ $private_sem = "$maj_data_directory/items/$maj_req_entry/private.txt";
if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
if (!file_exists($private_sem)) {
@@ -1192,7 +1041,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+ $member_sem = "$maj_data_directory/items/$maj_req_entry/member.txt";
if (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")) {
if (!file_exists($member_sem)) {
@@ -1205,7 +1054,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+ $edit_sem = "$maj_data_directory/items/$maj_req_entry/edit.txt";
if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on")) {
if (!file_exists($edit_sem)) {
@@ -1220,21 +1069,21 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if (isset($_POST['lock']) and !empty($_POST['lock']) and ($_POST['lock'] == "on")) {
- if (file_exists("data/items/{$_REQUEST['entry']}/edit.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/edit.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/edit.txt");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
- touch("data/items/{$_REQUEST['entry']}/lock.txt");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
+ touch("$maj_data_directory/items/$maj_req_entry/lock.txt");
}
}
if (!isset($_POST['lock']) or empty($_POST['lock'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/lock.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/lock.txt");
}
}
- $xtitle_sem = "data/items/{$_REQUEST['entry']}/xtitle.txt";
+ $xtitle_sem = "$maj_data_directory/items/$maj_req_entry/xtitle.txt";
if (isset($_POST['xtitle']) and !empty($_POST['xtitle']) and ($_POST['xtitle'] == "on")) {
if (!file_exists($xtitle_sem)) {
@@ -1248,7 +1097,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xdate_sem = "data/items/{$_REQUEST['entry']}/xdate.txt";
+ $xdate_sem = "$maj_data_directory/items/$maj_req_entry/xdate.txt";
if (isset($_POST['xdate']) and !empty($_POST['xdate']) and ($_POST['xdate'] == "on")) {
if (!file_exists($xdate_sem)) {
@@ -1262,7 +1111,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xauthor_sem = "data/items/{$_REQUEST['entry']}/xauthor.txt";
+ $xauthor_sem = "$maj_data_directory/items/$maj_req_entry/xauthor.txt";
if (isset($_POST['xauthor']) and !empty($_POST['xauthor']) and ($_POST['xauthor'] == "on")) {
if (!file_exists($xauthor_sem)) {
@@ -1276,7 +1125,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xavatar_sem = "data/items/{$_REQUEST['entry']}/xavatar.txt";
+ $xavatar_sem = "$maj_data_directory/items/$maj_req_entry/xavatar.txt";
if (isset($_POST['xavatar']) and !empty($_POST['xavatar']) and ($_POST['xavatar'] == "on")) {
if (!file_exists($xavatar_sem)) {
@@ -1290,7 +1139,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $fb_sem = "data/items/{$_REQUEST['entry']}/fb.txt";
+ $fb_sem = "$maj_data_directory/items/$maj_req_entry/fb.txt";
if (isset($_POST['fb']) and !empty($_POST['fb']) and ($_POST['fb'] == "on")) {
if (!file_exists($fb_sem)) {
@@ -1305,7 +1154,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/lastmod.txt";
if (isset($_POST['lastmod']) and !empty($_POST['lastmod']) and ($_POST['lastmod'] == "on")) {
if (!file_exists($lastmod_sem)) {
@@ -1321,73 +1170,19 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (isset($_POST['auto_album']) and !empty($_POST['auto_album']) and ($_POST['auto_album'] == "on")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
- touch("data/items/{$_REQUEST['entry']}/auto-album.txt");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
+ touch("$maj_data_directory/items/$maj_req_entry/auto-album.txt");
}
}
if (!isset($_POST['auto_album']) or empty($_POST['auto_album'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/auto-album.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/auto-album.txt");
}
}
- if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf");
- }
-
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf/file");
- }
-
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/count")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf/count");
- }
-
- $entry = $_REQUEST['entry'];
- $author_file = "data/author.txt";
- $title_file = "data/items/$entry/title.txt";
- $date_file = "data/items/$entry/date.txt";
- $body_file = "data/items/$entry/body.txt";
-
- $author = file_get_contents($author_file);
- $title = file_get_contents($title_file);
- $date = file_get_contents($date_file);
-
- $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
- $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
- $link = str_replace("edit.php?entry=", "index.php?entry=", $link);
-
- $body = file_get_contents($body_file);
- $body = str_replace("\n", "<br />", $body);
-
- $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-
- $filename = strtolower($title);
- $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
- $filename = str_replace(" ", "-", $filename);
- $filename = "data/items/$entry/pdf/file/$filename";
-
- $pdf = new PDF();
- $pdf->AddPage();
- $pdf->SetTitle($title);
- $pdf->SetAuthor($author);
- $pdf->SetFont('Helvetica', 'B', 14);
- $pdf->WriteHTML($title);
- $pdf->SetFont('Helvetica', '', 10);
- $pdf->WriteHTML($html);
- $pdf->Output($filename);
- }
-
- if (!isset($_POST['pdf']) or empty($_POST['pdf'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
- }
- }
-
- $passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
+ $passwd_file = "$maj_data_directory/items/$maj_req_entry/passwd.txt";
if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
$fp_passwd_txt = fopen("$passwd_file", "w");
@@ -1405,28 +1200,28 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if (isset($_POST['maxlines']) and !empty($_POST['maxlines']) and is_numeric($_POST['maxlines'])) {
- $fp_maxlines_txt = fopen("data/items/{$_REQUEST['entry']}/maxlines.txt", "w");
+ $fp_maxlines_txt = fopen("$maj_data_directory/items/$maj_req_entry/maxlines.txt", "w");
fwrite($fp_maxlines_txt, $_POST['maxlines']);
fclose($fp_maxlines_txt);
}
if (!isset($_POST['maxlines']) or empty($_POST['maxlines'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/maxlines.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/maxlines.txt");
}
}
}
- if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
- unlink("data/items/{$_REQUEST['entry']}/title.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/title.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/title.old");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
- unlink("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/body.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/body.old");
}
- if (file_exists("data/ping.txt")) {
- $ping_urls = explode("|", file_get_contents("data/ping.txt"));
+ if (file_exists("$maj_data_directory/ping.txt")) {
+ $ping_urls = explode("|", file_get_contents("$maj_data_directory/ping.txt"));
foreach ($ping_urls as $ping_url) {
$ping = file_get_contents($ping_url);
diff --git a/font/helvetica.php b/font/helvetica.php
deleted file mode 100755
index ca94cdf..0000000
--- a/font/helvetica.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helvetica']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
diff --git a/font/helveticab.php b/font/helveticab.php
deleted file mode 100755
index 276cfa8..0000000
--- a/font/helveticab.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaB']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
diff --git a/font/helveticabi.php b/font/helveticabi.php
deleted file mode 100755
index 8d21774..0000000
--- a/font/helveticabi.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaBI']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
diff --git a/font/helveticai.php b/font/helveticai.php
deleted file mode 100755
index 88bf437..0000000
--- a/font/helveticai.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaI']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
diff --git a/fpdf.php b/fpdf.php
deleted file mode 100644
index f0a3e45..0000000
--- a/fpdf.php
+++ /dev/null
@@ -1,1647 +0,0 @@
-<?php
-/*******************************************************************************
-* Software: FPDF *
-* Version: 1.53 *
-* Date: 2004-12-31 *
-* Author: Olivier PLATHEY *
-* License: Freeware *
-* *
-* You may use, modify and redistribute this software as you wish. *
-*******************************************************************************/
-
-if(!class_exists('FPDF'))
-{
-define('FPDF_VERSION','1.53');
-
-class FPDF
-{
-//Private properties
-var $page; //current page number
-var $n; //current object number
-var $offsets; //array of object offsets
-var $buffer; //buffer holding in-memory PDF
-var $pages; //array containing pages
-var $state; //current document state
-var $compress; //compression flag
-var $DefOrientation; //default orientation
-var $CurOrientation; //current orientation
-var $OrientationChanges; //array indicating orientation changes
-var $k; //scale factor (number of points in user unit)
-var $fwPt,$fhPt; //dimensions of page format in points
-var $fw,$fh; //dimensions of page format in user unit
-var $wPt,$hPt; //current dimensions of page in points
-var $w,$h; //current dimensions of page in user unit
-var $lMargin; //left margin
-var $tMargin; //top margin
-var $rMargin; //right margin
-var $bMargin; //page break margin
-var $cMargin; //cell margin
-var $x,$y; //current position in user unit for cell positioning
-var $lasth; //height of last cell printed
-var $LineWidth; //line width in user unit
-var $CoreFonts; //array of standard font names
-var $fonts; //array of used fonts
-var $FontFiles; //array of font files
-var $diffs; //array of encoding differences
-var $images; //array of used images
-var $PageLinks; //array of links in pages
-var $links; //array of internal links
-var $FontFamily; //current font family
-var $FontStyle; //current font style
-var $underline; //underlining flag
-var $CurrentFont; //current font info
-var $FontSizePt; //current font size in points
-var $FontSize; //current font size in user unit
-var $DrawColor; //commands for drawing color
-var $FillColor; //commands for filling color
-var $TextColor; //commands for text color
-var $ColorFlag; //indicates whether fill and text colors are different
-var $ws; //word spacing
-var $AutoPageBreak; //automatic page breaking
-var $PageBreakTrigger; //threshold used to trigger page breaks
-var $InFooter; //flag set when processing footer
-var $ZoomMode; //zoom display mode
-var $LayoutMode; //layout display mode
-var $title; //title
-var $subject; //subject
-var $author; //author
-var $keywords; //keywords
-var $creator; //creator
-var $AliasNbPages; //alias for total number of pages
-var $PDFVersion; //PDF version number
-
-/*******************************************************************************
-* *
-* Public methods *
-* *
-*******************************************************************************/
-function FPDF($orientation='P',$unit='mm',$format='A4')
-{
- //Some checks
- $this->_dochecks();
- //Initialization of properties
- $this->page=0;
- $this->n=2;
- $this->buffer='';
- $this->pages=array();
- $this->OrientationChanges=array();
- $this->state=0;
- $this->fonts=array();
- $this->FontFiles=array();
- $this->diffs=array();
- $this->images=array();
- $this->links=array();
- $this->InFooter=false;
- $this->lasth=0;
- $this->FontFamily='';
- $this->FontStyle='';
- $this->FontSizePt=12;
- $this->underline=false;
- $this->DrawColor='0 G';
- $this->FillColor='0 g';
- $this->TextColor='0 g';
- $this->ColorFlag=false;
- $this->ws=0;
- //Standard fonts
- $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
- 'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
- 'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
- 'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
- //Scale factor
- if($unit=='pt')
- $this->k=1;
- elseif($unit=='mm')
- $this->k=72/25.4;
- elseif($unit=='cm')
- $this->k=72/2.54;
- elseif($unit=='in')
- $this->k=72;
- else
- $this->Error('Incorrect unit: '.$unit);
- //Page format
- if(is_string($format))
- {
- $format=strtolower($format);
- if($format=='a3')
- $format=array(841.89,1190.55);
- elseif($format=='a4')
- $format=array(595.28,841.89);
- elseif($format=='a5')
- $format=array(420.94,595.28);
- elseif($format=='letter')
- $format=array(612,792);
- elseif($format=='legal')
- $format=array(612,1008);
- else
- $this->Error('Unknown page format: '.$format);
- $this->fwPt=$format[0];
- $this->fhPt=$format[1];
- }
- else
- {
- $this->fwPt=$format[0]*$this->k;
- $this->fhPt=$format[1]*$this->k;
- }
- $this->fw=$this->fwPt/$this->k;
- $this->fh=$this->fhPt/$this->k;
- //Page orientation
- $orientation=strtolower($orientation);
- if($orientation=='p' || $orientation=='portrait')
- {
- $this->DefOrientation='P';
- $this->wPt=$this->fwPt;
- $this->hPt=$this->fhPt;
- }
- elseif($orientation=='l' || $orientation=='landscape')
- {
- $this->DefOrientation='L';
- $this->wPt=$this->fhPt;
- $this->hPt=$this->fwPt;
- }
- else
- $this->Error('Incorrect orientation: '.$orientation);
- $this->CurOrientation=$this->DefOrientation;
- $this->w=$this->wPt/$this->k;
- $this->h=$this->hPt/$this->k;
- //Page margins (1 cm)
- $margin=28.35/$this->k;
- $this->SetMargins($margin,$margin);
- //Interior cell margin (1 mm)
- $this->cMargin=$margin/10;
- //Line width (0.2 mm)
- $this->LineWidth=.567/$this->k;
- //Automatic page break
- $this->SetAutoPageBreak(true,2*$margin);
- //Full width display mode
- $this->SetDisplayMode('fullwidth');
- //Enable compression
- $this->SetCompression(true);
- //Set default PDF version number
- $this->PDFVersion='1.3';
-}
-
-function SetMargins($left,$top,$right=-1)
-{
- //Set left, top and right margins
- $this->lMargin=$left;
- $this->tMargin=$top;
- if($right==-1)
- $right=$left;
- $this->rMargin=$right;
-}
-
-function SetLeftMargin($margin)
-{
- //Set left margin
- $this->lMargin=$margin;
- if($this->page>0 && $this->x<$margin)
- $this->x=$margin;
-}
-
-function SetTopMargin($margin)
-{
- //Set top margin
- $this->tMargin=$margin;
-}
-
-function SetRightMargin($margin)
-{
- //Set right margin
- $this->rMargin=$margin;
-}
-
-function SetAutoPageBreak($auto,$margin=0)
-{
- //Set auto page break mode and triggering margin
- $this->AutoPageBreak=$auto;
- $this->bMargin=$margin;
- $this->PageBreakTrigger=$this->h-$margin;
-}
-
-function SetDisplayMode($zoom,$layout='continuous')
-{
- //Set display mode in viewer
- if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
- $this->ZoomMode=$zoom;
- else
- $this->Error('Incorrect zoom display mode: '.$zoom);
- if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
- $this->LayoutMode=$layout;
- else
- $this->Error('Incorrect layout display mode: '.$layout);
-}
-
-function SetCompression($compress)
-{
- //Set page compression
- if(function_exists('gzcompress'))
- $this->compress=$compress;
- else
- $this->compress=false;
-}
-
-function SetTitle($title)
-{
- //Title of document
- $this->title=$title;
-}
-
-function SetSubject($subject)
-{
- //Subject of document
- $this->subject=$subject;
-}
-
-function SetAuthor($author)
-{
- //Author of document
- $this->author=$author;
-}
-
-function SetKeywords($keywords)
-{
- //Keywords of document
- $this->keywords=$keywords;
-}
-
-function SetCreator($creator)
-{
- //Creator of document
- $this->creator=$creator;
-}
-
-function AliasNbPages($alias='{nb}')
-{
- //Define an alias for total number of pages
- $this->AliasNbPages=$alias;
-}
-
-function Error($msg)
-{
- //Fatal error
- die('<B>FPDF error: </B>'.$msg);
-}
-
-function Open()
-{
- //Begin document
- $this->state=1;
-}
-
-function Close()
-{
- //Terminate document
- if($this->state==3)
- return;
- if($this->page==0)
- $this->AddPage();
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- //Close document
- $this->_enddoc();
-}
-
-function AddPage($orientation='')
-{
- //Start a new page
- if($this->state==0)
- $this->Open();
- $family=$this->FontFamily;
- $style=$this->FontStyle.($this->underline ? 'U' : '');
- $size=$this->FontSizePt;
- $lw=$this->LineWidth;
- $dc=$this->DrawColor;
- $fc=$this->FillColor;
- $tc=$this->TextColor;
- $cf=$this->ColorFlag;
- if($this->page>0)
- {
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- }
- //Start new page
- $this->_beginpage($orientation);
- //Set line cap style to square
- $this->_out('2 J');
- //Set line width
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2f w',$lw*$this->k));
- //Set font
- if($family)
- $this->SetFont($family,$style,$size);
- //Set colors
- $this->DrawColor=$dc;
- if($dc!='0 G')
- $this->_out($dc);
- $this->FillColor=$fc;
- if($fc!='0 g')
- $this->_out($fc);
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
- //Page header
- $this->Header();
- //Restore line width
- if($this->LineWidth!=$lw)
- {
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2f w',$lw*$this->k));
- }
- //Restore font
- if($family)
- $this->SetFont($family,$style,$size);
- //Restore colors
- if($this->DrawColor!=$dc)
- {
- $this->DrawColor=$dc;
- $this->_out($dc);
- }
- if($this->FillColor!=$fc)
- {
- $this->FillColor=$fc;
- $this->_out($fc);
- }
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
-}
-
-function Header()
-{
- //To be implemented in your own inherited class
-}
-
-function Footer()
-{
- //To be implemented in your own inherited class
-}
-
-function PageNo()
-{
- //Get current page number
- return $this->page;
-}
-
-function SetDrawColor($r,$g=-1,$b=-1)
-{
- //Set color for all stroking operations
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->DrawColor=sprintf('%.3f G',$r/255);
- else
- $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
- if($this->page>0)
- $this->_out($this->DrawColor);
-}
-
-function SetFillColor($r,$g=-1,$b=-1)
-{
- //Set color for all filling operations
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->FillColor=sprintf('%.3f g',$r/255);
- else
- $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
- if($this->page>0)
- $this->_out($this->FillColor);
-}
-
-function SetTextColor($r,$g=-1,$b=-1)
-{
- //Set color for text
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->TextColor=sprintf('%.3f g',$r/255);
- else
- $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
-}
-
-function GetStringWidth($s)
-{
- //Get width of a string in the current font
- $s=(string)$s;
- $cw=&$this->CurrentFont['cw'];
- $w=0;
- $l=strlen($s);
- for($i=0;$i<$l;$i++)
- $w+=$cw[$s{$i}];
- return $w*$this->FontSize/1000;
-}
-
-function SetLineWidth($width)
-{
- //Set line width
- $this->LineWidth=$width;
- if($this->page>0)
- $this->_out(sprintf('%.2f w',$width*$this->k));
-}
-
-function Line($x1,$y1,$x2,$y2)
-{
- //Draw a line
- $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
-}
-
-function Rect($x,$y,$w,$h,$style='')
-{
- //Draw a rectangle
- if($style=='F')
- $op='f';
- elseif($style=='FD' || $style=='DF')
- $op='B';
- else
- $op='S';
- $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
-}
-
-function AddFont($family,$style='',$file='')
-{
- //Add a TrueType or Type1 font
- $family=strtolower($family);
- if($file=='')
- $file=str_replace(' ','',$family).strtolower($style).'.php';
- if($family=='arial')
- $family='helvetica';
- $style=strtoupper($style);
- if($style=='IB')
- $style='BI';
- $fontkey=$family.$style;
- if(isset($this->fonts[$fontkey]))
- $this->Error('Font already added: '.$family.' '.$style);
- include($this->_getfontpath().$file);
- if(!isset($name))
- $this->Error('Could not include font definition file');
- $i=count($this->fonts)+1;
- $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file);
- if($diff)
- {
- //Search existing encodings
- $d=0;
- $nb=count($this->diffs);
- for($i=1;$i<=$nb;$i++)
- {
- if($this->diffs[$i]==$diff)
- {
- $d=$i;
- break;
- }
- }
- if($d==0)
- {
- $d=$nb+1;
- $this->diffs[$d]=$diff;
- }
- $this->fonts[$fontkey]['diff']=$d;
- }
- if($file)
- {
- if($type=='TrueType')
- $this->FontFiles[$file]=array('length1'=>$originalsize);
- else
- $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
- }
-}
-
-function SetFont($family,$style='',$size=0)
-{
- //Select a font; size given in points
- global $fpdf_charwidths;
-
- $family=strtolower($family);
- if($family=='')
- $family=$this->FontFamily;
- if($family=='arial')
- $family='helvetica';
- elseif($family=='symbol' || $family=='zapfdingbats')
- $style='';
- $style=strtoupper($style);
- if(strpos($style,'U')!==false)
- {
- $this->underline=true;
- $style=str_replace('U','',$style);
- }
- else
- $this->underline=false;
- if($style=='IB')
- $style='BI';
- if($size==0)
- $size=$this->FontSizePt;
- //Test if font is already selected
- if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
- return;
- //Test if used for the first time
- $fontkey=$family.$style;
- if(!isset($this->fonts[$fontkey]))
- {
- //Check if one of the standard fonts
- if(isset($this->CoreFonts[$fontkey]))
- {
- if(!isset($fpdf_charwidths[$fontkey]))
- {
- //Load metric file
- $file=$family;
- if($family=='times' || $family=='helvetica')
- $file.=strtolower($style);
- include($this->_getfontpath().$file.'.php');
- if(!isset($fpdf_charwidths[$fontkey]))
- $this->Error('Could not include font metric file');
- }
- $i=count($this->fonts)+1;
- $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]);
- }
- else
- $this->Error('Undefined font: '.$family.' '.$style);
- }
- //Select it
- $this->FontFamily=$family;
- $this->FontStyle=$style;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- $this->CurrentFont=&$this->fonts[$fontkey];
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function SetFontSize($size)
-{
- //Set font size in points
- if($this->FontSizePt==$size)
- return;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function AddLink()
-{
- //Create a new internal link
- $n=count($this->links)+1;
- $this->links[$n]=array(0,0);
- return $n;
-}
-
-function SetLink($link,$y=0,$page=-1)
-{
- //Set destination of internal link
- if($y==-1)
- $y=$this->y;
- if($page==-1)
- $page=$this->page;
- $this->links[$link]=array($page,$y);
-}
-
-function Link($x,$y,$w,$h,$link)
-{
- //Put a link on the page
- $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link);
-}
-
-function Text($x,$y,$txt)
-{
- //Output a string
- $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
- if($this->underline && $txt!='')
- $s.=' '.$this->_dounderline($x,$y,$txt);
- if($this->ColorFlag)
- $s='q '.$this->TextColor.' '.$s.' Q';
- $this->_out($s);
-}
-
-function AcceptPageBreak()
-{
- //Accept automatic page break or not
- return $this->AutoPageBreak;
-}
-
-function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
-{
- //Output a cell
- $k=$this->k;
- if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x=$this->x;
- $ws=$this->ws;
- if($ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->AddPage($this->CurOrientation);
- $this->x=$x;
- if($ws>0)
- {
- $this->ws=$ws;
- $this->_out(sprintf('%.3f Tw',$ws*$k));
- }
- }
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $s='';
- if($fill==1 || $border==1)
- {
- if($fill==1)
- $op=($border==1) ? 'B' : 'f';
- else
- $op='S';
- $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
- }
- if(is_string($border))
- {
- $x=$this->x;
- $y=$this->y;
- if(strpos($border,'L')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'T')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
- if(strpos($border,'R')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'B')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- }
- if($txt!=='')
- {
- if($align=='R')
- $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
- elseif($align=='C')
- $dx=($w-$this->GetStringWidth($txt))/2;
- else
- $dx=$this->cMargin;
- if($this->ColorFlag)
- $s.='q '.$this->TextColor.' ';
- $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
- $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
- if($this->underline)
- $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- if($this->ColorFlag)
- $s.=' Q';
- if($link)
- $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
- }
- if($s)
- $this->_out($s);
- $this->lasth=$h;
- if($ln>0)
- {
- //Go to next line
- $this->y+=$h;
- if($ln==1)
- $this->x=$this->lMargin;
- }
- else
- $this->x+=$w;
-}
-
-function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
-{
- //Output text with automatic or explicit line breaks
- $cw=&$this->CurrentFont['cw'];
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- if($nb>0 && $s[$nb-1]=="\n")
- $nb--;
- $b=0;
- if($border)
- {
- if($border==1)
- {
- $border='LTRB';
- $b='LRT';
- $b2='LR';
- }
- else
- {
- $b2='';
- if(strpos($border,'L')!==false)
- $b2.='L';
- if(strpos($border,'R')!==false)
- $b2.='R';
- $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
- }
- }
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $ns=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s{$i};
- if($c=="\n")
- {
- //Explicit line break
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- continue;
- }
- if($c==' ')
- {
- $sep=$i;
- $ls=$l;
- $ns++;
- }
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($i==$j)
- $i++;
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- }
- else
- {
- if($align=='J')
- {
- $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
- $this->_out(sprintf('%.3f Tw',$this->ws*$this->k));
- }
- $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- }
- else
- $i++;
- }
- //Last chunk
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- if($border && strpos($border,'B')!==false)
- $b.='B';
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $this->x=$this->lMargin;
-}
-
-function Write($h,$txt,$link='')
-{
- //Output text in flowing mode
- $cw=&$this->CurrentFont['cw'];
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s{$i};
- if($c=="\n")
- {
- //Explicit line break
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- continue;
- }
- if($c==' ')
- $sep=$i;
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($this->x>$this->lMargin)
- {
- //Move to next line
- $this->x=$this->lMargin;
- $this->y+=$h;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $i++;
- $nl++;
- continue;
- }
- if($i==$j)
- $i++;
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- }
- else
- {
- $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- }
- else
- $i++;
- }
- //Last chunk
- if($i!=$j)
- $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
-}
-
-function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
-{
- //Put an image on the page
- if(!isset($this->images[$file]))
- {
- //First use of image, get info
- if($type=='')
- {
- $pos=strrpos($file,'.');
- if(!$pos)
- $this->Error('Image file has no extension and no type was specified: '.$file);
- $type=substr($file,$pos+1);
- }
- $type=strtolower($type);
- $mqr=get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- if($type=='jpg' || $type=='jpeg')
- $info=$this->_parsejpg($file);
- elseif($type=='png')
- $info=$this->_parsepng($file);
- else
- {
- //Allow for additional formats
- $mtd='_parse'.$type;
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported image type: '.$type);
- $info=$this->$mtd($file);
- }
- set_magic_quotes_runtime($mqr);
- $info['i']=count($this->images)+1;
- $this->images[$file]=$info;
- }
- else
- $info=$this->images[$file];
- //Automatic width and height calculation if needed
- if($w==0 && $h==0)
- {
- //Put image at 72 dpi
- $w=$info['w']/$this->k;
- $h=$info['h']/$this->k;
- }
- if($w==0)
- $w=$h*$info['w']/$info['h'];
- if($h==0)
- $h=$w*$info['h']/$info['w'];
- $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
- if($link)
- $this->Link($x,$y,$w,$h,$link);
-}
-
-function Ln($h='')
-{
- //Line feed; default value is last cell height
- $this->x=$this->lMargin;
- if(is_string($h))
- $this->y+=$this->lasth;
- else
- $this->y+=$h;
-}
-
-function GetX()
-{
- //Get x position
- return $this->x;
-}
-
-function SetX($x)
-{
- //Set x position
- if($x>=0)
- $this->x=$x;
- else
- $this->x=$this->w+$x;
-}
-
-function GetY()
-{
- //Get y position
- return $this->y;
-}
-
-function SetY($y)
-{
- //Set y position and reset x
- $this->x=$this->lMargin;
- if($y>=0)
- $this->y=$y;
- else
- $this->y=$this->h+$y;
-}
-
-function SetXY($x,$y)
-{
- //Set x and y positions
- $this->SetY($y);
- $this->SetX($x);
-}
-
-function Output($name='',$dest='')
-{
- //Output PDF to some destination
- //Finish document if necessary
- if($this->state<3)
- $this->Close();
- //Normalize parameters
- if(is_bool($dest))
- $dest=$dest ? 'D' : 'F';
- $dest=strtoupper($dest);
- if($dest=='')
- {
- if($name=='')
- {
- $name='doc.pdf';
- $dest='I';
- }
- else
- $dest='F';
- }
- switch($dest)
- {
- case 'I':
- //Send to standard output
- if(ob_get_contents())
- $this->Error('Some data has already been output, can\'t send PDF file');
- if(php_sapi_name()!='cli')
- {
- //We send to a browser
- header('Content-Type: application/pdf');
- if(headers_sent())
- $this->Error('Some data has already been output to browser, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-disposition: inline; filename="'.$name.'"');
- }
- echo $this->buffer;
- break;
- case 'D':
- //Download file
- if(ob_get_contents())
- $this->Error('Some data has already been output, can\'t send PDF file');
- if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
- header('Content-Type: application/force-download');
- else
- header('Content-Type: application/octet-stream');
- if(headers_sent())
- $this->Error('Some data has already been output to browser, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-disposition: attachment; filename="'.$name.'"');
- echo $this->buffer;
- break;
- case 'F':
- //Save to local file
- $f=fopen($name,'wb');
- if(!$f)
- $this->Error('Unable to create output file: '.$name);
- fwrite($f,$this->buffer,strlen($this->buffer));
- fclose($f);
- break;
- case 'S':
- //Return as a string
- return $this->buffer;
- default:
- $this->Error('Incorrect output destination: '.$dest);
- }
- return '';
-}
-
-/*******************************************************************************
-* *
-* Protected methods *
-* *
-*******************************************************************************/
-function _dochecks()
-{
- //Check for locale-related bug
- if(1.1==1)
- $this->Error('Don\'t alter the locale before including class file');
- //Check for decimal separator
- if(sprintf('%.1f',1.0)!='1.0')
- setlocale(LC_NUMERIC,'C');
-}
-
-function _getfontpath()
-{
- if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
- define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
- return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
-}
-
-function _putpages()
-{
- $nb=$this->page;
- if(!empty($this->AliasNbPages))
- {
- //Replace number of pages
- for($n=1;$n<=$nb;$n++)
- $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
- }
- if($this->DefOrientation=='P')
- {
- $wPt=$this->fwPt;
- $hPt=$this->fhPt;
- }
- else
- {
- $wPt=$this->fhPt;
- $hPt=$this->fwPt;
- }
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- for($n=1;$n<=$nb;$n++)
- {
- //Page
- $this->_newobj();
- $this->_out('<</Type /Page');
- $this->_out('/Parent 1 0 R');
- if(isset($this->OrientationChanges[$n]))
- $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));
- $this->_out('/Resources 2 0 R');
- if(isset($this->PageLinks[$n]))
- {
- //Links
- $annots='/Annots [';
- foreach($this->PageLinks[$n] as $pl)
- {
- $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
- $annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
- if(is_string($pl[4]))
- $annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
- else
- {
- $l=$this->links[$pl[4]];
- $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;
- $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);
- }
- }
- $this->_out($annots.']');
- }
- $this->_out('/Contents '.($this->n+1).' 0 R>>');
- $this->_out('endobj');
- //Page content
- $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
- $this->_newobj();
- $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
- $this->_putstream($p);
- $this->_out('endobj');
- }
- //Pages root
- $this->offsets[1]=strlen($this->buffer);
- $this->_out('1 0 obj');
- $this->_out('<</Type /Pages');
- $kids='/Kids [';
- for($i=0;$i<$nb;$i++)
- $kids.=(3+2*$i).' 0 R ';
- $this->_out($kids.']');
- $this->_out('/Count '.$nb);
- $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putfonts()
-{
- $nf=$this->n;
- foreach($this->diffs as $diff)
- {
- //Encodings
- $this->_newobj();
- $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
- $this->_out('endobj');
- }
- $mqr=get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- foreach($this->FontFiles as $file=>$info)
- {
- //Font file embedding
- $this->_newobj();
- $this->FontFiles[$file]['n']=$this->n;
- $font='';
- $f=fopen($this->_getfontpath().$file,'rb',1);
- if(!$f)
- $this->Error('Font file not found');
- while(!feof($f))
- $font.=fread($f,8192);
- fclose($f);
- $compressed=(substr($file,-2)=='.z');
- if(!$compressed && isset($info['length2']))
- {
- $header=(ord($font{0})==128);
- if($header)
- {
- //Strip first binary header
- $font=substr($font,6);
- }
- if($header && ord($font{$info['length1']})==128)
- {
- //Strip second binary header
- $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
- }
- }
- $this->_out('<</Length '.strlen($font));
- if($compressed)
- $this->_out('/Filter /FlateDecode');
- $this->_out('/Length1 '.$info['length1']);
- if(isset($info['length2']))
- $this->_out('/Length2 '.$info['length2'].' /Length3 0');
- $this->_out('>>');
- $this->_putstream($font);
- $this->_out('endobj');
- }
- set_magic_quotes_runtime($mqr);
- foreach($this->fonts as $k=>$font)
- {
- //Font objects
- $this->fonts[$k]['n']=$this->n+1;
- $type=$font['type'];
- $name=$font['name'];
- if($type=='core')
- {
- //Standard font
- $this->_newobj();
- $this->_out('<</Type /Font');
- $this->_out('/BaseFont /'.$name);
- $this->_out('/Subtype /Type1');
- if($name!='Symbol' && $name!='ZapfDingbats')
- $this->_out('/Encoding /WinAnsiEncoding');
- $this->_out('>>');
- $this->_out('endobj');
- }
- elseif($type=='Type1' || $type=='TrueType')
- {
- //Additional Type1 or TrueType font
- $this->_newobj();
- $this->_out('<</Type /Font');
- $this->_out('/BaseFont /'.$name);
- $this->_out('/Subtype /'.$type);
- $this->_out('/FirstChar 32 /LastChar 255');
- $this->_out('/Widths '.($this->n+1).' 0 R');
- $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
- if($font['enc'])
- {
- if(isset($font['diff']))
- $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
- else
- $this->_out('/Encoding /WinAnsiEncoding');
- }
- $this->_out('>>');
- $this->_out('endobj');
- //Widths
- $this->_newobj();
- $cw=&$font['cw'];
- $s='[';
- for($i=32;$i<=255;$i++)
- $s.=$cw[chr($i)].' ';
- $this->_out($s.']');
- $this->_out('endobj');
- //Descriptor
- $this->_newobj();
- $s='<</Type /FontDescriptor /FontName /'.$name;
- foreach($font['desc'] as $k=>$v)
- $s.=' /'.$k.' '.$v;
- $file=$font['file'];
- if($file)
- $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
- $this->_out($s.'>>');
- $this->_out('endobj');
- }
- else
- {
- //Allow for additional types
- $mtd='_put'.strtolower($type);
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported font type: '.$type);
- $this->$mtd($font);
- }
- }
-}
-
-function _putimages()
-{
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- reset($this->images);
- while(list($file,$info)=each($this->images))
- {
- $this->_newobj();
- $this->images[$file]['n']=$this->n;
- $this->_out('<</Type /XObject');
- $this->_out('/Subtype /Image');
- $this->_out('/Width '.$info['w']);
- $this->_out('/Height '.$info['h']);
- if($info['cs']=='Indexed')
- $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
- else
- {
- $this->_out('/ColorSpace /'.$info['cs']);
- if($info['cs']=='DeviceCMYK')
- $this->_out('/Decode [1 0 1 0 1 0 1 0]');
- }
- $this->_out('/BitsPerComponent '.$info['bpc']);
- if(isset($info['f']))
- $this->_out('/Filter /'.$info['f']);
- if(isset($info['parms']))
- $this->_out($info['parms']);
- if(isset($info['trns']) && is_array($info['trns']))
- {
- $trns='';
- for($i=0;$i<count($info['trns']);$i++)
- $trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
- $this->_out('/Mask ['.$trns.']');
- }
- $this->_out('/Length '.strlen($info['data']).'>>');
- $this->_putstream($info['data']);
- unset($this->images[$file]['data']);
- $this->_out('endobj');
- //Palette
- if($info['cs']=='Indexed')
- {
- $this->_newobj();
- $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
- $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
- $this->_putstream($pal);
- $this->_out('endobj');
- }
- }
-}
-
-function _putxobjectdict()
-{
- foreach($this->images as $image)
- $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
-}
-
-function _putresourcedict()
-{
- $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
- $this->_out('/Font <<');
- foreach($this->fonts as $font)
- $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
- $this->_out('>>');
- $this->_out('/XObject <<');
- $this->_putxobjectdict();
- $this->_out('>>');
-}
-
-function _putresources()
-{
- $this->_putfonts();
- $this->_putimages();
- //Resource dictionary
- $this->offsets[2]=strlen($this->buffer);
- $this->_out('2 0 obj');
- $this->_out('<<');
- $this->_putresourcedict();
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putinfo()
-{
- $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
- if(!empty($this->title))
- $this->_out('/Title '.$this->_textstring($this->title));
- if(!empty($this->subject))
- $this->_out('/Subject '.$this->_textstring($this->subject));
- if(!empty($this->author))
- $this->_out('/Author '.$this->_textstring($this->author));
- if(!empty($this->keywords))
- $this->_out('/Keywords '.$this->_textstring($this->keywords));
- if(!empty($this->creator))
- $this->_out('/Creator '.$this->_textstring($this->creator));
- $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
-}
-
-function _putcatalog()
-{
- $this->_out('/Type /Catalog');
- $this->_out('/Pages 1 0 R');
- if($this->ZoomMode=='fullpage')
- $this->_out('/OpenAction [3 0 R /Fit]');
- elseif($this->ZoomMode=='fullwidth')
- $this->_out('/OpenAction [3 0 R /FitH null]');
- elseif($this->ZoomMode=='real')
- $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
- elseif(!is_string($this->ZoomMode))
- $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
- if($this->LayoutMode=='single')
- $this->_out('/PageLayout /SinglePage');
- elseif($this->LayoutMode=='continuous')
- $this->_out('/PageLayout /OneColumn');
- elseif($this->LayoutMode=='two')
- $this->_out('/PageLayout /TwoColumnLeft');
-}
-
-function _putheader()
-{
- $this->_out('%PDF-'.$this->PDFVersion);
-}
-
-function _puttrailer()
-{
- $this->_out('/Size '.($this->n+1));
- $this->_out('/Root '.$this->n.' 0 R');
- $this->_out('/Info '.($this->n-1).' 0 R');
-}
-
-function _enddoc()
-{
- $this->_putheader();
- $this->_putpages();
- $this->_putresources();
- //Info
- $this->_newobj();
- $this->_out('<<');
- $this->_putinfo();
- $this->_out('>>');
- $this->_out('endobj');
- //Catalog
- $this->_newobj();
- $this->_out('<<');
- $this->_putcatalog();
- $this->_out('>>');
- $this->_out('endobj');
- //Cross-ref
- $o=strlen($this->buffer);
- $this->_out('xref');
- $this->_out('0 '.($this->n+1));
- $this->_out('0000000000 65535 f ');
- for($i=1;$i<=$this->n;$i++)
- $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
- //Trailer
- $this->_out('trailer');
- $this->_out('<<');
- $this->_puttrailer();
- $this->_out('>>');
- $this->_out('startxref');
- $this->_out($o);
- $this->_out('%%EOF');
- $this->state=3;
-}
-
-function _beginpage($orientation)
-{
- $this->page++;
- $this->pages[$this->page]='';
- $this->state=2;
- $this->x=$this->lMargin;
- $this->y=$this->tMargin;
- $this->FontFamily='';
- //Page orientation
- if(!$orientation)
- $orientation=$this->DefOrientation;
- else
- {
- $orientation=strtoupper($orientation{0});
- if($orientation!=$this->DefOrientation)
- $this->OrientationChanges[$this->page]=true;
- }
- if($orientation!=$this->CurOrientation)
- {
- //Change orientation
- if($orientation=='P')
- {
- $this->wPt=$this->fwPt;
- $this->hPt=$this->fhPt;
- $this->w=$this->fw;
- $this->h=$this->fh;
- }
- else
- {
- $this->wPt=$this->fhPt;
- $this->hPt=$this->fwPt;
- $this->w=$this->fh;
- $this->h=$this->fw;
- }
- $this->PageBreakTrigger=$this->h-$this->bMargin;
- $this->CurOrientation=$orientation;
- }
-}
-
-function _endpage()
-{
- //End of page contents
- $this->state=1;
-}
-
-function _newobj()
-{
- //Begin a new object
- $this->n++;
- $this->offsets[$this->n]=strlen($this->buffer);
- $this->_out($this->n.' 0 obj');
-}
-
-function _dounderline($x,$y,$txt)
-{
- //Underline text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
- $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
- return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
-}
-
-function _parsejpg($file)
-{
- //Extract info from a JPEG file
- $a=GetImageSize($file);
- if(!$a)
- $this->Error('Missing or incorrect image file: '.$file);
- if($a[2]!=2)
- $this->Error('Not a JPEG file: '.$file);
- if(!isset($a['channels']) || $a['channels']==3)
- $colspace='DeviceRGB';
- elseif($a['channels']==4)
- $colspace='DeviceCMYK';
- else
- $colspace='DeviceGray';
- $bpc=isset($a['bits']) ? $a['bits'] : 8;
- //Read whole file
- $f=fopen($file,'rb');
- $data='';
- while(!feof($f))
- $data.=fread($f,4096);
- fclose($f);
- return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
-}
-
-function _parsepng($file)
-{
- //Extract info from a PNG file
- $f=fopen($file,'rb');
- if(!$f)
- $this->Error('Can\'t open image file: '.$file);
- //Check signature
- if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
- $this->Error('Not a PNG file: '.$file);
- //Read header chunk
- fread($f,4);
- if(fread($f,4)!='IHDR')
- $this->Error('Incorrect PNG file: '.$file);
- $w=$this->_freadint($f);
- $h=$this->_freadint($f);
- $bpc=ord(fread($f,1));
- if($bpc>8)
- $this->Error('16-bit depth not supported: '.$file);
- $ct=ord(fread($f,1));
- if($ct==0)
- $colspace='DeviceGray';
- elseif($ct==2)
- $colspace='DeviceRGB';
- elseif($ct==3)
- $colspace='Indexed';
- else
- $this->Error('Alpha channel not supported: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Unknown compression method: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Unknown filter method: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Interlacing not supported: '.$file);
- fread($f,4);
- $parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
- //Scan chunks looking for palette, transparency and image data
- $pal='';
- $trns='';
- $data='';
- do
- {
- $n=$this->_freadint($f);
- $type=fread($f,4);
- if($type=='PLTE')
- {
- //Read palette
- $pal=fread($f,$n);
- fread($f,4);
- }
- elseif($type=='tRNS')
- {
- //Read transparency info
- $t=fread($f,$n);
- if($ct==0)
- $trns=array(ord(substr($t,1,1)));
- elseif($ct==2)
- $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
- else
- {
- $pos=strpos($t,chr(0));
- if($pos!==false)
- $trns=array($pos);
- }
- fread($f,4);
- }
- elseif($type=='IDAT')
- {
- //Read image data block
- $data.=fread($f,$n);
- fread($f,4);
- }
- elseif($type=='IEND')
- break;
- else
- fread($f,$n+4);
- }
- while($n);
- if($colspace=='Indexed' && empty($pal))
- $this->Error('Missing palette in '.$file);
- fclose($f);
- return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);
-}
-
-function _freadint($f)
-{
- //Read a 4-byte integer from file
- $a=unpack('Ni',fread($f,4));
- return $a['i'];
-}
-
-function _textstring($s)
-{
- //Format a text string
- return '('.$this->_escape($s).')';
-}
-
-function _escape($s)
-{
- //Add \ before \, ( and )
- return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s)));
-}
-
-function _putstream($s)
-{
- $this->_out('stream');
- $this->_out($s);
- $this->_out('endstream');
-}
-
-function _out($s)
-{
- //Add a line to the document
- if($this->state==2)
- $this->pages[$this->page].=$s."\n";
- else
- $this->buffer.=$s."\n";
-}
-//End of class
-}
-
-//Handle special IE contype request
-if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
-{
- header('Content-Type: application/pdf');
- exit;
-}
-
-}
-?>
diff --git a/index.php b/index.php
index fa0e418..af3bfa2 100644
--- a/index.php
+++ b/index.php
@@ -6,14 +6,14 @@ session_start();
header("Cache-control: private");
-//error_reporting(E_ERROR);
+error_reporting(E_ERROR);
require("core.php");
if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
- if (file_exists("data/hits.txt")) {
- $maj_global_hits_count = file_get_contents("data/hits.txt");
+ if (file_exists("$maj_data_directory/hits.txt")) {
+ $maj_global_hits_count = file_get_contents("$maj_data_directory/hits.txt");
}
else {
$maj_global_hits_count = "0";
@@ -21,15 +21,15 @@ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_us
$maj_global_hits_count = $maj_global_hits_count + 1;
- $maj_global_hits_file = fopen("data/hits.txt","w");
+ $maj_global_hits_file = fopen("$maj_data_directory/hits.txt","w");
fwrite($maj_global_hits_file,$maj_global_hits_count);
fclose($maj_global_hits_file);
}
if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
- if (file_exists("data/google.txt")) {
- $maj_google_hits_count = file_get_contents("data/google.txt");
+ if (file_exists("$maj_data_directory/google.txt")) {
+ $maj_google_hits_count = file_get_contents("$maj_data_directory/google.txt");
}
else {
$maj_google_hits_count = "0";
@@ -37,7 +37,7 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
$maj_google_hits_count = $maj_google_hits_count + 1;
- $maj_google_hits_file = fopen("data/google.txt","w");
+ $maj_google_hits_file = fopen("$maj_data_directory/google.txt","w");
fwrite($maj_google_hits_file,$maj_google_hits_count);
fclose($maj_google_hits_file);
}
@@ -53,15 +53,9 @@ function go_download($maj_dl_file) {
$maj_req_entry = trim($_REQUEST['entry']);
- if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pdf")) {
- $maj_dl_path = "data/items/$maj_req_entry/pdf/file";
- $maj_count_path = "data/items/$maj_req_entry/pdf/count";
- $maj_count_file = "dl.txt";
- }
-
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "filedrop")) {
- $maj_dl_path = "data/items/$maj_req_entry/filedrop/files";
- $maj_count_path = "data/items/$maj_req_entry/filedrop/count";
+ $maj_dl_path = "$maj_data_directory/items/$maj_req_entry/filedrop/files";
+ $maj_count_path = "$maj_data_directory/items/$maj_req_entry/filedrop/count";
$maj_count_file = "{$maj_dl_file}.txt";
}
@@ -107,7 +101,7 @@ function go_download($maj_dl_file) {
if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
- $maj_comment_dir = "data/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
+ $maj_comment_dir = "$maj_data_directory/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
$maj_login_key = file_get_contents("$maj_comment_dir/key.txt");
@@ -115,14 +109,14 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if ($_REQUEST['action'] == "approve") {
- $maj_live_dir = "data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}";
+ $maj_live_dir = "$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}";
- if (!file_exists("data/items/$maj_req_entry/comments/live")) {
- mkdir("data/items/$maj_req_entry/comments/live");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
}
- if (!file_exists("data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}")) {
- mkdir("data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}");
}
rename($maj_comment_dir,$maj_live_dir);
@@ -131,40 +125,40 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
// clean-up old latest comments dir (start)
- if (file_exists("data/comments/latest")) {
- rmdirr("data/comments/latest");
+ if (file_exists("$maj_data_directory/comments/latest")) {
+ rmdirr("$maj_data_directory/comments/latest");
}
// clean-up old latest comments dir (end)
- if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
+ if (file_exists("$maj_data_directory/members/active") and !file_exists("$maj_data_directory/xucomment.txt")) {
- if (!file_exists("data/comments/unread")) {
- mkdir("data/comments/unread");
+ if (!file_exists("$maj_data_directory/comments/unread")) {
+ mkdir("$maj_data_directory/comments/unread");
}
- if (!file_exists("data/comments/unread/$maj_req_entry")) {
- mkdir("data/comments/unread/$maj_req_entry");
+ if (!file_exists("$maj_data_directory/comments/unread/$maj_req_entry")) {
+ mkdir("$maj_data_directory/comments/unread/$maj_req_entry");
}
- if ($maj_dh_unread_active_members = opendir("data/members/active")) {
+ if ($maj_dh_unread_active_members = opendir("$maj_data_directory/members/active")) {
while (($maj_unread_active_member = readdir($maj_dh_unread_active_members)) !== false) {
if ($maj_unread_active_member != "." && $maj_unread_active_member != "..") {
- if ((!file_exists("data/members/active/$maj_unread_active_member/bb-vacation.txt") and !file_exists("data/items/$maj_req_entry/members")) or (!file_exists("data/members/active/$maj_unread_active_member/bb-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("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/members")) or (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and file_exists("$maj_data_directory/items/$maj_req_entry/members") and file_exists("$maj_data_directory/items/$maj_req_entry/members/$maj_unread_active_member"))) {
- if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
- mkdir("data/members/active/$maj_unread_active_member/comments");
+ if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments");
}
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread");
+ if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread");
}
- if (!file_exists("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("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
}
}
}
@@ -175,15 +169,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_req_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_req_entry/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("data/categories/$maj_entry_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -192,13 +186,13 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
}
}
- if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$maj_req_entry/private.txt") and ($maj_private_categories == "0")) {
+ if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/ml.txt") and file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and ($maj_private_categories == "0")) {
- if (file_exists("data/ml-reply2.txt")) {
- $maj_ml_reply2 = file_get_contents("data/ml-reply2.txt");
+ if (file_exists("$maj_data_directory/ml-reply2.txt")) {
+ $maj_ml_reply2 = file_get_contents("$maj_data_directory/ml-reply2.txt");
}
- if (file_exists("data/ml-from.txt")) {
+ if (file_exists("$maj_data_directory/ml-from.txt")) {
$maj_ml_from = $maj_ml_reply2;
}
else {
@@ -212,10 +206,10 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_from = '"' . "$maj_ml_from_firstname $maj_ml_from_lastname" . '" <' . $maj_ml_from . '>';
- $maj_ml_subject = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_ml_subject = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (file_exists("data/ml-prepend.txt")) {
- $maj_ml_prepend = file_get_contents("data/ml-prepend.txt");
+ if (file_exists("$maj_data_directory/ml-prepend.txt")) {
+ $maj_ml_prepend = file_get_contents("$maj_data_directory/ml-prepend.txt");
$maj_ml_subject = str_replace($maj_ml_prepend,"",$maj_ml_subject);
$maj_ml_subject = $maj_ml_prepend . " " . $maj_ml_subject;
}
@@ -242,12 +236,12 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = str_replace('>','>',$maj_ml_body);
$maj_ml_body = str_replace('®','(R)',$maj_ml_body);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
+ if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt")) {
- $maj_badwords = file_get_contents("data/pf-badwords.txt");
+ $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $maj_censor = file_get_contents("data/pf-censor.txt");
+ if (file_exists("$maj_data_directory/pf-censor.txt")) {
+ $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
}
else {
$maj_censor = "[expletive]";
@@ -256,8 +250,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_ml_body);
}
- if (file_exists("data/ml-header.txt")) {
- $maj_ml_header = file_get_contents("data/ml-header.txt");
+ if (file_exists("$maj_data_directory/ml-header.txt")) {
+ $maj_ml_header = file_get_contents("$maj_data_directory/ml-header.txt");
$maj_ml_body = $maj_ml_header . "\n\n" . $maj_ml_body;
}
@@ -267,34 +261,34 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = $maj_ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $maj_ml_url;
- if (file_exists("data/items/$maj_req_entry/member.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt")) {
$maj_ml_body = $maj_ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
}
- if (file_exists("data/ml-footer.txt")) {
- $maj_ml_footer = file_get_contents("data/ml-footer.txt");
+ if (file_exists("$maj_data_directory/ml-footer.txt")) {
+ $maj_ml_footer = file_get_contents("$maj_data_directory/ml-footer.txt");
$maj_ml_body = $maj_ml_body . "\n\n" . $maj_ml_footer;
}
- if ($maj_dh_ml_member = opendir("data/members/active")) {
+ if ($maj_dh_ml_member = opendir("$maj_data_directory/members/active")) {
while (($maj_ml_member = readdir($maj_dh_ml_member)) !== false) {
if ($maj_ml_member != "." && $maj_ml_member != "..") {
- if (file_exists("data/members/active/$maj_ml_member/bb-noml.txt")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-noml.txt")) {
continue;
}
- if (file_exists("data/members/active/$maj_ml_member/bb-vacation.txt")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-vacation.txt")) {
continue;
}
- $maj_ml_to_firstname = file_get_contents("data/members/active/$maj_ml_member/firstname.txt");
- $maj_ml_to_lastname = file_get_contents("data/members/active/$maj_ml_member/lastname.txt");
- $maj_ml_to = file_get_contents("data/members/active/$maj_ml_member/email.txt");
+ $maj_ml_to_firstname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/firstname.txt");
+ $maj_ml_to_lastname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/lastname.txt");
+ $maj_ml_to = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/email.txt");
$maj_ml_to = '"' . "$maj_ml_to_firstname $maj_ml_to_lastname" . '" <'. $maj_ml_to . '>';
- if (file_exists("data/ml-reply2.txt")) {
+ if (file_exists("$maj_data_directory/ml-reply2.txt")) {
mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
"From: $maj_ml_from\r\n" .
"Reply-To: $maj_ml_reply2\r\n" .
@@ -319,17 +313,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
rmdirr($maj_comment_dir);
}
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
if ($maj_comment_count_value <= 1) {
- rmdirr("data/comments/pending/$maj_req_entry");
+ rmdirr("$maj_data_directory/comments/pending/$maj_req_entry");
}
else {
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
$maj_comment_count_value = $maj_comment_count_value - 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_req_entry/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_req_entry/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -340,16 +334,16 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if (isset($maj_req_entry) and !empty($maj_req_entry)) {
- if (file_exists("data/items/$maj_req_entry")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry")) {
- $maj_title = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
echo "<title>$maj_title</title>\r\n";
if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- if (file_exists("data/items/$maj_req_entry/views.txt")) {
- $maj_count_views = file_get_contents("data/items/$maj_req_entry/views.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/views.txt")) {
+ $maj_count_views = file_get_contents("$maj_data_directory/items/$maj_req_entry/views.txt");
}
else {
$maj_count_views = "0";
@@ -357,30 +351,30 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_count_views = $maj_count_views + 1;
- $maj_fp_views = fopen("data/items/$maj_req_entry/views.txt","w");
+ $maj_fp_views = fopen("$maj_data_directory/items/$maj_req_entry/views.txt","w");
fwrite($maj_fp_views,$maj_count_views);
fclose($maj_fp_views);
}
if (isset($maj_req_show) and !empty($maj_req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == sha1($_POST['captcha_put'])) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- if (!file_exists("data/items/$maj_req_entry/comments")) {
- mkdir("data/items/$maj_req_entry/comments");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments");
}
- if (!file_exists("data/items/$maj_req_entry/comments/pending")) {
- mkdir("data/items/$maj_req_entry/comments/pending");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/pending")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending");
}
- if (!file_exists("data/items/$maj_req_entry/comments/live")) {
- mkdir("data/items/$maj_req_entry/comments/live");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
}
$maj_timestamp = date("l, M j, Y, g:i A",time() + $maj_offset);
$maj_comment_entry_dir = date("YmdHis",time() + $maj_offset);
- mkdir("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir");
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir");
$maj_body_content = ucfirst($_POST['new_comment']);
$maj_body_content = htmlentities($maj_body_content,ENT_NOQUOTES);
@@ -397,15 +391,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$maj_body_content);
$maj_body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$maj_body_content);
- $maj_fp_body_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/comment.txt","w");
+ $maj_fp_body_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/comment.txt","w");
fwrite($maj_fp_body_txt,$maj_body_content);
fclose($maj_fp_body_txt);
- $maj_fp_timestamp_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/timestamp.txt","w");
+ $maj_fp_timestamp_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/timestamp.txt","w");
fwrite($maj_fp_timestamp_txt,$maj_timestamp);
fclose($maj_fp_timestamp_txt);
- $maj_fp_firstname_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/firstname.txt","w");
+ $maj_fp_firstname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/firstname.txt","w");
$maj_firstname = htmlentities($_POST['firstname'],ENT_NOQUOTES);
$maj_firstname = trim($maj_firstname);
@@ -417,7 +411,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_firstname_txt,$maj_firstname);
fclose($maj_fp_firstname_txt);
- $maj_fp_lastname_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/lastname.txt","w");
+ $maj_fp_lastname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/lastname.txt","w");
$maj_lastname = htmlentities($_POST['lastname'],ENT_NOQUOTES);
$maj_lastname = trim($maj_lastname);
@@ -429,15 +423,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_lastname_txt,$maj_lastname);
fclose($maj_fp_lastname_txt);
- $maj_fp_email_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/email.txt","w");
+ $maj_fp_email_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/email.txt","w");
$maj_email = strtolower($_POST['email']);
$maj_email = trim($maj_email);
$maj_email = htmlentities($maj_email,ENT_NOQUOTES);
fwrite($maj_fp_email_txt,$maj_email);
fclose($maj_fp_email_txt);
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/email.txt")) {
- $maj_fp_email_root = fopen("data/email.txt","w");
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/email.txt")) {
+ $maj_fp_email_root = fopen("$maj_data_directory/email.txt","w");
$maj_email_root = strtolower($_POST['email']);
$maj_email_root = trim($maj_email_root);
$maj_email_root = htmlentities($maj_email_root,ENT_NOQUOTES);
@@ -446,7 +440,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.",$_POST['url']))) {
- $maj_fp_url_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/url.txt","w");
+ $maj_fp_url_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/url.txt","w");
$maj_url = str_replace("http://","",$_POST['url']);
$maj_url = strtolower($maj_url);
$maj_url = trim($maj_url);
@@ -457,19 +451,19 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $maj_fp_cauthor_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/author.txt","w");
+ $maj_fp_cauthor_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/author.txt","w");
fwrite($maj_fp_cauthor_txt,$_POST['cauthor']);
fclose($maj_fp_cauthor_txt);
}
$maj_key_rand = str_rand(14);
- $maj_fp_key_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/key.txt","w");
+ $maj_fp_key_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/key.txt","w");
fwrite($maj_fp_key_txt,$maj_key_rand);
fclose($maj_fp_key_txt);
$maj_comment_quote = ucfirst($_POST['new_comment']);
- $maj_sig_author = file_get_contents("data/author.txt");
+ $maj_sig_author = file_get_contents("$maj_data_directory/author.txt");
$maj_sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$maj_sig_url = str_replace('//','/',$maj_sig_url);
@@ -478,17 +472,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_email_to = strtolower($_POST['email']);
$maj_email_to = '"' . "$maj_firstname $maj_lastname" . '" <' . $maj_email_to . '>';
- if (file_exists("data/email.txt")) {
- $maj_from_email_author = file_get_contents("data/author.txt");
- $maj_from_email = file_get_contents("data/email.txt");
+ if (file_exists("$maj_data_directory/email.txt")) {
+ $maj_from_email_author = file_get_contents("$maj_data_directory/author.txt");
+ $maj_from_email = file_get_contents("$maj_data_directory/email.txt");
$maj_from_email = '"' . $maj_from_email_author . '" <' . $maj_from_email . '>';
}
$maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
- $maj_commented_entry_title = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_commented_entry_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
+ if (!file_exists("$maj_data_directory/nak.txt") and file_exists("$maj_data_directory/email.txt")) {
$maj_comment_thanks = "Hi $maj_firstname,\n\nThanks for submitting the following comment last $maj_timestamp:\n\n\"$maj_comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&show=comments\n\nThanks again! =)\n\n--\n$maj_sig_author\n$maj_sig_url\n";
$maj_comment_thanks = wordwrap($maj_comment_thanks);
@@ -499,7 +493,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
"X-Mailer: $maj_mailer");
}
- if (file_exists("data/email.txt") and !file_exists("data/xscreen.txt")) {
+ if (file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/xscreen.txt")) {
$maj_comment_notice = "The following comment was submitted by $maj_email_to last $maj_timestamp for the entry \"$maj_commented_entry_title\":\n\n\"$maj_comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
$maj_comment_notice = wordwrap($maj_comment_notice);
@@ -510,22 +504,22 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
"X-Mailer: $maj_mailer");
}
- if (!file_exists("data/comments")) {
- mkdir("data/comments");
+ if (!file_exists("$maj_data_directory/comments")) {
+ mkdir("$maj_data_directory/comments");
}
- if (!file_exists("data/comments/pending")) {
- mkdir("data/comments/pending");
+ if (!file_exists("$maj_data_directory/comments/pending")) {
+ mkdir("$maj_data_directory/comments/pending");
}
$maj_pending_comment_flag = $maj_req_entry;
- if (!file_exists("data/comments/pending/$maj_pending_comment_flag")) {
- mkdir("data/comments/pending/$maj_pending_comment_flag");
+ if (!file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag")) {
+ mkdir("$maj_data_directory/comments/pending/$maj_pending_comment_flag");
}
- if (file_exists("data/comments/pending/$maj_pending_comment_flag/count.txt")) {
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_pending_comment_flag/count.txt");
+ if (file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt")) {
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt");
}
else {
$maj_comment_count_value = "0";
@@ -533,7 +527,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_comment_count_value = $maj_comment_count_value + 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -543,9 +537,9 @@ else {
echo "<title>$maj_default_title</title>\r\n";
}
-if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")))) {
+if (file_exists("$maj_data_directory/comments/pending") and (file_exists("$maj_data_directory/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")))) {
- if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
+ if ($maj_dh_xscreen_comments = opendir("$maj_data_directory/comments/pending")) {
while (($maj_xscreen_comment = readdir($maj_dh_xscreen_comments)) !== false) {
@@ -563,23 +557,23 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
foreach ($maj_xscreen_comments as $maj_xscreen_dir) {
- if ($maj_dh_xscreen_pending = opendir("data/items/$maj_xscreen_dir/comments/pending")) {
+ if ($maj_dh_xscreen_pending = opendir("$maj_data_directory/items/$maj_xscreen_dir/comments/pending")) {
while (($maj_xscreen_entry = readdir($maj_dh_xscreen_pending)) !== false) {
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- if (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")) {
+ if (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")) {
- if ($maj_logged_in_username == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+ if ($maj_logged_in_username == file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
}
}
else {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
}
@@ -591,19 +585,19 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
}
}
-if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_req_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_req_entry/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("data/categories/$maj_entry_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -615,11 +609,11 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
if ($maj_private_categories == "0") {
- if (!file_exists("data/items/$maj_req_entry/passwd.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
- if (!file_exists("data/items/$maj_req_entry/private.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/private.txt")) {
- $maj_description = file_get_contents("data/items/$maj_req_entry/body.txt");
+ $maj_description = file_get_contents("$maj_data_directory/items/$maj_req_entry/body.txt");
$maj_description = strip_tags($maj_description);
$maj_description = html_entity_decode($maj_description);
$maj_description = str_replace("&","&",$maj_description);
@@ -635,12 +629,12 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
$maj_description = substr($maj_description,0,210);
$maj_description = htmlentities($maj_description,ENT_NOQUOTES);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
+ if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
- $maj_badwords = file_get_contents("data/pf-badwords.txt");
+ $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $maj_censor = file_get_contents("data/pf-censor.txt");
+ if (file_exists("$maj_data_directory/pf-censor.txt")) {
+ $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
}
else {
$maj_censor = "[expletive]";
@@ -665,16 +659,16 @@ include("css.php");
<?php
-if (file_exists("data/center.txt")) {
+if (file_exists("$maj_data_directory/center.txt")) {
echo "<center>";
}
-if (file_exists("data/header.txt")) {
+if (file_exists("$maj_data_directory/header.txt")) {
- $maj_header_panel = file_get_contents("data/header.txt");
+ $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
- if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
- include("data/panels/$maj_header_panel/panel.php");
+ if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
+ include("$maj_data_directory/panels/$maj_header_panel/panel.php");
}
}
@@ -685,7 +679,7 @@ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_
echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+if (!file_exists("$maj_data_directory/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Profile</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t";
@@ -694,7 +688,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_gif_image_width = $maj_profile_gif_image_size[0];
$maj_profile_gif_image_height = $maj_profile_gif_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_gif_image_width = 150;
}
else {
@@ -718,7 +712,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_jpg_image_width = $maj_profile_jpg_image_size[0];
$maj_profile_jpg_image_height = $maj_profile_jpg_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_jpg_image_width = 150;
}
else {
@@ -742,7 +736,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_png_image_width = $maj_profile_png_image_size[0];
$maj_profile_png_image_height = $maj_profile_png_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_png_image_width = 150;
}
else {
@@ -761,16 +755,16 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
}
}
- include("data/profile.php");
+ include("$maj_data_directory/profile.php");
echo "\r\n\t</div>\r\n</div>\r\n\r\n";
}
-if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+if (!file_exists("$maj_data_directory/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Navigation</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t<a class=\"navlink\" href=\".\">Home</a><br>\r\n";
- if (file_exists("data/bb.txt") and file_exists("data/members/active")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
}
@@ -783,16 +777,16 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo "\t\t<a class=\"navlink\" href=\"fonts.php\">Fonts</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"login.php\">Logout</a>\r\n";
}
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
- if (!file_exists("data/categories/$maj_req_category")) {
- rmdirr("data/members/active/$maj_logged_in_username/categories/$maj_req_category");
+ if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
}
}
- if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
+ if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -800,7 +794,7 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo '<a class="navlink" href="login.php">Logout</a>';
}
else {
- if (file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
echo '<a class="navlink" href="reg.php">Register</a><br>';
}
@@ -810,31 +804,31 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo "\t</div>\r\n</div>\r\n";
}
-if (file_exists("data/sticky")) {
+if (file_exists("$maj_data_directory/sticky")) {
- if ($maj_dh_sticky = opendir("data/sticky")) {
+ if ($maj_dh_sticky = opendir("$maj_data_directory/sticky")) {
while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
- if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_sticky_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/categories")) {
- if ($maj_dh_sticky_categories = opendir("data/items/$maj_sticky_entry/categories")) {
+ if ($maj_dh_sticky_categories = opendir("$maj_data_directory/items/$maj_sticky_entry/categories")) {
while (($maj_sticky_category = readdir($maj_dh_sticky_categories)) !== false) {
if ($maj_sticky_category != "." && $maj_sticky_category != "..") {
- if (file_exists("data/categories/$maj_sticky_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_sticky_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -843,7 +837,7 @@ if (file_exists("data/sticky")) {
}
}
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_sticky_entry/cat.txt")) {
continue;
}
@@ -866,7 +860,7 @@ if (file_exists("data/sticky")) {
foreach ($maj_sticky_entries as $maj_sticky_list_entry) {
echo "<a class=\"navlink\" href=\"index.php?entry=$maj_sticky_list_entry\">";
- readfile("data/items/$maj_sticky_list_entry/title.txt");
+ readfile("$maj_data_directory/items/$maj_sticky_list_entry/title.txt");
echo "</a><br>";
}
@@ -874,52 +868,52 @@ if (file_exists("data/sticky")) {
}
}
-if (file_exists("data/panels")) {
+if (file_exists("$maj_data_directory/panels")) {
- if ($maj_dh_panels = opendir("data/panels")) {
+ if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
while (($maj_panel = readdir($maj_dh_panels)) !== false) {
if ($maj_panel != "." && $maj_panel != "..") {
- if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
continue;
}
- if (file_exists("data/panels/$maj_panel/right.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
$maj_right_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/top.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
$maj_top_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/bottom.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
$maj_bottom_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/center.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
$maj_center_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/entry.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
$maj_entry_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $maj_panel)) {
+ if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
continue;
}
- if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $maj_panel)) {
+ if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
continue;
}
@@ -963,10 +957,10 @@ if (file_exists("data/panels")) {
foreach ($maj_left_panels as $maj_left_panel) {
- if (!file_exists("data/panels/$maj_left_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
- if (file_exists("data/panels/$maj_left_panel/border.txt")) {
- $maj_left_panel_border = file_get_contents("data/panels/$maj_left_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/border.txt")) {
+ $maj_left_panel_border = file_get_contents("$maj_data_directory/panels/$maj_left_panel/border.txt");
}
else {
if (isset($maj_left_panel_border)) {
@@ -974,8 +968,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/bgcolor-t.txt")) {
- $maj_left_panel_bgcolor_t = file_get_contents("data/panels/$maj_left_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt")) {
+ $maj_left_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt");
}
else {
if (isset($maj_left_panel_bgcolor_t)) {
@@ -983,8 +977,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/bgcolor-c.txt")) {
- $maj_left_panel_bgcolor_c = file_get_contents("data/panels/$maj_left_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt")) {
+ $maj_left_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt");
}
else {
if (isset($maj_left_panel_bgcolor_c)) {
@@ -992,8 +986,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/text-t.txt")) {
- $maj_left_panel_text_t = file_get_contents("data/panels/$maj_left_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-t.txt")) {
+ $maj_left_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-t.txt");
}
else {
if (isset($maj_left_panel_text_t)) {
@@ -1001,8 +995,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/text-c.txt")) {
- $maj_left_panel_text_c = file_get_contents("data/panels/$maj_left_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-c.txt")) {
+ $maj_left_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-c.txt");
}
else {
if (isset($maj_left_panel_text_c)) {
@@ -1034,14 +1028,14 @@ if (file_exists("data/panels")) {
echo ">";
- readfile("data/panels/$maj_left_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_left_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_left_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_left_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1072,15 +1066,15 @@ if (file_exists("data/panels")) {
echo ">\r\n\t\t";
}
- if (file_exists("data/panels/$maj_left_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_left_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_left_panel/panel.php");
echo "\r\n\t</div>\r\n</div>\r\n";
- if (file_exists("data/panels/$maj_left_panel/free.txt") and !file_exists("data/panels/$maj_left_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_left_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1095,10 +1089,10 @@ if ($maj_count_top_panels > 0) {
foreach ($maj_top_panels as $maj_top_panel) {
- if (!file_exists("data/panels/$maj_top_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
- if (file_exists("data/panels/$maj_top_panel/border.txt")) {
- $maj_top_panel_border = file_get_contents("data/panels/$maj_top_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/border.txt")) {
+ $maj_top_panel_border = file_get_contents("$maj_data_directory/panels/$maj_top_panel/border.txt");
}
else {
if (isset($maj_top_panel_border)) {
@@ -1106,8 +1100,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/bgcolor-t.txt")) {
- $maj_top_panel_bgcolor_t = file_get_contents("data/panels/$maj_top_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt")) {
+ $maj_top_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt");
}
else {
if (isset($maj_top_panel_bgcolor_t)) {
@@ -1115,8 +1109,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/bgcolor-c.txt")) {
- $maj_top_panel_bgcolor_c = file_get_contents("data/panels/$maj_top_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt")) {
+ $maj_top_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt");
}
else {
if (isset($maj_top_panel_bgcolor_c)) {
@@ -1124,8 +1118,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/text-t.txt")) {
- $maj_top_panel_text_t = file_get_contents("data/panels/$maj_top_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-t.txt")) {
+ $maj_top_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-t.txt");
}
else {
if (isset($maj_top_panel_text_t)) {
@@ -1133,8 +1127,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/text-c.txt")) {
- $maj_top_panel_text_c = file_get_contents("data/panels/$maj_top_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-c.txt")) {
+ $maj_top_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-c.txt");
}
else {
if (isset($maj_top_panel_text_c)) {
@@ -1166,14 +1160,14 @@ if ($maj_count_top_panels > 0) {
echo '>';
- readfile("data/panels/$maj_top_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_top_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_top_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_top_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1204,15 +1198,15 @@ if ($maj_count_top_panels > 0) {
echo ">\r\n\t\t\t";
}
- if (file_exists("data/panels/$maj_top_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_top_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_top_panel/panel.php");
echo "\r\n\t\t</div>\r\n\t</div>\r\n\r\n";
- if (file_exists("data/panels/$maj_top_panel/free.txt") and !file_exists("data/panels/$maj_top_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_top_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1220,47 +1214,47 @@ if ($maj_count_top_panels > 0) {
// clean-up (start)
-if (file_exists("data/albums")) {
- rmdirr("data/albums");
+if (file_exists("$maj_data_directory/albums")) {
+ rmdirr("$maj_data_directory/albums");
}
// clean-up (end)
// global entry items (start)
-if ($maj_dh_items = opendir("data/items")) {
+if ($maj_dh_items = opendir("$maj_data_directory/items")) {
while (($maj_item = readdir($maj_dh_items)) !== false) {
if ($maj_item != "." && $maj_item != "..") {
- if (file_exists("data/items/$maj_item/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_egroups = opendir("data/items/$maj_item/categories")) {
+ if ($maj_dh_egroups = opendir("$maj_data_directory/items/$maj_item/categories")) {
while (($maj_egroup = readdir($maj_dh_egroups)) !== false) {
if ($maj_egroup != "." && $maj_egroup != "..") {
- if (!file_exists("data/categories/$maj_egroup")) {
- rmdirr("data/items/$maj_item/categories/$maj_egroup");
+ if (!file_exists("$maj_data_directory/categories/$maj_egroup")) {
+ rmdirr("$maj_data_directory/items/$maj_item/categories/$maj_egroup");
}
- if (file_exists("data/categories/$maj_egroup/members")) {
+ if (file_exists("$maj_data_directory/categories/$maj_egroup/members")) {
- if ($maj_dh_mgroups = opendir("data/categories/$maj_egroup/members")) {
+ if ($maj_dh_mgroups = opendir("$maj_data_directory/categories/$maj_egroup/members")) {
while (($maj_mgroup = readdir($maj_dh_mgroups)) !== false) {
if ($maj_mgroup != "." && $maj_mgroup != "..") {
- if (!file_exists("data/items/$maj_item/members/$maj_mgroup")) {
+ if (!file_exists("$maj_data_directory/items/$maj_item/members/$maj_mgroup")) {
- if (!file_exists("data/items/$maj_item/members")) {
- mkdir("data/items/$maj_item/members");
+ if (!file_exists("$maj_data_directory/items/$maj_item/members")) {
+ mkdir("$maj_data_directory/items/$maj_item/members");
}
- mkdir("data/items/$maj_item/members/$maj_mgroup");
+ mkdir("$maj_data_directory/items/$maj_item/members/$maj_mgroup");
}
}
}
@@ -1273,66 +1267,66 @@ if ($maj_dh_items = opendir("data/items")) {
}
}
- 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("$maj_data_directory/items/$maj_item/categories") and (count(glob("$maj_data_directory/items/$maj_item/categories/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/categories");
}
- if (file_exists("data/items/$maj_item/members")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/members")) {
- if ($maj_dh_members = opendir("data/items/$maj_item/members")) {
+ if ($maj_dh_members = opendir("$maj_data_directory/items/$maj_item/members")) {
while (($maj_member = readdir($maj_dh_members)) !== false) {
if ($maj_member != "." && $maj_member != "..") {
- if (!file_exists("data/members/active/$maj_member")) {
- rmdirr("data/items/$maj_item/members/$maj_member");
+ if (!file_exists("$maj_data_directory/members/active/$maj_member")) {
+ rmdirr("$maj_data_directory/items/$maj_item/members/$maj_member");
}
}
}
- closedir("data/items/$maj_item/members");
+ closedir("$maj_data_directory/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("$maj_data_directory/items/$maj_item/members") and (count(glob("$maj_data_directory/items/$maj_item/members/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/members");
}
- if (file_exists("data/items/$maj_item/comments/live") and (count(glob("data/items/$maj_item/comments/live/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments/live");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments/live") and (count(glob("$maj_data_directory/items/$maj_item/comments/live/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments/live");
}
- if (file_exists("data/items/$maj_item/comments/pending") and (count(glob("data/items/$maj_item/comments/pending/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments/pending");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments/pending") and (count(glob("$maj_data_directory/items/$maj_item/comments/pending/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments/pending");
}
- if (file_exists("data/items/$maj_item/comments") and (count(glob("data/items/$maj_item/comments/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments") and (count(glob("$maj_data_directory/items/$maj_item/comments/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments");
}
- if (file_exists("data/items/$maj_item/filedrop/files") and (count(glob("data/items/$maj_item/filedrop/files/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop/files");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop/files") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/files/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop/files");
}
- if (file_exists("data/items/$maj_item/filedrop/count") and (count(glob("data/items/$maj_item/filedrop/count/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop/count");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop/count") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/count/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop/count");
}
- if (file_exists("data/items/$maj_item/filedrop") and (count(glob("data/items/$maj_item/filedrop/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/captions") and (count(glob("data/items/$maj_item/album/captions/*")) < 1)) {
- 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("$maj_data_directory/items/$maj_item/album/captions") and (count(glob("$maj_data_directory/items/$maj_item/album/captions/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album/captions");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("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("$maj_data_directory/items/$maj_item/album/views") and (count(glob("$maj_data_directory/items/$maj_item/album/views/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album/views");
+ unlink("$maj_data_directory/items/$maj_item/album/views.txt");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album") and (count(glob("data/items/$maj_item/album/*")) < 1)) {
- rmdirr("data/items/$maj_item/album");
+ if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("$maj_data_directory/items/$maj_item/album") and (count(glob("$maj_data_directory/items/$maj_item/album/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album");
}
if (file_exists("images/$maj_item/album") and (count(glob("images/$maj_item/album/*")) < 1)) {
@@ -1353,11 +1347,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")) {
+ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
$maj_items[] = $maj_req_entry;
}
- if (isset($maj_req_category) and file_exists("data/categories/$maj_req_category") and file_exists("data/items/$maj_item/categories/$maj_req_category")) {
+ if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
$maj_items[] = $maj_item;
}
@@ -1365,21 +1359,21 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
if (isset($maj_req_find)) {
- if ((($maj_req_find == "private") or ($maj_req_find == "member") or ($maj_req_find == "passwd")) and file_exists("data/items/$maj_item/{$maj_req_find}.txt")) {
+ if ((($maj_req_find == "private") or ($maj_req_find == "member") or ($maj_req_find == "passwd")) and file_exists("$maj_data_directory/items/$maj_item/{$maj_req_find}.txt")) {
$maj_items[] = $maj_item;
}
- if ((($maj_req_find == "comments") or ($maj_req_find == "filedrop") or ($maj_req_find == "album")) and file_exists("data/items/$maj_item/$maj_req_find")) {
+ if ((($maj_req_find == "comments") or ($maj_req_find == "filedrop") or ($maj_req_find == "album")) and file_exists("$maj_data_directory/items/$maj_item/$maj_req_find")) {
$maj_items[] = $maj_item;
}
- if (($maj_req_find == "unfiled") and !file_exists("data/items/$maj_item/categories")) {
+ if (($maj_req_find == "unfiled") and !file_exists("$maj_data_directory/items/$maj_item/categories")) {
$maj_items[] = $maj_item;
}
}
@@ -1390,7 +1384,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
- if (file_exists("data/items/$maj_item/album")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
@@ -1408,21 +1402,21 @@ if ($maj_dh_items = opendir("data/items")) {
continue;
}
- if (file_exists("data/items/$maj_item/private.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/private.txt")) {
continue;
}
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_item/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_item/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_item/categories")) {
while (($maj_item_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_item_category != "." && $maj_item_category != "..") {
- if (file_exists("data/categories/$maj_item_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_item_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -1431,34 +1425,34 @@ if ($maj_dh_items = opendir("data/items")) {
}
}
- if (($maj_private_categories > 0) and !file_exists("data/items/$maj_item/cat.txt")) {
+ if (($maj_private_categories > 0) and !file_exists("$maj_data_directory/items/$maj_item/cat.txt")) {
continue;
}
$maj_latest[] = $maj_item;
- if ((file_exists("data/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/$maj_logged_in_username"))) {
+ if ((file_exists("$maj_data_directory/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("$maj_data_directory/items/$maj_item/members") and !file_exists("$maj_data_directory/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
- if (file_exists("data/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
- if (file_exists("data/items/$maj_item/album")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
$maj_random[] = $maj_item;
$maj_archives[] = substr($maj_item,0,6);
- if (file_exists("data/nocat.txt") and file_exists("data/items/$maj_item/categories") and !file_exists("data/items/$maj_item/cat.txt") and (!isset($maj_req_category) or empty($maj_req_category)) and (!isset($maj_req_entry) or empty($maj_req_entry)) and (!isset($maj_req_author) or empty($maj_req_author))) {
+ if (file_exists("$maj_data_directory/nocat.txt") and file_exists("$maj_data_directory/items/$maj_item/categories") and !file_exists("$maj_data_directory/items/$maj_item/cat.txt") and (!isset($maj_req_category) or empty($maj_req_category)) and (!isset($maj_req_entry) or empty($maj_req_entry)) and (!isset($maj_req_author) or empty($maj_req_author))) {
continue;
}
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
- if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
if ($maj_req_entry != $maj_item) {
continue;
@@ -1466,7 +1460,7 @@ if ($maj_dh_items = opendir("data/items")) {
$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")) {
+ if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
$maj_items[] = $maj_item;
}
@@ -1474,7 +1468,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
}
@@ -1494,13 +1488,13 @@ reset($maj_grand);
$maj_count_grand = count($maj_grand);
-if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
unset($maj_items);
}
- if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
unset($maj_items);
}
}
@@ -1508,7 +1502,7 @@ if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
$maj_items = array_unique($maj_items);
$maj_items = array_values($maj_items);
-if (file_exists("data/old.txt")) {
+if (file_exists("$maj_data_directory/old.txt")) {
sort($maj_items);
}
else {
@@ -1539,7 +1533,7 @@ reset($maj_archives);
$maj_count_archives = count($maj_archives);
-if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
+if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-summary.txt") and !file_exists("$maj_data_directory/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
if ($maj_count_latest > 0) {
@@ -1555,7 +1549,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
echo "<tr><td bgcolor=\"#ffffff\"><a href=\"index.php?entry=$maj_latest[$maj_increment_latest]";
- if ($maj_dh_summary_comments = opendir("data/items/$maj_latest[$maj_increment_latest]/comments/live")) {
+ if ($maj_dh_summary_comments = opendir("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/comments/live")) {
while (($maj_entry_summary_comments = readdir($maj_dh_summary_comments)) !== false) {
@@ -1575,21 +1569,21 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
}
echo "\">";
- readfile("data/items/$maj_latest[$maj_increment_latest]/title.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/title.txt");
echo "</a></td>";
echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
- readfile("data/items/$maj_latest[$maj_increment_latest]/author.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
echo "\">";
- readfile("data/items/$maj_latest[$maj_increment_latest]/author.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
echo "</a></td>";
echo "<td bgcolor=\"#ffffff\" align=\"right\">";
- if (!file_exists("data/items/$maj_latest[$maj_increment_latest]/views.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt")) {
echo 0;
}
else {
- readfile("data/items/$maj_latest[$maj_increment_latest]/views.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt");
}
echo "</td>";
@@ -1631,10 +1625,10 @@ if ($maj_count_center_panels > 0) {
foreach ($maj_center_panels as $maj_center_panel) {
- if (!file_exists("data/panels/$maj_center_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
- if (file_exists("data/panels/$maj_center_panel/border.txt")) {
- $maj_center_panel_border = file_get_contents("data/panels/$maj_center_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/border.txt")) {
+ $maj_center_panel_border = file_get_contents("$maj_data_directory/panels/$maj_center_panel/border.txt");
}
else {
if (isset($maj_center_panel_border)) {
@@ -1642,8 +1636,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/bgcolor-t.txt")) {
- $maj_center_panel_bgcolor_t = file_get_contents("data/panels/$maj_center_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt")) {
+ $maj_center_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt");
}
else {
if (isset($maj_center_panel_bgcolor_t)) {
@@ -1651,8 +1645,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/bgcolor-c.txt")) {
- $maj_center_panel_bgcolor_c = file_get_contents("data/panels/$maj_center_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt")) {
+ $maj_center_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt");
}
else {
if (isset($maj_center_panel_bgcolor_c)) {
@@ -1660,8 +1654,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/text-t.txt")) {
- $maj_center_panel_text_t = file_get_contents("data/panels/$maj_center_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-t.txt")) {
+ $maj_center_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-t.txt");
}
else {
if (isset($maj_center_panel_text_t)) {
@@ -1669,8 +1663,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/text-c.txt")) {
- $maj_center_panel_text_c = file_get_contents("data/panels/$maj_center_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-c.txt")) {
+ $maj_center_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-c.txt");
}
else {
if (isset($maj_center_panel_text_c)) {
@@ -1702,14 +1696,14 @@ if ($maj_count_center_panels > 0) {
echo '>';
- readfile("data/panels/$maj_center_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_center_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_center_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_center_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1740,15 +1734,15 @@ if ($maj_count_center_panels > 0) {
echo '>';
}
- if (file_exists("data/panels/$maj_center_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_center_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_center_panel/panel.php");
echo '</div></div>';
- if (file_exists("data/panels/$maj_center_panel/free.txt") and !file_exists("data/panels/$maj_center_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_center_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1756,9 +1750,9 @@ if ($maj_count_center_panels > 0) {
if (isset($maj_req_category) and !empty($maj_req_category)) {
- if (file_exists("data/categories/$maj_req_category/book.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_req_category/book.txt")) {
- if (!file_exists("data/old.txt")) {
+ if (!file_exists("$maj_data_directory/old.txt")) {
sort($maj_items);
}
else {
@@ -1829,8 +1823,8 @@ foreach ($maj_disp as $maj_d) {
echo "\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"$maj_wmain\">\r\n\r\n\t";
- if (file_exists("data/items/$maj_d/border.txt")) {
- $maj_d_border = file_get_contents("data/items/$maj_d/border.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/border.txt")) {
+ $maj_d_border = file_get_contents("$maj_data_directory/items/$maj_d/border.txt");
}
else {
if (isset($maj_d_border)) {
@@ -1838,8 +1832,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-t.txt")) {
- $maj_d_bgcolor_t = file_get_contents("data/items/$maj_d/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-t.txt")) {
+ $maj_d_bgcolor_t = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-t.txt");
}
else {
if (isset($maj_d_bgcolor_t)) {
@@ -1847,8 +1841,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-b.txt")) {
- $maj_d_bgcolor_b = file_get_contents("data/items/$maj_d/bgcolor-b.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-b.txt")) {
+ $maj_d_bgcolor_b = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-b.txt");
}
else {
if (isset($maj_d_bgcolor_b)) {
@@ -1856,8 +1850,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-c.txt")) {
- $maj_d_bgcolor_c = file_get_contents("data/items/$maj_d/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-c.txt")) {
+ $maj_d_bgcolor_c = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-c.txt");
}
else {
if (isset($maj_d_bgcolor_c)) {
@@ -1865,8 +1859,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-f.txt")) {
- $maj_d_bgcolor_f = file_get_contents("data/items/$maj_d/bgcolor-f.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-f.txt")) {
+ $maj_d_bgcolor_f = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-f.txt");
}
else {
if (isset($maj_d_bgcolor_f)) {
@@ -1874,8 +1868,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-t.txt")) {
- $maj_d_text_t = file_get_contents("data/items/$maj_d/text-t.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-t.txt")) {
+ $maj_d_text_t = file_get_contents("$maj_data_directory/items/$maj_d/text-t.txt");
}
else {
if (isset($maj_d_text_t)) {
@@ -1883,8 +1877,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-b.txt")) {
- $maj_d_text_b = file_get_contents("data/items/$maj_d/text-b.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-b.txt")) {
+ $maj_d_text_b = file_get_contents("$maj_data_directory/items/$maj_d/text-b.txt");
}
else {
if (isset($maj_d_text_b)) {
@@ -1892,8 +1886,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-c.txt")) {
- $maj_d_text_c = file_get_contents("data/items/$maj_d/text-c.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-c.txt")) {
+ $maj_d_text_c = file_get_contents("$maj_data_directory/items/$maj_d/text-c.txt");
}
else {
if (isset($maj_d_text_c)) {
@@ -1901,8 +1895,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-f.txt")) {
- $maj_d_text_f = file_get_contents("data/items/$maj_d/text-f.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-f.txt")) {
+ $maj_d_text_f = file_get_contents("$maj_data_directory/items/$maj_d/text-f.txt");
}
else {
if (isset($maj_d_text_f)) {
@@ -1912,7 +1906,7 @@ foreach ($maj_disp as $maj_d) {
echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t\t";
- if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_title"';
@@ -1938,17 +1932,17 @@ foreach ($maj_disp as $maj_d) {
echo '>';
- readfile("data/items/$maj_d/title.txt");
+ readfile("$maj_data_directory/items/$maj_d/title.txt");
- if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_d/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and !file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
- if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
+ if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\">";
echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
echo "</a>";
}
- if (!file_exists("data/items/$maj_d/lock.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
}
}
@@ -1957,50 +1951,50 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=\"del.php?entry=$maj_d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("data/items/$maj_d/private.txt") and !file_exists("data/items/$maj_d/categories") and file_exists("data/bb.txt") and (count(glob("data/items/$maj_d/comments/live/*")) === 0) and (count(glob("data/items/$maj_d/comments/pending/*")) === 0)) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/private.txt") and !file_exists("$maj_data_directory/items/$maj_d/categories") and file_exists("$maj_data_directory/bb.txt") and (count(glob("$maj_data_directory/items/$maj_d/comments/live/*")) === 0) and (count(glob("$maj_data_directory/items/$maj_d/comments/pending/*")) === 0)) {
echo "<a href=\"move.php?entry=$maj_d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
}
- if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
+ if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
}
echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- if (file_exists("data/items/$maj_d/passwd.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt")) {
echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
}
- if (file_exists("data/items/$maj_d/private.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/private.txt")) {
echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
}
- if (file_exists("data/items/$maj_d/member.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/member.txt")) {
echo "<img src=\"images/widget.member.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"members-only entry\">";
}
- if (file_exists("data/items/$maj_d/cat.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/cat.txt")) {
echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
}
- if (file_exists("data/items/$maj_d/categories/$maj_req_category")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/categories/$maj_req_category")) {
$maj_private_categories = "0";
$maj_book_categories = "0";
- if (file_exists("data/items/$maj_d/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/categories")) {
- if ($maj_dh_read_cat_dir = opendir("data/items/$maj_d/categories")) {
+ if ($maj_dh_read_cat_dir = opendir("$maj_data_directory/items/$maj_d/categories")) {
while (($maj_read_cat_dir = readdir($maj_dh_read_cat_dir)) !== false) {
if ($maj_read_cat_dir != "." && $maj_read_cat_dir != "..") {
- if (file_exists("data/categories/$maj_read_cat_dir/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
- if (file_exists("data/categories/$maj_read_cat_dir/book.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/book.txt")) {
$maj_book_categories = $maj_book_categories + 1;
}
}
@@ -2013,7 +2007,7 @@ foreach ($maj_disp as $maj_d) {
echo "<img src=\"images/widget.hidden.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private category\">";
}
- if (file_exists("data/nocat.txt")) {
+ if (file_exists("$maj_data_directory/nocat.txt")) {
echo "<img src=\"images/widget.isolated.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"isolated category\">";
}
@@ -2055,35 +2049,35 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/author.txt") and !file_exists("data/items/$maj_d/xavatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/author.txt") and !file_exists("$maj_data_directory/items/$maj_d/xavatar.txt")) {
echo "<td width=\"80\" valign=\"top\">";
- $maj_author = file_get_contents("data/items/$maj_d/author.txt");
+ $maj_author = file_get_contents("$maj_data_directory/items/$maj_d/author.txt");
show_maj_avatar_image($maj_author,80);
- if ($maj_dh_author_posts = opendir("data/items")) {
+ if ($maj_dh_author_posts = opendir("$maj_data_directory/items")) {
while (($maj_author_post = readdir($maj_dh_author_posts)) !== false) {
if ($maj_author_post != "." && $maj_author_post != "..") {
- if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))
tree 17f105a709f8c5ba79b5ffd03ac9e1ceeeaccda4
parent c4d3e1d4e896ca7fc9aab000589e760b24b6c413
author Magie Antonio <magie@majcms.org> 1309806034 +0800
committer Magie Antonio <magie@majcms.org> 1309806034 +0800
Clean up edit.php and associated files
Remove scarcely used PDF support
diff --git a/add.php b/add.php
index 844b423..70f092f 100644
--- a/add.php
+++ b/add.php
@@ -416,7 +416,6 @@ a:active {
?>
<p><input type="checkbox" name="sticky">Put entry title in Quick Links box.<br>
-<input type="checkbox" name="pdf">Allow PDF generation for this entry.<br>
<input type="checkbox" name="display">Always display. If this is not a private entry, it will be displayed even if its category is hidden or isolated.<br>
<input type="checkbox" name="private" <?php
if (file_exists("data/ml.txt")) {
@@ -756,51 +755,6 @@ a:active {
}
}
- if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
- if (!file_exists("data/items/$entry/pdf")) {
- mkdir("data/items/$entry/pdf");
- }
- if (!file_exists("data/items/$entry/pdf/file")) {
- mkdir("data/items/$entry/pdf/file");
- }
- if (!file_exists("data/items/$entry/pdf/count")) {
- mkdir("data/items/$entry/pdf/count");
- }
-
- $author_file = "data/author.txt";
- $title_file = "data/items/$entry/title.txt";
- $date_file = "data/items/$entry/date.txt";
- $body_file = "data/items/$entry/body.txt";
-
- $author = file_get_contents($author_file);
- $title = file_get_contents($title_file);
- $date = file_get_contents($date_file);
-
- $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
- $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
- $link = str_replace("add.php?entry=", "index.php?entry=", $link);
-
- $body = file_get_contents($body_file);
- $body = str_replace("\n", "<br />", $body);
-
- $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-
- $filename = strtolower($title);
- $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
- $filename = str_replace(" ", "-", $filename);
- $filename = "data/items/$entry/pdf/file/$filename";
-
- $pdf = new PDF();
- $pdf->AddPage();
- $pdf->SetTitle($title);
- $pdf->SetAuthor($author);
- $pdf->SetFont('Helvetica', 'B', 14);
- $pdf->WriteHTML($title);
- $pdf->SetFont('Helvetica', '', 10);
- $pdf->WriteHTML($html);
- $pdf->Output($filename);
- }
-
if (isset($_POST['category']) and !empty($_POST['category']) and file_exists("data/categories/{$_POST['category']}")) {
if (!file_exists("data/items/$entry/categories")) {
mkdir("data/items/$entry/categories");
diff --git a/core.php b/core.php
index ba59561..b9d6f18 100644
--- a/core.php
+++ b/core.php
@@ -1,7 +1,9 @@
<?php
-$maj_default_title = file_get_contents("data/title.txt");
-$maj_admin_username = file_get_contents("data/username.txt");
+$maj_data_directory = "data";
+
+$maj_default_title = file_get_contents("$maj_data_directory/title.txt");
+$maj_admin_username = file_get_contents("$maj_data_directory/username.txt");
if (isset($_SESSION['logged_in'])) {
$maj_logged_in_username = $_SESSION['logged_in'];
@@ -62,21 +64,21 @@ if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
$maj_req_author = strip_tags($maj_req_author);
}
-if (file_exists("data/offset.txt")) {
- $maj_offset = file_get_contents("data/offset.txt");
+if (file_exists("$maj_data_directory/offset.txt")) {
+ $maj_offset = file_get_contents("$maj_data_directory/offset.txt");
}
else {
$maj_offset = 0;
}
-if (file_exists("data/increase.txt")) {
- $maj_increase = file_get_contents("data/increase.txt");
+if (file_exists("$maj_data_directory/increase.txt")) {
+ $maj_increase = file_get_contents("$maj_data_directory/increase.txt");
}
else {
$maj_increase = 5;
}
-if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_wside = "160";
$maj_wmain = "600";
}
@@ -99,42 +101,42 @@ if (!file_exists("data")) {
mkdir("data");
}
-if (!file_exists("data/.htaccess")) {
+if (!file_exists("$maj_data_directory/.htaccess")) {
$maj_htaccess = "Order deny,allow\nDeny from all";
- $maj_fp_htaccess_txt = fopen("data/.htaccess","w");
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/.htaccess","w");
fwrite($maj_fp_htaccess_txt,$maj_htaccess);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/title.txt")) {
- $maj_fp_default_title_txt = fopen("data/title.txt","w");
+if (!file_exists("$maj_data_directory/title.txt")) {
+ $maj_fp_default_title_txt = fopen("$maj_data_directory/title.txt","w");
fwrite($maj_fp_default_title_txt,$maj_default_blog_title);
fclose($maj_fp_default_title_txt);
}
-if (!file_exists("data/username.txt")) {
- $maj_fp_htaccess_txt = fopen("data/username.txt","w");
+if (!file_exists("$maj_data_directory/username.txt")) {
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/username.txt","w");
fwrite($maj_fp_htaccess_txt,$maj_default_username);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/password.txt")) {
+if (!file_exists("$maj_data_directory/password.txt")) {
$maj_default_password = sha1($maj_default_password);
$maj_default_password = md5($maj_default_password);
$maj_default_password = crypt($maj_default_password,$maj_default_password);
- $maj_fp_htaccess_txt = fopen("data/password.txt","w");
+ $maj_fp_htaccess_txt = fopen("$maj_data_directory/password.txt","w");
fwrite($maj_fp_htaccess_txt,$maj_default_password);
fclose($maj_fp_htaccess_txt);
}
-if (!file_exists("data/profile.php")) {
- $maj_fp_default_profile_txt = fopen("data/profile.php","w");
+if (!file_exists("$maj_data_directory/profile.php")) {
+ $maj_fp_default_profile_txt = fopen("$maj_data_directory/profile.php","w");
fwrite($maj_fp_default_profile_txt,$maj_default_blog_profile);
fclose($maj_fp_default_profile_txt);
}
-if (!file_exists("data/author.txt")) {
- $maj_fp_default_author_txt = fopen("data/author.txt","w");
+if (!file_exists("$maj_data_directory/author.txt")) {
+ $maj_fp_default_author_txt = fopen("$maj_data_directory/author.txt","w");
fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
fclose($maj_fp_default_author_txt);
}
@@ -199,6 +201,20 @@ function return_bytes($val) {
return $val;
}
}
+
+$server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
+$server_post_max_size = return_bytes(ini_get('post_max_size'));
+$server_memory_limit = return_bytes(ini_get('memory_limit'));
+
+$max_file_size = $server_upload_max_filesize;
+
+if ($server_upload_max_filesize > $server_post_max_size) {
+ $max_file_size = $server_post_max_size;
+}
+
+if ($server_post_max_size > $server_memory_limit) {
+ $max_file_size = $server_memory_limit;
+}
function entry2date($entry) {
@@ -336,109 +352,6 @@ function format_body_put($data) {
return $data;
}
-
-require("fpdf.php");
-
-class PDF extends FPDF {
-
- var $B;
- var $I;
- var $U;
- var $HREF;
-
- function PDF($orientation = 'P', $unit = 'mm', $format = 'letter') {
- $this->FPDF($orientation, $unit, $format);
- $this->B = 0;
- $this->I = 0;
- $this->U = 0;
- $this->HREF = '';
- }
-
- function WriteHTML($html) {
- $html = str_replace("\n", ' ', $html);
- $a = preg_split('/<(.*)>/U', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
-
- foreach ($a as $i => $e) {
-
- if ($i % 2 == 0) {
-
- if ($this->HREF) {
- $this->PutLink($this->HREF, $e);
- }
- else {
- $this->Write(5, $e);
- }
- }
- else {
- if ($e{0} == '/') {
- $this->CloseTag(strtoupper(substr($e, 1)));
- }
- else {
- $a2 = explode(' ', $e);
- $tag = strtoupper(array_shift($a2));
- $attr = array();
-
- foreach ($a2 as $v) {
-
- if (ereg('^([^=]*)=["\']?([^"\']*)["\']?$', $v, $a3)) {
- $attr[strtoupper($a3[1])] = $a3[2];
- }
- $this->OpenTag($tag, $attr);
- }
- }
- }
- }
- }
-
- function OpenTag($tag, $attr) {
-
- if ($tag == 'B' or $tag == 'I' or $tag == 'U') {
- $this->SetStyle($tag, true);
- }
-
- if ($tag == 'A') {
- $this->HREF = $attr['HREF'];
- }
-
- if ($tag == 'BR') {
- $this->Ln(5);
- }
- }
-
- function CloseTag($tag) {
-
- if ($tag == 'B' or $tag == 'I' or $tag == 'U') {
- $this->SetStyle($tag, false);
- }
-
- if ($tag == 'A') {
- $this->HREF = '';
- }
- }
-
- function SetStyle($tag, $enable) {
-
- $this->$tag += ($enable ? 1 : -1);
- $style = '';
-
- foreach (array('B', 'I', 'U') as $s) {
-
- if ($this->$s > 0) {
- $style .= $s;
- }
- }
- $this->SetFont('', $style);
- }
-
- function PutLink($URL, $txt) {
-
- $this->SetTextColor(0, 0, 255);
- $this->SetStyle('U', true);
- $this->Write(5, $txt, $URL);
- $this->SetStyle('U', false);
- $this->SetTextColor(0);
- }
-}
function show_maj_avatar_image($author_username,$max_img_width=80) {
@@ -460,7 +373,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-gif.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-gif.txt")) {
$avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
@@ -504,7 +417,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-jpg.txt")) {
$avatar_jpg_image_resize = imagecreatetruecolor($avatar_jpg_image_width,$avatar_jpg_image_height);
$avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
@@ -534,7 +447,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-png.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-png.txt")) {
$avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
@@ -571,7 +484,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
$avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-gif.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-gif.txt")) {
$avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
@@ -615,7 +528,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
$avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-jpg.txt")) {
$avatar_jpg_image_resize = imagecreatetruecolor($avatar_jpg_image_width,$avatar_jpg_image_height);
$avatar_jpg_image_original = imagecreatefromjpeg("images/members/$author_username/avatar.jpg");
@@ -644,7 +557,7 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
$avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
$avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- if (file_exists("data/avatar-resize-png.txt")) {
+ if (file_exists("$maj_data_directory/avatar-resize-png.txt")) {
$avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
@@ -670,14 +583,14 @@ function show_maj_avatar_image($author_username,$max_img_width=80) {
echo "<b>$author_username</b></a><br>";
- if (($maj_admin_username == $author_username) and file_exists("data/rank.txt")) {
+ if (($maj_admin_username == $author_username) and file_exists("$maj_data_directory/rank.txt")) {
echo "administrator<br>";
}
- elseif (file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/$author_username/rank.txt");
+ elseif (file_exists("$maj_data_directory/members/active/$author_username/rank.txt") and file_exists("$maj_data_directory/rank.txt")) {
+ $rank = file_get_contents("$maj_data_directory/members/active/$author_username/rank.txt");
echo "$rank<br>";
}
- elseif (!file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
+ elseif (!file_exists("$maj_data_directory/members/active/$author_username/rank.txt") and file_exists("$maj_data_directory/rank.txt")) {
echo "member<br>";
}
}
diff --git a/del.php b/del.php
index 7dacf68..3439ff8 100644
--- a/del.php
+++ b/del.php
@@ -49,11 +49,6 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
rmdirr("data/items/{$_REQUEST['entry']}/filedrop");
header("Location: index.php?entry={$_REQUEST['entry']}");
}
-
- if ($_REQUEST['target'] == "pdf") {
- rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
- header("Location: index.php?entry={$_REQUEST['entry']}");
- }
}
if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type'])) {
diff --git a/edit.php b/edit.php
index a8af112..4d2745f 100644
--- a/edit.php
+++ b/edit.php
@@ -7,39 +7,33 @@
require("core.php");
- if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
- }
-
- $login_username = file_get_contents("data/username.txt");
-
if (isset($_POST['title_input']) and isset($_POST['body_input'])) {
- header("Location: edit.php?entry={$_REQUEST['entry']}");
+ header("Location: edit.php?entry=$maj_req_entry");
}
- if (!isset($_REQUEST['entry'])) {
+ if (!isset($maj_req_entry)) {
exit();
}
- if (!file_exists("data/items/{$_REQUEST['entry']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry")) {
exit();
}
- if (!isset($_SESSION['logged_in'])) {
+ if (!isset($maj_logged_in_username)) {
exit();
}
$do = 0;
- if (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt") and file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") and file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_req_entry/author.txt") == $maj_logged_in_username))) {
$do = 1;
}
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
$do = 0;
}
- if ($_SESSION['logged_in'] == $login_username) {
+ if ($maj_logged_in_username == $maj_admin_username) {
$do = 1;
}
@@ -47,209 +41,62 @@
exit();
}
- $title_file = "data/items/{$_REQUEST['entry']}/title.txt";
- $body_file = "data/items/{$_REQUEST['entry']}/body.txt";
- $date_file = "data/items/{$_REQUEST['entry']}/date.txt";
- $img_file = "data/items/{$_REQUEST['entry']}/image.txt";
- $revisions_file = "data/items/{$_REQUEST['entry']}/revisions.txt";
+ $title_file = "$maj_data_directory/items/$maj_req_entry/title.txt";
+ $body_file = "$maj_data_directory/items/$maj_req_entry/body.txt";
+ $date_file = "$maj_data_directory/items/$maj_req_entry/date.txt";
+ $img_file = "$maj_data_directory/items/$maj_req_entry/image.txt";
+ $revisions_file = "$maj_data_directory/items/$maj_req_entry/revisions.txt";
- $server_upload_max_filesize = return_bytes(ini_get('upload_max_filesize'));
- $server_post_max_size = return_bytes(ini_get('post_max_size'));
- $server_memory_limit = return_bytes(ini_get('memory_limit'));
-
- $max_file_size = $server_upload_max_filesize;
-
- if ($server_upload_max_filesize > $server_post_max_size) {
- $max_file_size = $server_post_max_size;
- }
-
- if ($server_post_max_size > $server_memory_limit) {
- $max_file_size = $server_memory_limit;
- }
?>
<title>Edit</title>
-<style>
-
-body {
- color: #666666;
- margin: 10px;
- padding: 0px;
- text-align: left;
- font-family: <?php
- if (file_exists("data/fonts/body.txt")) {
- $font_body = file_get_contents("data/fonts/body.txt");
- echo "{$font_body},";
- }
-?> arial, helvetica, sans-serif;
- background-color: #ffffff;
-}
-
-p, td {
- font-size: 11px;
-}
-
-a {
- font-weight: bold;
- text-decoration: none;
-}
-
-a:link, a:visited {
- color: #666666;
-}
-
-a:hover {
- color: #336699;
-}
-
-a:active {
- color: #336699;
-}
-
-.input_title {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 520px;
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- font-weight: bold
-}
-
-.input_body {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 520px;
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px
-}
-
-#panel_title {
- font-family: <?php
- if (file_exists("data/fonts/panel-title.txt")) {
- $font_panel_title = file_get_contents("data/fonts/panel-title.txt");
- echo "{$font_panel_title},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 12px;
- font-weight: bold;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 1px 1px 0px 1px;
- border-style: solid solid none solid;
-}
-
-#panel_body {
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 1px 1px 1px 1px;
- border-style: solid solid solid solid;
-}
-
-#panel_footer {
- font-family: <?php
- if (file_exists("data/fonts/panel-footer.txt")) {
- $font_panel_footer = file_get_contents("data/fonts/panel-footer.txt");
- echo "{$font_panel_footer},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px;
- color: #666666;
- padding: 4px 4px 4px 4px;
- background-color: #ffffff;
- margin: 0px;
- border-color: #cccccc;
- border-width: 0px 1px 1px 1px;
- border-style: none solid solid solid;
-}
-
-.input_cat {
- color: #666666;
- background: #ffffff;
- border: #999999 solid 1px;
- width: 40px;
- font-family: <?php
- if (file_exists("data/fonts/panel-body.txt")) {
- $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
- echo "{$font_panel_body},";
- }
-?> arial, helvetica, sans-serif;
- font-size: 11px
-}
-
<?php
- if (file_exists("data/css.txt")) {
- readfile("data/css.txt");
- }
-?>
-</style>
+ include("css.php");
+
+?>
<?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")) {
- mkdir("data/items/{$_REQUEST['entry']}/members");
+ if (($_POST['auth_toggle'] == "ack") and file_exists("$maj_data_directory/members/active/{$_POST['auth_member']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
- mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/imembers")) {
- mkdir("data/items/{$_REQUEST['entry']}/imembers");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/imembers")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/imembers");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
- mkdir("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/imembers/{$_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 (($_POST['auth_toggle'] == "nak") and file_exists("$maj_data_directory/members/active/{$_POST['auth_member']}")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/{$_POST['auth_member']}");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/imembers/{$_POST['auth_member']}");
}
}
}
- if (isset($_POST['category']) and !empty($_POST['category'])) {
- if (file_exists("data/categories/{$_REQUEST['category']}/members")) {
- if ($dh_cat_members = opendir("data/categories/{$_REQUEST['category']}/members")) {
+ if (isset($maj_req_category) and !empty($maj_req_category)) {
+ if (file_exists("$maj_data_directory/categories/$maj_req_category/members")) {
+ if ($dh_cat_members = opendir("$maj_data_directory/categories/$maj_req_category/members")) {
while (($get_cat_member = readdir($dh_cat_members)) !== false) {
if ($get_cat_member != "." && $get_cat_member != "..") {
- if (file_exists("data/members/active/$get_cat_member")) {
+ if (file_exists("$maj_data_directory/members/active/$get_cat_member")) {
$get_cat_members[] = $get_cat_member;
} else {
- rmdirr("data/categories/{$_REQUEST['category']}/members/$get_cat_member");
+ rmdirr("$maj_data_directory/categories/$maj_req_category/members/$get_cat_member");
}
}
}
@@ -257,15 +104,15 @@ a:active {
}
}
- if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
- rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ if (($_POST['do'] == "unfile") and file_exists("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category");
- if (count(glob("data/items/{$_REQUEST['entry']}/categories/*")) < 1) {
- rmdirr("data/items/{$_REQUEST['entry']}/categories");
+ if (count(glob("$maj_data_directory/items/$maj_req_entry/categories/*")) < 1) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/categories");
}
- if (file_exists("data/categories")) {
- if ($dh_get_categories = opendir("data/categories")) {
+ if (file_exists("$maj_data_directory/categories")) {
+ if ($dh_get_categories = opendir("$maj_data_directory/categories")) {
while (($get_category = readdir($dh_get_categories)) !== false) {
if ($get_category != "." && $get_category != "..") {
$get_categories[] = $get_category;
@@ -278,28 +125,28 @@ a:active {
$count_mem = 0;
foreach ($get_categories as $get_category) {
- if (file_exists("data/categories/$get_category/members/$get_cat_mem") and ($_REQUEST['category'] != $get_category) and file_exists("data/items/{$_REQUEST['entry']}/categories/$get_category")) {
+ if (file_exists("$maj_data_directory/categories/$get_category/members/$get_cat_mem") and ($maj_req_category != $get_category) and file_exists("$maj_data_directory/items/$maj_req_entry/categories/$get_category")) {
$count_mem = $count_mem + 1;
}
}
- if (($count_mem < 1) and !file_exists("data/items/{$_REQUEST['entry']}/imembers/$get_cat_mem")) {
- rmdirr("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+ if (($count_mem < 1) and !file_exists("$maj_data_directory/items/$maj_req_entry/imembers/$get_cat_mem")) {
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem");
}
}
}
}
- if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
- mkdir("data/items/{$_REQUEST['entry']}/categories");
+ if (($_POST['do'] == "file") and !file_exists("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/categories");
}
- mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ mkdir("$maj_data_directory/items/$maj_req_entry/categories/$maj_req_category");
foreach ($get_cat_members as $get_cat_mem) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/$get_cat_mem")) {
- mkdir("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/members/$get_cat_mem");
}
}
}
@@ -318,12 +165,12 @@ a:active {
$comment_txt = str_replace('=)', '<img src="images/smileys/surprised.png" border="0">', $comment_txt);
$comment_txt = str_replace(':\\', '<img src="images/smileys/undecided.png" border="0">', $comment_txt);
$comment_txt = str_replace(';)', '<img src="images/smileys/wink.png" border="0">', $comment_txt);
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+ $comment_txt_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
$open_comment_txt_file = fopen($comment_txt_file, "w");
fwrite($open_comment_txt_file, $comment_txt);
fclose($open_comment_txt_file);
- $comment_revisions_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
+ $comment_revisions_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt";
$fp_comment_revisions_file = fopen($comment_revisions_file, "r");
$comment_revisions_count = fread($fp_comment_revisions_file, filesize($comment_revisions_file));
fclose($fp_comment_revisions_file);
@@ -335,28 +182,28 @@ a:active {
}
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}")) {
exit();
}
?>
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="520">
- <div id="panel_title"><?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt");
+ <div class="panel_title"><?php
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/firstname.txt");
?> <?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/lastname.txt");
?> <<?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/email.txt");
?>></div>
- <div id="panel_body"><?php
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt");
+ <div class="panel_body"><?php
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt");
?></div>
- <div id="panel_footer"><font style="font-size: 10px; color: #999999;">
+ <div class="panel_footer"><font style="font-size: 10px; color: #999999;">
<?php
entry2date($_REQUEST['comment']);
- if (file_exists("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt")) {
echo " (Revision ";
- readfile("data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/revisions.txt");
echo ")";
}
?>
@@ -365,8 +212,8 @@ a:active {
<table border="0" cellspacing="2" cellpadding="0">
<form enctype="multipart/form-data" action="edit.php" method="post">
- <tr><td><textarea class="input_body" name="comment_txt" rows="10"><?php
- $comment_txt_file = "data/items/{$_REQUEST['entry']}/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
+ <tr><td><textarea class="input" name="comment_txt" rows="10"><?php
+ $comment_txt_file = "$maj_data_directory/items/$maj_req_entry/comments/{$_REQUEST['type']}/{$_REQUEST['comment']}/comment.txt";
$open_comment_txt_file = fopen($comment_txt_file, "r");
$read_comment_txt_file = fread($open_comment_txt_file, filesize($comment_txt_file));
fclose($open_comment_txt_file);
@@ -386,7 +233,7 @@ a:active {
echo $comment_smiley2emoticon;
?></textarea></td></tr>
<tr><td><input type="hidden" name="entry" value="<?php
- echo $_REQUEST['entry'];
+ echo $maj_req_entry;
?>"></td></tr>
<tr><td><input type="hidden" name="comment" value="<?php
echo $_REQUEST['comment'];
@@ -394,17 +241,17 @@ a:active {
<tr><td><input type="hidden" name="type" value="<?php
echo $_REQUEST['type'];
?>"></td></tr>
- <tr><td><input class="input_body" type="submit" value="click here to update this comment"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to update this comment"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php?entry=<?php
- echo $_REQUEST['entry'];
+ echo $maj_req_entry;
?>&show=comments" method="post">
- <tr><td><input class="input_body" type="submit" value="click here to view posted entry"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to view posted entry"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php" method="post">
- <tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
+ <tr><td><input class="click" style="width: 520px;" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -413,53 +260,60 @@ a:active {
}
?>
-<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
+<table border="0" cellspacing="0" cellpadding="0">
+
+<tr>
+<td rowspan="2" width="<?php echo $maj_wspace; ?>"><div style="width: <?php echo $maj_wspace; ?>px;"></div></td>
+<td colspan="3" height="<?php echo $maj_wspace; ?>"><div style="height: <?php echo $maj_wspace; ?>px;"></div></td>
+<td rowspan="2" width="<?php echo $maj_wspace; ?>"><div style="width: <?php echo $maj_wspace; ?>px;"></div></td>
+</tr>
+
+<tr><td valign="top">
+
+<table border="0" cellspacing="0" cellpadding="0"><tr><td width="520">
-<table border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc"><tr><td width="520">
+<div class="panel_wrapper">
-<div id="panel_title"><?php
+<div class="panel_title"><?php
readfile($title_file);
?></div>
-<div id="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php
- readfile($body_file);
-?></td></tr></table></div>
-<div id="panel_footer"><font style="font-size: 10px; color: #999999;"><?php
- if (file_exists("data/items/{$_REQUEST['entry']}/author.txt")) {
- readfile("data/items/{$_REQUEST['entry']}/author.txt");
+<div class="panel_body"><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php
+
+ echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
+
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/author.txt")) {
+ readfile("$maj_data_directory/items/$maj_req_entry/author.txt");
echo " - ";
}
- entry2date($_REQUEST['entry']);
+ entry2date($maj_req_entry);
if (file_exists($revisions_file)) {
echo ' (Revision ';
readfile($revisions_file);
echo " - ";
- echo date("l, M j, Y, g:i A", filemtime("data/items/{$_REQUEST['entry']}/body.txt"));
+ echo date("l, M j, Y, g:i A", filemtime("$maj_data_directory/items/$maj_req_entry/body.txt"));
echo ')';
}
-?>
-</font></div>
+ echo "</font><div style=\"height: {$maj_wspace}px;\"></div>";
+
+ readfile($body_file);
+?></td></tr></table></div></div>
</td></tr></table>
<form enctype="multipart/form-data" action="edit.php" method="post">
-<p><table border="0" cellspacing="2" cellpadding="0" bgcolor="#ffffff">
+<table border="0" cellspacing="2" cellpadding="0" bgcolor="#ffffff">
<?php
- if (($_SESSION['logged_in'] == $login_username) or (file_exists("data/members/active/{$_SESSION['logged_in']}/bb-ul.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}/bb-rw.txt"))) {
+ if (($maj_logged_in_username == $maj_admin_username) or (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-ul.txt") and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt"))) {
?>
<input type="hidden" name="max_file_size" value="<?php
echo $max_file_size;
?>">
-<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 GIF, JPG, or PNG entry image.</td></tr>
<tr><td><input type="hidden" name="max_file_size" value="<?php
echo $max_file_size;
@@ -468,36 +322,42 @@ a:active {
echo($max_file_size / (1024 * 1024));
?>MB.</td></tr>
+<tr><td><input autocomplete="off" type="file" name="album_image_input"> Upload optional album image.</td></tr>
+<tr><td><input autocomplete="off" type="text" name="caption" class="input"> Enter optional album image caption.</td></tr>
+<tr><td><input type="hidden" name="max_file_size" value="<?php
+ echo $max_file_size;
+?>"></td></tr>
+
<?php
}
- if ($_SESSION['logged_in'] == $login_username) {
+ if ($maj_logged_in_username == $maj_admin_username) {
?>
- <tr><td><input autocomplete="off" type="password" name="passwd" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+ <tr><td><input class="input" autocomplete="off" type="password" name="passwd" <?php
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
echo "value=\"password\"";
}
?>
> <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
echo "Enter new password or clear field to disable password protection.";
} else {
- echo "Enter optional password.";
+ echo "Enter optional entry access password.";
}
?></td></tr>
- <tr><td><input autocomplete="off" type="text" name="maxlines" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+ <tr><td><input class="input" autocomplete="off" type="text" name="maxlines" <?php
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
echo "value=\"";
- readfile("data/items/{$_REQUEST['entry']}/maxlines.txt");
+ readfile("$maj_data_directory/items/$maj_req_entry/maxlines.txt");
echo "\"";
}
?>
> <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
echo "Enter new maximum lines for initial display or clear field to disable.";
} else {
echo "Enter optional maximum lines for initial display.";
@@ -505,39 +365,34 @@ a:active {
?></td></tr>
<tr><td><input type="checkbox" name="sticky" <?php
- $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+ $sticky_sem = 'data/sticky/' . $maj_req_entry;
if (file_exists($sticky_sem)) {
echo checked;
}
?>>Put entry title in Quick Links box.</td></tr>
- <tr><td><input type="checkbox" name="pdf" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- echo checked;
- }
-?>>Allow PDF generation for this entry.</td></tr>
<tr><td><input type="checkbox" name="display" <?php
- $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+ $display_sem = "$maj_data_directory/items/$maj_req_entry/cat.txt";
if (file_exists($display_sem)) {
echo checked;
}
?>>Always display. If this is not a private entry, it will be displayed even if its category is hidden or isolated.</td></tr>
<tr><td><input type="checkbox" name="private" <?php
- $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
+ $private_sem = "$maj_data_directory/items/$maj_req_entry/private.txt";
if (file_exists($private_sem)) {
echo checked;
}
?>>Private entry. This entry will unconditionally be invisible to visitors<?php
- if (file_exists("data/ml.txt")) {
+ if (file_exists("$maj_data_directory/ml.txt")) {
echo " and to the mailing list";
}
?>, even if always display is set.</td></tr>
<?php
- if (file_exists("data/bb.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt")) {
?>
<tr><td><input type="checkbox" name="member" <?php
- $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+ $member_sem = "$maj_data_directory/items/$maj_req_entry/member.txt";
if (file_exists($member_sem)) {
echo checked;
}
@@ -548,17 +403,17 @@ a:active {
?>
<?php
- if (file_exists("data/bb.txt") and file_exists("data/wiki.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/wiki.txt")) {
?>
<tr><td><input type="checkbox" name="edit" <?php
- $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+ $edit_sem = "$maj_data_directory/items/$maj_req_entry/edit.txt";
if (file_exists($edit_sem)) {
echo checked;
}
?>>Registered members can edit this entry.</td></tr>
<tr><td><input type="checkbox" name="lock" <?php
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
echo checked;
}
?>>Only the administrator can edit this entry. </td></tr>
@@ -568,7 +423,7 @@ a:active {
?>
<tr><td><input type="checkbox" name="xtitle" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/xtitle.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/xtitle.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -579,7 +434,7 @@ a:active {
?>
<tr><td><input type="checkbox" name="xdate" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/xdate.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/xdate.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -587,11 +442,11 @@ a:active {
<?php
-if (!file_exists("data/avatar.txt")) {
+if (!file_exists("$maj_data_directory/avatar.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"xauthor\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/xauthor.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/xauthor.txt")) {
echo checked;
}
@@ -600,7 +455,7 @@ if (!file_exists("data/avatar.txt")) {
else {
echo "<tr><td><input type=\"checkbox\" name=\"xavatar\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/xavatar.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/xavatar.txt")) {
echo checked;
}
@@ -611,7 +466,7 @@ else {
<tr><td><input type="checkbox" name="lastmod" <?php
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/lastmod.txt";
if (file_exists($lastmod_sem)) {
echo checked;
}
@@ -619,26 +474,26 @@ else {
<?php
-if (file_exists("data/fb.txt")) {
+if (file_exists("$maj_data_directory/fb.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"fb\"";
- if (file_exists("data/items/{$_REQUEST['entry']}/fb.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/fb.txt")) {
echo checked;
}
echo ">Enable Facebook support.</td></tr>";
}
-if (file_exists("images/{$_REQUEST['entry']}/album")) {
+if (file_exists("images/$maj_req_entry/album")) {
- $count_album_images = count(glob("images/{$_REQUEST['entry']}/album/*"));
+ $count_album_images = count(glob("images/$maj_req_entry/album/*"));
if ($count_album_images < 1) {
- rmdirr("images/{$_REQUEST['entry']}/album");
+ rmdirr("images/$maj_req_entry/album");
}
else {
- if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
echo "<tr><td><input type=\"checkbox\" name=\"auto_album\" checked>";
}
else {
@@ -646,10 +501,10 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if ($count_album_images > 1) {
- echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images images</a>).</td></tr>";
+ echo "Automatically display album (<a href=\"index.php?entry=$maj_req_entry&show=album\">$count_album_images images</a>).</td></tr>";
}
else {
- echo "Automatically display album (<a href=\"index.php?entry={$_REQUEST['entry']}&show=album\">$count_album_images image</a>).</td></tr>";
+ echo "Automatically display album (<a href=\"index.php?entry=$maj_req_entry&show=album\">$count_album_images image</a>).</td></tr>";
}
}
}
@@ -658,17 +513,13 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
</table></p>
-<input type="hidden" name="entry" value="<?php
- echo $_REQUEST['entry'];
-?>">
+<input type="hidden" name="entry" value="<?php echo $maj_req_entry; ?>">
<table border="0" cellspacing="0" cellpadding="0"><tr><td>
<table border="0" cellspacing="2" cellpadding="0">
-<tr><td><input required autocomplete="off" class="input_title" type="text" name="title_input" value="<?php
- readfile($title_file);
-?>"></td></tr>
-<tr><td><textarea class="input_body" name="body_input" rows="15" required>
+<tr><td><input required autocomplete="off" class="input" style="width: 520px; font-size: <?php echo $maj_font_Lpx; ?>; font-weight: bold;" type="text" name="title_input" value="<?php readfile($title_file); ?>"></td></tr>
+<tr><td><textarea class="input" style="width: 520px; font-size: <?php echo $maj_font_Mpx; ?>;" name="body_input" rows="15" required>
<?php
$open_body_file = fopen($body_file, "r");
$read_body_file = fread($open_body_file, filesize($body_file));
@@ -693,17 +544,15 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
echo $body_read_content;
?>
</textarea></td></tr>
-<tr><td><input class="input_body" type="submit" value="click here to update this entry"></td></tr>
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to update this entry"></td></tr>
</form>
-<form enctype="multipart/form-data" action="index.php?entry=<?php
- echo $_REQUEST['entry'];
-?>" method="post">
-<tr><td><input class=input_body type=submit value="click here to view posted entry"></td></tr>
+<form enctype="multipart/form-data" action="index.php?entry=<?php echo $maj_req_entry; ?>" method="post">
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to view posted entry"></td></tr>
</form>
<form enctype="multipart/form-data" action="index.php" method="post">
-<tr><td><input class="input_body" type="submit" value="click here to go to the index page"></td></tr>
+<tr><td><input class="click" style="width: 520px;" type="submit" value="click here to go to the index page"></td></tr>
</form>
</table>
@@ -730,21 +579,21 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
<?php
// improve category handling (20100221) - start
- if (file_exists("data/categories")) {
+ if (file_exists("$maj_data_directory/categories")) {
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- if ($dh_cat = opendir("data/categories")) {
+ if ($dh_cat = opendir("$maj_data_directory/categories")) {
while (($entry_cat = readdir($dh_cat)) !== false) {
if ($entry_cat != "." && $entry_cat != "..") {
- if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
+ if (file_exists("$maj_data_directory/categories/$entry_cat/private.txt") and ($maj_admin_username != $maj_logged_in_username)) {
continue;
}
- if (file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories/$entry_cat")) {
$filed_cat[] = $entry_cat;
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/categories/$entry_cat")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/categories/$entry_cat")) {
$unfiled_cat[] = $entry_cat;
}
}
@@ -768,7 +617,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
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=\"entry\" value=\"$maj_req_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>";
@@ -788,7 +637,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
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=\"entry\" value=\"$maj_req_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>";
@@ -806,16 +655,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
// add member authorization (20100221) - start
- if (file_exists("data/members/active")) {
+ if (file_exists("$maj_data_directory/members/active")) {
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td valign=\"top\" width=\"150\">";
- if ($dh_ack_members = opendir("data/items/{$_REQUEST['entry']}/members")) {
+ if ($dh_ack_members = opendir("$maj_data_directory/items/$maj_req_entry/members")) {
while (($ack_member = readdir($dh_ack_members)) !== false) {
if ($ack_member != "." && $ack_member != "..") {
- if (file_exists("data/members/active/$ack_member")) {
+ if (file_exists("$maj_data_directory/members/active/$ack_member")) {
$ack_members[] = $ack_member;
} else {
- rmdirr("data/items/{$_REQUEST['entry']}/members/$ack_member");
+ rmdirr("$maj_data_directory/items/$maj_req_entry/members/$ack_member");
}
}
}
@@ -825,14 +674,14 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$count_ack_members = count($ack_members);
}
- if ($dh_nak_members = opendir("data/members/active")) {
+ if ($dh_nak_members = opendir("$maj_data_directory/members/active")) {
while (($nak_member = readdir($dh_nak_members)) !== false) {
if ($nak_member != "." && $nak_member != "..") {
- if (file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/members/$nak_member")) {
continue;
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/members/$nak_member")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/members/$nak_member")) {
$nak_members[] = $nak_member;
}
}
@@ -850,12 +699,12 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
foreach ($ack_members as $ack_member) {
- if ($_SESSION['logged_in'] == $nak_member) {
+ if ($maj_logged_in_username == $nak_member) {
continue;
}
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=\"entry\" value=\"$maj_req_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>";
@@ -874,12 +723,12 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
foreach ($nak_members as $nak_member) {
- if ($_SESSION['logged_in'] == $nak_member) {
+ if ($maj_logged_in_username == $nak_member) {
continue;
}
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=\"entry\" value=\"$maj_req_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>";
@@ -902,16 +751,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
exit();
}
- if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
- unlink("data/items/{$_REQUEST['entry']}/title.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/title.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/title.old");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
- unlink("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/body.old")) {
+ unlink("$maj_data_directory/items/$maj_req_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");
+ copy("$maj_data_directory/items/$maj_req_entry/title.txt", "$maj_data_directory/items/$maj_req_entry/title.old");
+ copy("$maj_data_directory/items/$maj_req_entry/body.txt", "$maj_data_directory/items/$maj_req_entry/body.old");
$title_write_content = format_title_put($_POST['title_input']);
$body_write_content = format_body_put($_POST['body_input']);
@@ -932,33 +781,33 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (($_FILES['album_image_input']['type'] == "image/gif") || ($_FILES['album_image_input']['type'] == "image/pjpeg") || ($_FILES['album_image_input']['type'] == "image/jpeg") || ($_FILES['album_image_input']['type'] == "image/png")) {
$album_image_input_name = str_replace(" ", "_", $_FILES['album_image_input']['name']);
- if (!file_exists("images/{$_REQUEST['entry']}/album/$album_image_input_name")) {
- if (!file_exists("images/{$_REQUEST['entry']}")) {
- mkdir("images/{$_REQUEST['entry']}");
+ if (!file_exists("images/$maj_req_entry/album/$album_image_input_name")) {
+ if (!file_exists("images/$maj_req_entry")) {
+ mkdir("images/$maj_req_entry");
}
- if (!file_exists("images/{$_REQUEST['entry']}/album")) {
- mkdir("images/{$_REQUEST['entry']}/album");
+ if (!file_exists("images/$maj_req_entry/album")) {
+ mkdir("images/$maj_req_entry/album");
}
- if (!file_exists("data/albums")) {
- mkdir("data/albums");
+ if (!file_exists("$maj_data_directory/albums")) {
+ mkdir("$maj_data_directory/albums");
}
- if (!file_exists("data/albums/{$_REQUEST['entry']}")) {
- mkdir("data/albums/{$_REQUEST['entry']}");
+ if (!file_exists("$maj_data_directory/albums/$maj_req_entry")) {
+ mkdir("$maj_data_directory/albums/$maj_req_entry");
}
if (isset($_POST['caption']) and !empty($_POST['caption'])) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/album")) {
- mkdir("data/items/{$_REQUEST['entry']}/album");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/album");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions")) {
- mkdir("data/items/{$_REQUEST['entry']}/album/captions");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album/captions")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/album/captions");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/album/captions/{$album_image_input_name}.txt")) {
$caption_txt = ucfirst($_POST['caption']);
$caption_txt = str_replace(':((', '<img src="images/smileys/crying.png" border="0">', $caption_txt);
$caption_txt = str_replace(':(', '<img src="images/smileys/frown.png" border="0">', $caption_txt);
@@ -990,14 +839,14 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$caption_txt = str_replace('<highlight>', '<span style="background-color: #ffff00;">', $caption_txt);
$caption_txt = str_replace('</highlight>', '</span>', $caption_txt);
- $fp_caption_txt = fopen("data/items/{$_REQUEST['entry']}/album/captions/{$album_image_input_name}.txt", "w");
+ $fp_caption_txt = fopen("$maj_data_directory/items/$maj_req_entry/album/captions/{$album_image_input_name}.txt", "w");
fwrite($fp_caption_txt, $caption_txt);
fclose($fp_caption_txt);
}
}
- $res = copy($_FILES['album_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/album/$album_image_input_name");
+ $res = copy($_FILES['album_image_input']['tmp_name'], "images/$maj_req_entry/album/$album_image_input_name");
unlink($_FILES['album_image_input']['tmp_name']);
} else {
unlink($_FILES['album_image_input']['tmp_name']);
@@ -1020,16 +869,16 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$entry_image_input_name = str_replace(" ", "_", $_FILES['entry_image_input']['name']);
- if (!file_exists("images/{$_REQUEST['entry']}/$entry_image_input_name")) {
- if (!file_exists("images/{$_REQUEST['entry']}")) {
- mkdir("images/{$_REQUEST['entry']}");
+ if (!file_exists("images/$maj_req_entry/$entry_image_input_name")) {
+ if (!file_exists("images/$maj_req_entry")) {
+ mkdir("images/$maj_req_entry");
}
- $res = copy($_FILES['entry_image_input']['tmp_name'], "images/{$_REQUEST['entry']}/$entry_image_input_name");
+ $res = copy($_FILES['entry_image_input']['tmp_name'], "images/$maj_req_entry/$entry_image_input_name");
unlink($_FILES['entry_image_input']['tmp_name']);
- $entry_image_size = getimagesize("images/{$_REQUEST['entry']}/$entry_image_input_name");
+ $entry_image_size = getimagesize("images/$maj_req_entry/$entry_image_input_name");
$entry_image_width = $entry_image_size[0];
$entry_image_height = $entry_image_size[1];
@@ -1041,7 +890,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
$entry_image_height = (int)($entry_image_height * $sizefactor);
}
- $body_write_content = "<img src=\"images/{$_REQUEST['entry']}/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$body_write_content";
+ $body_write_content = "<img src=\"images/$maj_req_entry/$entry_image_input_name\" border=\"0\" width=\"$entry_image_width\" height=\"$entry_image_height\">\n\r$body_write_content";
} else {
unlink($_FILES['entry_image_input']['tmp_name']);
}
@@ -1059,23 +908,23 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (isset($_FILES['file_input']) and !empty($_FILES['file_input'])) {
if (is_uploaded_file($_FILES['file_input']['tmp_name'])) {
if ($_FILES['file_input']['size'] <= $max_file_size) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop")) {
- mkdir("data/items/{$_REQUEST['entry']}/filedrop");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/filedrop");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files")) {
- mkdir("data/items/{$_REQUEST['entry']}/filedrop/files");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop/files")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/filedrop/files");
}
$file_input_name = str_replace(" ", "_", $_FILES['file_input']['name']);
- if (!file_exists("data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name")) {
- $res = copy($_FILES['file_input']['tmp_name'], "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name")) {
+ $res = copy($_FILES['file_input']['tmp_name'], "$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name");
unlink($_FILES['file_input']['tmp_name']);
- $fp_file_txt = fopen("data/items/{$_REQUEST['entry']}/filedrop/{$file_input_name}.txt", "w");
- fwrite($fp_file_txt, "data/items/{$_REQUEST['entry']}/filedrop/files/$file_input_name");
+ $fp_file_txt = fopen("$maj_data_directory/items/$maj_req_entry/filedrop/{$file_input_name}.txt", "w");
+ fwrite($fp_file_txt, "$maj_data_directory/items/$maj_req_entry/filedrop/files/$file_input_name");
fclose($fp_file_txt);
} else {
unlink($_FILES['file_input']['tmp_name']);
@@ -1088,49 +937,49 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- if (file_exists("data/wiki.txt")) {
- $old_title = file_get_contents("data/items/{$_REQUEST['entry']}/title.old");
- $old_body = file_get_contents("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/wiki.txt")) {
+ $old_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.old");
+ $old_body = file_get_contents("$maj_data_directory/items/$maj_req_entry/body.old");
if (($old_title != $title_write_content) or ($old_body != $body_write_content)) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki/delta");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki/delta")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki/delta");
}
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
+ if (file_exists("$maj_data_directory/offset.txt")) {
+ $offset = file_get_contents("$maj_data_directory/offset.txt");
} else {
$offset = 0;
}
$ddate = date("YmdHis", time() + $offset);
- if (!file_exists("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate")) {
- mkdir("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate");
}
- $new_body = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/body.txt", "w");
+ $new_body = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/body.txt", "w");
fwrite($new_body, $body_write_content);
fclose($new_body);
- $new_title = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/title.txt", "w");
+ $new_title = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/title.txt", "w");
fwrite($new_title, $title_write_content);
fclose($new_title);
- copy("data/items/{$_REQUEST['entry']}/title.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/ptitle.txt");
- copy("data/items/{$_REQUEST['entry']}/body.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/prev.txt");
- copy("data/items/{$_REQUEST['entry']}/date.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/date.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/title.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/ptitle.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/body.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/prev.txt");
+ copy("$maj_data_directory/items/$maj_req_entry/date.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/date.txt");
- if (file_exists("data/items/{$_REQUEST['entry']}/contrib.txt")) {
- copy("data/items/{$_REQUEST['entry']}/contrib.txt", "data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/contrib.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/contrib.txt")) {
+ copy("$maj_data_directory/items/$maj_req_entry/contrib.txt", "$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/contrib.txt");
}
- $open_editor_file = fopen("data/items/{$_REQUEST['entry']}/wiki/delta/$ddate/editor.txt", "w");
- fwrite($open_editor_file, $_SESSION['logged_in']);
+ $open_editor_file = fopen("$maj_data_directory/items/$maj_req_entry/wiki/delta/$ddate/editor.txt", "w");
+ fwrite($open_editor_file, $maj_logged_in_username);
fclose($open_editor_file);
}
}
@@ -1143,18 +992,18 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
fwrite($open_body_file, $body_write_content);
fclose($open_body_file);
- if (file_exists("data/wiki.txt") and (file_exists("data/items/{$_REQUEST['entry']}/edit.txt") or (file_get_contents("data/items/{$_REQUEST['entry']}/author.txt") == $_SESSION['logged_in']))) {
- $open_contrib_file = fopen("data/items/{$_REQUEST['entry']}/contrib.txt", "w");
- fwrite($open_contrib_file, $_SESSION['logged_in']);
+ if (file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_req_entry/author.txt") == $maj_logged_in_username))) {
+ $open_contrib_file = fopen("$maj_data_directory/items/$maj_req_entry/contrib.txt", "w");
+ fwrite($open_contrib_file, $maj_logged_in_username);
fclose($open_contrib_file);
}
- if ($_SESSION['logged_in'] == $login_username) {
- $sticky_sem = 'data/sticky/' . $_REQUEST['entry'];
+ if ($maj_logged_in_username == $maj_admin_username) {
+ $sticky_sem = 'data/sticky/' . $maj_req_entry;
if (isset($_POST['sticky']) and !empty($_POST['sticky']) and ($_POST['sticky'] == "on")) {
- if (!file_exists("data/sticky")) {
- mkdir("data/sticky");
+ if (!file_exists("$maj_data_directory/sticky")) {
+ mkdir("$maj_data_directory/sticky");
}
if (!file_exists($sticky_sem)) {
touch($sticky_sem);
@@ -1166,7 +1015,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+ $display_sem = "$maj_data_directory/items/$maj_req_entry/cat.txt";
if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
if (!file_exists($display_sem)) {
@@ -1179,7 +1028,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $private_sem = "data/items/{$_REQUEST['entry']}/private.txt";
+ $private_sem = "$maj_data_directory/items/$maj_req_entry/private.txt";
if (isset($_POST['private']) and !empty($_POST['private']) and ($_POST['private'] == "on")) {
if (!file_exists($private_sem)) {
@@ -1192,7 +1041,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $member_sem = "data/items/{$_REQUEST['entry']}/member.txt";
+ $member_sem = "$maj_data_directory/items/$maj_req_entry/member.txt";
if (isset($_POST['member']) and !empty($_POST['member']) and ($_POST['member'] == "on")) {
if (!file_exists($member_sem)) {
@@ -1205,7 +1054,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $edit_sem = "data/items/{$_REQUEST['entry']}/edit.txt";
+ $edit_sem = "$maj_data_directory/items/$maj_req_entry/edit.txt";
if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on")) {
if (!file_exists($edit_sem)) {
@@ -1220,21 +1069,21 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if (isset($_POST['lock']) and !empty($_POST['lock']) and ($_POST['lock'] == "on")) {
- if (file_exists("data/items/{$_REQUEST['entry']}/edit.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/edit.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/edit.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/edit.txt");
}
- if (!file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
- touch("data/items/{$_REQUEST['entry']}/lock.txt");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
+ touch("$maj_data_directory/items/$maj_req_entry/lock.txt");
}
}
if (!isset($_POST['lock']) or empty($_POST['lock'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/lock.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/lock.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/lock.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/lock.txt");
}
}
- $xtitle_sem = "data/items/{$_REQUEST['entry']}/xtitle.txt";
+ $xtitle_sem = "$maj_data_directory/items/$maj_req_entry/xtitle.txt";
if (isset($_POST['xtitle']) and !empty($_POST['xtitle']) and ($_POST['xtitle'] == "on")) {
if (!file_exists($xtitle_sem)) {
@@ -1248,7 +1097,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xdate_sem = "data/items/{$_REQUEST['entry']}/xdate.txt";
+ $xdate_sem = "$maj_data_directory/items/$maj_req_entry/xdate.txt";
if (isset($_POST['xdate']) and !empty($_POST['xdate']) and ($_POST['xdate'] == "on")) {
if (!file_exists($xdate_sem)) {
@@ -1262,7 +1111,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xauthor_sem = "data/items/{$_REQUEST['entry']}/xauthor.txt";
+ $xauthor_sem = "$maj_data_directory/items/$maj_req_entry/xauthor.txt";
if (isset($_POST['xauthor']) and !empty($_POST['xauthor']) and ($_POST['xauthor'] == "on")) {
if (!file_exists($xauthor_sem)) {
@@ -1276,7 +1125,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $xavatar_sem = "data/items/{$_REQUEST['entry']}/xavatar.txt";
+ $xavatar_sem = "$maj_data_directory/items/$maj_req_entry/xavatar.txt";
if (isset($_POST['xavatar']) and !empty($_POST['xavatar']) and ($_POST['xavatar'] == "on")) {
if (!file_exists($xavatar_sem)) {
@@ -1290,7 +1139,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
}
- $fb_sem = "data/items/{$_REQUEST['entry']}/fb.txt";
+ $fb_sem = "$maj_data_directory/items/$maj_req_entry/fb.txt";
if (isset($_POST['fb']) and !empty($_POST['fb']) and ($_POST['fb'] == "on")) {
if (!file_exists($fb_sem)) {
@@ -1305,7 +1154,7 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
- $lastmod_sem = "data/items/{$_REQUEST['entry']}/lastmod.txt";
+ $lastmod_sem = "$maj_data_directory/items/$maj_req_entry/lastmod.txt";
if (isset($_POST['lastmod']) and !empty($_POST['lastmod']) and ($_POST['lastmod'] == "on")) {
if (!file_exists($lastmod_sem)) {
@@ -1321,73 +1170,19 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
if (isset($_POST['auto_album']) and !empty($_POST['auto_album']) and ($_POST['auto_album'] == "on")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
- touch("data/items/{$_REQUEST['entry']}/auto-album.txt");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
+ touch("$maj_data_directory/items/$maj_req_entry/auto-album.txt");
}
}
if (!isset($_POST['auto_album']) or empty($_POST['auto_album'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/auto-album.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/auto-album.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/auto-album.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/auto-album.txt");
}
}
- if (isset($_POST['pdf']) and !empty($_POST['pdf']) and ($_POST['pdf'] == "on")) {
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf");
- }
-
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf/file");
- }
-
- if (!file_exists("data/items/{$_REQUEST['entry']}/pdf/count")) {
- mkdir("data/items/{$_REQUEST['entry']}/pdf/count");
- }
-
- $entry = $_REQUEST['entry'];
- $author_file = "data/author.txt";
- $title_file = "data/items/$entry/title.txt";
- $date_file = "data/items/$entry/date.txt";
- $body_file = "data/items/$entry/body.txt";
-
- $author = file_get_contents($author_file);
- $title = file_get_contents($title_file);
- $date = file_get_contents($date_file);
-
- $link = "<a href=\"http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry\">http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?entry=$entry</a>";
- $link = str_replace("pdf.php?entry=", "index.php?entry=", $link);
- $link = str_replace("edit.php?entry=", "index.php?entry=", $link);
-
- $body = file_get_contents($body_file);
- $body = str_replace("\n", "<br />", $body);
-
- $html = "<br><i>by $author</i><br><br>$date<br><br>Canonical Source<br>$link<br><br><br>$body";
-
- $filename = strtolower($title);
- $filename = strtolower($_SERVER['SERVER_NAME']) . "-" . $entry . "-" . $filename . ".pdf";
- $filename = str_replace(" ", "-", $filename);
- $filename = "data/items/$entry/pdf/file/$filename";
-
- $pdf = new PDF();
- $pdf->AddPage();
- $pdf->SetTitle($title);
- $pdf->SetAuthor($author);
- $pdf->SetFont('Helvetica', 'B', 14);
- $pdf->WriteHTML($title);
- $pdf->SetFont('Helvetica', '', 10);
- $pdf->WriteHTML($html);
- $pdf->Output($filename);
- }
-
- if (!isset($_POST['pdf']) or empty($_POST['pdf'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/pdf/file")) {
- rmdirr("data/items/{$_REQUEST['entry']}/pdf/file");
- }
- }
-
- $passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
+ $passwd_file = "$maj_data_directory/items/$maj_req_entry/passwd.txt";
if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
$fp_passwd_txt = fopen("$passwd_file", "w");
@@ -1405,28 +1200,28 @@ if (file_exists("images/{$_REQUEST['entry']}/album")) {
}
if (isset($_POST['maxlines']) and !empty($_POST['maxlines']) and is_numeric($_POST['maxlines'])) {
- $fp_maxlines_txt = fopen("data/items/{$_REQUEST['entry']}/maxlines.txt", "w");
+ $fp_maxlines_txt = fopen("$maj_data_directory/items/$maj_req_entry/maxlines.txt", "w");
fwrite($fp_maxlines_txt, $_POST['maxlines']);
fclose($fp_maxlines_txt);
}
if (!isset($_POST['maxlines']) or empty($_POST['maxlines'])) {
- if (file_exists("data/items/{$_REQUEST['entry']}/maxlines.txt")) {
- unlink("data/items/{$_REQUEST['entry']}/maxlines.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/maxlines.txt")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/maxlines.txt");
}
}
}
- if (file_exists("data/items/{$_REQUEST['entry']}/title.old")) {
- unlink("data/items/{$_REQUEST['entry']}/title.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/title.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/title.old");
}
- if (file_exists("data/items/{$_REQUEST['entry']}/body.old")) {
- unlink("data/items/{$_REQUEST['entry']}/body.old");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/body.old")) {
+ unlink("$maj_data_directory/items/$maj_req_entry/body.old");
}
- if (file_exists("data/ping.txt")) {
- $ping_urls = explode("|", file_get_contents("data/ping.txt"));
+ if (file_exists("$maj_data_directory/ping.txt")) {
+ $ping_urls = explode("|", file_get_contents("$maj_data_directory/ping.txt"));
foreach ($ping_urls as $ping_url) {
$ping = file_get_contents($ping_url);
diff --git a/font/helvetica.php b/font/helvetica.php
deleted file mode 100755
index ca94cdf..0000000
--- a/font/helvetica.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helvetica']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
diff --git a/font/helveticab.php b/font/helveticab.php
deleted file mode 100755
index 276cfa8..0000000
--- a/font/helveticab.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaB']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
diff --git a/font/helveticabi.php b/font/helveticabi.php
deleted file mode 100755
index 8d21774..0000000
--- a/font/helveticabi.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaBI']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
diff --git a/font/helveticai.php b/font/helveticai.php
deleted file mode 100755
index 88bf437..0000000
--- a/font/helveticai.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-$fpdf_charwidths['helveticaI']=array(
- chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
diff --git a/fpdf.php b/fpdf.php
deleted file mode 100644
index f0a3e45..0000000
--- a/fpdf.php
+++ /dev/null
@@ -1,1647 +0,0 @@
-<?php
-/*******************************************************************************
-* Software: FPDF *
-* Version: 1.53 *
-* Date: 2004-12-31 *
-* Author: Olivier PLATHEY *
-* License: Freeware *
-* *
-* You may use, modify and redistribute this software as you wish. *
-*******************************************************************************/
-
-if(!class_exists('FPDF'))
-{
-define('FPDF_VERSION','1.53');
-
-class FPDF
-{
-//Private properties
-var $page; //current page number
-var $n; //current object number
-var $offsets; //array of object offsets
-var $buffer; //buffer holding in-memory PDF
-var $pages; //array containing pages
-var $state; //current document state
-var $compress; //compression flag
-var $DefOrientation; //default orientation
-var $CurOrientation; //current orientation
-var $OrientationChanges; //array indicating orientation changes
-var $k; //scale factor (number of points in user unit)
-var $fwPt,$fhPt; //dimensions of page format in points
-var $fw,$fh; //dimensions of page format in user unit
-var $wPt,$hPt; //current dimensions of page in points
-var $w,$h; //current dimensions of page in user unit
-var $lMargin; //left margin
-var $tMargin; //top margin
-var $rMargin; //right margin
-var $bMargin; //page break margin
-var $cMargin; //cell margin
-var $x,$y; //current position in user unit for cell positioning
-var $lasth; //height of last cell printed
-var $LineWidth; //line width in user unit
-var $CoreFonts; //array of standard font names
-var $fonts; //array of used fonts
-var $FontFiles; //array of font files
-var $diffs; //array of encoding differences
-var $images; //array of used images
-var $PageLinks; //array of links in pages
-var $links; //array of internal links
-var $FontFamily; //current font family
-var $FontStyle; //current font style
-var $underline; //underlining flag
-var $CurrentFont; //current font info
-var $FontSizePt; //current font size in points
-var $FontSize; //current font size in user unit
-var $DrawColor; //commands for drawing color
-var $FillColor; //commands for filling color
-var $TextColor; //commands for text color
-var $ColorFlag; //indicates whether fill and text colors are different
-var $ws; //word spacing
-var $AutoPageBreak; //automatic page breaking
-var $PageBreakTrigger; //threshold used to trigger page breaks
-var $InFooter; //flag set when processing footer
-var $ZoomMode; //zoom display mode
-var $LayoutMode; //layout display mode
-var $title; //title
-var $subject; //subject
-var $author; //author
-var $keywords; //keywords
-var $creator; //creator
-var $AliasNbPages; //alias for total number of pages
-var $PDFVersion; //PDF version number
-
-/*******************************************************************************
-* *
-* Public methods *
-* *
-*******************************************************************************/
-function FPDF($orientation='P',$unit='mm',$format='A4')
-{
- //Some checks
- $this->_dochecks();
- //Initialization of properties
- $this->page=0;
- $this->n=2;
- $this->buffer='';
- $this->pages=array();
- $this->OrientationChanges=array();
- $this->state=0;
- $this->fonts=array();
- $this->FontFiles=array();
- $this->diffs=array();
- $this->images=array();
- $this->links=array();
- $this->InFooter=false;
- $this->lasth=0;
- $this->FontFamily='';
- $this->FontStyle='';
- $this->FontSizePt=12;
- $this->underline=false;
- $this->DrawColor='0 G';
- $this->FillColor='0 g';
- $this->TextColor='0 g';
- $this->ColorFlag=false;
- $this->ws=0;
- //Standard fonts
- $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
- 'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
- 'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
- 'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
- //Scale factor
- if($unit=='pt')
- $this->k=1;
- elseif($unit=='mm')
- $this->k=72/25.4;
- elseif($unit=='cm')
- $this->k=72/2.54;
- elseif($unit=='in')
- $this->k=72;
- else
- $this->Error('Incorrect unit: '.$unit);
- //Page format
- if(is_string($format))
- {
- $format=strtolower($format);
- if($format=='a3')
- $format=array(841.89,1190.55);
- elseif($format=='a4')
- $format=array(595.28,841.89);
- elseif($format=='a5')
- $format=array(420.94,595.28);
- elseif($format=='letter')
- $format=array(612,792);
- elseif($format=='legal')
- $format=array(612,1008);
- else
- $this->Error('Unknown page format: '.$format);
- $this->fwPt=$format[0];
- $this->fhPt=$format[1];
- }
- else
- {
- $this->fwPt=$format[0]*$this->k;
- $this->fhPt=$format[1]*$this->k;
- }
- $this->fw=$this->fwPt/$this->k;
- $this->fh=$this->fhPt/$this->k;
- //Page orientation
- $orientation=strtolower($orientation);
- if($orientation=='p' || $orientation=='portrait')
- {
- $this->DefOrientation='P';
- $this->wPt=$this->fwPt;
- $this->hPt=$this->fhPt;
- }
- elseif($orientation=='l' || $orientation=='landscape')
- {
- $this->DefOrientation='L';
- $this->wPt=$this->fhPt;
- $this->hPt=$this->fwPt;
- }
- else
- $this->Error('Incorrect orientation: '.$orientation);
- $this->CurOrientation=$this->DefOrientation;
- $this->w=$this->wPt/$this->k;
- $this->h=$this->hPt/$this->k;
- //Page margins (1 cm)
- $margin=28.35/$this->k;
- $this->SetMargins($margin,$margin);
- //Interior cell margin (1 mm)
- $this->cMargin=$margin/10;
- //Line width (0.2 mm)
- $this->LineWidth=.567/$this->k;
- //Automatic page break
- $this->SetAutoPageBreak(true,2*$margin);
- //Full width display mode
- $this->SetDisplayMode('fullwidth');
- //Enable compression
- $this->SetCompression(true);
- //Set default PDF version number
- $this->PDFVersion='1.3';
-}
-
-function SetMargins($left,$top,$right=-1)
-{
- //Set left, top and right margins
- $this->lMargin=$left;
- $this->tMargin=$top;
- if($right==-1)
- $right=$left;
- $this->rMargin=$right;
-}
-
-function SetLeftMargin($margin)
-{
- //Set left margin
- $this->lMargin=$margin;
- if($this->page>0 && $this->x<$margin)
- $this->x=$margin;
-}
-
-function SetTopMargin($margin)
-{
- //Set top margin
- $this->tMargin=$margin;
-}
-
-function SetRightMargin($margin)
-{
- //Set right margin
- $this->rMargin=$margin;
-}
-
-function SetAutoPageBreak($auto,$margin=0)
-{
- //Set auto page break mode and triggering margin
- $this->AutoPageBreak=$auto;
- $this->bMargin=$margin;
- $this->PageBreakTrigger=$this->h-$margin;
-}
-
-function SetDisplayMode($zoom,$layout='continuous')
-{
- //Set display mode in viewer
- if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
- $this->ZoomMode=$zoom;
- else
- $this->Error('Incorrect zoom display mode: '.$zoom);
- if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
- $this->LayoutMode=$layout;
- else
- $this->Error('Incorrect layout display mode: '.$layout);
-}
-
-function SetCompression($compress)
-{
- //Set page compression
- if(function_exists('gzcompress'))
- $this->compress=$compress;
- else
- $this->compress=false;
-}
-
-function SetTitle($title)
-{
- //Title of document
- $this->title=$title;
-}
-
-function SetSubject($subject)
-{
- //Subject of document
- $this->subject=$subject;
-}
-
-function SetAuthor($author)
-{
- //Author of document
- $this->author=$author;
-}
-
-function SetKeywords($keywords)
-{
- //Keywords of document
- $this->keywords=$keywords;
-}
-
-function SetCreator($creator)
-{
- //Creator of document
- $this->creator=$creator;
-}
-
-function AliasNbPages($alias='{nb}')
-{
- //Define an alias for total number of pages
- $this->AliasNbPages=$alias;
-}
-
-function Error($msg)
-{
- //Fatal error
- die('<B>FPDF error: </B>'.$msg);
-}
-
-function Open()
-{
- //Begin document
- $this->state=1;
-}
-
-function Close()
-{
- //Terminate document
- if($this->state==3)
- return;
- if($this->page==0)
- $this->AddPage();
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- //Close document
- $this->_enddoc();
-}
-
-function AddPage($orientation='')
-{
- //Start a new page
- if($this->state==0)
- $this->Open();
- $family=$this->FontFamily;
- $style=$this->FontStyle.($this->underline ? 'U' : '');
- $size=$this->FontSizePt;
- $lw=$this->LineWidth;
- $dc=$this->DrawColor;
- $fc=$this->FillColor;
- $tc=$this->TextColor;
- $cf=$this->ColorFlag;
- if($this->page>0)
- {
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- }
- //Start new page
- $this->_beginpage($orientation);
- //Set line cap style to square
- $this->_out('2 J');
- //Set line width
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2f w',$lw*$this->k));
- //Set font
- if($family)
- $this->SetFont($family,$style,$size);
- //Set colors
- $this->DrawColor=$dc;
- if($dc!='0 G')
- $this->_out($dc);
- $this->FillColor=$fc;
- if($fc!='0 g')
- $this->_out($fc);
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
- //Page header
- $this->Header();
- //Restore line width
- if($this->LineWidth!=$lw)
- {
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2f w',$lw*$this->k));
- }
- //Restore font
- if($family)
- $this->SetFont($family,$style,$size);
- //Restore colors
- if($this->DrawColor!=$dc)
- {
- $this->DrawColor=$dc;
- $this->_out($dc);
- }
- if($this->FillColor!=$fc)
- {
- $this->FillColor=$fc;
- $this->_out($fc);
- }
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
-}
-
-function Header()
-{
- //To be implemented in your own inherited class
-}
-
-function Footer()
-{
- //To be implemented in your own inherited class
-}
-
-function PageNo()
-{
- //Get current page number
- return $this->page;
-}
-
-function SetDrawColor($r,$g=-1,$b=-1)
-{
- //Set color for all stroking operations
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->DrawColor=sprintf('%.3f G',$r/255);
- else
- $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
- if($this->page>0)
- $this->_out($this->DrawColor);
-}
-
-function SetFillColor($r,$g=-1,$b=-1)
-{
- //Set color for all filling operations
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->FillColor=sprintf('%.3f g',$r/255);
- else
- $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
- if($this->page>0)
- $this->_out($this->FillColor);
-}
-
-function SetTextColor($r,$g=-1,$b=-1)
-{
- //Set color for text
- if(($r==0 && $g==0 && $b==0) || $g==-1)
- $this->TextColor=sprintf('%.3f g',$r/255);
- else
- $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
-}
-
-function GetStringWidth($s)
-{
- //Get width of a string in the current font
- $s=(string)$s;
- $cw=&$this->CurrentFont['cw'];
- $w=0;
- $l=strlen($s);
- for($i=0;$i<$l;$i++)
- $w+=$cw[$s{$i}];
- return $w*$this->FontSize/1000;
-}
-
-function SetLineWidth($width)
-{
- //Set line width
- $this->LineWidth=$width;
- if($this->page>0)
- $this->_out(sprintf('%.2f w',$width*$this->k));
-}
-
-function Line($x1,$y1,$x2,$y2)
-{
- //Draw a line
- $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
-}
-
-function Rect($x,$y,$w,$h,$style='')
-{
- //Draw a rectangle
- if($style=='F')
- $op='f';
- elseif($style=='FD' || $style=='DF')
- $op='B';
- else
- $op='S';
- $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
-}
-
-function AddFont($family,$style='',$file='')
-{
- //Add a TrueType or Type1 font
- $family=strtolower($family);
- if($file=='')
- $file=str_replace(' ','',$family).strtolower($style).'.php';
- if($family=='arial')
- $family='helvetica';
- $style=strtoupper($style);
- if($style=='IB')
- $style='BI';
- $fontkey=$family.$style;
- if(isset($this->fonts[$fontkey]))
- $this->Error('Font already added: '.$family.' '.$style);
- include($this->_getfontpath().$file);
- if(!isset($name))
- $this->Error('Could not include font definition file');
- $i=count($this->fonts)+1;
- $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file);
- if($diff)
- {
- //Search existing encodings
- $d=0;
- $nb=count($this->diffs);
- for($i=1;$i<=$nb;$i++)
- {
- if($this->diffs[$i]==$diff)
- {
- $d=$i;
- break;
- }
- }
- if($d==0)
- {
- $d=$nb+1;
- $this->diffs[$d]=$diff;
- }
- $this->fonts[$fontkey]['diff']=$d;
- }
- if($file)
- {
- if($type=='TrueType')
- $this->FontFiles[$file]=array('length1'=>$originalsize);
- else
- $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
- }
-}
-
-function SetFont($family,$style='',$size=0)
-{
- //Select a font; size given in points
- global $fpdf_charwidths;
-
- $family=strtolower($family);
- if($family=='')
- $family=$this->FontFamily;
- if($family=='arial')
- $family='helvetica';
- elseif($family=='symbol' || $family=='zapfdingbats')
- $style='';
- $style=strtoupper($style);
- if(strpos($style,'U')!==false)
- {
- $this->underline=true;
- $style=str_replace('U','',$style);
- }
- else
- $this->underline=false;
- if($style=='IB')
- $style='BI';
- if($size==0)
- $size=$this->FontSizePt;
- //Test if font is already selected
- if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
- return;
- //Test if used for the first time
- $fontkey=$family.$style;
- if(!isset($this->fonts[$fontkey]))
- {
- //Check if one of the standard fonts
- if(isset($this->CoreFonts[$fontkey]))
- {
- if(!isset($fpdf_charwidths[$fontkey]))
- {
- //Load metric file
- $file=$family;
- if($family=='times' || $family=='helvetica')
- $file.=strtolower($style);
- include($this->_getfontpath().$file.'.php');
- if(!isset($fpdf_charwidths[$fontkey]))
- $this->Error('Could not include font metric file');
- }
- $i=count($this->fonts)+1;
- $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]);
- }
- else
- $this->Error('Undefined font: '.$family.' '.$style);
- }
- //Select it
- $this->FontFamily=$family;
- $this->FontStyle=$style;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- $this->CurrentFont=&$this->fonts[$fontkey];
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function SetFontSize($size)
-{
- //Set font size in points
- if($this->FontSizePt==$size)
- return;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function AddLink()
-{
- //Create a new internal link
- $n=count($this->links)+1;
- $this->links[$n]=array(0,0);
- return $n;
-}
-
-function SetLink($link,$y=0,$page=-1)
-{
- //Set destination of internal link
- if($y==-1)
- $y=$this->y;
- if($page==-1)
- $page=$this->page;
- $this->links[$link]=array($page,$y);
-}
-
-function Link($x,$y,$w,$h,$link)
-{
- //Put a link on the page
- $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link);
-}
-
-function Text($x,$y,$txt)
-{
- //Output a string
- $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
- if($this->underline && $txt!='')
- $s.=' '.$this->_dounderline($x,$y,$txt);
- if($this->ColorFlag)
- $s='q '.$this->TextColor.' '.$s.' Q';
- $this->_out($s);
-}
-
-function AcceptPageBreak()
-{
- //Accept automatic page break or not
- return $this->AutoPageBreak;
-}
-
-function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
-{
- //Output a cell
- $k=$this->k;
- if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x=$this->x;
- $ws=$this->ws;
- if($ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->AddPage($this->CurOrientation);
- $this->x=$x;
- if($ws>0)
- {
- $this->ws=$ws;
- $this->_out(sprintf('%.3f Tw',$ws*$k));
- }
- }
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $s='';
- if($fill==1 || $border==1)
- {
- if($fill==1)
- $op=($border==1) ? 'B' : 'f';
- else
- $op='S';
- $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
- }
- if(is_string($border))
- {
- $x=$this->x;
- $y=$this->y;
- if(strpos($border,'L')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'T')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
- if(strpos($border,'R')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'B')!==false)
- $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- }
- if($txt!=='')
- {
- if($align=='R')
- $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
- elseif($align=='C')
- $dx=($w-$this->GetStringWidth($txt))/2;
- else
- $dx=$this->cMargin;
- if($this->ColorFlag)
- $s.='q '.$this->TextColor.' ';
- $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
- $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
- if($this->underline)
- $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- if($this->ColorFlag)
- $s.=' Q';
- if($link)
- $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
- }
- if($s)
- $this->_out($s);
- $this->lasth=$h;
- if($ln>0)
- {
- //Go to next line
- $this->y+=$h;
- if($ln==1)
- $this->x=$this->lMargin;
- }
- else
- $this->x+=$w;
-}
-
-function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
-{
- //Output text with automatic or explicit line breaks
- $cw=&$this->CurrentFont['cw'];
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- if($nb>0 && $s[$nb-1]=="\n")
- $nb--;
- $b=0;
- if($border)
- {
- if($border==1)
- {
- $border='LTRB';
- $b='LRT';
- $b2='LR';
- }
- else
- {
- $b2='';
- if(strpos($border,'L')!==false)
- $b2.='L';
- if(strpos($border,'R')!==false)
- $b2.='R';
- $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
- }
- }
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $ns=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s{$i};
- if($c=="\n")
- {
- //Explicit line break
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- continue;
- }
- if($c==' ')
- {
- $sep=$i;
- $ls=$l;
- $ns++;
- }
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($i==$j)
- $i++;
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- }
- else
- {
- if($align=='J')
- {
- $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
- $this->_out(sprintf('%.3f Tw',$this->ws*$this->k));
- }
- $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- }
- else
- $i++;
- }
- //Last chunk
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- if($border && strpos($border,'B')!==false)
- $b.='B';
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $this->x=$this->lMargin;
-}
-
-function Write($h,$txt,$link='')
-{
- //Output text in flowing mode
- $cw=&$this->CurrentFont['cw'];
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s{$i};
- if($c=="\n")
- {
- //Explicit line break
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- continue;
- }
- if($c==' ')
- $sep=$i;
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($this->x>$this->lMargin)
- {
- //Move to next line
- $this->x=$this->lMargin;
- $this->y+=$h;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $i++;
- $nl++;
- continue;
- }
- if($i==$j)
- $i++;
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- }
- else
- {
- $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- }
- else
- $i++;
- }
- //Last chunk
- if($i!=$j)
- $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
-}
-
-function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
-{
- //Put an image on the page
- if(!isset($this->images[$file]))
- {
- //First use of image, get info
- if($type=='')
- {
- $pos=strrpos($file,'.');
- if(!$pos)
- $this->Error('Image file has no extension and no type was specified: '.$file);
- $type=substr($file,$pos+1);
- }
- $type=strtolower($type);
- $mqr=get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- if($type=='jpg' || $type=='jpeg')
- $info=$this->_parsejpg($file);
- elseif($type=='png')
- $info=$this->_parsepng($file);
- else
- {
- //Allow for additional formats
- $mtd='_parse'.$type;
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported image type: '.$type);
- $info=$this->$mtd($file);
- }
- set_magic_quotes_runtime($mqr);
- $info['i']=count($this->images)+1;
- $this->images[$file]=$info;
- }
- else
- $info=$this->images[$file];
- //Automatic width and height calculation if needed
- if($w==0 && $h==0)
- {
- //Put image at 72 dpi
- $w=$info['w']/$this->k;
- $h=$info['h']/$this->k;
- }
- if($w==0)
- $w=$h*$info['w']/$info['h'];
- if($h==0)
- $h=$w*$info['h']/$info['w'];
- $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
- if($link)
- $this->Link($x,$y,$w,$h,$link);
-}
-
-function Ln($h='')
-{
- //Line feed; default value is last cell height
- $this->x=$this->lMargin;
- if(is_string($h))
- $this->y+=$this->lasth;
- else
- $this->y+=$h;
-}
-
-function GetX()
-{
- //Get x position
- return $this->x;
-}
-
-function SetX($x)
-{
- //Set x position
- if($x>=0)
- $this->x=$x;
- else
- $this->x=$this->w+$x;
-}
-
-function GetY()
-{
- //Get y position
- return $this->y;
-}
-
-function SetY($y)
-{
- //Set y position and reset x
- $this->x=$this->lMargin;
- if($y>=0)
- $this->y=$y;
- else
- $this->y=$this->h+$y;
-}
-
-function SetXY($x,$y)
-{
- //Set x and y positions
- $this->SetY($y);
- $this->SetX($x);
-}
-
-function Output($name='',$dest='')
-{
- //Output PDF to some destination
- //Finish document if necessary
- if($this->state<3)
- $this->Close();
- //Normalize parameters
- if(is_bool($dest))
- $dest=$dest ? 'D' : 'F';
- $dest=strtoupper($dest);
- if($dest=='')
- {
- if($name=='')
- {
- $name='doc.pdf';
- $dest='I';
- }
- else
- $dest='F';
- }
- switch($dest)
- {
- case 'I':
- //Send to standard output
- if(ob_get_contents())
- $this->Error('Some data has already been output, can\'t send PDF file');
- if(php_sapi_name()!='cli')
- {
- //We send to a browser
- header('Content-Type: application/pdf');
- if(headers_sent())
- $this->Error('Some data has already been output to browser, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-disposition: inline; filename="'.$name.'"');
- }
- echo $this->buffer;
- break;
- case 'D':
- //Download file
- if(ob_get_contents())
- $this->Error('Some data has already been output, can\'t send PDF file');
- if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
- header('Content-Type: application/force-download');
- else
- header('Content-Type: application/octet-stream');
- if(headers_sent())
- $this->Error('Some data has already been output to browser, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-disposition: attachment; filename="'.$name.'"');
- echo $this->buffer;
- break;
- case 'F':
- //Save to local file
- $f=fopen($name,'wb');
- if(!$f)
- $this->Error('Unable to create output file: '.$name);
- fwrite($f,$this->buffer,strlen($this->buffer));
- fclose($f);
- break;
- case 'S':
- //Return as a string
- return $this->buffer;
- default:
- $this->Error('Incorrect output destination: '.$dest);
- }
- return '';
-}
-
-/*******************************************************************************
-* *
-* Protected methods *
-* *
-*******************************************************************************/
-function _dochecks()
-{
- //Check for locale-related bug
- if(1.1==1)
- $this->Error('Don\'t alter the locale before including class file');
- //Check for decimal separator
- if(sprintf('%.1f',1.0)!='1.0')
- setlocale(LC_NUMERIC,'C');
-}
-
-function _getfontpath()
-{
- if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
- define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
- return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
-}
-
-function _putpages()
-{
- $nb=$this->page;
- if(!empty($this->AliasNbPages))
- {
- //Replace number of pages
- for($n=1;$n<=$nb;$n++)
- $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
- }
- if($this->DefOrientation=='P')
- {
- $wPt=$this->fwPt;
- $hPt=$this->fhPt;
- }
- else
- {
- $wPt=$this->fhPt;
- $hPt=$this->fwPt;
- }
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- for($n=1;$n<=$nb;$n++)
- {
- //Page
- $this->_newobj();
- $this->_out('<</Type /Page');
- $this->_out('/Parent 1 0 R');
- if(isset($this->OrientationChanges[$n]))
- $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));
- $this->_out('/Resources 2 0 R');
- if(isset($this->PageLinks[$n]))
- {
- //Links
- $annots='/Annots [';
- foreach($this->PageLinks[$n] as $pl)
- {
- $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
- $annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
- if(is_string($pl[4]))
- $annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
- else
- {
- $l=$this->links[$pl[4]];
- $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;
- $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);
- }
- }
- $this->_out($annots.']');
- }
- $this->_out('/Contents '.($this->n+1).' 0 R>>');
- $this->_out('endobj');
- //Page content
- $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
- $this->_newobj();
- $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
- $this->_putstream($p);
- $this->_out('endobj');
- }
- //Pages root
- $this->offsets[1]=strlen($this->buffer);
- $this->_out('1 0 obj');
- $this->_out('<</Type /Pages');
- $kids='/Kids [';
- for($i=0;$i<$nb;$i++)
- $kids.=(3+2*$i).' 0 R ';
- $this->_out($kids.']');
- $this->_out('/Count '.$nb);
- $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putfonts()
-{
- $nf=$this->n;
- foreach($this->diffs as $diff)
- {
- //Encodings
- $this->_newobj();
- $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
- $this->_out('endobj');
- }
- $mqr=get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- foreach($this->FontFiles as $file=>$info)
- {
- //Font file embedding
- $this->_newobj();
- $this->FontFiles[$file]['n']=$this->n;
- $font='';
- $f=fopen($this->_getfontpath().$file,'rb',1);
- if(!$f)
- $this->Error('Font file not found');
- while(!feof($f))
- $font.=fread($f,8192);
- fclose($f);
- $compressed=(substr($file,-2)=='.z');
- if(!$compressed && isset($info['length2']))
- {
- $header=(ord($font{0})==128);
- if($header)
- {
- //Strip first binary header
- $font=substr($font,6);
- }
- if($header && ord($font{$info['length1']})==128)
- {
- //Strip second binary header
- $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
- }
- }
- $this->_out('<</Length '.strlen($font));
- if($compressed)
- $this->_out('/Filter /FlateDecode');
- $this->_out('/Length1 '.$info['length1']);
- if(isset($info['length2']))
- $this->_out('/Length2 '.$info['length2'].' /Length3 0');
- $this->_out('>>');
- $this->_putstream($font);
- $this->_out('endobj');
- }
- set_magic_quotes_runtime($mqr);
- foreach($this->fonts as $k=>$font)
- {
- //Font objects
- $this->fonts[$k]['n']=$this->n+1;
- $type=$font['type'];
- $name=$font['name'];
- if($type=='core')
- {
- //Standard font
- $this->_newobj();
- $this->_out('<</Type /Font');
- $this->_out('/BaseFont /'.$name);
- $this->_out('/Subtype /Type1');
- if($name!='Symbol' && $name!='ZapfDingbats')
- $this->_out('/Encoding /WinAnsiEncoding');
- $this->_out('>>');
- $this->_out('endobj');
- }
- elseif($type=='Type1' || $type=='TrueType')
- {
- //Additional Type1 or TrueType font
- $this->_newobj();
- $this->_out('<</Type /Font');
- $this->_out('/BaseFont /'.$name);
- $this->_out('/Subtype /'.$type);
- $this->_out('/FirstChar 32 /LastChar 255');
- $this->_out('/Widths '.($this->n+1).' 0 R');
- $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
- if($font['enc'])
- {
- if(isset($font['diff']))
- $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
- else
- $this->_out('/Encoding /WinAnsiEncoding');
- }
- $this->_out('>>');
- $this->_out('endobj');
- //Widths
- $this->_newobj();
- $cw=&$font['cw'];
- $s='[';
- for($i=32;$i<=255;$i++)
- $s.=$cw[chr($i)].' ';
- $this->_out($s.']');
- $this->_out('endobj');
- //Descriptor
- $this->_newobj();
- $s='<</Type /FontDescriptor /FontName /'.$name;
- foreach($font['desc'] as $k=>$v)
- $s.=' /'.$k.' '.$v;
- $file=$font['file'];
- if($file)
- $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
- $this->_out($s.'>>');
- $this->_out('endobj');
- }
- else
- {
- //Allow for additional types
- $mtd='_put'.strtolower($type);
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported font type: '.$type);
- $this->$mtd($font);
- }
- }
-}
-
-function _putimages()
-{
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- reset($this->images);
- while(list($file,$info)=each($this->images))
- {
- $this->_newobj();
- $this->images[$file]['n']=$this->n;
- $this->_out('<</Type /XObject');
- $this->_out('/Subtype /Image');
- $this->_out('/Width '.$info['w']);
- $this->_out('/Height '.$info['h']);
- if($info['cs']=='Indexed')
- $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
- else
- {
- $this->_out('/ColorSpace /'.$info['cs']);
- if($info['cs']=='DeviceCMYK')
- $this->_out('/Decode [1 0 1 0 1 0 1 0]');
- }
- $this->_out('/BitsPerComponent '.$info['bpc']);
- if(isset($info['f']))
- $this->_out('/Filter /'.$info['f']);
- if(isset($info['parms']))
- $this->_out($info['parms']);
- if(isset($info['trns']) && is_array($info['trns']))
- {
- $trns='';
- for($i=0;$i<count($info['trns']);$i++)
- $trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
- $this->_out('/Mask ['.$trns.']');
- }
- $this->_out('/Length '.strlen($info['data']).'>>');
- $this->_putstream($info['data']);
- unset($this->images[$file]['data']);
- $this->_out('endobj');
- //Palette
- if($info['cs']=='Indexed')
- {
- $this->_newobj();
- $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
- $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
- $this->_putstream($pal);
- $this->_out('endobj');
- }
- }
-}
-
-function _putxobjectdict()
-{
- foreach($this->images as $image)
- $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
-}
-
-function _putresourcedict()
-{
- $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
- $this->_out('/Font <<');
- foreach($this->fonts as $font)
- $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
- $this->_out('>>');
- $this->_out('/XObject <<');
- $this->_putxobjectdict();
- $this->_out('>>');
-}
-
-function _putresources()
-{
- $this->_putfonts();
- $this->_putimages();
- //Resource dictionary
- $this->offsets[2]=strlen($this->buffer);
- $this->_out('2 0 obj');
- $this->_out('<<');
- $this->_putresourcedict();
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putinfo()
-{
- $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
- if(!empty($this->title))
- $this->_out('/Title '.$this->_textstring($this->title));
- if(!empty($this->subject))
- $this->_out('/Subject '.$this->_textstring($this->subject));
- if(!empty($this->author))
- $this->_out('/Author '.$this->_textstring($this->author));
- if(!empty($this->keywords))
- $this->_out('/Keywords '.$this->_textstring($this->keywords));
- if(!empty($this->creator))
- $this->_out('/Creator '.$this->_textstring($this->creator));
- $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
-}
-
-function _putcatalog()
-{
- $this->_out('/Type /Catalog');
- $this->_out('/Pages 1 0 R');
- if($this->ZoomMode=='fullpage')
- $this->_out('/OpenAction [3 0 R /Fit]');
- elseif($this->ZoomMode=='fullwidth')
- $this->_out('/OpenAction [3 0 R /FitH null]');
- elseif($this->ZoomMode=='real')
- $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
- elseif(!is_string($this->ZoomMode))
- $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
- if($this->LayoutMode=='single')
- $this->_out('/PageLayout /SinglePage');
- elseif($this->LayoutMode=='continuous')
- $this->_out('/PageLayout /OneColumn');
- elseif($this->LayoutMode=='two')
- $this->_out('/PageLayout /TwoColumnLeft');
-}
-
-function _putheader()
-{
- $this->_out('%PDF-'.$this->PDFVersion);
-}
-
-function _puttrailer()
-{
- $this->_out('/Size '.($this->n+1));
- $this->_out('/Root '.$this->n.' 0 R');
- $this->_out('/Info '.($this->n-1).' 0 R');
-}
-
-function _enddoc()
-{
- $this->_putheader();
- $this->_putpages();
- $this->_putresources();
- //Info
- $this->_newobj();
- $this->_out('<<');
- $this->_putinfo();
- $this->_out('>>');
- $this->_out('endobj');
- //Catalog
- $this->_newobj();
- $this->_out('<<');
- $this->_putcatalog();
- $this->_out('>>');
- $this->_out('endobj');
- //Cross-ref
- $o=strlen($this->buffer);
- $this->_out('xref');
- $this->_out('0 '.($this->n+1));
- $this->_out('0000000000 65535 f ');
- for($i=1;$i<=$this->n;$i++)
- $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
- //Trailer
- $this->_out('trailer');
- $this->_out('<<');
- $this->_puttrailer();
- $this->_out('>>');
- $this->_out('startxref');
- $this->_out($o);
- $this->_out('%%EOF');
- $this->state=3;
-}
-
-function _beginpage($orientation)
-{
- $this->page++;
- $this->pages[$this->page]='';
- $this->state=2;
- $this->x=$this->lMargin;
- $this->y=$this->tMargin;
- $this->FontFamily='';
- //Page orientation
- if(!$orientation)
- $orientation=$this->DefOrientation;
- else
- {
- $orientation=strtoupper($orientation{0});
- if($orientation!=$this->DefOrientation)
- $this->OrientationChanges[$this->page]=true;
- }
- if($orientation!=$this->CurOrientation)
- {
- //Change orientation
- if($orientation=='P')
- {
- $this->wPt=$this->fwPt;
- $this->hPt=$this->fhPt;
- $this->w=$this->fw;
- $this->h=$this->fh;
- }
- else
- {
- $this->wPt=$this->fhPt;
- $this->hPt=$this->fwPt;
- $this->w=$this->fh;
- $this->h=$this->fw;
- }
- $this->PageBreakTrigger=$this->h-$this->bMargin;
- $this->CurOrientation=$orientation;
- }
-}
-
-function _endpage()
-{
- //End of page contents
- $this->state=1;
-}
-
-function _newobj()
-{
- //Begin a new object
- $this->n++;
- $this->offsets[$this->n]=strlen($this->buffer);
- $this->_out($this->n.' 0 obj');
-}
-
-function _dounderline($x,$y,$txt)
-{
- //Underline text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
- $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
- return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
-}
-
-function _parsejpg($file)
-{
- //Extract info from a JPEG file
- $a=GetImageSize($file);
- if(!$a)
- $this->Error('Missing or incorrect image file: '.$file);
- if($a[2]!=2)
- $this->Error('Not a JPEG file: '.$file);
- if(!isset($a['channels']) || $a['channels']==3)
- $colspace='DeviceRGB';
- elseif($a['channels']==4)
- $colspace='DeviceCMYK';
- else
- $colspace='DeviceGray';
- $bpc=isset($a['bits']) ? $a['bits'] : 8;
- //Read whole file
- $f=fopen($file,'rb');
- $data='';
- while(!feof($f))
- $data.=fread($f,4096);
- fclose($f);
- return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
-}
-
-function _parsepng($file)
-{
- //Extract info from a PNG file
- $f=fopen($file,'rb');
- if(!$f)
- $this->Error('Can\'t open image file: '.$file);
- //Check signature
- if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
- $this->Error('Not a PNG file: '.$file);
- //Read header chunk
- fread($f,4);
- if(fread($f,4)!='IHDR')
- $this->Error('Incorrect PNG file: '.$file);
- $w=$this->_freadint($f);
- $h=$this->_freadint($f);
- $bpc=ord(fread($f,1));
- if($bpc>8)
- $this->Error('16-bit depth not supported: '.$file);
- $ct=ord(fread($f,1));
- if($ct==0)
- $colspace='DeviceGray';
- elseif($ct==2)
- $colspace='DeviceRGB';
- elseif($ct==3)
- $colspace='Indexed';
- else
- $this->Error('Alpha channel not supported: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Unknown compression method: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Unknown filter method: '.$file);
- if(ord(fread($f,1))!=0)
- $this->Error('Interlacing not supported: '.$file);
- fread($f,4);
- $parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
- //Scan chunks looking for palette, transparency and image data
- $pal='';
- $trns='';
- $data='';
- do
- {
- $n=$this->_freadint($f);
- $type=fread($f,4);
- if($type=='PLTE')
- {
- //Read palette
- $pal=fread($f,$n);
- fread($f,4);
- }
- elseif($type=='tRNS')
- {
- //Read transparency info
- $t=fread($f,$n);
- if($ct==0)
- $trns=array(ord(substr($t,1,1)));
- elseif($ct==2)
- $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
- else
- {
- $pos=strpos($t,chr(0));
- if($pos!==false)
- $trns=array($pos);
- }
- fread($f,4);
- }
- elseif($type=='IDAT')
- {
- //Read image data block
- $data.=fread($f,$n);
- fread($f,4);
- }
- elseif($type=='IEND')
- break;
- else
- fread($f,$n+4);
- }
- while($n);
- if($colspace=='Indexed' && empty($pal))
- $this->Error('Missing palette in '.$file);
- fclose($f);
- return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);
-}
-
-function _freadint($f)
-{
- //Read a 4-byte integer from file
- $a=unpack('Ni',fread($f,4));
- return $a['i'];
-}
-
-function _textstring($s)
-{
- //Format a text string
- return '('.$this->_escape($s).')';
-}
-
-function _escape($s)
-{
- //Add \ before \, ( and )
- return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s)));
-}
-
-function _putstream($s)
-{
- $this->_out('stream');
- $this->_out($s);
- $this->_out('endstream');
-}
-
-function _out($s)
-{
- //Add a line to the document
- if($this->state==2)
- $this->pages[$this->page].=$s."\n";
- else
- $this->buffer.=$s."\n";
-}
-//End of class
-}
-
-//Handle special IE contype request
-if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
-{
- header('Content-Type: application/pdf');
- exit;
-}
-
-}
-?>
diff --git a/index.php b/index.php
index fa0e418..af3bfa2 100644
--- a/index.php
+++ b/index.php
@@ -6,14 +6,14 @@ session_start();
header("Cache-control: private");
-//error_reporting(E_ERROR);
+error_reporting(E_ERROR);
require("core.php");
if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
- if (file_exists("data/hits.txt")) {
- $maj_global_hits_count = file_get_contents("data/hits.txt");
+ if (file_exists("$maj_data_directory/hits.txt")) {
+ $maj_global_hits_count = file_get_contents("$maj_data_directory/hits.txt");
}
else {
$maj_global_hits_count = "0";
@@ -21,15 +21,15 @@ if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_us
$maj_global_hits_count = $maj_global_hits_count + 1;
- $maj_global_hits_file = fopen("data/hits.txt","w");
+ $maj_global_hits_file = fopen("$maj_data_directory/hits.txt","w");
fwrite($maj_global_hits_file,$maj_global_hits_count);
fclose($maj_global_hits_file);
}
if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
- if (file_exists("data/google.txt")) {
- $maj_google_hits_count = file_get_contents("data/google.txt");
+ if (file_exists("$maj_data_directory/google.txt")) {
+ $maj_google_hits_count = file_get_contents("$maj_data_directory/google.txt");
}
else {
$maj_google_hits_count = "0";
@@ -37,7 +37,7 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
$maj_google_hits_count = $maj_google_hits_count + 1;
- $maj_google_hits_file = fopen("data/google.txt","w");
+ $maj_google_hits_file = fopen("$maj_data_directory/google.txt","w");
fwrite($maj_google_hits_file,$maj_google_hits_count);
fclose($maj_google_hits_file);
}
@@ -53,15 +53,9 @@ function go_download($maj_dl_file) {
$maj_req_entry = trim($_REQUEST['entry']);
- if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "pdf")) {
- $maj_dl_path = "data/items/$maj_req_entry/pdf/file";
- $maj_count_path = "data/items/$maj_req_entry/pdf/count";
- $maj_count_file = "dl.txt";
- }
-
if (isset($_REQUEST['type']) and !empty($_REQUEST['type']) and ($_REQUEST['type'] == "filedrop")) {
- $maj_dl_path = "data/items/$maj_req_entry/filedrop/files";
- $maj_count_path = "data/items/$maj_req_entry/filedrop/count";
+ $maj_dl_path = "$maj_data_directory/items/$maj_req_entry/filedrop/files";
+ $maj_count_path = "$maj_data_directory/items/$maj_req_entry/filedrop/count";
$maj_count_file = "{$maj_dl_file}.txt";
}
@@ -107,7 +101,7 @@ function go_download($maj_dl_file) {
if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQUEST['key']) and !empty($_REQUEST['key']) and isset($_REQUEST['action']) and !empty($_REQUEST['action'])) {
- $maj_comment_dir = "data/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
+ $maj_comment_dir = "$maj_data_directory/items/$maj_req_entry/comments/pending/{$_REQUEST['comment']}";
$maj_login_key = file_get_contents("$maj_comment_dir/key.txt");
@@ -115,14 +109,14 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if ($_REQUEST['action'] == "approve") {
- $maj_live_dir = "data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}";
+ $maj_live_dir = "$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}";
- if (!file_exists("data/items/$maj_req_entry/comments/live")) {
- mkdir("data/items/$maj_req_entry/comments/live");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
}
- if (!file_exists("data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}")) {
- mkdir("data/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live/{$_REQUEST['comment']}");
}
rename($maj_comment_dir,$maj_live_dir);
@@ -131,40 +125,40 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
// clean-up old latest comments dir (start)
- if (file_exists("data/comments/latest")) {
- rmdirr("data/comments/latest");
+ if (file_exists("$maj_data_directory/comments/latest")) {
+ rmdirr("$maj_data_directory/comments/latest");
}
// clean-up old latest comments dir (end)
- if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
+ if (file_exists("$maj_data_directory/members/active") and !file_exists("$maj_data_directory/xucomment.txt")) {
- if (!file_exists("data/comments/unread")) {
- mkdir("data/comments/unread");
+ if (!file_exists("$maj_data_directory/comments/unread")) {
+ mkdir("$maj_data_directory/comments/unread");
}
- if (!file_exists("data/comments/unread/$maj_req_entry")) {
- mkdir("data/comments/unread/$maj_req_entry");
+ if (!file_exists("$maj_data_directory/comments/unread/$maj_req_entry")) {
+ mkdir("$maj_data_directory/comments/unread/$maj_req_entry");
}
- if ($maj_dh_unread_active_members = opendir("data/members/active")) {
+ if ($maj_dh_unread_active_members = opendir("$maj_data_directory/members/active")) {
while (($maj_unread_active_member = readdir($maj_dh_unread_active_members)) !== false) {
if ($maj_unread_active_member != "." && $maj_unread_active_member != "..") {
- if ((!file_exists("data/members/active/$maj_unread_active_member/bb-vacation.txt") and !file_exists("data/items/$maj_req_entry/members")) or (!file_exists("data/members/active/$maj_unread_active_member/bb-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("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/members")) or (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/bb-vacation.txt") and file_exists("$maj_data_directory/items/$maj_req_entry/members") and file_exists("$maj_data_directory/items/$maj_req_entry/members/$maj_unread_active_member"))) {
- if (!file_exists("data/members/active/$maj_unread_active_member/comments")) {
- mkdir("data/members/active/$maj_unread_active_member/comments");
+ if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments");
}
- if (!file_exists("data/members/active/$maj_unread_active_member/comments/unread")) {
- mkdir("data/members/active/$maj_unread_active_member/comments/unread");
+ if (!file_exists("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread");
}
- if (!file_exists("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("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry")) {
+ mkdir("$maj_data_directory/members/active/$maj_unread_active_member/comments/unread/$maj_req_entry");
}
}
}
@@ -175,15 +169,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_req_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_req_entry/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("data/categories/$maj_entry_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -192,13 +186,13 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
}
}
- if (file_exists("data/members/active") and file_exists("data/ml.txt") and file_exists("data/email.txt") and !file_exists("data/items/$maj_req_entry/private.txt") and ($maj_private_categories == "0")) {
+ if (file_exists("$maj_data_directory/members/active") and file_exists("$maj_data_directory/ml.txt") and file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and ($maj_private_categories == "0")) {
- if (file_exists("data/ml-reply2.txt")) {
- $maj_ml_reply2 = file_get_contents("data/ml-reply2.txt");
+ if (file_exists("$maj_data_directory/ml-reply2.txt")) {
+ $maj_ml_reply2 = file_get_contents("$maj_data_directory/ml-reply2.txt");
}
- if (file_exists("data/ml-from.txt")) {
+ if (file_exists("$maj_data_directory/ml-from.txt")) {
$maj_ml_from = $maj_ml_reply2;
}
else {
@@ -212,10 +206,10 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_from = '"' . "$maj_ml_from_firstname $maj_ml_from_lastname" . '" <' . $maj_ml_from . '>';
- $maj_ml_subject = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_ml_subject = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (file_exists("data/ml-prepend.txt")) {
- $maj_ml_prepend = file_get_contents("data/ml-prepend.txt");
+ if (file_exists("$maj_data_directory/ml-prepend.txt")) {
+ $maj_ml_prepend = file_get_contents("$maj_data_directory/ml-prepend.txt");
$maj_ml_subject = str_replace($maj_ml_prepend,"",$maj_ml_subject);
$maj_ml_subject = $maj_ml_prepend . " " . $maj_ml_subject;
}
@@ -242,12 +236,12 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = str_replace('>','>',$maj_ml_body);
$maj_ml_body = str_replace('®','(R)',$maj_ml_body);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
+ if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt")) {
- $maj_badwords = file_get_contents("data/pf-badwords.txt");
+ $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $maj_censor = file_get_contents("data/pf-censor.txt");
+ if (file_exists("$maj_data_directory/pf-censor.txt")) {
+ $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
}
else {
$maj_censor = "[expletive]";
@@ -256,8 +250,8 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = preg_replace("/\b($maj_badwords)\b/i",$maj_censor,$maj_ml_body);
}
- if (file_exists("data/ml-header.txt")) {
- $maj_ml_header = file_get_contents("data/ml-header.txt");
+ if (file_exists("$maj_data_directory/ml-header.txt")) {
+ $maj_ml_header = file_get_contents("$maj_data_directory/ml-header.txt");
$maj_ml_body = $maj_ml_header . "\n\n" . $maj_ml_body;
}
@@ -267,34 +261,34 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
$maj_ml_body = $maj_ml_body . "\n\nPlease visit the following URL for the full thread:\n\n" . $maj_ml_url;
- if (file_exists("data/items/$maj_req_entry/member.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt")) {
$maj_ml_body = $maj_ml_body . "\n\nYou need to login first to view the entry or to add a comment.";
}
- if (file_exists("data/ml-footer.txt")) {
- $maj_ml_footer = file_get_contents("data/ml-footer.txt");
+ if (file_exists("$maj_data_directory/ml-footer.txt")) {
+ $maj_ml_footer = file_get_contents("$maj_data_directory/ml-footer.txt");
$maj_ml_body = $maj_ml_body . "\n\n" . $maj_ml_footer;
}
- if ($maj_dh_ml_member = opendir("data/members/active")) {
+ if ($maj_dh_ml_member = opendir("$maj_data_directory/members/active")) {
while (($maj_ml_member = readdir($maj_dh_ml_member)) !== false) {
if ($maj_ml_member != "." && $maj_ml_member != "..") {
- if (file_exists("data/members/active/$maj_ml_member/bb-noml.txt")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-noml.txt")) {
continue;
}
- if (file_exists("data/members/active/$maj_ml_member/bb-vacation.txt")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_ml_member/bb-vacation.txt")) {
continue;
}
- $maj_ml_to_firstname = file_get_contents("data/members/active/$maj_ml_member/firstname.txt");
- $maj_ml_to_lastname = file_get_contents("data/members/active/$maj_ml_member/lastname.txt");
- $maj_ml_to = file_get_contents("data/members/active/$maj_ml_member/email.txt");
+ $maj_ml_to_firstname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/firstname.txt");
+ $maj_ml_to_lastname = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/lastname.txt");
+ $maj_ml_to = file_get_contents("$maj_data_directory/members/active/$maj_ml_member/email.txt");
$maj_ml_to = '"' . "$maj_ml_to_firstname $maj_ml_to_lastname" . '" <'. $maj_ml_to . '>';
- if (file_exists("data/ml-reply2.txt")) {
+ if (file_exists("$maj_data_directory/ml-reply2.txt")) {
mail($maj_ml_to,$maj_ml_subject,$maj_ml_body,
"From: $maj_ml_from\r\n" .
"Reply-To: $maj_ml_reply2\r\n" .
@@ -319,17 +313,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
rmdirr($maj_comment_dir);
}
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
if ($maj_comment_count_value <= 1) {
- rmdirr("data/comments/pending/$maj_req_entry");
+ rmdirr("$maj_data_directory/comments/pending/$maj_req_entry");
}
else {
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_req_entry/count.txt");
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_req_entry/count.txt");
$maj_comment_count_value = $maj_comment_count_value - 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_req_entry/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_req_entry/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -340,16 +334,16 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and isset($_REQUEST['commen
if (isset($maj_req_entry) and !empty($maj_req_entry)) {
- if (file_exists("data/items/$maj_req_entry")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry")) {
- $maj_title = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
echo "<title>$maj_title</title>\r\n";
if ((!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- if (file_exists("data/items/$maj_req_entry/views.txt")) {
- $maj_count_views = file_get_contents("data/items/$maj_req_entry/views.txt");
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/views.txt")) {
+ $maj_count_views = file_get_contents("$maj_data_directory/items/$maj_req_entry/views.txt");
}
else {
$maj_count_views = "0";
@@ -357,30 +351,30 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_count_views = $maj_count_views + 1;
- $maj_fp_views = fopen("data/items/$maj_req_entry/views.txt","w");
+ $maj_fp_views = fopen("$maj_data_directory/items/$maj_req_entry/views.txt","w");
fwrite($maj_fp_views,$maj_count_views);
fclose($maj_fp_views);
}
if (isset($maj_req_show) and !empty($maj_req_show) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == sha1($_POST['captcha_put'])) and (ereg("@",$_POST['email'])) and (ereg("\.",$_POST['email']))) {
- if (!file_exists("data/items/$maj_req_entry/comments")) {
- mkdir("data/items/$maj_req_entry/comments");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments");
}
- if (!file_exists("data/items/$maj_req_entry/comments/pending")) {
- mkdir("data/items/$maj_req_entry/comments/pending");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/pending")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending");
}
- if (!file_exists("data/items/$maj_req_entry/comments/live")) {
- mkdir("data/items/$maj_req_entry/comments/live");
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/comments/live")) {
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/live");
}
$maj_timestamp = date("l, M j, Y, g:i A",time() + $maj_offset);
$maj_comment_entry_dir = date("YmdHis",time() + $maj_offset);
- mkdir("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir");
+ mkdir("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir");
$maj_body_content = ucfirst($_POST['new_comment']);
$maj_body_content = htmlentities($maj_body_content,ENT_NOQUOTES);
@@ -397,15 +391,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_body_content = str_replace(':\\','<img src="images/smileys/undecided.png" border="0">',$maj_body_content);
$maj_body_content = str_replace(';)','<img src="images/smileys/wink.png" border="0">',$maj_body_content);
- $maj_fp_body_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/comment.txt","w");
+ $maj_fp_body_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/comment.txt","w");
fwrite($maj_fp_body_txt,$maj_body_content);
fclose($maj_fp_body_txt);
- $maj_fp_timestamp_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/timestamp.txt","w");
+ $maj_fp_timestamp_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/timestamp.txt","w");
fwrite($maj_fp_timestamp_txt,$maj_timestamp);
fclose($maj_fp_timestamp_txt);
- $maj_fp_firstname_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/firstname.txt","w");
+ $maj_fp_firstname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/firstname.txt","w");
$maj_firstname = htmlentities($_POST['firstname'],ENT_NOQUOTES);
$maj_firstname = trim($maj_firstname);
@@ -417,7 +411,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_firstname_txt,$maj_firstname);
fclose($maj_fp_firstname_txt);
- $maj_fp_lastname_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/lastname.txt","w");
+ $maj_fp_lastname_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/lastname.txt","w");
$maj_lastname = htmlentities($_POST['lastname'],ENT_NOQUOTES);
$maj_lastname = trim($maj_lastname);
@@ -429,15 +423,15 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
fwrite($maj_fp_lastname_txt,$maj_lastname);
fclose($maj_fp_lastname_txt);
- $maj_fp_email_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/email.txt","w");
+ $maj_fp_email_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/email.txt","w");
$maj_email = strtolower($_POST['email']);
$maj_email = trim($maj_email);
$maj_email = htmlentities($maj_email,ENT_NOQUOTES);
fwrite($maj_fp_email_txt,$maj_email);
fclose($maj_fp_email_txt);
- if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/email.txt")) {
- $maj_fp_email_root = fopen("data/email.txt","w");
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("$maj_data_directory/email.txt")) {
+ $maj_fp_email_root = fopen("$maj_data_directory/email.txt","w");
$maj_email_root = strtolower($_POST['email']);
$maj_email_root = trim($maj_email_root);
$maj_email_root = htmlentities($maj_email_root,ENT_NOQUOTES);
@@ -446,7 +440,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.",$_POST['url']))) {
- $maj_fp_url_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/url.txt","w");
+ $maj_fp_url_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/url.txt","w");
$maj_url = str_replace("http://","",$_POST['url']);
$maj_url = strtolower($maj_url);
$maj_url = trim($maj_url);
@@ -457,19 +451,19 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
}
if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
- $maj_fp_cauthor_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/author.txt","w");
+ $maj_fp_cauthor_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/author.txt","w");
fwrite($maj_fp_cauthor_txt,$_POST['cauthor']);
fclose($maj_fp_cauthor_txt);
}
$maj_key_rand = str_rand(14);
- $maj_fp_key_txt = fopen("data/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/key.txt","w");
+ $maj_fp_key_txt = fopen("$maj_data_directory/items/$maj_req_entry/comments/pending/$maj_comment_entry_dir/key.txt","w");
fwrite($maj_fp_key_txt,$maj_key_rand);
fclose($maj_fp_key_txt);
$maj_comment_quote = ucfirst($_POST['new_comment']);
- $maj_sig_author = file_get_contents("data/author.txt");
+ $maj_sig_author = file_get_contents("$maj_data_directory/author.txt");
$maj_sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
$maj_sig_url = str_replace('//','/',$maj_sig_url);
@@ -478,17 +472,17 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_email_to = strtolower($_POST['email']);
$maj_email_to = '"' . "$maj_firstname $maj_lastname" . '" <' . $maj_email_to . '>';
- if (file_exists("data/email.txt")) {
- $maj_from_email_author = file_get_contents("data/author.txt");
- $maj_from_email = file_get_contents("data/email.txt");
+ if (file_exists("$maj_data_directory/email.txt")) {
+ $maj_from_email_author = file_get_contents("$maj_data_directory/author.txt");
+ $maj_from_email = file_get_contents("$maj_data_directory/email.txt");
$maj_from_email = '"' . $maj_from_email_author . '" <' . $maj_from_email . '>';
}
$maj_mailer = 'MAJ/2.0 (PHP/' . phpversion() . ')';
- $maj_commented_entry_title = file_get_contents("data/items/$maj_req_entry/title.txt");
+ $maj_commented_entry_title = file_get_contents("$maj_data_directory/items/$maj_req_entry/title.txt");
- if (!file_exists("data/nak.txt") and file_exists("data/email.txt")) {
+ if (!file_exists("$maj_data_directory/nak.txt") and file_exists("$maj_data_directory/email.txt")) {
$maj_comment_thanks = "Hi $maj_firstname,\n\nThanks for submitting the following comment last $maj_timestamp:\n\n\"$maj_comment_quote\"\n\nIt will be e-mailed to me first for approval. Please visit the following URL to see if it has been posted:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&show=comments\n\nThanks again! =)\n\n--\n$maj_sig_author\n$maj_sig_url\n";
$maj_comment_thanks = wordwrap($maj_comment_thanks);
@@ -499,7 +493,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
"X-Mailer: $maj_mailer");
}
- if (file_exists("data/email.txt") and !file_exists("data/xscreen.txt")) {
+ if (file_exists("$maj_data_directory/email.txt") and !file_exists("$maj_data_directory/xscreen.txt")) {
$maj_comment_notice = "The following comment was submitted by $maj_email_to last $maj_timestamp for the entry \"$maj_commented_entry_title\":\n\n\"$maj_comment_quote\"\n\nVisit the link below to approve and post this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=approve\n\nVisit the link below to disapprove and delete this pending comment:\n\n{$maj_sig_url}index.php?entry=$maj_req_entry&comment={$maj_comment_entry_dir}&key={$maj_key_rand}&action=delete\n\nYou can also approve or disapprove pending comments at a later time by logging on to your blog.";
$maj_comment_notice = wordwrap($maj_comment_notice);
@@ -510,22 +504,22 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
"X-Mailer: $maj_mailer");
}
- if (!file_exists("data/comments")) {
- mkdir("data/comments");
+ if (!file_exists("$maj_data_directory/comments")) {
+ mkdir("$maj_data_directory/comments");
}
- if (!file_exists("data/comments/pending")) {
- mkdir("data/comments/pending");
+ if (!file_exists("$maj_data_directory/comments/pending")) {
+ mkdir("$maj_data_directory/comments/pending");
}
$maj_pending_comment_flag = $maj_req_entry;
- if (!file_exists("data/comments/pending/$maj_pending_comment_flag")) {
- mkdir("data/comments/pending/$maj_pending_comment_flag");
+ if (!file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag")) {
+ mkdir("$maj_data_directory/comments/pending/$maj_pending_comment_flag");
}
- if (file_exists("data/comments/pending/$maj_pending_comment_flag/count.txt")) {
- $maj_comment_count_value = file_get_contents("data/comments/pending/$maj_pending_comment_flag/count.txt");
+ if (file_exists("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt")) {
+ $maj_comment_count_value = file_get_contents("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt");
}
else {
$maj_comment_count_value = "0";
@@ -533,7 +527,7 @@ if (isset($maj_req_entry) and !empty($maj_req_entry)) {
$maj_comment_count_value = $maj_comment_count_value + 1;
- $maj_fp_comment_count_txt = fopen("data/comments/pending/$maj_pending_comment_flag/count.txt","w");
+ $maj_fp_comment_count_txt = fopen("$maj_data_directory/comments/pending/$maj_pending_comment_flag/count.txt","w");
fwrite($maj_fp_comment_count_txt,$maj_comment_count_value);
fclose($maj_fp_comment_count_txt);
}
@@ -543,9 +537,9 @@ else {
echo "<title>$maj_default_title</title>\r\n";
}
-if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")))) {
+if (file_exists("$maj_data_directory/comments/pending") and (file_exists("$maj_data_directory/xscreen.txt") or (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")))) {
- if ($maj_dh_xscreen_comments = opendir("data/comments/pending")) {
+ if ($maj_dh_xscreen_comments = opendir("$maj_data_directory/comments/pending")) {
while (($maj_xscreen_comment = readdir($maj_dh_xscreen_comments)) !== false) {
@@ -563,23 +557,23 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
foreach ($maj_xscreen_comments as $maj_xscreen_dir) {
- if ($maj_dh_xscreen_pending = opendir("data/items/$maj_xscreen_dir/comments/pending")) {
+ if ($maj_dh_xscreen_pending = opendir("$maj_data_directory/items/$maj_xscreen_dir/comments/pending")) {
while (($maj_xscreen_entry = readdir($maj_dh_xscreen_pending)) !== false) {
if ($maj_xscreen_entry != "." && $maj_xscreen_entry != "..") {
- if (isset($maj_logged_in_username) and file_exists("data/members/active/$maj_logged_in_username/xscreen.txt")) {
+ if (isset($maj_logged_in_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/xscreen.txt")) {
- if ($maj_logged_in_username == file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
+ if ($maj_logged_in_username == file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/author.txt")) {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
}
}
else {
- $maj_xscreen_key = file_get_contents("data/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
+ $maj_xscreen_key = file_get_contents("$maj_data_directory/items/$maj_xscreen_dir/comments/pending/$maj_xscreen_entry/key.txt");
header("Location: index.php?entry={$maj_xscreen_dir}&comment={$maj_xscreen_entry}&key={$maj_xscreen_key}&action=approve");
}
@@ -591,19 +585,19 @@ if (file_exists("data/comments/pending") and (file_exists("data/xscreen.txt") or
}
}
-if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_req_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_req_entry/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_req_entry/categories")) {
while (($maj_entry_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_entry_category != "." && $maj_entry_category != "..") {
- if (file_exists("data/categories/$maj_entry_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_entry_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -615,11 +609,11 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
if ($maj_private_categories == "0") {
- if (!file_exists("data/items/$maj_req_entry/passwd.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/passwd.txt")) {
- if (!file_exists("data/items/$maj_req_entry/private.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_req_entry/private.txt")) {
- $maj_description = file_get_contents("data/items/$maj_req_entry/body.txt");
+ $maj_description = file_get_contents("$maj_data_directory/items/$maj_req_entry/body.txt");
$maj_description = strip_tags($maj_description);
$maj_description = html_entity_decode($maj_description);
$maj_description = str_replace("&","&",$maj_description);
@@ -635,12 +629,12 @@ if (isset($maj_req_entry) and !empty($maj_req_entry) and file_exists("data/items
$maj_description = substr($maj_description,0,210);
$maj_description = htmlentities($maj_description,ENT_NOQUOTES);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
+ if (file_exists("$maj_data_directory/pf.txt") and file_exists("$maj_data_directory/pf-badwords.txt") and (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username)))) {
- $maj_badwords = file_get_contents("data/pf-badwords.txt");
+ $maj_badwords = file_get_contents("$maj_data_directory/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $maj_censor = file_get_contents("data/pf-censor.txt");
+ if (file_exists("$maj_data_directory/pf-censor.txt")) {
+ $maj_censor = file_get_contents("$maj_data_directory/pf-censor.txt");
}
else {
$maj_censor = "[expletive]";
@@ -665,16 +659,16 @@ include("css.php");
<?php
-if (file_exists("data/center.txt")) {
+if (file_exists("$maj_data_directory/center.txt")) {
echo "<center>";
}
-if (file_exists("data/header.txt")) {
+if (file_exists("$maj_data_directory/header.txt")) {
- $maj_header_panel = file_get_contents("data/header.txt");
+ $maj_header_panel = file_get_contents("$maj_data_directory/header.txt");
- if (file_exists("data/panels/$maj_header_panel") and (!file_exists("data/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
- include("data/panels/$maj_header_panel/panel.php");
+ if (file_exists("$maj_data_directory/panels/$maj_header_panel") and (!file_exists("$maj_data_directory/panels/$maj_header_panel/private.txt") or isset($maj_logged_in_username))) {
+ include("$maj_data_directory/panels/$maj_header_panel/panel.php");
}
}
@@ -685,7 +679,7 @@ echo "<tr>\r\n<td width=\"$maj_wspace\" rowspan=\"2\"><div style=\"width: {$maj_
echo "<tr><td width=\"$maj_wside\" valign=\"top\">\r\n";
-if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+if (!file_exists("$maj_data_directory/xprofile.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "\r\n<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Profile</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t";
@@ -694,7 +688,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_gif_image_width = $maj_profile_gif_image_size[0];
$maj_profile_gif_image_height = $maj_profile_gif_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_gif_image_width = 150;
}
else {
@@ -718,7 +712,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_jpg_image_width = $maj_profile_jpg_image_size[0];
$maj_profile_jpg_image_height = $maj_profile_jpg_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_jpg_image_width = 150;
}
else {
@@ -742,7 +736,7 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
$maj_profile_png_image_width = $maj_profile_png_image_size[0];
$maj_profile_png_image_height = $maj_profile_png_image_size[1];
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt")) {
$maj_max_profile_png_image_width = 150;
}
else {
@@ -761,16 +755,16 @@ if (!file_exists("data/xprofile.txt") or ($maj_logged_in_username == $maj_admin_
}
}
- include("data/profile.php");
+ include("$maj_data_directory/profile.php");
echo "\r\n\t</div>\r\n</div>\r\n\r\n";
}
-if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
+if (!file_exists("$maj_data_directory/xnavigation.txt") or ($maj_logged_in_username == $maj_admin_username)) {
echo "<div class=\"panel_wrapper\">\r\n\r\n\t<div class=\"panel_title\">Navigation</div>\r\n\r\n\t<div class=\"panel_body\">\r\n\t\t<a class=\"navlink\" href=\".\">Home</a><br>\r\n";
- if (file_exists("data/bb.txt") and file_exists("data/members/active")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/members/active")) {
echo "\t\t<a class=\"navlink\" href=\"member.php?id=all\">Members</a><br>\r\n";
}
@@ -783,16 +777,16 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo "\t\t<a class=\"navlink\" href=\"fonts.php\">Fonts</a><br>\r\n";
echo "\t\t<a class=\"navlink\" href=\"login.php\">Logout</a>\r\n";
}
- elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/bb.txt")) {
+ elseif (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/bb.txt")) {
- if (file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
+ if (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category")) {
- if (!file_exists("data/categories/$maj_req_category")) {
- rmdirr("data/members/active/$maj_logged_in_username/categories/$maj_req_category");
+ if (!file_exists("$maj_data_directory/categories/$maj_req_category")) {
+ rmdirr("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category");
}
}
- if (!file_exists("data/noadd.txt") and (file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("data/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
+ if (!file_exists("$maj_data_directory/noadd.txt") and (file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") or file_exists("$maj_data_directory/members/active/$maj_logged_in_username/categories/$maj_req_category"))) {
echo '<a class="navlink" href="add.php">Add Entry</a><br>';
}
@@ -800,7 +794,7 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo '<a class="navlink" href="login.php">Logout</a>';
}
else {
- if (file_exists("data/bb.txt") and file_exists("data/reg.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/reg.txt")) {
echo '<a class="navlink" href="reg.php">Register</a><br>';
}
@@ -810,31 +804,31 @@ if (!file_exists("data/xnavigation.txt") or ($maj_logged_in_username == $maj_adm
echo "\t</div>\r\n</div>\r\n";
}
-if (file_exists("data/sticky")) {
+if (file_exists("$maj_data_directory/sticky")) {
- if ($maj_dh_sticky = opendir("data/sticky")) {
+ if ($maj_dh_sticky = opendir("$maj_data_directory/sticky")) {
while (($maj_sticky_entry = readdir($maj_dh_sticky)) !== false) {
- if (file_exists("data/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_sticky_entry/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_sticky_entry/categories")) {
- if ($maj_dh_sticky_categories = opendir("data/items/$maj_sticky_entry/categories")) {
+ if ($maj_dh_sticky_categories = opendir("$maj_data_directory/items/$maj_sticky_entry/categories")) {
while (($maj_sticky_category = readdir($maj_dh_sticky_categories)) !== false) {
if ($maj_sticky_category != "." && $maj_sticky_category != "..") {
- if (file_exists("data/categories/$maj_sticky_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_sticky_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -843,7 +837,7 @@ if (file_exists("data/sticky")) {
}
}
- if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$maj_sticky_entry/cat.txt")) {
+ if (($maj_private_categories > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("$maj_data_directory/items/$maj_sticky_entry/cat.txt")) {
continue;
}
@@ -866,7 +860,7 @@ if (file_exists("data/sticky")) {
foreach ($maj_sticky_entries as $maj_sticky_list_entry) {
echo "<a class=\"navlink\" href=\"index.php?entry=$maj_sticky_list_entry\">";
- readfile("data/items/$maj_sticky_list_entry/title.txt");
+ readfile("$maj_data_directory/items/$maj_sticky_list_entry/title.txt");
echo "</a><br>";
}
@@ -874,52 +868,52 @@ if (file_exists("data/sticky")) {
}
}
-if (file_exists("data/panels")) {
+if (file_exists("$maj_data_directory/panels")) {
- if ($maj_dh_panels = opendir("data/panels")) {
+ if ($maj_dh_panels = opendir("$maj_data_directory/panels")) {
while (($maj_panel = readdir($maj_dh_panels)) !== false) {
if ($maj_panel != "." && $maj_panel != "..") {
- if (file_exists("data/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
- if (file_exists("data/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/auth.txt") and !isset($maj_logged_in_username)) {
continue;
}
- if (file_exists("data/panels/$maj_panel/right.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/right.txt")) {
$maj_right_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/top.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/top.txt")) {
$maj_top_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/bottom.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/bottom.txt")) {
$maj_bottom_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/center.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/center.txt")) {
$maj_center_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/panels/$maj_panel/entry.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_panel/entry.txt")) {
$maj_entry_panels[] = $maj_panel;
continue;
}
- if (file_exists("data/header.txt") and (file_get_contents("data/header.txt") == $maj_panel)) {
+ if (file_exists("$maj_data_directory/header.txt") and (file_get_contents("$maj_data_directory/header.txt") == $maj_panel)) {
continue;
}
- if (file_exists("data/footer.txt") and (file_get_contents("data/footer.txt") == $maj_panel)) {
+ if (file_exists("$maj_data_directory/footer.txt") and (file_get_contents("$maj_data_directory/footer.txt") == $maj_panel)) {
continue;
}
@@ -963,10 +957,10 @@ if (file_exists("data/panels")) {
foreach ($maj_left_panels as $maj_left_panel) {
- if (!file_exists("data/panels/$maj_left_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
- if (file_exists("data/panels/$maj_left_panel/border.txt")) {
- $maj_left_panel_border = file_get_contents("data/panels/$maj_left_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/border.txt")) {
+ $maj_left_panel_border = file_get_contents("$maj_data_directory/panels/$maj_left_panel/border.txt");
}
else {
if (isset($maj_left_panel_border)) {
@@ -974,8 +968,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/bgcolor-t.txt")) {
- $maj_left_panel_bgcolor_t = file_get_contents("data/panels/$maj_left_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt")) {
+ $maj_left_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-t.txt");
}
else {
if (isset($maj_left_panel_bgcolor_t)) {
@@ -983,8 +977,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/bgcolor-c.txt")) {
- $maj_left_panel_bgcolor_c = file_get_contents("data/panels/$maj_left_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt")) {
+ $maj_left_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/bgcolor-c.txt");
}
else {
if (isset($maj_left_panel_bgcolor_c)) {
@@ -992,8 +986,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/text-t.txt")) {
- $maj_left_panel_text_t = file_get_contents("data/panels/$maj_left_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-t.txt")) {
+ $maj_left_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-t.txt");
}
else {
if (isset($maj_left_panel_text_t)) {
@@ -1001,8 +995,8 @@ if (file_exists("data/panels")) {
}
}
- if (file_exists("data/panels/$maj_left_panel/text-c.txt")) {
- $maj_left_panel_text_c = file_get_contents("data/panels/$maj_left_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/text-c.txt")) {
+ $maj_left_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_left_panel/text-c.txt");
}
else {
if (isset($maj_left_panel_text_c)) {
@@ -1034,14 +1028,14 @@ if (file_exists("data/panels")) {
echo ">";
- readfile("data/panels/$maj_left_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_left_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_left_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_left_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1072,15 +1066,15 @@ if (file_exists("data/panels")) {
echo ">\r\n\t\t";
}
- if (file_exists("data/panels/$maj_left_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_left_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_left_panel/panel.php");
echo "\r\n\t</div>\r\n</div>\r\n";
- if (file_exists("data/panels/$maj_left_panel/free.txt") and !file_exists("data/panels/$maj_left_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_left_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_left_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1095,10 +1089,10 @@ if ($maj_count_top_panels > 0) {
foreach ($maj_top_panels as $maj_top_panel) {
- if (!file_exists("data/panels/$maj_top_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
- if (file_exists("data/panels/$maj_top_panel/border.txt")) {
- $maj_top_panel_border = file_get_contents("data/panels/$maj_top_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/border.txt")) {
+ $maj_top_panel_border = file_get_contents("$maj_data_directory/panels/$maj_top_panel/border.txt");
}
else {
if (isset($maj_top_panel_border)) {
@@ -1106,8 +1100,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/bgcolor-t.txt")) {
- $maj_top_panel_bgcolor_t = file_get_contents("data/panels/$maj_top_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt")) {
+ $maj_top_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-t.txt");
}
else {
if (isset($maj_top_panel_bgcolor_t)) {
@@ -1115,8 +1109,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/bgcolor-c.txt")) {
- $maj_top_panel_bgcolor_c = file_get_contents("data/panels/$maj_top_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt")) {
+ $maj_top_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/bgcolor-c.txt");
}
else {
if (isset($maj_top_panel_bgcolor_c)) {
@@ -1124,8 +1118,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/text-t.txt")) {
- $maj_top_panel_text_t = file_get_contents("data/panels/$maj_top_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-t.txt")) {
+ $maj_top_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-t.txt");
}
else {
if (isset($maj_top_panel_text_t)) {
@@ -1133,8 +1127,8 @@ if ($maj_count_top_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_top_panel/text-c.txt")) {
- $maj_top_panel_text_c = file_get_contents("data/panels/$maj_top_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/text-c.txt")) {
+ $maj_top_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_top_panel/text-c.txt");
}
else {
if (isset($maj_top_panel_text_c)) {
@@ -1166,14 +1160,14 @@ if ($maj_count_top_panels > 0) {
echo '>';
- readfile("data/panels/$maj_top_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_top_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_top_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_top_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1204,15 +1198,15 @@ if ($maj_count_top_panels > 0) {
echo ">\r\n\t\t\t";
}
- if (file_exists("data/panels/$maj_top_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_top_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_top_panel/panel.php");
echo "\r\n\t\t</div>\r\n\t</div>\r\n\r\n";
- if (file_exists("data/panels/$maj_top_panel/free.txt") and !file_exists("data/panels/$maj_top_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_top_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_top_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1220,47 +1214,47 @@ if ($maj_count_top_panels > 0) {
// clean-up (start)
-if (file_exists("data/albums")) {
- rmdirr("data/albums");
+if (file_exists("$maj_data_directory/albums")) {
+ rmdirr("$maj_data_directory/albums");
}
// clean-up (end)
// global entry items (start)
-if ($maj_dh_items = opendir("data/items")) {
+if ($maj_dh_items = opendir("$maj_data_directory/items")) {
while (($maj_item = readdir($maj_dh_items)) !== false) {
if ($maj_item != "." && $maj_item != "..") {
- if (file_exists("data/items/$maj_item/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_egroups = opendir("data/items/$maj_item/categories")) {
+ if ($maj_dh_egroups = opendir("$maj_data_directory/items/$maj_item/categories")) {
while (($maj_egroup = readdir($maj_dh_egroups)) !== false) {
if ($maj_egroup != "." && $maj_egroup != "..") {
- if (!file_exists("data/categories/$maj_egroup")) {
- rmdirr("data/items/$maj_item/categories/$maj_egroup");
+ if (!file_exists("$maj_data_directory/categories/$maj_egroup")) {
+ rmdirr("$maj_data_directory/items/$maj_item/categories/$maj_egroup");
}
- if (file_exists("data/categories/$maj_egroup/members")) {
+ if (file_exists("$maj_data_directory/categories/$maj_egroup/members")) {
- if ($maj_dh_mgroups = opendir("data/categories/$maj_egroup/members")) {
+ if ($maj_dh_mgroups = opendir("$maj_data_directory/categories/$maj_egroup/members")) {
while (($maj_mgroup = readdir($maj_dh_mgroups)) !== false) {
if ($maj_mgroup != "." && $maj_mgroup != "..") {
- if (!file_exists("data/items/$maj_item/members/$maj_mgroup")) {
+ if (!file_exists("$maj_data_directory/items/$maj_item/members/$maj_mgroup")) {
- if (!file_exists("data/items/$maj_item/members")) {
- mkdir("data/items/$maj_item/members");
+ if (!file_exists("$maj_data_directory/items/$maj_item/members")) {
+ mkdir("$maj_data_directory/items/$maj_item/members");
}
- mkdir("data/items/$maj_item/members/$maj_mgroup");
+ mkdir("$maj_data_directory/items/$maj_item/members/$maj_mgroup");
}
}
}
@@ -1273,66 +1267,66 @@ if ($maj_dh_items = opendir("data/items")) {
}
}
- 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("$maj_data_directory/items/$maj_item/categories") and (count(glob("$maj_data_directory/items/$maj_item/categories/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/categories");
}
- if (file_exists("data/items/$maj_item/members")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/members")) {
- if ($maj_dh_members = opendir("data/items/$maj_item/members")) {
+ if ($maj_dh_members = opendir("$maj_data_directory/items/$maj_item/members")) {
while (($maj_member = readdir($maj_dh_members)) !== false) {
if ($maj_member != "." && $maj_member != "..") {
- if (!file_exists("data/members/active/$maj_member")) {
- rmdirr("data/items/$maj_item/members/$maj_member");
+ if (!file_exists("$maj_data_directory/members/active/$maj_member")) {
+ rmdirr("$maj_data_directory/items/$maj_item/members/$maj_member");
}
}
}
- closedir("data/items/$maj_item/members");
+ closedir("$maj_data_directory/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("$maj_data_directory/items/$maj_item/members") and (count(glob("$maj_data_directory/items/$maj_item/members/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/members");
}
- if (file_exists("data/items/$maj_item/comments/live") and (count(glob("data/items/$maj_item/comments/live/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments/live");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments/live") and (count(glob("$maj_data_directory/items/$maj_item/comments/live/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments/live");
}
- if (file_exists("data/items/$maj_item/comments/pending") and (count(glob("data/items/$maj_item/comments/pending/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments/pending");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments/pending") and (count(glob("$maj_data_directory/items/$maj_item/comments/pending/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments/pending");
}
- if (file_exists("data/items/$maj_item/comments") and (count(glob("data/items/$maj_item/comments/*")) < 1)) {
- rmdirr("data/items/$maj_item/comments");
+ if (file_exists("$maj_data_directory/items/$maj_item/comments") and (count(glob("$maj_data_directory/items/$maj_item/comments/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/comments");
}
- if (file_exists("data/items/$maj_item/filedrop/files") and (count(glob("data/items/$maj_item/filedrop/files/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop/files");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop/files") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/files/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop/files");
}
- if (file_exists("data/items/$maj_item/filedrop/count") and (count(glob("data/items/$maj_item/filedrop/count/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop/count");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop/count") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/count/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop/count");
}
- if (file_exists("data/items/$maj_item/filedrop") and (count(glob("data/items/$maj_item/filedrop/*")) < 1)) {
- rmdirr("data/items/$maj_item/filedrop");
+ if (file_exists("$maj_data_directory/items/$maj_item/filedrop") and (count(glob("$maj_data_directory/items/$maj_item/filedrop/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/filedrop");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album/captions") and (count(glob("data/items/$maj_item/album/captions/*")) < 1)) {
- 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("$maj_data_directory/items/$maj_item/album/captions") and (count(glob("$maj_data_directory/items/$maj_item/album/captions/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album/captions");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("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("$maj_data_directory/items/$maj_item/album/views") and (count(glob("$maj_data_directory/items/$maj_item/album/views/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album/views");
+ unlink("$maj_data_directory/items/$maj_item/album/views.txt");
}
- if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("data/items/$maj_item/album") and (count(glob("data/items/$maj_item/album/*")) < 1)) {
- rmdirr("data/items/$maj_item/album");
+ if ((!file_exists("images/$maj_item/album") or (count(glob("images/$maj_item/album/*")) < 1)) and file_exists("$maj_data_directory/items/$maj_item/album") and (count(glob("$maj_data_directory/items/$maj_item/album/*")) < 1)) {
+ rmdirr("$maj_data_directory/items/$maj_item/album");
}
if (file_exists("images/$maj_item/album") and (count(glob("images/$maj_item/album/*")) < 1)) {
@@ -1353,11 +1347,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")) {
+ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
$maj_items[] = $maj_req_entry;
}
- if (isset($maj_req_category) and file_exists("data/categories/$maj_req_category") and file_exists("data/items/$maj_item/categories/$maj_req_category")) {
+ if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
$maj_items[] = $maj_item;
}
@@ -1365,21 +1359,21 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
if (isset($maj_req_find)) {
- if ((($maj_req_find == "private") or ($maj_req_find == "member") or ($maj_req_find == "passwd")) and file_exists("data/items/$maj_item/{$maj_req_find}.txt")) {
+ if ((($maj_req_find == "private") or ($maj_req_find == "member") or ($maj_req_find == "passwd")) and file_exists("$maj_data_directory/items/$maj_item/{$maj_req_find}.txt")) {
$maj_items[] = $maj_item;
}
- if ((($maj_req_find == "comments") or ($maj_req_find == "filedrop") or ($maj_req_find == "album")) and file_exists("data/items/$maj_item/$maj_req_find")) {
+ if ((($maj_req_find == "comments") or ($maj_req_find == "filedrop") or ($maj_req_find == "album")) and file_exists("$maj_data_directory/items/$maj_item/$maj_req_find")) {
$maj_items[] = $maj_item;
}
- if (($maj_req_find == "unfiled") and !file_exists("data/items/$maj_item/categories")) {
+ if (($maj_req_find == "unfiled") and !file_exists("$maj_data_directory/items/$maj_item/categories")) {
$maj_items[] = $maj_item;
}
}
@@ -1390,7 +1384,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_latest[] = $maj_item;
- if (file_exists("data/items/$maj_item/album")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
@@ -1408,21 +1402,21 @@ if ($maj_dh_items = opendir("data/items")) {
continue;
}
- if (file_exists("data/items/$maj_item/private.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/private.txt")) {
continue;
}
$maj_private_categories = "0";
- if (file_exists("data/items/$maj_item/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/categories")) {
- if ($maj_dh_entry_categories = opendir("data/items/$maj_item/categories")) {
+ if ($maj_dh_entry_categories = opendir("$maj_data_directory/items/$maj_item/categories")) {
while (($maj_item_category = readdir($maj_dh_entry_categories)) !== false) {
if ($maj_item_category != "." && $maj_item_category != "..") {
- if (file_exists("data/categories/$maj_item_category/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_item_category/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
}
@@ -1431,34 +1425,34 @@ if ($maj_dh_items = opendir("data/items")) {
}
}
- if (($maj_private_categories > 0) and !file_exists("data/items/$maj_item/cat.txt")) {
+ if (($maj_private_categories > 0) and !file_exists("$maj_data_directory/items/$maj_item/cat.txt")) {
continue;
}
$maj_latest[] = $maj_item;
- if ((file_exists("data/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("data/items/$maj_item/members") and !file_exists("data/items/$maj_item/members/$maj_logged_in_username"))) {
+ if ((file_exists("$maj_data_directory/items/$maj_item/members") and !isset($maj_logged_in_username)) or (file_exists("$maj_data_directory/items/$maj_item/members") and !file_exists("$maj_data_directory/items/$maj_item/members/$maj_logged_in_username"))) {
continue;
}
- if (file_exists("data/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_item/member.txt") and (!isset($maj_logged_in_username))) {
continue;
}
- if (file_exists("data/items/$maj_item/album")) {
+ if (file_exists("$maj_data_directory/items/$maj_item/album")) {
$maj_albums[] = $maj_item;
}
$maj_random[] = $maj_item;
$maj_archives[] = substr($maj_item,0,6);
- if (file_exists("data/nocat.txt") and file_exists("data/items/$maj_item/categories") and !file_exists("data/items/$maj_item/cat.txt") and (!isset($maj_req_category) or empty($maj_req_category)) and (!isset($maj_req_entry) or empty($maj_req_entry)) and (!isset($maj_req_author) or empty($maj_req_author))) {
+ if (file_exists("$maj_data_directory/nocat.txt") and file_exists("$maj_data_directory/items/$maj_item/categories") and !file_exists("$maj_data_directory/items/$maj_item/cat.txt") and (!isset($maj_req_category) or empty($maj_req_category)) and (!isset($maj_req_entry) or empty($maj_req_entry)) and (!isset($maj_req_author) or empty($maj_req_author))) {
continue;
}
if (isset($maj_req_entry) or isset($maj_req_category) or isset($maj_req_archive) or isset($maj_req_find) or isset($maj_req_author)) {
- if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+ if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
if ($maj_req_entry != $maj_item) {
continue;
@@ -1466,7 +1460,7 @@ if ($maj_dh_items = opendir("data/items")) {
$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")) {
+ if (isset($maj_req_category) and file_exists("$maj_data_directory/categories/$maj_req_category") and file_exists("$maj_data_directory/items/$maj_item/categories/$maj_req_category")) {
$maj_items[] = $maj_item;
}
@@ -1474,7 +1468,7 @@ if ($maj_dh_items = opendir("data/items")) {
$maj_items[] = $maj_item;
}
- if (isset($maj_req_author) and (file_exists("data/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("data/items/$maj_item/author.txt") == $maj_req_author)) {
+ if (isset($maj_req_author) and (file_exists("$maj_data_directory/members/active/$maj_req_author") or ($maj_admin_username == $maj_req_author)) and (file_get_contents("$maj_data_directory/items/$maj_item/author.txt") == $maj_req_author)) {
$maj_items[] = $maj_item;
}
}
@@ -1494,13 +1488,13 @@ reset($maj_grand);
$maj_count_grand = count($maj_grand);
-if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
+if (isset($maj_req_entry) and file_exists("$maj_data_directory/items/$maj_req_entry")) {
- if (file_exists("data/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
unset($maj_items);
}
- if (file_exists("data/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
+ if (file_exists("$maj_data_directory/items/$maj_req_entry/member.txt") and !isset($maj_logged_in_username)) {
unset($maj_items);
}
}
@@ -1508,7 +1502,7 @@ if (isset($maj_req_entry) and file_exists("data/items/$maj_req_entry")) {
$maj_items = array_unique($maj_items);
$maj_items = array_values($maj_items);
-if (file_exists("data/old.txt")) {
+if (file_exists("$maj_data_directory/old.txt")) {
sort($maj_items);
}
else {
@@ -1539,7 +1533,7 @@ reset($maj_archives);
$maj_count_archives = count($maj_archives);
-if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_exists("data/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
+if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/bb-summary.txt") and !file_exists("$maj_data_directory/lite.txt") and !isset($maj_req_entry) and !isset($maj_req_category) and !isset($_REQUEST['start']) and !isset($maj_req_author) and !isset($maj_req_archive) and !isset($maj_req_find)) {
if ($maj_count_latest > 0) {
@@ -1555,7 +1549,7 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
echo "<tr><td bgcolor=\"#ffffff\"><a href=\"index.php?entry=$maj_latest[$maj_increment_latest]";
- if ($maj_dh_summary_comments = opendir("data/items/$maj_latest[$maj_increment_latest]/comments/live")) {
+ if ($maj_dh_summary_comments = opendir("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/comments/live")) {
while (($maj_entry_summary_comments = readdir($maj_dh_summary_comments)) !== false) {
@@ -1575,21 +1569,21 @@ if (file_exists("data/bb.txt") and file_exists("data/bb-summary.txt") and !file_
}
echo "\">";
- readfile("data/items/$maj_latest[$maj_increment_latest]/title.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/title.txt");
echo "</a></td>";
echo "<td bgcolor=\"#ffffff\"><a href=\"member.php?id=";
- readfile("data/items/$maj_latest[$maj_increment_latest]/author.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
echo "\">";
- readfile("data/items/$maj_latest[$maj_increment_latest]/author.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/author.txt");
echo "</a></td>";
echo "<td bgcolor=\"#ffffff\" align=\"right\">";
- if (!file_exists("data/items/$maj_latest[$maj_increment_latest]/views.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt")) {
echo 0;
}
else {
- readfile("data/items/$maj_latest[$maj_increment_latest]/views.txt");
+ readfile("$maj_data_directory/items/$maj_latest[$maj_increment_latest]/views.txt");
}
echo "</td>";
@@ -1631,10 +1625,10 @@ if ($maj_count_center_panels > 0) {
foreach ($maj_center_panels as $maj_center_panel) {
- if (!file_exists("data/panels/$maj_center_panel/free.txt")) {
+ if (!file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
- if (file_exists("data/panels/$maj_center_panel/border.txt")) {
- $maj_center_panel_border = file_get_contents("data/panels/$maj_center_panel/border.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/border.txt")) {
+ $maj_center_panel_border = file_get_contents("$maj_data_directory/panels/$maj_center_panel/border.txt");
}
else {
if (isset($maj_center_panel_border)) {
@@ -1642,8 +1636,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/bgcolor-t.txt")) {
- $maj_center_panel_bgcolor_t = file_get_contents("data/panels/$maj_center_panel/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt")) {
+ $maj_center_panel_bgcolor_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-t.txt");
}
else {
if (isset($maj_center_panel_bgcolor_t)) {
@@ -1651,8 +1645,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/bgcolor-c.txt")) {
- $maj_center_panel_bgcolor_c = file_get_contents("data/panels/$maj_center_panel/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt")) {
+ $maj_center_panel_bgcolor_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/bgcolor-c.txt");
}
else {
if (isset($maj_center_panel_bgcolor_c)) {
@@ -1660,8 +1654,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/text-t.txt")) {
- $maj_center_panel_text_t = file_get_contents("data/panels/$maj_center_panel/text-t.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-t.txt")) {
+ $maj_center_panel_text_t = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-t.txt");
}
else {
if (isset($maj_center_panel_text_t)) {
@@ -1669,8 +1663,8 @@ if ($maj_count_center_panels > 0) {
}
}
- if (file_exists("data/panels/$maj_center_panel/text-c.txt")) {
- $maj_center_panel_text_c = file_get_contents("data/panels/$maj_center_panel/text-c.txt");
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/text-c.txt")) {
+ $maj_center_panel_text_c = file_get_contents("$maj_data_directory/panels/$maj_center_panel/text-c.txt");
}
else {
if (isset($maj_center_panel_text_c)) {
@@ -1702,14 +1696,14 @@ if ($maj_count_center_panels > 0) {
echo '>';
- readfile("data/panels/$maj_center_panel/title.txt");
+ readfile("$maj_data_directory/panels/$maj_center_panel/title.txt");
if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo "<a href=\"panels.php#{$maj_center_panel}\">";
echo '<img src="images/widget.edit.png" border="0" width="11" height="11" align="right"></a>';
}
- if (file_exists("data/panels/$maj_center_panel/private.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/private.txt")) {
echo '<img src="images/widget.private.png" border="0" width="11" height="11" align="right">';
}
@@ -1740,15 +1734,15 @@ if ($maj_count_center_panels > 0) {
echo '>';
}
- if (file_exists("data/panels/$maj_center_panel/free.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt")) {
echo '<div class=panel_free>';
}
- include("data/panels/$maj_center_panel/panel.php");
+ include("$maj_data_directory/panels/$maj_center_panel/panel.php");
echo '</div></div>';
- if (file_exists("data/panels/$maj_center_panel/free.txt") and !file_exists("data/panels/$maj_center_panel/nomargin.txt")) {
+ if (file_exists("$maj_data_directory/panels/$maj_center_panel/free.txt") and !file_exists("$maj_data_directory/panels/$maj_center_panel/nomargin.txt")) {
echo "<div style=\"height: {$maj_wspace}px;\"></div>";
}
}
@@ -1756,9 +1750,9 @@ if ($maj_count_center_panels > 0) {
if (isset($maj_req_category) and !empty($maj_req_category)) {
- if (file_exists("data/categories/$maj_req_category/book.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_req_category/book.txt")) {
- if (!file_exists("data/old.txt")) {
+ if (!file_exists("$maj_data_directory/old.txt")) {
sort($maj_items);
}
else {
@@ -1829,8 +1823,8 @@ foreach ($maj_disp as $maj_d) {
echo "\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\" style=\"background-color: transparent;\"><tr><td width=\"$maj_wmain\">\r\n\r\n\t";
- if (file_exists("data/items/$maj_d/border.txt")) {
- $maj_d_border = file_get_contents("data/items/$maj_d/border.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/border.txt")) {
+ $maj_d_border = file_get_contents("$maj_data_directory/items/$maj_d/border.txt");
}
else {
if (isset($maj_d_border)) {
@@ -1838,8 +1832,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-t.txt")) {
- $maj_d_bgcolor_t = file_get_contents("data/items/$maj_d/bgcolor-t.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-t.txt")) {
+ $maj_d_bgcolor_t = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-t.txt");
}
else {
if (isset($maj_d_bgcolor_t)) {
@@ -1847,8 +1841,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-b.txt")) {
- $maj_d_bgcolor_b = file_get_contents("data/items/$maj_d/bgcolor-b.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-b.txt")) {
+ $maj_d_bgcolor_b = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-b.txt");
}
else {
if (isset($maj_d_bgcolor_b)) {
@@ -1856,8 +1850,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-c.txt")) {
- $maj_d_bgcolor_c = file_get_contents("data/items/$maj_d/bgcolor-c.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-c.txt")) {
+ $maj_d_bgcolor_c = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-c.txt");
}
else {
if (isset($maj_d_bgcolor_c)) {
@@ -1865,8 +1859,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/bgcolor-f.txt")) {
- $maj_d_bgcolor_f = file_get_contents("data/items/$maj_d/bgcolor-f.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/bgcolor-f.txt")) {
+ $maj_d_bgcolor_f = file_get_contents("$maj_data_directory/items/$maj_d/bgcolor-f.txt");
}
else {
if (isset($maj_d_bgcolor_f)) {
@@ -1874,8 +1868,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-t.txt")) {
- $maj_d_text_t = file_get_contents("data/items/$maj_d/text-t.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-t.txt")) {
+ $maj_d_text_t = file_get_contents("$maj_data_directory/items/$maj_d/text-t.txt");
}
else {
if (isset($maj_d_text_t)) {
@@ -1883,8 +1877,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-b.txt")) {
- $maj_d_text_b = file_get_contents("data/items/$maj_d/text-b.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-b.txt")) {
+ $maj_d_text_b = file_get_contents("$maj_data_directory/items/$maj_d/text-b.txt");
}
else {
if (isset($maj_d_text_b)) {
@@ -1892,8 +1886,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-c.txt")) {
- $maj_d_text_c = file_get_contents("data/items/$maj_d/text-c.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-c.txt")) {
+ $maj_d_text_c = file_get_contents("$maj_data_directory/items/$maj_d/text-c.txt");
}
else {
if (isset($maj_d_text_c)) {
@@ -1901,8 +1895,8 @@ foreach ($maj_disp as $maj_d) {
}
}
- if (file_exists("data/items/$maj_d/text-f.txt")) {
- $maj_d_text_f = file_get_contents("data/items/$maj_d/text-f.txt");
+ if (file_exists("$maj_data_directory/items/$maj_d/text-f.txt")) {
+ $maj_d_text_f = file_get_contents("$maj_data_directory/items/$maj_d/text-f.txt");
}
else {
if (isset($maj_d_text_f)) {
@@ -1912,7 +1906,7 @@ foreach ($maj_disp as $maj_d) {
echo "\t<div class=\"panel_wrapper\">\r\n\r\n\t\t\t";
- if (!file_exists("data/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/xtitle.txt") or (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username))) {
echo '<div class="panel_title"';
@@ -1938,17 +1932,17 @@ foreach ($maj_disp as $maj_d) {
echo '>';
- readfile("data/items/$maj_d/title.txt");
+ readfile("$maj_data_directory/items/$maj_d/title.txt");
- if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("data/members/active/$maj_logged_in_username") and file_exists("data/wiki.txt") and (file_exists("data/items/$maj_d/edit.txt") or (file_get_contents("data/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("data/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("data/items/$maj_d/passwd.txt") and !file_exists("data/items/$maj_d/lock.txt")) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username != $maj_admin_username) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username") and file_exists("$maj_data_directory/wiki.txt") and (file_exists("$maj_data_directory/items/$maj_d/edit.txt") or (file_get_contents("$maj_data_directory/items/$maj_d/author.txt") == $maj_logged_in_username)) and file_exists("$maj_data_directory/members/active/$maj_logged_in_username/bb-rw.txt") and !file_exists("$maj_data_directory/items/$maj_d/passwd.txt") and !file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
- if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
+ if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\">";
echo "<img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\">";
echo "</a>";
}
- if (!file_exists("data/items/$maj_d/lock.txt")) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/lock.txt")) {
echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
}
}
@@ -1957,50 +1951,50 @@ foreach ($maj_disp as $maj_d) {
echo "<a href=\"del.php?entry=$maj_d\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete entry\"></a>";
- if (!file_exists("data/items/$maj_d/private.txt") and !file_exists("data/items/$maj_d/categories") and file_exists("data/bb.txt") and (count(glob("data/items/$maj_d/comments/live/*")) === 0) and (count(glob("data/items/$maj_d/comments/pending/*")) === 0)) {
+ if (!file_exists("$maj_data_directory/items/$maj_d/private.txt") and !file_exists("$maj_data_directory/items/$maj_d/categories") and file_exists("$maj_data_directory/bb.txt") and (count(glob("$maj_data_directory/items/$maj_d/comments/live/*")) === 0) and (count(glob("$maj_data_directory/items/$maj_d/comments/pending/*")) === 0)) {
echo "<a href=\"move.php?entry=$maj_d\"><img src=\"images/widget.move.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"move to comment\"></a>";
}
- if (file_exists("data/items/$maj_d/wiki/delta") and (count(glob("data/items/$maj_d/wiki/delta/*")) > 0)) {
+ if (file_exists("$maj_data_directory/items/$maj_d/wiki/delta") and (count(glob("$maj_data_directory/items/$maj_d/wiki/delta/*")) > 0)) {
echo "<a href=\"wiki.php?entry=$maj_d\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"revisions\"></a>";
}
echo "<a href=\"edit.php?entry=$maj_d\"><img src=\"images/widget.edit.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"edit entry\"></a>";
- if (file_exists("data/items/$maj_d/passwd.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/passwd.txt")) {
echo "<img src=\"images/widget.protected.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"protected entry\">";
}
- if (file_exists("data/items/$maj_d/private.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/private.txt")) {
echo "<img src=\"images/widget.private.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private entry\">";
}
- if (file_exists("data/items/$maj_d/member.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/member.txt")) {
echo "<img src=\"images/widget.member.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"members-only entry\">";
}
- if (file_exists("data/items/$maj_d/cat.txt")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/cat.txt")) {
echo "<img src=\"images/widget.cat.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"always displayed\">";
}
- if (file_exists("data/items/$maj_d/categories/$maj_req_category")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/categories/$maj_req_category")) {
$maj_private_categories = "0";
$maj_book_categories = "0";
- if (file_exists("data/items/$maj_d/categories")) {
+ if (file_exists("$maj_data_directory/items/$maj_d/categories")) {
- if ($maj_dh_read_cat_dir = opendir("data/items/$maj_d/categories")) {
+ if ($maj_dh_read_cat_dir = opendir("$maj_data_directory/items/$maj_d/categories")) {
while (($maj_read_cat_dir = readdir($maj_dh_read_cat_dir)) !== false) {
if ($maj_read_cat_dir != "." && $maj_read_cat_dir != "..") {
- if (file_exists("data/categories/$maj_read_cat_dir/private.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/private.txt")) {
$maj_private_categories = $maj_private_categories + 1;
}
- if (file_exists("data/categories/$maj_read_cat_dir/book.txt")) {
+ if (file_exists("$maj_data_directory/categories/$maj_read_cat_dir/book.txt")) {
$maj_book_categories = $maj_book_categories + 1;
}
}
@@ -2013,7 +2007,7 @@ foreach ($maj_disp as $maj_d) {
echo "<img src=\"images/widget.hidden.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"private category\">";
}
- if (file_exists("data/nocat.txt")) {
+ if (file_exists("$maj_data_directory/nocat.txt")) {
echo "<img src=\"images/widget.isolated.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"isolated category\">";
}
@@ -2055,35 +2049,35 @@ foreach ($maj_disp as $maj_d) {
echo "\r\n\t\t\t\t<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
- if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/author.txt") and !file_exists("data/items/$maj_d/xavatar.txt")) {
+ if (file_exists("$maj_data_directory/bb.txt") and file_exists("$maj_data_directory/avatar.txt") and file_exists("$maj_data_directory/items/$maj_d/author.txt") and !file_exists("$maj_data_directory/items/$maj_d/xavatar.txt")) {
echo "<td width=\"80\" valign=\"top\">";
- $maj_author = file_get_contents("data/items/$maj_d/author.txt");
+ $maj_author = file_get_contents("$maj_data_directory/items/$maj_d/author.txt");
show_maj_avatar_image($maj_author,80);
- if ($maj_dh_author_posts = opendir("data/items")) {
+ if ($maj_dh_author_posts = opendir("$maj_data_directory/items")) {
while (($maj_author_post = readdir($maj_dh_author_posts)) !== false) {
if ($maj_author_post != "." && $maj_author_post != "..") {
- if (file_exists("data/items/$maj_author_post/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))