This commit has been accessed 599 times via Git panel.
commit 56b47f1febf599f172a02c6e3a0af88347ce9b78
tree b41f32035ca89ad150e2c81a3efc4fc1e98af9b0
parent 02d9fa3e67d76f699e079818dd80254d421589a5
author Magie Antonio <magie@majcms.org> 1309772544 +0800
committer Magie Antonio <magie@majcms.org> 1309772544 +0800
Clean up avatar display functions
diff --git a/core.php b/core.php
index 0d0d919..ea49474 100644
--- a/core.php
+++ b/core.php
@@ -1,4 +1,140 @@
<?php
+
+$maj_default_title = file_get_contents("data/title.txt");
+$maj_admin_username = file_get_contents("data/username.txt");
+
+if (isset($_SESSION['logged_in'])) {
+ $maj_logged_in_username = $_SESSION['logged_in'];
+}
+
+if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
+ header("Location: login.php");
+}
+
+if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
+ $maj_req_entry = trim($_REQUEST['entry']);
+}
+
+if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
+ $maj_req_show = trim($_REQUEST['show']);
+}
+
+if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
+ $maj_req_find = trim($_REQUEST['find']);
+ $maj_req_find = str_replace(" ","-",$maj_req_find);
+ $maj_req_find = strtolower($maj_req_find);
+ $maj_req_find = strip_tags($maj_req_find);
+}
+
+if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
+ $maj_req_category = trim($_REQUEST['category']);
+ $maj_req_category = str_replace(" ","-",$maj_req_category);
+ $maj_req_category = strtolower($maj_req_category);
+ $maj_req_category = strip_tags($maj_req_category);
+}
+
+if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
+ $maj_req_archive = trim($_REQUEST['archive']);
+}
+
+if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
+ $maj_req_author = trim($_REQUEST['author']);
+ $maj_req_author = str_replace(" ","-",$maj_req_author);
+ $maj_req_author = strtolower($maj_req_author);
+ $maj_req_author = strip_tags($maj_req_author);
+}
+
+if (file_exists("data/offset.txt")) {
+ $maj_offset = file_get_contents("data/offset.txt");
+}
+else {
+ $maj_offset = 0;
+}
+
+if (file_exists("data/increase.txt")) {
+ $maj_increase = file_get_contents("data/increase.txt");
+}
+else {
+ $maj_increase = 5;
+}
+
+if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ $maj_wside = "160";
+ $maj_wmain = "600";
+}
+else {
+ $maj_wside = "200";
+ $maj_wmain = "520";
+}
+
+$maj_wspace = "10";
+
+$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+
+$maj_default_blog_title = "My Activity Journal";
+$maj_default_username = "maj";
+$maj_default_password = "php";
+$maj_default_blog_profile = 'This cool site is powered by My Activity Journal (<a href="http://majcms.org/" target="_maj">MAJ</a>), a simple <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://opensource.org/" target="_maj">Open Source</a> content management system (CMS) that can be deployed as a blog, bulletin board (Internet forum or message board), and wiki.';
+$maj_default_blog_author = "My Activity Journal";
+
+if (!file_exists("data")) {
+ mkdir("data");
+}
+
+if (!file_exists("data/.htaccess")) {
+ $maj_htaccess = "Order deny,allow\nDeny from all";
+ $maj_fp_htaccess_txt = fopen("data/.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");
+ 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");
+ fwrite($maj_fp_htaccess_txt,$maj_default_username);
+ fclose($maj_fp_htaccess_txt);
+}
+
+if (!file_exists("data/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");
+ 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");
+ 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");
+ fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
+ fclose($maj_fp_default_author_txt);
+}
+
+function str_rand($maj_length = 8,$maj_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
+ $maj_str = '';
+ $maj_seeds_count = strlen($maj_seeds);
+
+ list($maj_usec,$maj_sec) = explode(' ',microtime());
+ $maj_seed = (float) $maj_sec + ((float) $maj_usec * 100000);
+ mt_srand($maj_seed);
+
+ for ($maj_i = 0; $maj_length > $maj_i; $maj_i++) {
+ $maj_str .= $maj_seeds{mt_rand(0,$maj_seeds_count - 1)};
+ }
+ return $maj_str;
+}
+
// 20100729 - aggregate recurring functions
if (get_magic_quotes_gpc()) {
@@ -264,4 +400,248 @@
$this->SetTextColor(0);
} //function PutLink($URL, $txt)
} //class PDF extends FPDF
+
+function show_maj_avatar_image($author_username,$max_img_width=80) {
+
+ // please replace this with something better:
+ global $maj_admin_username;
+
+ echo "<a href=\"member.php?id=$author_username\">";
+
+ if (($maj_admin_username == $author_username) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
+ if (file_exists("images/avatar.gif")) {
+
+ $avatar_gif_image_size = getimagesize("images/avatar.gif");
+ $avatar_gif_image_width = $avatar_gif_image_size[0];
+ $avatar_gif_image_height = $avatar_gif_image_size[1];
+
+ if ($avatar_gif_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_gif_image_width) ;
+ $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
+ $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-gif.txt")) {
+
+ $avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
+
+ imagealphablending($avatar_gif_image_resize, false);
+ imagesavealpha($avatar_gif_image_resize, true);
+
+ $avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
+ $avatar_gif_transparent_index = imagecolortransparent($avatar_gif_image_original);
+
+ if ($avatar_gif_transparent_index >= 0) {
+
+ $avatar_gif_transparent_color = imagecolorsforindex($avatar_gif_image_original, $avatar_gif_transparent_index);
+ $avatar_gif_transparent_index = imagecolorallocate($avatar_gif_image_resize, $avatar_gif_transparent_color['red'], $avatar_gif_transparent_color['green'], $avatar_gif_transparent_color['blue']);
+
+ imagefill($avatar_gif_image_resize, 0, 0, $avatar_gif_transparent_index);
+ imagecolortransparent($avatar_gif_image_resize, $avatar_gif_transparent_index);
+ }
+
+ imagecopyresampled($avatar_gif_image_resize,$avatar_gif_image_original,0,0,0,0,$avatar_gif_image_width,$avatar_gif_image_height,$avatar_gif_image_size[0],$avatar_gif_image_size[1]);
+
+ unlink("images/avatar.gif");
+
+ imagegif($avatar_gif_image_resize,"images/avatar.gif",100);
+
+ imagedestroy($avatar_gif_image_resize);
+ imagedestroy($avatar_gif_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
+ }
+
+ if (file_exists("images/avatar.jpg")) {
+
+ $avatar_jpg_image_size = getimagesize("images/avatar.jpg");
+ $avatar_jpg_image_width = $avatar_jpg_image_size[0];
+ $avatar_jpg_image_height = $avatar_jpg_image_size[1];
+
+ if ($avatar_jpg_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_jpg_image_width) ;
+ $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
+ $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("data/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");
+
+ imagecopyresampled($avatar_jpg_image_resize,$avatar_jpg_image_original,0,0,0,0,$avatar_jpg_image_width,$avatar_jpg_image_height,$avatar_jpg_image_size[0],$avatar_jpg_image_size[1]);
+
+ unlink("images/avatar.jpg");
+
+ imagejpeg($avatar_jpg_image_resize,"images/avatar.jpg",100);
+
+ imagedestroy($avatar_jpg_image_resize);
+ imagedestroy($avatar_jpg_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
+ }
+
+ if (file_exists("images/avatar.png")) {
+
+ $avatar_png_image_size = getimagesize("images/avatar.png");
+ $avatar_png_image_width = $avatar_png_image_size[0];
+ $avatar_png_image_height = $avatar_png_image_size[1];
+
+ if ($avatar_png_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_png_image_width) ;
+ $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
+ $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-png.txt")) {
+
+ $avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
+
+ imagealphablending($avatar_png_image_resize, false);
+ imagesavealpha($avatar_png_image_resize, true);
+
+ $avatar_png_image_original = imagecreatefrompng("images/avatar.png");
+
+ imagecopyresampled($avatar_png_image_resize,$avatar_png_image_original,0,0,0,0,$avatar_png_image_width,$avatar_png_image_height,$avatar_png_image_size[0],$avatar_png_image_size[1]);
+
+ unlink("images/avatar.png");
+
+ imagepng($avatar_png_image_resize,"images/avatar.png",100);
+
+ imagedestroy($avatar_png_image_resize);
+ imagedestroy($avatar_png_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
+ }
+ echo "<br>";
+ }
+ elseif (file_exists("images/members/$author_username/avatar.jpg") or file_exists("images/members/$author_username/avatar.gif") or file_exists("images/members/$author_username/avatar.png")) {
+
+ if (file_exists("images/members/$author_username/avatar.gif")) {
+
+ $avatar_gif_image_size = getimagesize("images/members/$author_username/avatar.gif");
+ $avatar_gif_image_width = $avatar_gif_image_size[0];
+ $avatar_gif_image_height = $avatar_gif_image_size[1];
+
+ if ($avatar_gif_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_gif_image_width) ;
+ $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
+ $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-gif.txt")) {
+
+ $avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
+
+ imagealphablending($avatar_gif_image_resize, false);
+ imagesavealpha($avatar_gif_image_resize, true);
+
+ $avatar_gif_image_original = imagecreatefromgif("images/members/$author_username/avatar.gif");
+ $avatar_gif_transparent_index = imagecolortransparent($avatar_gif_image_original);
+
+ if ($avatar_gif_transparent_index >= 0) {
+
+ $avatar_gif_transparent_color = imagecolorsforindex($avatar_gif_image_original, $avatar_gif_transparent_index);
+ $avatar_gif_transparent_index = imagecolorallocate($avatar_gif_image_resize, $avatar_gif_transparent_color['red'], $avatar_gif_transparent_color['green'], $avatar_gif_transparent_color['blue']);
+
+ imagefill($avatar_gif_image_resize, 0, 0, $avatar_gif_transparent_index);
+ imagecolortransparent($avatar_gif_image_resize, $avatar_gif_transparent_index);
+ }
+
+ imagecopyresampled($avatar_gif_image_resize,$avatar_gif_image_original,0,0,0,0,$avatar_gif_image_width,$avatar_gif_image_height,$avatar_gif_image_size[0],$avatar_gif_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.gif");
+
+ imagegif($avatar_gif_image_resize,"images/members/$author_username/avatar.gif",100);
+
+ imagedestroy($avatar_gif_image_resize);
+ imagedestroy($avatar_gif_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
+ }
+
+ if (file_exists("images/members/$author_username/avatar.jpg")) {
+
+ $avatar_jpg_image_size = getimagesize("images/members/$author_username/avatar.jpg");
+ $avatar_jpg_image_width = $avatar_jpg_image_size[0];
+ $avatar_jpg_image_height = $avatar_jpg_image_size[1];
+
+ if ($avatar_jpg_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_jpg_image_width) ;
+ $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
+ $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("data/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");
+
+ imagecopyresampled($avatar_jpg_image_resize,$avatar_jpg_image_original,0,0,0,0,$avatar_jpg_image_width,$avatar_jpg_image_height,$avatar_jpg_image_size[0],$avatar_jpg_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.jpg");
+
+ imagejpeg($avatar_jpg_image_resize,"images/members/$author_username/avatar.jpg",100);
+
+ imagedestroy($avatar_jpg_image_resize);
+ imagedestroy($avatar_jpg_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
+ }
+
+ if (file_exists("images/members/$author_username/avatar.png")) {
+
+ $avatar_png_image_size = getimagesize("images/members/$author_username/avatar.png");
+ $avatar_png_image_width = $avatar_png_image_size[0];
+ $avatar_png_image_height = $avatar_png_image_size[1];
+
+ if ($avatar_png_image_width > $max_img_width) {
+ $sizefactor = (double) ($max_img_width / $avatar_png_image_width) ;
+ $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
+ $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-png.txt")) {
+
+ $avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
+
+ imagealphablending($avatar_png_image_resize, false);
+ imagesavealpha($avatar_png_image_resize, true);
+
+ $avatar_png_image_original = imagecreatefrompng("images/members/$author_username/avatar.png");
+
+ imagecopyresampled($avatar_png_image_resize,$avatar_png_image_original,0,0,0,0,$avatar_png_image_width,$avatar_png_image_height,$avatar_png_image_size[0],$avatar_png_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.png");
+
+ imagepng($avatar_png_image_resize,"images/members/$author_username/avatar.png",100);
+
+ imagedestroy($avatar_png_image_resize);
+ imagedestroy($avatar_png_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
+ }
+ echo "<br>";
+ }
+
+ echo "<b>$author_username</b></a><br>";
+
+ if (($maj_admin_username == $author_username) and file_exists("data/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");
+ echo "$rank<br>";
+ }
+ elseif (!file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
+ echo "member<br>";
+ }
+}
+
?>
diff --git a/index.php b/index.php
index b9311f7..fa0e418 100644
--- a/index.php
+++ b/index.php
@@ -6,131 +6,10 @@ session_start();
header("Cache-control: private");
-error_reporting(E_ERROR);
+//error_reporting(E_ERROR);
require("core.php");
-if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
-}
-
-if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $maj_req_entry = trim($_REQUEST['entry']);
-}
-
-if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
- $maj_req_show = trim($_REQUEST['show']);
-}
-
-if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
- $maj_req_find = trim($_REQUEST['find']);
- $maj_req_find = str_replace(" ","-",$maj_req_find);
- $maj_req_find = strtolower($maj_req_find);
- $maj_req_find = strip_tags($maj_req_find);
-}
-
-if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $maj_req_category = trim($_REQUEST['category']);
- $maj_req_category = str_replace(" ","-",$maj_req_category);
- $maj_req_category = strtolower($maj_req_category);
- $maj_req_category = strip_tags($maj_req_category);
-}
-
-if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
- $maj_req_archive = trim($_REQUEST['archive']);
-}
-
-if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
- $maj_req_author = trim($_REQUEST['author']);
- $maj_req_author = str_replace(" ","-",$maj_req_author);
- $maj_req_author = strtolower($maj_req_author);
- $maj_req_author = strip_tags($maj_req_author);
-}
-
-if (file_exists("data/offset.txt")) {
- $maj_offset = file_get_contents("data/offset.txt");
-}
-else {
- $maj_offset = 0;
-}
-
-if (file_exists("data/increase.txt")) {
- $maj_increase = file_get_contents("data/increase.txt");
-}
-else {
- $maj_increase = 5;
-}
-
-if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
- $maj_wside = "160";
- $maj_wmain = "600";
-}
-else {
- $maj_wside = "200";
- $maj_wmain = "520";
-}
-
-$maj_wspace = "10";
-
-$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
-
-$maj_default_blog_title = "My Activity Journal";
-$maj_default_username = "maj";
-$maj_default_password = "php";
-$maj_default_blog_profile = 'This cool site is powered by My Activity Journal (<a href="http://majcms.org/" target="_maj">MAJ</a>), a simple <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://opensource.org/" target="_maj">Open Source</a> content management system (CMS) that can be deployed as a blog, bulletin board (Internet forum or message board), and wiki.';
-$maj_default_blog_author = "My Activity Journal";
-
-if (!file_exists("data")) {
- mkdir("data");
-}
-
-if (!file_exists("data/.htaccess")) {
- $maj_htaccess = "Order deny,allow\nDeny from all";
- $maj_fp_htaccess_txt = fopen("data/.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");
- 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");
- fwrite($maj_fp_htaccess_txt,$maj_default_username);
- fclose($maj_fp_htaccess_txt);
-}
-
-if (!file_exists("data/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");
- 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");
- 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");
- fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
- fclose($maj_fp_default_author_txt);
-}
-
-$maj_default_title = file_get_contents("data/title.txt");
-$maj_admin_username = file_get_contents("data/username.txt");
-
-if (isset($_SESSION['logged_in'])) {
- $maj_logged_in_username = $_SESSION['logged_in'];
-}
-
if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
if (file_exists("data/hits.txt")) {
@@ -163,20 +42,6 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
fclose($maj_google_hits_file);
}
-function str_rand($maj_length = 8,$maj_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $maj_str = '';
- $maj_seeds_count = strlen($maj_seeds);
-
- list($maj_usec,$maj_sec) = explode(' ',microtime());
- $maj_seed = (float) $maj_sec + ((float) $maj_usec * 100000);
- mt_srand($maj_seed);
-
- for ($maj_i = 0; $maj_length > $maj_i; $maj_i++) {
- $maj_str .= $maj_seeds{mt_rand(0,$maj_seeds_count - 1)};
- }
- return $maj_str;
-}
-
if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
ini_set("zlib.output_compression","off");
$maj_dl_file = str_replace("../","",@$_REQUEST['download']);
@@ -2192,260 +2057,11 @@ foreach ($maj_disp as $maj_d) {
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")) {
- echo "<td width=\"75\" valign=\"top\">";
+ echo "<td width=\"80\" valign=\"top\">";
$maj_author = file_get_contents("data/items/$maj_d/author.txt");
- echo "<a href=\"member.php?id=$maj_author\">";
-
- if (($maj_admin_username == $maj_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
-
- $maj_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_avatar_gif_image_width = $maj_avatar_gif_image_size[0];
- $maj_avatar_gif_image_height = $maj_avatar_gif_image_size[1];
-
- $maj_max_avatar_gif_image_width = 75;
-
- if ($maj_avatar_gif_image_width > $maj_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_gif_image_width / $maj_avatar_gif_image_width) ;
- $maj_avatar_gif_image_width = (int) ($maj_avatar_gif_image_width * $maj_sizefactor);
- $maj_avatar_gif_image_height = (int) ($maj_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_avatar_gif_image_resize = imagecreatetruecolor($maj_avatar_gif_image_width,$maj_avatar_gif_image_height);
-
- imagealphablending($maj_avatar_gif_image_resize, false);
- imagesavealpha($maj_avatar_gif_image_resize, true);
-
- $maj_avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
- $maj_avatar_gif_transparent_index = imagecolortransparent($maj_avatar_gif_image_original);
-
- if ($maj_avatar_gif_transparent_index >= 0) {
-
- $maj_avatar_gif_transparent_color = imagecolorsforindex($maj_avatar_gif_image_original, $maj_avatar_gif_transparent_index);
- $maj_avatar_gif_transparent_index = imagecolorallocate($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_color['red'], $maj_avatar_gif_transparent_color['green'], $maj_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_avatar_gif_image_resize, 0, 0, $maj_avatar_gif_transparent_index);
- imagecolortransparent($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_avatar_gif_image_resize,$maj_avatar_gif_image_original,0,0,0,0,$maj_avatar_gif_image_width,$maj_avatar_gif_image_height,$maj_avatar_gif_image_size[0],$maj_avatar_gif_image_size[1]);
-
- unlink("images/avatar.gif");
-
- imagegif($maj_avatar_gif_image_resize,"images/avatar.gif",100);
-
- imagedestroy($maj_avatar_gif_image_resize);
- imagedestroy($maj_avatar_gif_image_original);
- }
- }
- echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$maj_avatar_gif_image_width\" height=\"$maj_avatar_gif_image_height\">";
- }
-
- if (file_exists("images/avatar.jpg")) {
-
- $maj_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_avatar_jpg_image_width = $maj_avatar_jpg_image_size[0];
- $maj_avatar_jpg_image_height = $maj_avatar_jpg_image_size[1];
-
- $maj_max_avatar_jpg_image_width = 75;
-
- if ($maj_avatar_jpg_image_width > $maj_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_jpg_image_width / $maj_avatar_jpg_image_width) ;
- $maj_avatar_jpg_image_width = (int) ($maj_avatar_jpg_image_width * $maj_sizefactor);
- $maj_avatar_jpg_image_height = (int) ($maj_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_avatar_jpg_image_resize = imagecreatetruecolor($maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height);
- $maj_avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
-
- imagecopyresampled($maj_avatar_jpg_image_resize,$maj_avatar_jpg_image_original,0,0,0,0,$maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height,$maj_avatar_jpg_image_size[0],$maj_avatar_jpg_image_size[1]);
-
- unlink("images/avatar.jpg");
-
- imagejpeg($maj_avatar_jpg_image_resize,"images/avatar.jpg",100);
-
- imagedestroy($maj_avatar_jpg_image_resize);
- imagedestroy($maj_avatar_jpg_image_original);
- }
- }
- echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$maj_avatar_jpg_image_width\" height=\"$maj_avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/avatar.png")) {
-
- $maj_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_avatar_png_image_width = $maj_avatar_png_image_size[0];
- $maj_avatar_png_image_height = $maj_avatar_png_image_size[1];
-
- $maj_max_avatar_png_image_width = 75;
-
- if ($maj_avatar_png_image_width > $maj_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_png_image_width / $maj_avatar_png_image_width) ;
- $maj_avatar_png_image_width = (int) ($maj_avatar_png_image_width * $maj_sizefactor);
- $maj_avatar_png_image_height = (int) ($maj_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_avatar_png_image_resize = imagecreatetruecolor($maj_avatar_png_image_width,$maj_avatar_png_image_height);
-
- imagealphablending($maj_avatar_png_image_resize, false);
- imagesavealpha($maj_avatar_png_image_resize, true);
-
- $maj_avatar_png_image_original = imagecreatefrompng("images/avatar.png");
-
- imagecopyresampled($maj_avatar_png_image_resize,$maj_avatar_png_image_original,0,0,0,0,$maj_avatar_png_image_width,$maj_avatar_png_image_height,$maj_avatar_png_image_size[0],$maj_avatar_png_image_size[1]);
-
- unlink("images/avatar.png");
-
- imagepng($maj_avatar_png_image_resize,"images/avatar.png",100);
-
- imagedestroy($maj_avatar_png_image_resize);
- imagedestroy($maj_avatar_png_image_original);
- }
- }
-
- echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$maj_avatar_png_image_width\" height=\"$maj_avatar_png_image_height\">";
- }
- echo "<br>";
- }
- elseif (file_exists("images/members/$maj_author/avatar.jpg") or file_exists("images/members/$maj_author/avatar.gif") or file_exists("images/members/$maj_author/avatar.png")) {
-
- if (file_exists("images/members/$maj_author/avatar.gif")) {
-
- $maj_avatar_gif_image_size = getimagesize("images/members/$maj_author/avatar.gif");
- $maj_avatar_gif_image_width = $maj_avatar_gif_image_size[0];
- $maj_avatar_gif_image_height = $maj_avatar_gif_image_size[1];
-
- $maj_max_avatar_gif_image_width = 75;
-
- if ($maj_avatar_gif_image_width > $maj_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_gif_image_width / $maj_avatar_gif_image_width) ;
- $maj_avatar_gif_image_width = (int) ($maj_avatar_gif_image_width * $maj_sizefactor);
- $maj_avatar_gif_image_height = (int) ($maj_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_avatar_gif_image_resize = imagecreatetruecolor($maj_avatar_gif_image_width,$maj_avatar_gif_image_height);
-
- imagealphablending($maj_avatar_gif_image_resize, false);
- imagesavealpha($maj_avatar_gif_image_resize, true);
-
- $maj_avatar_gif_image_original = imagecreatefromgif("images/members/$maj_author/avatar.gif");
- $maj_avatar_gif_transparent_index = imagecolortransparent($maj_avatar_gif_image_original);
-
- if ($maj_avatar_gif_transparent_index >= 0) {
-
- $maj_avatar_gif_transparent_color = imagecolorsforindex($maj_avatar_gif_image_original, $maj_avatar_gif_transparent_index);
- $maj_avatar_gif_transparent_index = imagecolorallocate($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_color['red'], $maj_avatar_gif_transparent_color['green'], $maj_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_avatar_gif_image_resize, 0, 0, $maj_avatar_gif_transparent_index);
- imagecolortransparent($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_avatar_gif_image_resize,$maj_avatar_gif_image_original,0,0,0,0,$maj_avatar_gif_image_width,$maj_avatar_gif_image_height,$maj_avatar_gif_image_size[0],$maj_avatar_gif_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.gif");
-
- imagegif($maj_avatar_gif_image_resize,"images/members/$maj_author/avatar.gif",100);
-
- imagedestroy($maj_avatar_gif_image_resize);
- imagedestroy($maj_avatar_gif_image_original);
- }
- }
- echo "<img src=\"images/members/$maj_author/avatar.gif\" border=\"0\" width=\"$maj_avatar_gif_image_width\" height=\"$maj_avatar_gif_image_height\">";
- }
-
- if (file_exists("images/members/$maj_author/avatar.jpg")) {
-
- $maj_avatar_jpg_image_size = getimagesize("images/members/$maj_author/avatar.jpg");
- $maj_avatar_jpg_image_width = $maj_avatar_jpg_image_size[0];
- $maj_avatar_jpg_image_height = $maj_avatar_jpg_image_size[1];
-
- $maj_max_avatar_jpg_image_width = 75;
-
- if ($maj_avatar_jpg_image_width > $maj_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_jpg_image_width / $maj_avatar_jpg_image_width) ;
- $maj_avatar_jpg_image_width = (int) ($maj_avatar_jpg_image_width * $maj_sizefactor);
- $maj_avatar_jpg_image_height = (int) ($maj_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_avatar_jpg_image_resize = imagecreatetruecolor($maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height);
- $maj_avatar_jpg_image_original = imagecreatefromjpeg("images/members/$maj_author/avatar.jpg");
-
- imagecopyresampled($maj_avatar_jpg_image_resize,$maj_avatar_jpg_image_original,0,0,0,0,$maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height,$maj_avatar_jpg_image_size[0],$maj_avatar_jpg_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.jpg");
-
- imagejpeg($maj_avatar_jpg_image_resize,"images/members/$maj_author/avatar.jpg",100);
-
- imagedestroy($maj_avatar_jpg_image_resize);
- imagedestroy($maj_avatar_jpg_image_original);
- }
- }
- echo "<img src=\"images/members/$maj_author/avatar.jpg\" border=\"0\" width=\"$maj_avatar_jpg_image_width\" height=\"$maj_avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/members/$maj_author/avatar.png")) {
-
- $maj_avatar_png_image_size = getimagesize("images/members/$maj_author/avatar.png");
- $maj_avatar_png_image_width = $maj_avatar_png_image_size[0];
- $maj_avatar_png_image_height = $maj_avatar_png_image_size[1];
-
- $maj_max_avatar_png_image_width = 75;
-
- if ($maj_avatar_png_image_width > $maj_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_max_avatar_png_image_width / $maj_avatar_png_image_width) ;
- $maj_avatar_png_image_width = (int) ($maj_avatar_png_image_width * $maj_sizefactor);
- $maj_avatar_png_image_height = (int) ($maj_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_avatar_png_image_resize = imagecreatetruecolor($maj_avatar_png_image_width,$maj_avatar_png_image_height);
-
- imagealphablending($maj_avatar_png_image_resize, false);
- imagesavealpha($maj_avatar_png_image_resize, true);
-
- $maj_avatar_png_image_original = imagecreatefrompng("images/members/$maj_author/avatar.png");
-
- imagecopyresampled($maj_avatar_png_image_resize,$maj_avatar_png_image_original,0,0,0,0,$maj_avatar_png_image_width,$maj_avatar_png_image_height,$maj_avatar_png_image_size[0],$maj_avatar_png_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.png");
-
- imagepng($maj_avatar_png_image_resize,"images/members/$maj_author/avatar.png",100);
-
- imagedestroy($maj_avatar_png_image_resize);
- imagedestroy($maj_avatar_png_image_original);
- }
- }
-
- echo "<img src=\"images/members/$maj_author/avatar.png\" border=\"0\" width=\"$maj_avatar_png_image_width\" height=\"$maj_avatar_png_image_height\">";
- }
- echo "<br>";
- }
-
- echo "<b>$maj_author</b></a><br>";
-
- if (($maj_admin_username == $maj_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_rank = file_get_contents("data/members/active/$maj_author/rank.txt");
- echo "$maj_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
+ show_maj_avatar_image($maj_author,80);
if ($maj_dh_author_posts = opendir("data/items")) {
@@ -3524,266 +3140,13 @@ foreach ($maj_disp as $maj_d) {
echo '</div><div class=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt")) {
- echo "<td width=75 valign=top>";
- $maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
- echo "<a href=member.php?id=$maj_c_author>";
- if (($maj_admin_username == $maj_c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
- if (file_exists("images/avatar.gif")) {
- $maj_c_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
- $maj_c_avatar_gif_image_height = $maj_c_avatar_gif_image_size[1];
-
- $maj_c_max_avatar_gif_image_width = 75;
-
- if ($maj_c_avatar_gif_image_width > $maj_c_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_gif_image_width / $maj_c_avatar_gif_image_width) ;
- $maj_c_avatar_gif_image_width = (int) ($maj_c_avatar_gif_image_width * $maj_sizefactor);
- $maj_c_avatar_gif_image_height = (int) ($maj_c_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_c_avatar_gif_image_resize = imagecreatetruecolor($maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height);
-
- imagealphablending($maj_c_avatar_gif_image_resize, false);
- imagesavealpha($maj_c_avatar_gif_image_resize, true);
-
- $maj_c_avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
- $maj_c_avatar_gif_transparent_index = imagecolortransparent($maj_c_avatar_gif_image_original);
-
- if ($maj_c_avatar_gif_transparent_index >= 0) {
- $maj_c_avatar_gif_transparent_color = imagecolorsforindex($maj_c_avatar_gif_image_original, $maj_c_avatar_gif_transparent_index);
- $maj_c_avatar_gif_transparent_index = imagecolorallocate($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_color['red'], $maj_c_avatar_gif_transparent_color['green'], $maj_c_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_c_avatar_gif_image_resize, 0, 0, $maj_c_avatar_gif_transparent_index);
- imagecolortransparent($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_c_avatar_gif_image_resize,$maj_c_avatar_gif_image_original,0,0,0,0,$maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height,$maj_c_avatar_gif_image_size[0],$maj_c_avatar_gif_image_size[1]);
-
- unlink("images/avatar.gif");
-
- imagegif($maj_c_avatar_gif_image_resize,"images/avatar.gif",100);
-
- imagedestroy($maj_c_avatar_gif_image_resize);
- imagedestroy($maj_c_avatar_gif_image_original);
- }
- }
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $maj_c_avatar_gif_image_width;
- echo " height=";
- echo $maj_c_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $maj_c_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_c_avatar_jpg_image_width = $maj_c_avatar_jpg_image_size[0];
- $maj_c_avatar_jpg_image_height = $maj_c_avatar_jpg_image_size[1];
-
- $maj_c_max_avatar_jpg_image_width = 75;
-
- if ($maj_c_avatar_jpg_image_width > $maj_c_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_jpg_image_width / $maj_c_avatar_jpg_image_width) ;
- $maj_c_avatar_jpg_image_width = (int) ($maj_c_avatar_jpg_image_width * $maj_sizefactor);
- $maj_c_avatar_jpg_image_height = (int) ($maj_c_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_c_avatar_jpg_image_resize = imagecreatetruecolor($maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height);
- $maj_c_avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
-
- imagecopyresampled($maj_c_avatar_jpg_image_resize,$maj_c_avatar_jpg_image_original,0,0,0,0,$maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height,$maj_c_avatar_jpg_image_size[0],$maj_c_avatar_jpg_image_size[1]);
-
- unlink("images/avatar.jpg");
-
- imagejpeg($maj_c_avatar_jpg_image_resize,"images/avatar.jpg",100);
-
- imagedestroy($maj_c_avatar_jpg_image_resize);
- imagedestroy($maj_c_avatar_jpg_image_original);
- }
- }
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $maj_c_avatar_jpg_image_width;
- echo " height=";
- echo $maj_c_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $maj_c_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_c_avatar_png_image_width = $maj_c_avatar_png_image_size[0];
- $maj_c_avatar_png_image_height = $maj_c_avatar_png_image_size[1];
-
- $maj_c_max_avatar_png_image_width = 75;
-
- if ($maj_c_avatar_png_image_width > $maj_c_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_png_image_width / $maj_c_avatar_png_image_width) ;
- $maj_c_avatar_png_image_width = (int) ($maj_c_avatar_png_image_width * $maj_sizefactor);
- $maj_c_avatar_png_image_height = (int) ($maj_c_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_c_avatar_png_image_resize = imagecreatetruecolor($maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height);
-
- imagealphablending($maj_c_avatar_png_image_resize, false);
- imagesavealpha($maj_c_avatar_png_image_resize, true);
-
- $maj_c_avatar_png_image_original = imagecreatefrompng("images/avatar.png");
-
- imagecopyresampled($maj_c_avatar_png_image_resize,$maj_c_avatar_png_image_original,0,0,0,0,$maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height,$maj_c_avatar_png_image_size[0],$maj_c_avatar_png_image_size[1]);
-
- unlink("images/avatar.png");
-
- imagepng($maj_c_avatar_png_image_resize,"images/avatar.png",100);
-
- imagedestroy($maj_c_avatar_png_image_resize);
- imagedestroy($maj_c_avatar_png_image_original);
- }
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $maj_c_avatar_png_image_width;
- echo " height=";
- echo $maj_c_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$maj_c_author/avatar.jpg") or file_exists("images/members/$maj_c_author/avatar.gif") or file_exists("images/members/$maj_c_author/avatar.png")) {
- if (file_exists("images/members/$maj_c_author/avatar.gif")) {
- $maj_c_avatar_gif_image_size = getimagesize("images/members/$maj_c_author/avatar.gif");
- $maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
- $maj_c_avatar_gif_image_height = $maj_c_avatar_gif_image_size[1];
-
- $maj_c_max_avatar_gif_image_width = 75;
-
- if ($maj_c_avatar_gif_image_width > $maj_c_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_gif_image_width / $maj_c_avatar_gif_image_width) ;
- $maj_c_avatar_gif_image_width = (int) ($maj_c_avatar_gif_image_width * $maj_sizefactor);
- $maj_c_avatar_gif_image_height = (int) ($maj_c_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_c_avatar_gif_image_resize = imagecreatetruecolor($maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height);
-
- imagealphablending($maj_c_avatar_gif_image_resize, false);
- imagesavealpha($maj_c_avatar_gif_image_resize, true);
-
- $maj_c_avatar_gif_image_original = imagecreatefromgif("images/members/$maj_c_author/avatar.gif");
- $maj_c_avatar_gif_transparent_index = imagecolortransparent($maj_c_avatar_gif_image_original);
-
- if ($maj_c_avatar_gif_transparent_index >= 0) {
-
- $maj_c_avatar_gif_transparent_color = imagecolorsforindex($maj_c_avatar_gif_image_original, $maj_c_avatar_gif_transparent_index);
- $maj_c_avatar_gif_transparent_index = imagecolorallocate($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_color['red'], $maj_c_avatar_gif_transparent_color['green'], $maj_c_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_c_avatar_gif_image_resize, 0, 0, $maj_c_avatar_gif_transparent_index);
- imagecolortransparent($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_c_avatar_gif_image_resize,$maj_c_avatar_gif_image_original,0,0,0,0,$maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height,$maj_c_avatar_gif_image_size[0],$maj_c_avatar_gif_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.gif");
-
- imagegif($maj_c_avatar_gif_image_resize,"images/members/$maj_c_author/avatar.gif",100);
-
- imagedestroy($maj_c_avatar_gif_image_resize);
- imagedestroy($maj_c_avatar_gif_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.gif border=0 width=";
- echo $maj_c_avatar_gif_image_width;
- echo " height=";
- echo $maj_c_avatar_gif_image_height;
- }
- if (file_exists("images/members/$maj_c_author/avatar.jpg")) {
- $maj_c_avatar_jpg_image_size = getimagesize("images/members/$maj_c_author/avatar.jpg");
- $maj_c_avatar_jpg_image_width = $maj_c_avatar_jpg_image_size[0];
- $maj_c_avatar_jpg_image_height = $maj_c_avatar_jpg_image_size[1];
-
- $maj_c_max_avatar_jpg_image_width = 75;
-
- if ($maj_c_avatar_jpg_image_width > $maj_c_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_jpg_image_width / $maj_c_avatar_jpg_image_width) ;
- $maj_c_avatar_jpg_image_width = (int) ($maj_c_avatar_jpg_image_width * $maj_sizefactor);
- $maj_c_avatar_jpg_image_height = (int) ($maj_c_avatar_jpg_image_height * $maj_sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_c_avatar_jpg_image_resize = imagecreatetruecolor($maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height);
- $maj_c_avatar_jpg_image_original = imagecreatefromjpeg("images/members/$maj_c_author/avatar.jpg");
-
- imagecopyresampled($maj_c_avatar_jpg_image_resize,$maj_c_avatar_jpg_image_original,0,0,0,0,$maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height,$maj_c_avatar_jpg_image_size[0],$maj_c_avatar_jpg_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.jpg");
-
- imagejpeg($maj_c_avatar_jpg_image_resize,"images/members/$maj_c_author/avatar.jpg",100);
-
- imagedestroy($maj_c_avatar_jpg_image_resize);
- imagedestroy($maj_c_avatar_jpg_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.jpg border=0 width=";
- echo $maj_c_avatar_jpg_image_width;
- echo " height=";
- echo $maj_c_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$maj_c_author/avatar.png")) {
- $maj_c_avatar_png_image_size = getimagesize("images/members/$maj_c_author/avatar.png");
- $maj_c_avatar_png_image_width = $maj_c_avatar_png_image_size[0];
- $maj_c_avatar_png_image_height = $maj_c_avatar_png_image_size[1];
-
- $maj_c_max_avatar_png_image_width = 75;
-
- if ($maj_c_avatar_png_image_width > $maj_c_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_png_image_width / $maj_c_avatar_png_image_width) ;
- $maj_c_avatar_png_image_width = (int) ($maj_c_avatar_png_image_width * $maj_sizefactor);
- $maj_c_avatar_png_image_height = (int) ($maj_c_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_c_avatar_png_image_resize = imagecreatetruecolor($maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height);
-
- imagealphablending($maj_c_avatar_png_image_resize, false);
- imagesavealpha($maj_c_avatar_png_image_resize, true);
-
- $maj_c_avatar_png_image_original = imagecreatefrompng("images/members/$maj_c_author/avatar.png");
-
- imagecopyresampled($maj_c_avatar_png_image_resize,$maj_c_avatar_png_image_original,0,0,0,0,$maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height,$maj_c_avatar_png_image_size[0],$maj_c_avatar_png_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.png");
-
- imagepng($maj_c_avatar_png_image_resize,"images/members/$maj_c_author/avatar.png",100);
+ echo "<td width=\"80\" valign=\"top\">";
+
+ $maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
- imagedestroy($maj_c_avatar_png_image_resize);
- imagedestroy($maj_c_avatar_png_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.png border=0 width=";
- echo $maj_c_avatar_png_image_width;
- echo " height=";
- echo $maj_c_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$maj_c_author</a><br>";
- if (($maj_admin_username == $maj_c_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_c_rank = file_get_contents("data/members/active/$maj_c_author/rank.txt");
- echo "$maj_c_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
+ show_maj_avatar_image($maj_c_author,80);
+
if ($maj_c_dh_posts = opendir("data/items")) {
while (($maj_c_entry_posts = readdir($maj_c_dh_posts)) !== false) {
@@ -3865,7 +3228,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><div style=\"height: 10px;\"></div>";
$maj_entry_comment = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/comment.txt");
@@ -4158,145 +3521,12 @@ foreach ($maj_disp as $maj_d) {
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt")) {
- echo "<td width=75 valign=top>";
+ echo "<td width=\"80\" valign=\"top\">";
$maj_pc_author = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
-
- echo "<a href=member.php?id=$maj_pc_author>";
-
- if (($maj_admin_username == $maj_pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
- $maj_pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_pc_avatar_gif_image_width = $maj_pc_avatar_gif_image_size[0];
- $maj_pc_avatar_gif_image_height = $maj_pc_avatar_gif_image_size[1];
-
- $maj_pc_max_avatar_gif_image_width = 75;
-
- if ($maj_pc_avatar_gif_image_width > $maj_pc_max_avatar_gif_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_gif_image_width / $maj_pc_avatar_gif_image_width) ;
- $maj_pc_avatar_gif_image_width = (int) ($maj_pc_avatar_gif_image_width * $maj_sizefactor);
- $maj_pc_avatar_gif_image_height = (int) ($maj_pc_avatar_gif_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $maj_pc_avatar_gif_image_width;
- echo " height=";
- echo $maj_pc_avatar_gif_image_height;
- }
-
- if (file_exists("images/avatar.jpg")) {
- $maj_pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_pc_avatar_jpg_image_width = $maj_pc_avatar_jpg_image_size[0];
- $maj_pc_avatar_jpg_image_height = $maj_pc_avatar_jpg_image_size[1];
-
- $maj_pc_max_avatar_jpg_image_width = 75;
-
- if ($maj_pc_avatar_jpg_image_width > $maj_pc_max_avatar_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_jpg_image_width / $maj_pc_avatar_jpg_image_width) ;
- $maj_pc_avatar_jpg_image_width = (int) ($maj_pc_avatar_jpg_image_width * $maj_sizefactor);
- $maj_pc_avatar_jpg_image_height = (int) ($maj_pc_avatar_jpg_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $maj_pc_avatar_jpg_image_width;
- echo " height=";
- echo $maj_pc_avatar_jpg_image_height;
- }
-
- if (file_exists("images/avatar.png")) {
- $maj_pc_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_pc_avatar_png_image_width = $maj_pc_avatar_png_image_size[0];
- $maj_pc_avatar_png_image_height = $maj_pc_avatar_png_image_size[1];
- $maj_pc_max_avatar_png_image_width = 75;
-
- if ($maj_pc_avatar_png_image_width > $maj_pc_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_png_image_width / $maj_pc_avatar_png_image_width) ;
- $maj_pc_avatar_png_image_width = (int) ($maj_pc_avatar_png_image_width * $maj_sizefactor);
- $maj_pc_avatar_png_image_height = (int) ($maj_pc_avatar_png_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $maj_pc_avatar_png_image_width;
- echo " height=";
- echo $maj_pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$maj_pc_author/avatar.jpg") or file_exists("images/members/$maj_pc_author/avatar.gif") or file_exists("images/members/$maj_pc_author/avatar.png")) {
+ show_maj_avatar_image($maj_pc_author,80);
- if (file_exists("images/members/$maj_pc_author/avatar.gif")) {
- $maj_pc_avatar_gif_image_size = getimagesize("images/members/$maj_pc_author/avatar.gif");
- $maj_pc_avatar_gif_image_width = $maj_pc_avatar_gif_image_size[0];
- $maj_pc_avatar_gif_image_height = $maj_pc_avatar_gif_image_size[1];
-
- $maj_pc_max_avatar_gif_image_width = 75;
-
- if ($maj_pc_avatar_gif_image_width > $maj_pc_max_avatar_gif_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_gif_image_width / $maj_pc_avatar_gif_image_width) ;
- $maj_pc_avatar_gif_image_width = (int) ($maj_pc_avatar_gif_image_width * $maj_sizefactor);
- $maj_pc_avatar_gif_image_height = (int) ($maj_pc_avatar_gif_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.gif border=0 width=";
- echo $maj_pc_avatar_gif_image_width;
- echo " height=";
- echo $maj_pc_avatar_gif_image_height;
- }
-
- if (file_exists("images/members/$maj_pc_author/avatar.jpg")) {
- $maj_pc_avatar_jpg_image_size = getimagesize("images/members/$maj_pc_author/avatar.jpg");
- $maj_pc_avatar_jpg_image_width = $maj_pc_avatar_jpg_image_size[0];
- $maj_pc_avatar_jpg_image_height = $maj_pc_avatar_jpg_image_size[1];
-
- $maj_pc_max_avatar_jpg_image_width = 75;
-
- if ($maj_pc_avatar_jpg_image_width > $maj_pc_max_avatar_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_jpg_image_width / $maj_pc_avatar_jpg_image_width) ;
- $maj_pc_avatar_jpg_image_width = (int) ($maj_pc_avatar_jpg_image_width * $maj_sizefactor);
- $maj_pc_avatar_jpg_image_height = (int) ($maj_pc_avatar_jpg_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.jpg border=0 width=";
- echo $maj_pc_avatar_jpg_image_width;
- echo " height=";
- echo $maj_pc_avatar_jpg_image_height;
- }
-
- if (file_exists("images/members/$maj_pc_author/avatar.png")) {
- $maj_pc_avatar_png_image_size = getimagesize("images/members/$maj_pc_author/avatar.png");
- $maj_pc_avatar_png_image_width = $maj_pc_avatar_png_image_size[0];
- $maj_pc_avatar_png_image_height = $maj_pc_avatar_png_image_size[1];
-
- $maj_pc_max_avatar_png_image_width = 75;
-
- if ($maj_pc_avatar_png_image_width > $maj_pc_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_png_image_width / $maj_pc_avatar_png_image_width) ;
- $maj_pc_avatar_png_image_width = (int) ($maj_pc_avatar_png_image_width * $maj_sizefactor);
- $maj_pc_avatar_png_image_height = (int) ($maj_pc_avatar_png_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.png border=0 width=";
- echo $maj_pc_avatar_png_image_width;
- echo " height=";
- echo $maj_pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$maj_pc_author</a><br>";
-
- if (($maj_admin_username == $maj_pc_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_pc_rank = file_get_contents("data/members/active/$maj_pc_author/rank.txt");
- echo "$maj_pc_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
if ($maj_pc_dh_posts = opendir("data/items")) {
while (($maj_pc_entry_posts = readdir($maj_pc_dh_posts)) !== false) {
@@ -4356,10 +3586,10 @@ foreach ($maj_disp as $maj_d) {
}
unset($maj_pc_items_posts);
- echo "</td><td width=5 valign=top><div style=\"width: 5px;\"></div></td>";
+ echo "</td><td width=\"5\" valign=\"top\"><div style=\"width: 5px;\"></div></td>";
}
- echo "<td width=510 valign=top>";
+ echo "<td width=\"510\" valign=\"top\">";
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
@@ -4375,7 +3605,7 @@ foreach ($maj_disp as $maj_d) {
echo ')';
}
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><div style=\"height: 10px;\"></div>";
readfile("data/items/$maj_d/comments/pending/$maj_pending_comment/comment.txt");
echo '</tr></table></div></div>';
diff --git a/member.php b/member.php
index 96b11a9..8dadcb2 100644
--- a/member.php
+++ b/member.php
@@ -8,10 +8,6 @@ error_reporting(E_ERROR);
require("core.php");
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
-}
-
if (file_exists("data/lite.txt")) {
exit();
}
@@ -24,21 +20,19 @@ if (!isset($_REQUEST['id']) or empty($_REQUEST['id'])) {
exit();
}
-if (isset($_REQUEST['id']) and ($_REQUEST['id'] != file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_REQUEST['id']}") and ($_REQUEST['id'] != "all")) {
+if (isset($_REQUEST['id']) and ($_REQUEST['id'] != $maj_admin_username) and !file_exists("data/members/active/{$_REQUEST['id']}") and ($_REQUEST['id'] != "all")) {
exit();
}
-if (!isset($_SESSION['logged_in']) and file_exists("data/nomem.txt")) {
+if (!isset($maj_logged_in_username) and file_exists("data/nomem.txt")) {
header("Location: login.php");
}
$id = $_REQUEST['id'];
-$login_username = file_get_contents("data/username.txt");
-
$maj_server = sha1($_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
-if (file_get_contents("data/username.txt") != $id) {
+if ($maj_admin_username != $id) {
$member_firstname = file_get_contents("data/members/active/$id/firstname.txt");
$member_lastname = file_get_contents("data/members/active/$id/lastname.txt");
}
@@ -47,7 +41,7 @@ if ($id == "all") {
echo "<title>Members</title>";
}
else {
- if ($id == $login_username) {
+ if ($id == $maj_admin_username) {
$author = file_get_contents("data/author.txt");
echo "<title>$author</title>";
}
@@ -171,7 +165,7 @@ a:active {
if ($id == "all") {
- if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on") and isset($_POST['username']) and !empty($_POST['username']) and file_exists("data/members/active/{$_POST['username']}") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on") and isset($_POST['username']) and !empty($_POST['username']) and file_exists("data/members/active/{$_POST['username']}") and isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (isset($_POST['rw']) and !empty($_POST['rw']) and ($_POST['rw'] == "on") and !file_exists("data/members/active/{$_POST['username']}/bb-rw.txt")) {
touch("data/members/active/{$_POST['username']}/bb-rw.txt");
@@ -260,9 +254,9 @@ if ($id == "all") {
?>
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" style="background-color: transparent;"><tr><td><div id="panel_title">Members</div><div id="panel_body"><table border="0" cellspacing="1" cellpadding="2" bgcolor="#cccccc">
-<tr><td bgcolor="#eeeeee" align="center">status</td><td bgcolor="#eeeeee" align="center">username</td><?php if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) { echo "<td bgcolor=\"#eeeeee\" align=\"center\">real name</td>"; } ?><td bgcolor="#eeeeee" align="center">member since</td><td bgcolor="#eeeeee" align="center">logins</td><td bgcolor="#eeeeee" align="center">posts</td><?php
+<tr><td bgcolor="#eeeeee" align="center">status</td><td bgcolor="#eeeeee" align="center">username</td><?php if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) { echo "<td bgcolor=\"#eeeeee\" align=\"center\">real name</td>"; } ?><td bgcolor="#eeeeee" align="center">member since</td><td bgcolor="#eeeeee" align="center">logins</td><td bgcolor="#eeeeee" align="center">posts</td><?php
-if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<td bgcolor="#eeeeee" align="center">rw</td><td bgcolor="#eeeeee" align="center">ul</td><td bgcolor="#eeeeee" align="center">noml</td><td bgcolor="#eeeeee" align="center">lock</td><td bgcolor="#eeeeee" align="center">del</td><td bgcolor="#eeeeee" align="center">rank</td><td bgcolor="#eeeeee" align="center">category</td><td bgcolor="#eeeeee" align="center">action</td>';
}
@@ -270,7 +264,7 @@ if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESS
<?php
-$show_member_list[] = file_get_contents("data/username.txt");
+$show_member_list[] = $maj_admin_username;
if (file_exists("data/members/active")) {
if ($dh_member_list = opendir("data/members/active")) {
@@ -347,34 +341,34 @@ if (file_exists("data/members/active")) {
}
if ($sess_count > 0) {
- echo "<img src=images/smileys/smile.png>";
+ echo "<img src=\"images/smileys/smile.png\">";
}
else {
- echo "<img src=images/smileys/offline.png>";
+ echo "<img src=\"images/smileys/offline.png\">";
}
$sess_count = 0;
- echo "</td><td bgcolor=#ffffff><a href=member.php?id=$member_list_entry>$member_list_entry</a></td>";
+ echo "</td><td bgcolor=#ffffff><a href=\"member.php?id=$member_list_entry\">$member_list_entry</a></td>";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/members/active/$member_list_entry")) {
$member_name = file_get_contents("data/members/active/$member_list_entry/firstname.txt") . " " . file_get_contents("data/members/active/$member_list_entry/lastname.txt");
}
- if ($member_list_entry == file_get_contents("data/username.txt")) {
+ if ($member_list_entry == $maj_admin_username) {
$member_name = file_get_contents("data/author.txt");
}
echo "<td bgcolor=#ffffff>$member_name</td>";
}
- if ($member_list_entry == file_get_contents("data/username.txt") or (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/timestamp.txt"))) {
+ if ($member_list_entry == $maj_admin_username or (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/timestamp.txt"))) {
echo "<td bgcolor=#ffffff align=center><nobr><code>-</code></nobr></td>";
}
- if (file_exists("data/members/active/$member_list_entry") and ($member_list_entry != file_get_contents("data/username.txt")) and file_exists("data/members/active/$member_list_entry/timestamp.txt")) {
+ if (file_exists("data/members/active/$member_list_entry") and ($member_list_entry != $maj_admin_username) and file_exists("data/members/active/$member_list_entry/timestamp.txt")) {
$joined = file_get_contents("data/members/active/$member_list_entry/timestamp.txt");
$joined_year = substr($joined,0,4);
$joined_month = substr($joined,4,2);
@@ -383,7 +377,7 @@ if (file_exists("data/members/active")) {
echo "<td bgcolor=#ffffff align=center><nobr><code>$member_since</code></nobr></td>";
}
- if ((file_get_contents("data/username.txt") == $member_list_entry) and file_exists("data/bb-logins.txt")) {
+ if (($maj_admin_username == $member_list_entry) and file_exists("data/bb-logins.txt")) {
$logins = file_get_contents("data/bb-logins.txt");
echo "<td bgcolor=#ffffff align=right><code>$logins</code></td>";
}
@@ -392,7 +386,7 @@ if (file_exists("data/members/active")) {
echo "<td bgcolor=#ffffff align=right><code>$logins</code></td>";
}
- if ((file_get_contents("data/username.txt") == $member_list_entry) and !file_exists("data/bb-logins.txt")) {
+ if (($maj_admin_username == $member_list_entry) and !file_exists("data/bb-logins.txt")) {
echo "<td bgcolor=#ffffff align=right><code>0</code></td>";
}
elseif (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/bb-logins.txt")) {
@@ -405,7 +399,7 @@ if (file_exists("data/members/active")) {
if ($member_posts != "." && $member_posts != "..") {
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -428,7 +422,7 @@ if (file_exists("data/members/active")) {
}
}
- if (($private_cat > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
+ if (($private_cat > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
continue;
}
@@ -439,7 +433,7 @@ if (file_exists("data/members/active")) {
}
}
else {
- if (!file_exists("data/members/active/$member_list_entry") and (file_get_contents("data/username.txt") == $member_list_entry) and file_exists("data/bb.txt")) {
+ if (!file_exists("data/members/active/$member_list_entry") and ($maj_admin_username == $member_list_entry) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$member_posts/author.txt") and (file_get_contents("data/items/$member_posts/author.txt") == $member_list_entry)) {
$items_posts[] = $member_posts;
@@ -457,9 +451,9 @@ if (file_exists("data/members/active")) {
unset($items_posts);
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if (($member_list_entry != file_get_contents("data/username.txt")) and file_exists("data/members/active/$member_list_entry")) {
+ if (($member_list_entry != $maj_admin_username) and file_exists("data/members/active/$member_list_entry")) {
echo "<form action=member.php method=post><input type=hidden name=id value=all><input type=hidden name=edit value=on><input type=hidden name=username value=$member_list_entry>";
echo "<td bgcolor=#ffffff align=center><input type=checkbox name=rw";
@@ -536,7 +530,7 @@ if (file_exists("data/members/active")) {
echo "</select></td><td bgcolor=#ffffff align=center><input class=submit type=submit value=submit></td></form>";
}
- if ($member_list_entry == file_get_contents("data/username.txt")) {
+ if ($member_list_entry == $maj_admin_username) {
echo "<td colspan=8 bgcolor=#ffffff align=center><a href=settings.php>administrator settings</a></td>";
}
}
@@ -548,7 +542,7 @@ if (file_exists("data/members/active")) {
</table></div><div id="panel_footer"><font style="font-size: 10px; color: #999999;"><a href="index.php">home</a> | <a href="member.php?id=all">members</a> | <a href="login.php">
<?php
-if (isset($_SESSION['logged_in'])) {
+if (isset($maj_logged_in_username)) {
echo "logout";
}
else {
@@ -566,11 +560,11 @@ else {
<?php
-if (file_get_contents("data/username.txt") == $id) {
+if ($maj_admin_username == $id) {
readfile("data/author.txt");
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+ if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/members/active/{$maj_logged_in_username}")) {
echo " <";
readfile("data/email.txt");
echo " >";
@@ -579,7 +573,7 @@ if (file_get_contents("data/username.txt") == $id) {
else {
echo "$member_firstname $member_lastname";
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/$id/email.txt")) {
+ if (isset($maj_logged_in_username) and !empty($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/members/active/$id/email.txt")) {
$email = file_get_contents("data/members/active/$id/email.txt");
echo " <$email>";
}
@@ -595,125 +589,7 @@ else {
<?php
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/avatar.txt") and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
-
- $avatar_gif_image_size = getimagesize("images/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
-
- $max_avatar_gif_image_width = 80;
-
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
-
- if (file_exists("images/avatar.jpg")) {
-
- $avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
-
- $max_avatar_jpg_image_width = 80;
-
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/avatar.png")) {
-
- $avatar_png_image_size = getimagesize("images/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
-
- $max_avatar_png_image_width = 80;
-
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
-}
-else {
-
- if (file_exists("data/avatar.txt") and (file_exists("images/members/$id/avatar.jpg") or file_exists("images/members/$id/avatar.gif") or file_exists("images/members/$id/avatar.png"))) {
-
- if (file_exists("images/members/$id/avatar.gif")) {
-
- $avatar_gif_image_size = getimagesize("images/members/$id/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
-
- $max_avatar_gif_image_width = 80;
-
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
-
-
- if (file_exists("images/members/$id/avatar.jpg")) {
-
- $avatar_jpg_image_size = getimagesize("images/members/$id/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
-
- $max_avatar_jpg_image_width = 80;
-
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/members/$id/avatar.png")) {
-
- $avatar_png_image_size = getimagesize("images/members/$id/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
-
- $max_avatar_png_image_width = 80;
-
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
- }
-}
-
-echo "<b>$id</b><br>";
-
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/rank.txt")) {
- echo "administrator";
-}
-elseif (file_exists("data/members/active/$id/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/$id/rank.txt");
- echo "$rank";
-}
-elseif (!file_exists("data/members/active/$id/rank.txt") and file_exists("data/rank.txt")) {
- echo "member";
-}
+show_maj_avatar_image($id,80);
?>
@@ -722,16 +598,16 @@ elseif (!file_exists("data/members/active/$id/rank.txt") and file_exists("data/r
<?php
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/url.txt") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in'])) {
+if (($maj_admin_username == $id) and file_exists("data/url.txt") and isset($maj_logged_in_username) and !empty($maj_logged_in_username)) {
$member_url = file_get_contents("data/url.txt");
echo "<tr><td width=90>website</td><td><a href=$member_url target=_majbb><code>$member_url</code></a></td></tr>";
}
-elseif (file_exists("data/members/active/$id/url.txt") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in'])) {
+elseif (file_exists("data/members/active/$id/url.txt") and isset($maj_logged_in_username) and !empty($maj_logged_in_username)) {
$member_url = file_get_contents("data/members/active/$id/url.txt");
echo "<tr><td width=90>website</td><td><a href=$member_url target=_majbb><code>$member_url</code></a></td></tr>";
}
-if (file_exists("data/members/active/$id/bday.txt") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (file_exists("data/members/active/$id/bday.txt") and ($maj_logged_in_username == $maj_admin_username)) {
$bday = file_get_contents("data/members/active/$id/bday.txt");
$bday_year = substr($bday,0,4);
$bday_month = substr($bday,4,2);
@@ -751,7 +627,7 @@ if (file_exists("data/members/active/$id/timestamp.txt")) {
echo "<tr><td width=90>member since</td><td><code>$member_since</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/lastlog.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/lastlog.txt")) {
$lastlog = file_get_contents("data/lastlog.txt");
$lastlog_year = substr($lastlog,0,4);
$lastlog_month = substr($lastlog,4,2);
@@ -772,7 +648,7 @@ elseif (file_exists("data/members/active/$id/bb-last.txt")) {
echo "<tr><td width=90>last login</td><td><code>$last_login</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/lastpost.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/lastpost.txt")) {
$lastpost = file_get_contents("data/lastpost.txt");
$lastpost_year = substr($lastpost,0,4);
$lastpost_month = substr($lastpost,4,2);
@@ -793,14 +669,14 @@ elseif (file_exists("data/members/active/$id/bb-post.txt")) {
echo "<tr><td width=90>last post</td><td><code>$last_post</code></td></tr>";
}
-if (file_get_contents("data/username.txt") == $id) {
+if ($maj_admin_username == $id) {
if (!file_exists("data/bb-views.txt")) {
$views = 0;
}
else {
$views = file_get_contents("data/bb-views.txt");
}
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if (!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))) {
$views = $views + 1;
$views_file = fopen("data/bb-views.txt", "w");
fwrite($views_file, $views);
@@ -817,9 +693,9 @@ elseif (file_exists("data/members/active/$id")) {
$views = file_get_contents("data/members/active/$id/bb-views.txt");
}
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $id))) {
+ if (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $id))) {
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if (!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))) {
$views = $views + 1;
$views_file = fopen("data/members/active/$id/bb-views.txt", "w");
fwrite($views_file, $views);
@@ -829,7 +705,7 @@ elseif (file_exists("data/members/active/$id")) {
echo "<tr><td width=90>profile views</td><td><code>$views</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/bb-logins.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/bb-logins.txt")) {
$logins = file_get_contents("data/bb-logins.txt");
echo "<tr><td width=90>total logins</td><td><code>$logins</code></td></tr>";
}
@@ -846,7 +722,7 @@ if ($dh_posts = opendir("data/items")) {
$total_posts[] = $member_posts;
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -869,7 +745,7 @@ if ($dh_posts = opendir("data/items")) {
}
}
- if (($private_cat > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
+ if (($private_cat > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
continue;
}
@@ -879,7 +755,7 @@ if ($dh_posts = opendir("data/items")) {
$items_posts[] = $member_posts;
}
}
- elseif (!file_exists("data/members/active/$id") and (file_get_contents("data/username.txt") == $id) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$id") and ($maj_admin_username == $id) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$member_posts/author.txt") and (file_get_contents("data/items/$member_posts/author.txt") == $id)) {
$items_posts[] = $member_posts;
@@ -911,11 +787,11 @@ unset($total_posts);
<?php
-if ($id == file_get_contents("data/username.txt")) {
+if ($id == $maj_admin_username) {
echo "rw";
}
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/bb-rw.txt")) {
echo "rw";
@@ -925,7 +801,7 @@ if (($id != file_get_contents("data/username.txt")) and file_exists("data/member
}
}
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/bb-ul.txt")) {
echo " upload";
@@ -938,7 +814,7 @@ if (($id != file_get_contents("data/username.txt")) and file_exists("data/member
<?php
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/category.txt")) {
@@ -1023,7 +899,7 @@ $sess_count = 0;
<?php
-if (isset($_SESSION['logged_in'])) {
+if (isset($maj_logged_in_username)) {
echo "logout";
}
else {
tree b41f32035ca89ad150e2c81a3efc4fc1e98af9b0
parent 02d9fa3e67d76f699e079818dd80254d421589a5
author Magie Antonio <magie@majcms.org> 1309772544 +0800
committer Magie Antonio <magie@majcms.org> 1309772544 +0800
Clean up avatar display functions
diff --git a/core.php b/core.php
index 0d0d919..ea49474 100644
--- a/core.php
+++ b/core.php
@@ -1,4 +1,140 @@
<?php
+
+$maj_default_title = file_get_contents("data/title.txt");
+$maj_admin_username = file_get_contents("data/username.txt");
+
+if (isset($_SESSION['logged_in'])) {
+ $maj_logged_in_username = $_SESSION['logged_in'];
+}
+
+if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
+ header("Location: login.php");
+}
+
+if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
+ $maj_req_entry = trim($_REQUEST['entry']);
+}
+
+if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
+ $maj_req_show = trim($_REQUEST['show']);
+}
+
+if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
+ $maj_req_find = trim($_REQUEST['find']);
+ $maj_req_find = str_replace(" ","-",$maj_req_find);
+ $maj_req_find = strtolower($maj_req_find);
+ $maj_req_find = strip_tags($maj_req_find);
+}
+
+if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
+ $maj_req_category = trim($_REQUEST['category']);
+ $maj_req_category = str_replace(" ","-",$maj_req_category);
+ $maj_req_category = strtolower($maj_req_category);
+ $maj_req_category = strip_tags($maj_req_category);
+}
+
+if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
+ $maj_req_archive = trim($_REQUEST['archive']);
+}
+
+if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
+ $maj_req_author = trim($_REQUEST['author']);
+ $maj_req_author = str_replace(" ","-",$maj_req_author);
+ $maj_req_author = strtolower($maj_req_author);
+ $maj_req_author = strip_tags($maj_req_author);
+}
+
+if (file_exists("data/offset.txt")) {
+ $maj_offset = file_get_contents("data/offset.txt");
+}
+else {
+ $maj_offset = 0;
+}
+
+if (file_exists("data/increase.txt")) {
+ $maj_increase = file_get_contents("data/increase.txt");
+}
+else {
+ $maj_increase = 5;
+}
+
+if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
+ $maj_wside = "160";
+ $maj_wmain = "600";
+}
+else {
+ $maj_wside = "200";
+ $maj_wmain = "520";
+}
+
+$maj_wspace = "10";
+
+$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
+
+$maj_default_blog_title = "My Activity Journal";
+$maj_default_username = "maj";
+$maj_default_password = "php";
+$maj_default_blog_profile = 'This cool site is powered by My Activity Journal (<a href="http://majcms.org/" target="_maj">MAJ</a>), a simple <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://opensource.org/" target="_maj">Open Source</a> content management system (CMS) that can be deployed as a blog, bulletin board (Internet forum or message board), and wiki.';
+$maj_default_blog_author = "My Activity Journal";
+
+if (!file_exists("data")) {
+ mkdir("data");
+}
+
+if (!file_exists("data/.htaccess")) {
+ $maj_htaccess = "Order deny,allow\nDeny from all";
+ $maj_fp_htaccess_txt = fopen("data/.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");
+ 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");
+ fwrite($maj_fp_htaccess_txt,$maj_default_username);
+ fclose($maj_fp_htaccess_txt);
+}
+
+if (!file_exists("data/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");
+ 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");
+ 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");
+ fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
+ fclose($maj_fp_default_author_txt);
+}
+
+function str_rand($maj_length = 8,$maj_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
+ $maj_str = '';
+ $maj_seeds_count = strlen($maj_seeds);
+
+ list($maj_usec,$maj_sec) = explode(' ',microtime());
+ $maj_seed = (float) $maj_sec + ((float) $maj_usec * 100000);
+ mt_srand($maj_seed);
+
+ for ($maj_i = 0; $maj_length > $maj_i; $maj_i++) {
+ $maj_str .= $maj_seeds{mt_rand(0,$maj_seeds_count - 1)};
+ }
+ return $maj_str;
+}
+
// 20100729 - aggregate recurring functions
if (get_magic_quotes_gpc()) {
@@ -264,4 +400,248 @@
$this->SetTextColor(0);
} //function PutLink($URL, $txt)
} //class PDF extends FPDF
+
+function show_maj_avatar_image($author_username,$max_img_width=80) {
+
+ // please replace this with something better:
+ global $maj_admin_username;
+
+ echo "<a href=\"member.php?id=$author_username\">";
+
+ if (($maj_admin_username == $author_username) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
+
+ if (file_exists("images/avatar.gif")) {
+
+ $avatar_gif_image_size = getimagesize("images/avatar.gif");
+ $avatar_gif_image_width = $avatar_gif_image_size[0];
+ $avatar_gif_image_height = $avatar_gif_image_size[1];
+
+ if ($avatar_gif_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_gif_image_width) ;
+ $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
+ $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-gif.txt")) {
+
+ $avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
+
+ imagealphablending($avatar_gif_image_resize, false);
+ imagesavealpha($avatar_gif_image_resize, true);
+
+ $avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
+ $avatar_gif_transparent_index = imagecolortransparent($avatar_gif_image_original);
+
+ if ($avatar_gif_transparent_index >= 0) {
+
+ $avatar_gif_transparent_color = imagecolorsforindex($avatar_gif_image_original, $avatar_gif_transparent_index);
+ $avatar_gif_transparent_index = imagecolorallocate($avatar_gif_image_resize, $avatar_gif_transparent_color['red'], $avatar_gif_transparent_color['green'], $avatar_gif_transparent_color['blue']);
+
+ imagefill($avatar_gif_image_resize, 0, 0, $avatar_gif_transparent_index);
+ imagecolortransparent($avatar_gif_image_resize, $avatar_gif_transparent_index);
+ }
+
+ imagecopyresampled($avatar_gif_image_resize,$avatar_gif_image_original,0,0,0,0,$avatar_gif_image_width,$avatar_gif_image_height,$avatar_gif_image_size[0],$avatar_gif_image_size[1]);
+
+ unlink("images/avatar.gif");
+
+ imagegif($avatar_gif_image_resize,"images/avatar.gif",100);
+
+ imagedestroy($avatar_gif_image_resize);
+ imagedestroy($avatar_gif_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
+ }
+
+ if (file_exists("images/avatar.jpg")) {
+
+ $avatar_jpg_image_size = getimagesize("images/avatar.jpg");
+ $avatar_jpg_image_width = $avatar_jpg_image_size[0];
+ $avatar_jpg_image_height = $avatar_jpg_image_size[1];
+
+ if ($avatar_jpg_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_jpg_image_width) ;
+ $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
+ $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("data/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");
+
+ imagecopyresampled($avatar_jpg_image_resize,$avatar_jpg_image_original,0,0,0,0,$avatar_jpg_image_width,$avatar_jpg_image_height,$avatar_jpg_image_size[0],$avatar_jpg_image_size[1]);
+
+ unlink("images/avatar.jpg");
+
+ imagejpeg($avatar_jpg_image_resize,"images/avatar.jpg",100);
+
+ imagedestroy($avatar_jpg_image_resize);
+ imagedestroy($avatar_jpg_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
+ }
+
+ if (file_exists("images/avatar.png")) {
+
+ $avatar_png_image_size = getimagesize("images/avatar.png");
+ $avatar_png_image_width = $avatar_png_image_size[0];
+ $avatar_png_image_height = $avatar_png_image_size[1];
+
+ if ($avatar_png_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_png_image_width) ;
+ $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
+ $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-png.txt")) {
+
+ $avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
+
+ imagealphablending($avatar_png_image_resize, false);
+ imagesavealpha($avatar_png_image_resize, true);
+
+ $avatar_png_image_original = imagecreatefrompng("images/avatar.png");
+
+ imagecopyresampled($avatar_png_image_resize,$avatar_png_image_original,0,0,0,0,$avatar_png_image_width,$avatar_png_image_height,$avatar_png_image_size[0],$avatar_png_image_size[1]);
+
+ unlink("images/avatar.png");
+
+ imagepng($avatar_png_image_resize,"images/avatar.png",100);
+
+ imagedestroy($avatar_png_image_resize);
+ imagedestroy($avatar_png_image_original);
+ }
+ }
+ echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
+ }
+ echo "<br>";
+ }
+ elseif (file_exists("images/members/$author_username/avatar.jpg") or file_exists("images/members/$author_username/avatar.gif") or file_exists("images/members/$author_username/avatar.png")) {
+
+ if (file_exists("images/members/$author_username/avatar.gif")) {
+
+ $avatar_gif_image_size = getimagesize("images/members/$author_username/avatar.gif");
+ $avatar_gif_image_width = $avatar_gif_image_size[0];
+ $avatar_gif_image_height = $avatar_gif_image_size[1];
+
+ if ($avatar_gif_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_gif_image_width) ;
+ $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
+ $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-gif.txt")) {
+
+ $avatar_gif_image_resize = imagecreatetruecolor($avatar_gif_image_width,$avatar_gif_image_height);
+
+ imagealphablending($avatar_gif_image_resize, false);
+ imagesavealpha($avatar_gif_image_resize, true);
+
+ $avatar_gif_image_original = imagecreatefromgif("images/members/$author_username/avatar.gif");
+ $avatar_gif_transparent_index = imagecolortransparent($avatar_gif_image_original);
+
+ if ($avatar_gif_transparent_index >= 0) {
+
+ $avatar_gif_transparent_color = imagecolorsforindex($avatar_gif_image_original, $avatar_gif_transparent_index);
+ $avatar_gif_transparent_index = imagecolorallocate($avatar_gif_image_resize, $avatar_gif_transparent_color['red'], $avatar_gif_transparent_color['green'], $avatar_gif_transparent_color['blue']);
+
+ imagefill($avatar_gif_image_resize, 0, 0, $avatar_gif_transparent_index);
+ imagecolortransparent($avatar_gif_image_resize, $avatar_gif_transparent_index);
+ }
+
+ imagecopyresampled($avatar_gif_image_resize,$avatar_gif_image_original,0,0,0,0,$avatar_gif_image_width,$avatar_gif_image_height,$avatar_gif_image_size[0],$avatar_gif_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.gif");
+
+ imagegif($avatar_gif_image_resize,"images/members/$author_username/avatar.gif",100);
+
+ imagedestroy($avatar_gif_image_resize);
+ imagedestroy($avatar_gif_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
+ }
+
+ if (file_exists("images/members/$author_username/avatar.jpg")) {
+
+ $avatar_jpg_image_size = getimagesize("images/members/$author_username/avatar.jpg");
+ $avatar_jpg_image_width = $avatar_jpg_image_size[0];
+ $avatar_jpg_image_height = $avatar_jpg_image_size[1];
+
+ if ($avatar_jpg_image_width > $max_img_width) {
+
+ $sizefactor = (double) ($max_img_width / $avatar_jpg_image_width) ;
+ $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
+ $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
+
+ if (file_exists("data/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");
+
+ imagecopyresampled($avatar_jpg_image_resize,$avatar_jpg_image_original,0,0,0,0,$avatar_jpg_image_width,$avatar_jpg_image_height,$avatar_jpg_image_size[0],$avatar_jpg_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.jpg");
+
+ imagejpeg($avatar_jpg_image_resize,"images/members/$author_username/avatar.jpg",100);
+
+ imagedestroy($avatar_jpg_image_resize);
+ imagedestroy($avatar_jpg_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
+ }
+
+ if (file_exists("images/members/$author_username/avatar.png")) {
+
+ $avatar_png_image_size = getimagesize("images/members/$author_username/avatar.png");
+ $avatar_png_image_width = $avatar_png_image_size[0];
+ $avatar_png_image_height = $avatar_png_image_size[1];
+
+ if ($avatar_png_image_width > $max_img_width) {
+ $sizefactor = (double) ($max_img_width / $avatar_png_image_width) ;
+ $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
+ $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
+
+ if (file_exists("data/avatar-resize-png.txt")) {
+
+ $avatar_png_image_resize = imagecreatetruecolor($avatar_png_image_width,$avatar_png_image_height);
+
+ imagealphablending($avatar_png_image_resize, false);
+ imagesavealpha($avatar_png_image_resize, true);
+
+ $avatar_png_image_original = imagecreatefrompng("images/members/$author_username/avatar.png");
+
+ imagecopyresampled($avatar_png_image_resize,$avatar_png_image_original,0,0,0,0,$avatar_png_image_width,$avatar_png_image_height,$avatar_png_image_size[0],$avatar_png_image_size[1]);
+
+ unlink("images/members/$author_username/avatar.png");
+
+ imagepng($avatar_png_image_resize,"images/members/$author_username/avatar.png",100);
+
+ imagedestroy($avatar_png_image_resize);
+ imagedestroy($avatar_png_image_original);
+ }
+ }
+ echo "<img src=\"images/members/$author_username/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
+ }
+ echo "<br>";
+ }
+
+ echo "<b>$author_username</b></a><br>";
+
+ if (($maj_admin_username == $author_username) and file_exists("data/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");
+ echo "$rank<br>";
+ }
+ elseif (!file_exists("data/members/active/$author_username/rank.txt") and file_exists("data/rank.txt")) {
+ echo "member<br>";
+ }
+}
+
?>
diff --git a/index.php b/index.php
index b9311f7..fa0e418 100644
--- a/index.php
+++ b/index.php
@@ -6,131 +6,10 @@ session_start();
header("Cache-control: private");
-error_reporting(E_ERROR);
+//error_reporting(E_ERROR);
require("core.php");
-if (isset($maj_logged_in_username) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
-}
-
-if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
- $maj_req_entry = trim($_REQUEST['entry']);
-}
-
-if (isset($_REQUEST['show']) and !empty($_REQUEST['show'])) {
- $maj_req_show = trim($_REQUEST['show']);
-}
-
-if (isset($_REQUEST['find']) and !empty($_REQUEST['find'])) {
- $maj_req_find = trim($_REQUEST['find']);
- $maj_req_find = str_replace(" ","-",$maj_req_find);
- $maj_req_find = strtolower($maj_req_find);
- $maj_req_find = strip_tags($maj_req_find);
-}
-
-if (isset($_REQUEST['category']) and !empty($_REQUEST['category'])) {
- $maj_req_category = trim($_REQUEST['category']);
- $maj_req_category = str_replace(" ","-",$maj_req_category);
- $maj_req_category = strtolower($maj_req_category);
- $maj_req_category = strip_tags($maj_req_category);
-}
-
-if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
- $maj_req_archive = trim($_REQUEST['archive']);
-}
-
-if (isset($_REQUEST['author']) and !empty($_REQUEST['author'])) {
- $maj_req_author = trim($_REQUEST['author']);
- $maj_req_author = str_replace(" ","-",$maj_req_author);
- $maj_req_author = strtolower($maj_req_author);
- $maj_req_author = strip_tags($maj_req_author);
-}
-
-if (file_exists("data/offset.txt")) {
- $maj_offset = file_get_contents("data/offset.txt");
-}
-else {
- $maj_offset = 0;
-}
-
-if (file_exists("data/increase.txt")) {
- $maj_increase = file_get_contents("data/increase.txt");
-}
-else {
- $maj_increase = 5;
-}
-
-if (file_exists("data/bb.txt") and file_exists("data/avatar.txt")) {
- $maj_wside = "160";
- $maj_wmain = "600";
-}
-else {
- $maj_wside = "200";
- $maj_wmain = "520";
-}
-
-$maj_wspace = "10";
-
-$maj_wtable = $maj_wspace + $maj_wside + $maj_wspace + $maj_wmain + $maj_wspace + $maj_wside + $maj_wspace;
-
-$maj_default_blog_title = "My Activity Journal";
-$maj_default_username = "maj";
-$maj_default_password = "php";
-$maj_default_blog_profile = 'This cool site is powered by My Activity Journal (<a href="http://majcms.org/" target="_maj">MAJ</a>), a simple <a href="http://php.net/" target="_maj">PHP</a>-based, <a href="http://opensource.org/" target="_maj">Open Source</a> content management system (CMS) that can be deployed as a blog, bulletin board (Internet forum or message board), and wiki.';
-$maj_default_blog_author = "My Activity Journal";
-
-if (!file_exists("data")) {
- mkdir("data");
-}
-
-if (!file_exists("data/.htaccess")) {
- $maj_htaccess = "Order deny,allow\nDeny from all";
- $maj_fp_htaccess_txt = fopen("data/.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");
- 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");
- fwrite($maj_fp_htaccess_txt,$maj_default_username);
- fclose($maj_fp_htaccess_txt);
-}
-
-if (!file_exists("data/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");
- 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");
- 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");
- fwrite($maj_fp_default_author_txt,$maj_default_blog_author);
- fclose($maj_fp_default_author_txt);
-}
-
-$maj_default_title = file_get_contents("data/title.txt");
-$maj_admin_username = file_get_contents("data/username.txt");
-
-if (isset($_SESSION['logged_in'])) {
- $maj_logged_in_username = $_SESSION['logged_in'];
-}
-
if (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) {
if (file_exists("data/hits.txt")) {
@@ -163,20 +42,6 @@ if (@ereg("Google",$_SERVER['HTTP_USER_AGENT'])) {
fclose($maj_google_hits_file);
}
-function str_rand($maj_length = 8,$maj_seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
- $maj_str = '';
- $maj_seeds_count = strlen($maj_seeds);
-
- list($maj_usec,$maj_sec) = explode(' ',microtime());
- $maj_seed = (float) $maj_sec + ((float) $maj_usec * 100000);
- mt_srand($maj_seed);
-
- for ($maj_i = 0; $maj_length > $maj_i; $maj_i++) {
- $maj_str .= $maj_seeds{mt_rand(0,$maj_seeds_count - 1)};
- }
- return $maj_str;
-}
-
if (isset($_REQUEST['download']) and !empty($_REQUEST['download'])) {
ini_set("zlib.output_compression","off");
$maj_dl_file = str_replace("../","",@$_REQUEST['download']);
@@ -2192,260 +2057,11 @@ foreach ($maj_disp as $maj_d) {
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")) {
- echo "<td width=\"75\" valign=\"top\">";
+ echo "<td width=\"80\" valign=\"top\">";
$maj_author = file_get_contents("data/items/$maj_d/author.txt");
- echo "<a href=\"member.php?id=$maj_author\">";
-
- if (($maj_admin_username == $maj_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
-
- $maj_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_avatar_gif_image_width = $maj_avatar_gif_image_size[0];
- $maj_avatar_gif_image_height = $maj_avatar_gif_image_size[1];
-
- $maj_max_avatar_gif_image_width = 75;
-
- if ($maj_avatar_gif_image_width > $maj_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_gif_image_width / $maj_avatar_gif_image_width) ;
- $maj_avatar_gif_image_width = (int) ($maj_avatar_gif_image_width * $maj_sizefactor);
- $maj_avatar_gif_image_height = (int) ($maj_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_avatar_gif_image_resize = imagecreatetruecolor($maj_avatar_gif_image_width,$maj_avatar_gif_image_height);
-
- imagealphablending($maj_avatar_gif_image_resize, false);
- imagesavealpha($maj_avatar_gif_image_resize, true);
-
- $maj_avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
- $maj_avatar_gif_transparent_index = imagecolortransparent($maj_avatar_gif_image_original);
-
- if ($maj_avatar_gif_transparent_index >= 0) {
-
- $maj_avatar_gif_transparent_color = imagecolorsforindex($maj_avatar_gif_image_original, $maj_avatar_gif_transparent_index);
- $maj_avatar_gif_transparent_index = imagecolorallocate($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_color['red'], $maj_avatar_gif_transparent_color['green'], $maj_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_avatar_gif_image_resize, 0, 0, $maj_avatar_gif_transparent_index);
- imagecolortransparent($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_avatar_gif_image_resize,$maj_avatar_gif_image_original,0,0,0,0,$maj_avatar_gif_image_width,$maj_avatar_gif_image_height,$maj_avatar_gif_image_size[0],$maj_avatar_gif_image_size[1]);
-
- unlink("images/avatar.gif");
-
- imagegif($maj_avatar_gif_image_resize,"images/avatar.gif",100);
-
- imagedestroy($maj_avatar_gif_image_resize);
- imagedestroy($maj_avatar_gif_image_original);
- }
- }
- echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$maj_avatar_gif_image_width\" height=\"$maj_avatar_gif_image_height\">";
- }
-
- if (file_exists("images/avatar.jpg")) {
-
- $maj_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_avatar_jpg_image_width = $maj_avatar_jpg_image_size[0];
- $maj_avatar_jpg_image_height = $maj_avatar_jpg_image_size[1];
-
- $maj_max_avatar_jpg_image_width = 75;
-
- if ($maj_avatar_jpg_image_width > $maj_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_jpg_image_width / $maj_avatar_jpg_image_width) ;
- $maj_avatar_jpg_image_width = (int) ($maj_avatar_jpg_image_width * $maj_sizefactor);
- $maj_avatar_jpg_image_height = (int) ($maj_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_avatar_jpg_image_resize = imagecreatetruecolor($maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height);
- $maj_avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
-
- imagecopyresampled($maj_avatar_jpg_image_resize,$maj_avatar_jpg_image_original,0,0,0,0,$maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height,$maj_avatar_jpg_image_size[0],$maj_avatar_jpg_image_size[1]);
-
- unlink("images/avatar.jpg");
-
- imagejpeg($maj_avatar_jpg_image_resize,"images/avatar.jpg",100);
-
- imagedestroy($maj_avatar_jpg_image_resize);
- imagedestroy($maj_avatar_jpg_image_original);
- }
- }
- echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$maj_avatar_jpg_image_width\" height=\"$maj_avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/avatar.png")) {
-
- $maj_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_avatar_png_image_width = $maj_avatar_png_image_size[0];
- $maj_avatar_png_image_height = $maj_avatar_png_image_size[1];
-
- $maj_max_avatar_png_image_width = 75;
-
- if ($maj_avatar_png_image_width > $maj_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_png_image_width / $maj_avatar_png_image_width) ;
- $maj_avatar_png_image_width = (int) ($maj_avatar_png_image_width * $maj_sizefactor);
- $maj_avatar_png_image_height = (int) ($maj_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_avatar_png_image_resize = imagecreatetruecolor($maj_avatar_png_image_width,$maj_avatar_png_image_height);
-
- imagealphablending($maj_avatar_png_image_resize, false);
- imagesavealpha($maj_avatar_png_image_resize, true);
-
- $maj_avatar_png_image_original = imagecreatefrompng("images/avatar.png");
-
- imagecopyresampled($maj_avatar_png_image_resize,$maj_avatar_png_image_original,0,0,0,0,$maj_avatar_png_image_width,$maj_avatar_png_image_height,$maj_avatar_png_image_size[0],$maj_avatar_png_image_size[1]);
-
- unlink("images/avatar.png");
-
- imagepng($maj_avatar_png_image_resize,"images/avatar.png",100);
-
- imagedestroy($maj_avatar_png_image_resize);
- imagedestroy($maj_avatar_png_image_original);
- }
- }
-
- echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$maj_avatar_png_image_width\" height=\"$maj_avatar_png_image_height\">";
- }
- echo "<br>";
- }
- elseif (file_exists("images/members/$maj_author/avatar.jpg") or file_exists("images/members/$maj_author/avatar.gif") or file_exists("images/members/$maj_author/avatar.png")) {
-
- if (file_exists("images/members/$maj_author/avatar.gif")) {
-
- $maj_avatar_gif_image_size = getimagesize("images/members/$maj_author/avatar.gif");
- $maj_avatar_gif_image_width = $maj_avatar_gif_image_size[0];
- $maj_avatar_gif_image_height = $maj_avatar_gif_image_size[1];
-
- $maj_max_avatar_gif_image_width = 75;
-
- if ($maj_avatar_gif_image_width > $maj_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_gif_image_width / $maj_avatar_gif_image_width) ;
- $maj_avatar_gif_image_width = (int) ($maj_avatar_gif_image_width * $maj_sizefactor);
- $maj_avatar_gif_image_height = (int) ($maj_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_avatar_gif_image_resize = imagecreatetruecolor($maj_avatar_gif_image_width,$maj_avatar_gif_image_height);
-
- imagealphablending($maj_avatar_gif_image_resize, false);
- imagesavealpha($maj_avatar_gif_image_resize, true);
-
- $maj_avatar_gif_image_original = imagecreatefromgif("images/members/$maj_author/avatar.gif");
- $maj_avatar_gif_transparent_index = imagecolortransparent($maj_avatar_gif_image_original);
-
- if ($maj_avatar_gif_transparent_index >= 0) {
-
- $maj_avatar_gif_transparent_color = imagecolorsforindex($maj_avatar_gif_image_original, $maj_avatar_gif_transparent_index);
- $maj_avatar_gif_transparent_index = imagecolorallocate($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_color['red'], $maj_avatar_gif_transparent_color['green'], $maj_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_avatar_gif_image_resize, 0, 0, $maj_avatar_gif_transparent_index);
- imagecolortransparent($maj_avatar_gif_image_resize, $maj_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_avatar_gif_image_resize,$maj_avatar_gif_image_original,0,0,0,0,$maj_avatar_gif_image_width,$maj_avatar_gif_image_height,$maj_avatar_gif_image_size[0],$maj_avatar_gif_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.gif");
-
- imagegif($maj_avatar_gif_image_resize,"images/members/$maj_author/avatar.gif",100);
-
- imagedestroy($maj_avatar_gif_image_resize);
- imagedestroy($maj_avatar_gif_image_original);
- }
- }
- echo "<img src=\"images/members/$maj_author/avatar.gif\" border=\"0\" width=\"$maj_avatar_gif_image_width\" height=\"$maj_avatar_gif_image_height\">";
- }
-
- if (file_exists("images/members/$maj_author/avatar.jpg")) {
-
- $maj_avatar_jpg_image_size = getimagesize("images/members/$maj_author/avatar.jpg");
- $maj_avatar_jpg_image_width = $maj_avatar_jpg_image_size[0];
- $maj_avatar_jpg_image_height = $maj_avatar_jpg_image_size[1];
-
- $maj_max_avatar_jpg_image_width = 75;
-
- if ($maj_avatar_jpg_image_width > $maj_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_max_avatar_jpg_image_width / $maj_avatar_jpg_image_width) ;
- $maj_avatar_jpg_image_width = (int) ($maj_avatar_jpg_image_width * $maj_sizefactor);
- $maj_avatar_jpg_image_height = (int) ($maj_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_avatar_jpg_image_resize = imagecreatetruecolor($maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height);
- $maj_avatar_jpg_image_original = imagecreatefromjpeg("images/members/$maj_author/avatar.jpg");
-
- imagecopyresampled($maj_avatar_jpg_image_resize,$maj_avatar_jpg_image_original,0,0,0,0,$maj_avatar_jpg_image_width,$maj_avatar_jpg_image_height,$maj_avatar_jpg_image_size[0],$maj_avatar_jpg_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.jpg");
-
- imagejpeg($maj_avatar_jpg_image_resize,"images/members/$maj_author/avatar.jpg",100);
-
- imagedestroy($maj_avatar_jpg_image_resize);
- imagedestroy($maj_avatar_jpg_image_original);
- }
- }
- echo "<img src=\"images/members/$maj_author/avatar.jpg\" border=\"0\" width=\"$maj_avatar_jpg_image_width\" height=\"$maj_avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/members/$maj_author/avatar.png")) {
-
- $maj_avatar_png_image_size = getimagesize("images/members/$maj_author/avatar.png");
- $maj_avatar_png_image_width = $maj_avatar_png_image_size[0];
- $maj_avatar_png_image_height = $maj_avatar_png_image_size[1];
-
- $maj_max_avatar_png_image_width = 75;
-
- if ($maj_avatar_png_image_width > $maj_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_max_avatar_png_image_width / $maj_avatar_png_image_width) ;
- $maj_avatar_png_image_width = (int) ($maj_avatar_png_image_width * $maj_sizefactor);
- $maj_avatar_png_image_height = (int) ($maj_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_avatar_png_image_resize = imagecreatetruecolor($maj_avatar_png_image_width,$maj_avatar_png_image_height);
-
- imagealphablending($maj_avatar_png_image_resize, false);
- imagesavealpha($maj_avatar_png_image_resize, true);
-
- $maj_avatar_png_image_original = imagecreatefrompng("images/members/$maj_author/avatar.png");
-
- imagecopyresampled($maj_avatar_png_image_resize,$maj_avatar_png_image_original,0,0,0,0,$maj_avatar_png_image_width,$maj_avatar_png_image_height,$maj_avatar_png_image_size[0],$maj_avatar_png_image_size[1]);
-
- unlink("images/members/$maj_author/avatar.png");
-
- imagepng($maj_avatar_png_image_resize,"images/members/$maj_author/avatar.png",100);
-
- imagedestroy($maj_avatar_png_image_resize);
- imagedestroy($maj_avatar_png_image_original);
- }
- }
-
- echo "<img src=\"images/members/$maj_author/avatar.png\" border=\"0\" width=\"$maj_avatar_png_image_width\" height=\"$maj_avatar_png_image_height\">";
- }
- echo "<br>";
- }
-
- echo "<b>$maj_author</b></a><br>";
-
- if (($maj_admin_username == $maj_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_rank = file_get_contents("data/members/active/$maj_author/rank.txt");
- echo "$maj_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
+ show_maj_avatar_image($maj_author,80);
if ($maj_dh_author_posts = opendir("data/items")) {
@@ -3524,266 +3140,13 @@ foreach ($maj_disp as $maj_d) {
echo '</div><div class=panel_body><table border=0 cellspacing=0 cellpadding=0><tr>';
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/comments/live/$maj_comment/author.txt")) {
- echo "<td width=75 valign=top>";
- $maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
- echo "<a href=member.php?id=$maj_c_author>";
- if (($maj_admin_username == $maj_c_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
- if (file_exists("images/avatar.gif")) {
- $maj_c_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
- $maj_c_avatar_gif_image_height = $maj_c_avatar_gif_image_size[1];
-
- $maj_c_max_avatar_gif_image_width = 75;
-
- if ($maj_c_avatar_gif_image_width > $maj_c_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_gif_image_width / $maj_c_avatar_gif_image_width) ;
- $maj_c_avatar_gif_image_width = (int) ($maj_c_avatar_gif_image_width * $maj_sizefactor);
- $maj_c_avatar_gif_image_height = (int) ($maj_c_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_c_avatar_gif_image_resize = imagecreatetruecolor($maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height);
-
- imagealphablending($maj_c_avatar_gif_image_resize, false);
- imagesavealpha($maj_c_avatar_gif_image_resize, true);
-
- $maj_c_avatar_gif_image_original = imagecreatefromgif("images/avatar.gif");
- $maj_c_avatar_gif_transparent_index = imagecolortransparent($maj_c_avatar_gif_image_original);
-
- if ($maj_c_avatar_gif_transparent_index >= 0) {
- $maj_c_avatar_gif_transparent_color = imagecolorsforindex($maj_c_avatar_gif_image_original, $maj_c_avatar_gif_transparent_index);
- $maj_c_avatar_gif_transparent_index = imagecolorallocate($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_color['red'], $maj_c_avatar_gif_transparent_color['green'], $maj_c_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_c_avatar_gif_image_resize, 0, 0, $maj_c_avatar_gif_transparent_index);
- imagecolortransparent($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_c_avatar_gif_image_resize,$maj_c_avatar_gif_image_original,0,0,0,0,$maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height,$maj_c_avatar_gif_image_size[0],$maj_c_avatar_gif_image_size[1]);
-
- unlink("images/avatar.gif");
-
- imagegif($maj_c_avatar_gif_image_resize,"images/avatar.gif",100);
-
- imagedestroy($maj_c_avatar_gif_image_resize);
- imagedestroy($maj_c_avatar_gif_image_original);
- }
- }
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $maj_c_avatar_gif_image_width;
- echo " height=";
- echo $maj_c_avatar_gif_image_height;
- }
- if (file_exists("images/avatar.jpg")) {
- $maj_c_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_c_avatar_jpg_image_width = $maj_c_avatar_jpg_image_size[0];
- $maj_c_avatar_jpg_image_height = $maj_c_avatar_jpg_image_size[1];
-
- $maj_c_max_avatar_jpg_image_width = 75;
-
- if ($maj_c_avatar_jpg_image_width > $maj_c_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_jpg_image_width / $maj_c_avatar_jpg_image_width) ;
- $maj_c_avatar_jpg_image_width = (int) ($maj_c_avatar_jpg_image_width * $maj_sizefactor);
- $maj_c_avatar_jpg_image_height = (int) ($maj_c_avatar_jpg_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_c_avatar_jpg_image_resize = imagecreatetruecolor($maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height);
- $maj_c_avatar_jpg_image_original = imagecreatefromjpeg("images/avatar.jpg");
-
- imagecopyresampled($maj_c_avatar_jpg_image_resize,$maj_c_avatar_jpg_image_original,0,0,0,0,$maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height,$maj_c_avatar_jpg_image_size[0],$maj_c_avatar_jpg_image_size[1]);
-
- unlink("images/avatar.jpg");
-
- imagejpeg($maj_c_avatar_jpg_image_resize,"images/avatar.jpg",100);
-
- imagedestroy($maj_c_avatar_jpg_image_resize);
- imagedestroy($maj_c_avatar_jpg_image_original);
- }
- }
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $maj_c_avatar_jpg_image_width;
- echo " height=";
- echo $maj_c_avatar_jpg_image_height;
- }
- if (file_exists("images/avatar.png")) {
- $maj_c_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_c_avatar_png_image_width = $maj_c_avatar_png_image_size[0];
- $maj_c_avatar_png_image_height = $maj_c_avatar_png_image_size[1];
-
- $maj_c_max_avatar_png_image_width = 75;
-
- if ($maj_c_avatar_png_image_width > $maj_c_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_png_image_width / $maj_c_avatar_png_image_width) ;
- $maj_c_avatar_png_image_width = (int) ($maj_c_avatar_png_image_width * $maj_sizefactor);
- $maj_c_avatar_png_image_height = (int) ($maj_c_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_c_avatar_png_image_resize = imagecreatetruecolor($maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height);
-
- imagealphablending($maj_c_avatar_png_image_resize, false);
- imagesavealpha($maj_c_avatar_png_image_resize, true);
-
- $maj_c_avatar_png_image_original = imagecreatefrompng("images/avatar.png");
-
- imagecopyresampled($maj_c_avatar_png_image_resize,$maj_c_avatar_png_image_original,0,0,0,0,$maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height,$maj_c_avatar_png_image_size[0],$maj_c_avatar_png_image_size[1]);
-
- unlink("images/avatar.png");
-
- imagepng($maj_c_avatar_png_image_resize,"images/avatar.png",100);
-
- imagedestroy($maj_c_avatar_png_image_resize);
- imagedestroy($maj_c_avatar_png_image_original);
- }
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $maj_c_avatar_png_image_width;
- echo " height=";
- echo $maj_c_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$maj_c_author/avatar.jpg") or file_exists("images/members/$maj_c_author/avatar.gif") or file_exists("images/members/$maj_c_author/avatar.png")) {
- if (file_exists("images/members/$maj_c_author/avatar.gif")) {
- $maj_c_avatar_gif_image_size = getimagesize("images/members/$maj_c_author/avatar.gif");
- $maj_c_avatar_gif_image_width = $maj_c_avatar_gif_image_size[0];
- $maj_c_avatar_gif_image_height = $maj_c_avatar_gif_image_size[1];
-
- $maj_c_max_avatar_gif_image_width = 75;
-
- if ($maj_c_avatar_gif_image_width > $maj_c_max_avatar_gif_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_gif_image_width / $maj_c_avatar_gif_image_width) ;
- $maj_c_avatar_gif_image_width = (int) ($maj_c_avatar_gif_image_width * $maj_sizefactor);
- $maj_c_avatar_gif_image_height = (int) ($maj_c_avatar_gif_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-gif.txt")) {
-
- $maj_c_avatar_gif_image_resize = imagecreatetruecolor($maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height);
-
- imagealphablending($maj_c_avatar_gif_image_resize, false);
- imagesavealpha($maj_c_avatar_gif_image_resize, true);
-
- $maj_c_avatar_gif_image_original = imagecreatefromgif("images/members/$maj_c_author/avatar.gif");
- $maj_c_avatar_gif_transparent_index = imagecolortransparent($maj_c_avatar_gif_image_original);
-
- if ($maj_c_avatar_gif_transparent_index >= 0) {
-
- $maj_c_avatar_gif_transparent_color = imagecolorsforindex($maj_c_avatar_gif_image_original, $maj_c_avatar_gif_transparent_index);
- $maj_c_avatar_gif_transparent_index = imagecolorallocate($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_color['red'], $maj_c_avatar_gif_transparent_color['green'], $maj_c_avatar_gif_transparent_color['blue']);
-
- imagefill($maj_c_avatar_gif_image_resize, 0, 0, $maj_c_avatar_gif_transparent_index);
- imagecolortransparent($maj_c_avatar_gif_image_resize, $maj_c_avatar_gif_transparent_index);
- }
-
- imagecopyresampled($maj_c_avatar_gif_image_resize,$maj_c_avatar_gif_image_original,0,0,0,0,$maj_c_avatar_gif_image_width,$maj_c_avatar_gif_image_height,$maj_c_avatar_gif_image_size[0],$maj_c_avatar_gif_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.gif");
-
- imagegif($maj_c_avatar_gif_image_resize,"images/members/$maj_c_author/avatar.gif",100);
-
- imagedestroy($maj_c_avatar_gif_image_resize);
- imagedestroy($maj_c_avatar_gif_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.gif border=0 width=";
- echo $maj_c_avatar_gif_image_width;
- echo " height=";
- echo $maj_c_avatar_gif_image_height;
- }
- if (file_exists("images/members/$maj_c_author/avatar.jpg")) {
- $maj_c_avatar_jpg_image_size = getimagesize("images/members/$maj_c_author/avatar.jpg");
- $maj_c_avatar_jpg_image_width = $maj_c_avatar_jpg_image_size[0];
- $maj_c_avatar_jpg_image_height = $maj_c_avatar_jpg_image_size[1];
-
- $maj_c_max_avatar_jpg_image_width = 75;
-
- if ($maj_c_avatar_jpg_image_width > $maj_c_max_avatar_jpg_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_jpg_image_width / $maj_c_avatar_jpg_image_width) ;
- $maj_c_avatar_jpg_image_width = (int) ($maj_c_avatar_jpg_image_width * $maj_sizefactor);
- $maj_c_avatar_jpg_image_height = (int) ($maj_c_avatar_jpg_image_height * $maj_sizefactor);
- if (file_exists("data/avatar-resize-jpg.txt")) {
-
- $maj_c_avatar_jpg_image_resize = imagecreatetruecolor($maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height);
- $maj_c_avatar_jpg_image_original = imagecreatefromjpeg("images/members/$maj_c_author/avatar.jpg");
-
- imagecopyresampled($maj_c_avatar_jpg_image_resize,$maj_c_avatar_jpg_image_original,0,0,0,0,$maj_c_avatar_jpg_image_width,$maj_c_avatar_jpg_image_height,$maj_c_avatar_jpg_image_size[0],$maj_c_avatar_jpg_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.jpg");
-
- imagejpeg($maj_c_avatar_jpg_image_resize,"images/members/$maj_c_author/avatar.jpg",100);
-
- imagedestroy($maj_c_avatar_jpg_image_resize);
- imagedestroy($maj_c_avatar_jpg_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.jpg border=0 width=";
- echo $maj_c_avatar_jpg_image_width;
- echo " height=";
- echo $maj_c_avatar_jpg_image_height;
- }
- if (file_exists("images/members/$maj_c_author/avatar.png")) {
- $maj_c_avatar_png_image_size = getimagesize("images/members/$maj_c_author/avatar.png");
- $maj_c_avatar_png_image_width = $maj_c_avatar_png_image_size[0];
- $maj_c_avatar_png_image_height = $maj_c_avatar_png_image_size[1];
-
- $maj_c_max_avatar_png_image_width = 75;
-
- if ($maj_c_avatar_png_image_width > $maj_c_max_avatar_png_image_width) {
-
- $maj_sizefactor = (double) ($maj_c_max_avatar_png_image_width / $maj_c_avatar_png_image_width) ;
- $maj_c_avatar_png_image_width = (int) ($maj_c_avatar_png_image_width * $maj_sizefactor);
- $maj_c_avatar_png_image_height = (int) ($maj_c_avatar_png_image_height * $maj_sizefactor);
-
- if (file_exists("data/avatar-resize-png.txt")) {
-
- $maj_c_avatar_png_image_resize = imagecreatetruecolor($maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height);
-
- imagealphablending($maj_c_avatar_png_image_resize, false);
- imagesavealpha($maj_c_avatar_png_image_resize, true);
-
- $maj_c_avatar_png_image_original = imagecreatefrompng("images/members/$maj_c_author/avatar.png");
-
- imagecopyresampled($maj_c_avatar_png_image_resize,$maj_c_avatar_png_image_original,0,0,0,0,$maj_c_avatar_png_image_width,$maj_c_avatar_png_image_height,$maj_c_avatar_png_image_size[0],$maj_c_avatar_png_image_size[1]);
-
- unlink("images/members/$maj_c_author/avatar.png");
-
- imagepng($maj_c_avatar_png_image_resize,"images/members/$maj_c_author/avatar.png",100);
+ echo "<td width=\"80\" valign=\"top\">";
+
+ $maj_c_author = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/author.txt");
- imagedestroy($maj_c_avatar_png_image_resize);
- imagedestroy($maj_c_avatar_png_image_original);
- }
- }
-
- echo "<img src=images/members/$maj_c_author/avatar.png border=0 width=";
- echo $maj_c_avatar_png_image_width;
- echo " height=";
- echo $maj_c_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$maj_c_author</a><br>";
- if (($maj_admin_username == $maj_c_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_c_rank = file_get_contents("data/members/active/$maj_c_author/rank.txt");
- echo "$maj_c_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_c_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
+ show_maj_avatar_image($maj_c_author,80);
+
if ($maj_c_dh_posts = opendir("data/items")) {
while (($maj_c_entry_posts = readdir($maj_c_dh_posts)) !== false) {
@@ -3865,7 +3228,7 @@ foreach ($maj_disp as $maj_d) {
}
}
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><div style=\"height: 10px;\"></div>";
$maj_entry_comment = file_get_contents("data/items/$maj_d/comments/live/$maj_comment/comment.txt");
@@ -4158,145 +3521,12 @@ foreach ($maj_disp as $maj_d) {
if (file_exists("data/bb.txt") and file_exists("data/avatar.txt") and file_exists("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt")) {
- echo "<td width=75 valign=top>";
+ echo "<td width=\"80\" valign=\"top\">";
$maj_pc_author = file_get_contents("data/items/$maj_d/comments/pending/$maj_pending_comment/author.txt");
-
- echo "<a href=member.php?id=$maj_pc_author>";
-
- if (($maj_admin_username == $maj_pc_author) and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
- $maj_pc_avatar_gif_image_size = getimagesize("images/avatar.gif");
- $maj_pc_avatar_gif_image_width = $maj_pc_avatar_gif_image_size[0];
- $maj_pc_avatar_gif_image_height = $maj_pc_avatar_gif_image_size[1];
-
- $maj_pc_max_avatar_gif_image_width = 75;
-
- if ($maj_pc_avatar_gif_image_width > $maj_pc_max_avatar_gif_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_gif_image_width / $maj_pc_avatar_gif_image_width) ;
- $maj_pc_avatar_gif_image_width = (int) ($maj_pc_avatar_gif_image_width * $maj_sizefactor);
- $maj_pc_avatar_gif_image_height = (int) ($maj_pc_avatar_gif_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.gif border=0 width=";
- echo $maj_pc_avatar_gif_image_width;
- echo " height=";
- echo $maj_pc_avatar_gif_image_height;
- }
-
- if (file_exists("images/avatar.jpg")) {
- $maj_pc_avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $maj_pc_avatar_jpg_image_width = $maj_pc_avatar_jpg_image_size[0];
- $maj_pc_avatar_jpg_image_height = $maj_pc_avatar_jpg_image_size[1];
-
- $maj_pc_max_avatar_jpg_image_width = 75;
-
- if ($maj_pc_avatar_jpg_image_width > $maj_pc_max_avatar_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_jpg_image_width / $maj_pc_avatar_jpg_image_width) ;
- $maj_pc_avatar_jpg_image_width = (int) ($maj_pc_avatar_jpg_image_width * $maj_sizefactor);
- $maj_pc_avatar_jpg_image_height = (int) ($maj_pc_avatar_jpg_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.jpg border=0 width=";
- echo $maj_pc_avatar_jpg_image_width;
- echo " height=";
- echo $maj_pc_avatar_jpg_image_height;
- }
-
- if (file_exists("images/avatar.png")) {
- $maj_pc_avatar_png_image_size = getimagesize("images/avatar.png");
- $maj_pc_avatar_png_image_width = $maj_pc_avatar_png_image_size[0];
- $maj_pc_avatar_png_image_height = $maj_pc_avatar_png_image_size[1];
- $maj_pc_max_avatar_png_image_width = 75;
-
- if ($maj_pc_avatar_png_image_width > $maj_pc_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_png_image_width / $maj_pc_avatar_png_image_width) ;
- $maj_pc_avatar_png_image_width = (int) ($maj_pc_avatar_png_image_width * $maj_sizefactor);
- $maj_pc_avatar_png_image_height = (int) ($maj_pc_avatar_png_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/avatar.png border=0 width=";
- echo $maj_pc_avatar_png_image_width;
- echo " height=";
- echo $maj_pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- elseif (file_exists("images/members/$maj_pc_author/avatar.jpg") or file_exists("images/members/$maj_pc_author/avatar.gif") or file_exists("images/members/$maj_pc_author/avatar.png")) {
+ show_maj_avatar_image($maj_pc_author,80);
- if (file_exists("images/members/$maj_pc_author/avatar.gif")) {
- $maj_pc_avatar_gif_image_size = getimagesize("images/members/$maj_pc_author/avatar.gif");
- $maj_pc_avatar_gif_image_width = $maj_pc_avatar_gif_image_size[0];
- $maj_pc_avatar_gif_image_height = $maj_pc_avatar_gif_image_size[1];
-
- $maj_pc_max_avatar_gif_image_width = 75;
-
- if ($maj_pc_avatar_gif_image_width > $maj_pc_max_avatar_gif_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_gif_image_width / $maj_pc_avatar_gif_image_width) ;
- $maj_pc_avatar_gif_image_width = (int) ($maj_pc_avatar_gif_image_width * $maj_sizefactor);
- $maj_pc_avatar_gif_image_height = (int) ($maj_pc_avatar_gif_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.gif border=0 width=";
- echo $maj_pc_avatar_gif_image_width;
- echo " height=";
- echo $maj_pc_avatar_gif_image_height;
- }
-
- if (file_exists("images/members/$maj_pc_author/avatar.jpg")) {
- $maj_pc_avatar_jpg_image_size = getimagesize("images/members/$maj_pc_author/avatar.jpg");
- $maj_pc_avatar_jpg_image_width = $maj_pc_avatar_jpg_image_size[0];
- $maj_pc_avatar_jpg_image_height = $maj_pc_avatar_jpg_image_size[1];
-
- $maj_pc_max_avatar_jpg_image_width = 75;
-
- if ($maj_pc_avatar_jpg_image_width > $maj_pc_max_avatar_jpg_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_jpg_image_width / $maj_pc_avatar_jpg_image_width) ;
- $maj_pc_avatar_jpg_image_width = (int) ($maj_pc_avatar_jpg_image_width * $maj_sizefactor);
- $maj_pc_avatar_jpg_image_height = (int) ($maj_pc_avatar_jpg_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.jpg border=0 width=";
- echo $maj_pc_avatar_jpg_image_width;
- echo " height=";
- echo $maj_pc_avatar_jpg_image_height;
- }
-
- if (file_exists("images/members/$maj_pc_author/avatar.png")) {
- $maj_pc_avatar_png_image_size = getimagesize("images/members/$maj_pc_author/avatar.png");
- $maj_pc_avatar_png_image_width = $maj_pc_avatar_png_image_size[0];
- $maj_pc_avatar_png_image_height = $maj_pc_avatar_png_image_size[1];
-
- $maj_pc_max_avatar_png_image_width = 75;
-
- if ($maj_pc_avatar_png_image_width > $maj_pc_max_avatar_png_image_width) {
- $maj_sizefactor = (double) ($maj_pc_max_avatar_png_image_width / $maj_pc_avatar_png_image_width) ;
- $maj_pc_avatar_png_image_width = (int) ($maj_pc_avatar_png_image_width * $maj_sizefactor);
- $maj_pc_avatar_png_image_height = (int) ($maj_pc_avatar_png_image_height * $maj_sizefactor);
- }
-
- echo "<img src=images/members/$maj_pc_author/avatar.png border=0 width=";
- echo $maj_pc_avatar_png_image_width;
- echo " height=";
- echo $maj_pc_avatar_png_image_height;
- }
- echo "><br>";
- }
- echo "$maj_pc_author</a><br>";
-
- if (($maj_admin_username == $maj_pc_author) and file_exists("data/rank.txt")) {
- echo "administrator<br>";
- }
- elseif (file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
- $maj_pc_rank = file_get_contents("data/members/active/$maj_pc_author/rank.txt");
- echo "$maj_pc_rank<br>";
- }
- elseif (!file_exists("data/members/active/$maj_pc_author/rank.txt") and file_exists("data/rank.txt")) {
- echo "member<br>";
- }
-
if ($maj_pc_dh_posts = opendir("data/items")) {
while (($maj_pc_entry_posts = readdir($maj_pc_dh_posts)) !== false) {
@@ -4356,10 +3586,10 @@ foreach ($maj_disp as $maj_d) {
}
unset($maj_pc_items_posts);
- echo "</td><td width=5 valign=top><div style=\"width: 5px;\"></div></td>";
+ echo "</td><td width=\"5\" valign=\"top\"><div style=\"width: 5px;\"></div></td>";
}
- echo "<td width=510 valign=top>";
+ echo "<td width=\"510\" valign=\"top\">";
echo "<font style=\"font-size: $maj_font_Spx; color: #999999;\">";
@@ -4375,7 +3605,7 @@ foreach ($maj_disp as $maj_d) {
echo ')';
}
- echo '</font><font style="font-size: 5px;"><br><br></font>';
+ echo "</font><div style=\"height: 10px;\"></div>";
readfile("data/items/$maj_d/comments/pending/$maj_pending_comment/comment.txt");
echo '</tr></table></div></div>';
diff --git a/member.php b/member.php
index 96b11a9..8dadcb2 100644
--- a/member.php
+++ b/member.php
@@ -8,10 +8,6 @@ error_reporting(E_ERROR);
require("core.php");
-if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT'])) {
- header("Location: login.php");
-}
-
if (file_exists("data/lite.txt")) {
exit();
}
@@ -24,21 +20,19 @@ if (!isset($_REQUEST['id']) or empty($_REQUEST['id'])) {
exit();
}
-if (isset($_REQUEST['id']) and ($_REQUEST['id'] != file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_REQUEST['id']}") and ($_REQUEST['id'] != "all")) {
+if (isset($_REQUEST['id']) and ($_REQUEST['id'] != $maj_admin_username) and !file_exists("data/members/active/{$_REQUEST['id']}") and ($_REQUEST['id'] != "all")) {
exit();
}
-if (!isset($_SESSION['logged_in']) and file_exists("data/nomem.txt")) {
+if (!isset($maj_logged_in_username) and file_exists("data/nomem.txt")) {
header("Location: login.php");
}
$id = $_REQUEST['id'];
-$login_username = file_get_contents("data/username.txt");
-
$maj_server = sha1($_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
-if (file_get_contents("data/username.txt") != $id) {
+if ($maj_admin_username != $id) {
$member_firstname = file_get_contents("data/members/active/$id/firstname.txt");
$member_lastname = file_get_contents("data/members/active/$id/lastname.txt");
}
@@ -47,7 +41,7 @@ if ($id == "all") {
echo "<title>Members</title>";
}
else {
- if ($id == $login_username) {
+ if ($id == $maj_admin_username) {
$author = file_get_contents("data/author.txt");
echo "<title>$author</title>";
}
@@ -171,7 +165,7 @@ a:active {
if ($id == "all") {
- if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on") and isset($_POST['username']) and !empty($_POST['username']) and file_exists("data/members/active/{$_POST['username']}") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on") and isset($_POST['username']) and !empty($_POST['username']) and file_exists("data/members/active/{$_POST['username']}") and isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (isset($_POST['rw']) and !empty($_POST['rw']) and ($_POST['rw'] == "on") and !file_exists("data/members/active/{$_POST['username']}/bb-rw.txt")) {
touch("data/members/active/{$_POST['username']}/bb-rw.txt");
@@ -260,9 +254,9 @@ if ($id == "all") {
?>
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" style="background-color: transparent;"><tr><td><div id="panel_title">Members</div><div id="panel_body"><table border="0" cellspacing="1" cellpadding="2" bgcolor="#cccccc">
-<tr><td bgcolor="#eeeeee" align="center">status</td><td bgcolor="#eeeeee" align="center">username</td><?php if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) { echo "<td bgcolor=\"#eeeeee\" align=\"center\">real name</td>"; } ?><td bgcolor="#eeeeee" align="center">member since</td><td bgcolor="#eeeeee" align="center">logins</td><td bgcolor="#eeeeee" align="center">posts</td><?php
+<tr><td bgcolor="#eeeeee" align="center">status</td><td bgcolor="#eeeeee" align="center">username</td><?php if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) { echo "<td bgcolor=\"#eeeeee\" align=\"center\">real name</td>"; } ?><td bgcolor="#eeeeee" align="center">member since</td><td bgcolor="#eeeeee" align="center">logins</td><td bgcolor="#eeeeee" align="center">posts</td><?php
-if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
echo '<td bgcolor="#eeeeee" align="center">rw</td><td bgcolor="#eeeeee" align="center">ul</td><td bgcolor="#eeeeee" align="center">noml</td><td bgcolor="#eeeeee" align="center">lock</td><td bgcolor="#eeeeee" align="center">del</td><td bgcolor="#eeeeee" align="center">rank</td><td bgcolor="#eeeeee" align="center">category</td><td bgcolor="#eeeeee" align="center">action</td>';
}
@@ -270,7 +264,7 @@ if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESS
<?php
-$show_member_list[] = file_get_contents("data/username.txt");
+$show_member_list[] = $maj_admin_username;
if (file_exists("data/members/active")) {
if ($dh_member_list = opendir("data/members/active")) {
@@ -347,34 +341,34 @@ if (file_exists("data/members/active")) {
}
if ($sess_count > 0) {
- echo "<img src=images/smileys/smile.png>";
+ echo "<img src=\"images/smileys/smile.png\">";
}
else {
- echo "<img src=images/smileys/offline.png>";
+ echo "<img src=\"images/smileys/offline.png\">";
}
$sess_count = 0;
- echo "</td><td bgcolor=#ffffff><a href=member.php?id=$member_list_entry>$member_list_entry</a></td>";
+ echo "</td><td bgcolor=#ffffff><a href=\"member.php?id=$member_list_entry\">$member_list_entry</a></td>";
- if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
if (file_exists("data/members/active/$member_list_entry")) {
$member_name = file_get_contents("data/members/active/$member_list_entry/firstname.txt") . " " . file_get_contents("data/members/active/$member_list_entry/lastname.txt");
}
- if ($member_list_entry == file_get_contents("data/username.txt")) {
+ if ($member_list_entry == $maj_admin_username) {
$member_name = file_get_contents("data/author.txt");
}
echo "<td bgcolor=#ffffff>$member_name</td>";
}
- if ($member_list_entry == file_get_contents("data/username.txt") or (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/timestamp.txt"))) {
+ if ($member_list_entry == $maj_admin_username or (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/timestamp.txt"))) {
echo "<td bgcolor=#ffffff align=center><nobr><code>-</code></nobr></td>";
}
- if (file_exists("data/members/active/$member_list_entry") and ($member_list_entry != file_get_contents("data/username.txt")) and file_exists("data/members/active/$member_list_entry/timestamp.txt")) {
+ if (file_exists("data/members/active/$member_list_entry") and ($member_list_entry != $maj_admin_username) and file_exists("data/members/active/$member_list_entry/timestamp.txt")) {
$joined = file_get_contents("data/members/active/$member_list_entry/timestamp.txt");
$joined_year = substr($joined,0,4);
$joined_month = substr($joined,4,2);
@@ -383,7 +377,7 @@ if (file_exists("data/members/active")) {
echo "<td bgcolor=#ffffff align=center><nobr><code>$member_since</code></nobr></td>";
}
- if ((file_get_contents("data/username.txt") == $member_list_entry) and file_exists("data/bb-logins.txt")) {
+ if (($maj_admin_username == $member_list_entry) and file_exists("data/bb-logins.txt")) {
$logins = file_get_contents("data/bb-logins.txt");
echo "<td bgcolor=#ffffff align=right><code>$logins</code></td>";
}
@@ -392,7 +386,7 @@ if (file_exists("data/members/active")) {
echo "<td bgcolor=#ffffff align=right><code>$logins</code></td>";
}
- if ((file_get_contents("data/username.txt") == $member_list_entry) and !file_exists("data/bb-logins.txt")) {
+ if (($maj_admin_username == $member_list_entry) and !file_exists("data/bb-logins.txt")) {
echo "<td bgcolor=#ffffff align=right><code>0</code></td>";
}
elseif (file_exists("data/members/active/$member_list_entry") and !file_exists("data/members/active/$member_list_entry/bb-logins.txt")) {
@@ -405,7 +399,7 @@ if (file_exists("data/members/active")) {
if ($member_posts != "." && $member_posts != "..") {
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -428,7 +422,7 @@ if (file_exists("data/members/active")) {
}
}
- if (($private_cat > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
+ if (($private_cat > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
continue;
}
@@ -439,7 +433,7 @@ if (file_exists("data/members/active")) {
}
}
else {
- if (!file_exists("data/members/active/$member_list_entry") and (file_get_contents("data/username.txt") == $member_list_entry) and file_exists("data/bb.txt")) {
+ if (!file_exists("data/members/active/$member_list_entry") and ($maj_admin_username == $member_list_entry) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$member_posts/author.txt") and (file_get_contents("data/items/$member_posts/author.txt") == $member_list_entry)) {
$items_posts[] = $member_posts;
@@ -457,9 +451,9 @@ if (file_exists("data/members/active")) {
unset($items_posts);
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+ if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- if (($member_list_entry != file_get_contents("data/username.txt")) and file_exists("data/members/active/$member_list_entry")) {
+ if (($member_list_entry != $maj_admin_username) and file_exists("data/members/active/$member_list_entry")) {
echo "<form action=member.php method=post><input type=hidden name=id value=all><input type=hidden name=edit value=on><input type=hidden name=username value=$member_list_entry>";
echo "<td bgcolor=#ffffff align=center><input type=checkbox name=rw";
@@ -536,7 +530,7 @@ if (file_exists("data/members/active")) {
echo "</select></td><td bgcolor=#ffffff align=center><input class=submit type=submit value=submit></td></form>";
}
- if ($member_list_entry == file_get_contents("data/username.txt")) {
+ if ($member_list_entry == $maj_admin_username) {
echo "<td colspan=8 bgcolor=#ffffff align=center><a href=settings.php>administrator settings</a></td>";
}
}
@@ -548,7 +542,7 @@ if (file_exists("data/members/active")) {
</table></div><div id="panel_footer"><font style="font-size: 10px; color: #999999;"><a href="index.php">home</a> | <a href="member.php?id=all">members</a> | <a href="login.php">
<?php
-if (isset($_SESSION['logged_in'])) {
+if (isset($maj_logged_in_username)) {
echo "logout";
}
else {
@@ -566,11 +560,11 @@ else {
<?php
-if (file_get_contents("data/username.txt") == $id) {
+if ($maj_admin_username == $id) {
readfile("data/author.txt");
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+ if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username) and !file_exists("data/members/active/{$maj_logged_in_username}")) {
echo " <";
readfile("data/email.txt");
echo " >";
@@ -579,7 +573,7 @@ if (file_get_contents("data/username.txt") == $id) {
else {
echo "$member_firstname $member_lastname";
- if (isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and !file_exists("data/members/active/{$_SESSION['logged_in']}") and file_exists("data/members/active/$id/email.txt")) {
+ if (isset($maj_logged_in_username) and !empty($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/members/active/$id/email.txt")) {
$email = file_get_contents("data/members/active/$id/email.txt");
echo " <$email>";
}
@@ -595,125 +589,7 @@ else {
<?php
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/avatar.txt") and (file_exists("images/avatar.jpg") or file_exists("images/avatar.gif") or file_exists("images/avatar.png"))) {
-
- if (file_exists("images/avatar.gif")) {
-
- $avatar_gif_image_size = getimagesize("images/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
-
- $max_avatar_gif_image_width = 80;
-
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
-
- if (file_exists("images/avatar.jpg")) {
-
- $avatar_jpg_image_size = getimagesize("images/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
-
- $max_avatar_jpg_image_width = 80;
-
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/avatar.png")) {
-
- $avatar_png_image_size = getimagesize("images/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
-
- $max_avatar_png_image_width = 80;
-
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
-}
-else {
-
- if (file_exists("data/avatar.txt") and (file_exists("images/members/$id/avatar.jpg") or file_exists("images/members/$id/avatar.gif") or file_exists("images/members/$id/avatar.png"))) {
-
- if (file_exists("images/members/$id/avatar.gif")) {
-
- $avatar_gif_image_size = getimagesize("images/members/$id/avatar.gif");
- $avatar_gif_image_width = $avatar_gif_image_size[0];
- $avatar_gif_image_height = $avatar_gif_image_size[1];
-
- $max_avatar_gif_image_width = 80;
-
- if ($avatar_gif_image_width > $max_avatar_gif_image_width) {
- $sizefactor = (double) ($max_avatar_gif_image_width / $avatar_gif_image_width) ;
- $avatar_gif_image_width = (int) ($avatar_gif_image_width * $sizefactor);
- $avatar_gif_image_height = (int) ($avatar_gif_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.gif\" border=\"0\" width=\"$avatar_gif_image_width\" height=\"$avatar_gif_image_height\">";
- }
-
-
- if (file_exists("images/members/$id/avatar.jpg")) {
-
- $avatar_jpg_image_size = getimagesize("images/members/$id/avatar.jpg");
- $avatar_jpg_image_width = $avatar_jpg_image_size[0];
- $avatar_jpg_image_height = $avatar_jpg_image_size[1];
-
- $max_avatar_jpg_image_width = 80;
-
- if ($avatar_jpg_image_width > $max_avatar_jpg_image_width) {
- $sizefactor = (double) ($max_avatar_jpg_image_width / $avatar_jpg_image_width) ;
- $avatar_jpg_image_width = (int) ($avatar_jpg_image_width * $sizefactor);
- $avatar_jpg_image_height = (int) ($avatar_jpg_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.jpg\" border=\"0\" width=\"$avatar_jpg_image_width\" height=\"$avatar_jpg_image_height\">";
- }
-
- if (file_exists("images/members/$id/avatar.png")) {
-
- $avatar_png_image_size = getimagesize("images/members/$id/avatar.png");
- $avatar_png_image_width = $avatar_png_image_size[0];
- $avatar_png_image_height = $avatar_png_image_size[1];
-
- $max_avatar_png_image_width = 80;
-
- if ($avatar_png_image_width > $max_avatar_png_image_width) {
- $sizefactor = (double) ($max_avatar_png_image_width / $avatar_png_image_width) ;
- $avatar_png_image_width = (int) ($avatar_png_image_width * $sizefactor);
- $avatar_png_image_height = (int) ($avatar_png_image_height * $sizefactor);
- }
- echo "<img src=\"images/members/$id/avatar.png\" border=\"0\" width=\"$avatar_png_image_width\" height=\"$avatar_png_image_height\">";
- }
- echo "<br>";
- }
-}
-
-echo "<b>$id</b><br>";
-
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/rank.txt")) {
- echo "administrator";
-}
-elseif (file_exists("data/members/active/$id/rank.txt") and file_exists("data/rank.txt")) {
- $rank = file_get_contents("data/members/active/$id/rank.txt");
- echo "$rank";
-}
-elseif (!file_exists("data/members/active/$id/rank.txt") and file_exists("data/rank.txt")) {
- echo "member";
-}
+show_maj_avatar_image($id,80);
?>
@@ -722,16 +598,16 @@ elseif (!file_exists("data/members/active/$id/rank.txt") and file_exists("data/r
<?php
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/url.txt") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in'])) {
+if (($maj_admin_username == $id) and file_exists("data/url.txt") and isset($maj_logged_in_username) and !empty($maj_logged_in_username)) {
$member_url = file_get_contents("data/url.txt");
echo "<tr><td width=90>website</td><td><a href=$member_url target=_majbb><code>$member_url</code></a></td></tr>";
}
-elseif (file_exists("data/members/active/$id/url.txt") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in'])) {
+elseif (file_exists("data/members/active/$id/url.txt") and isset($maj_logged_in_username) and !empty($maj_logged_in_username)) {
$member_url = file_get_contents("data/members/active/$id/url.txt");
echo "<tr><td width=90>website</td><td><a href=$member_url target=_majbb><code>$member_url</code></a></td></tr>";
}
-if (file_exists("data/members/active/$id/bday.txt") and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (file_exists("data/members/active/$id/bday.txt") and ($maj_logged_in_username == $maj_admin_username)) {
$bday = file_get_contents("data/members/active/$id/bday.txt");
$bday_year = substr($bday,0,4);
$bday_month = substr($bday,4,2);
@@ -751,7 +627,7 @@ if (file_exists("data/members/active/$id/timestamp.txt")) {
echo "<tr><td width=90>member since</td><td><code>$member_since</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/lastlog.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/lastlog.txt")) {
$lastlog = file_get_contents("data/lastlog.txt");
$lastlog_year = substr($lastlog,0,4);
$lastlog_month = substr($lastlog,4,2);
@@ -772,7 +648,7 @@ elseif (file_exists("data/members/active/$id/bb-last.txt")) {
echo "<tr><td width=90>last login</td><td><code>$last_login</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/lastpost.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/lastpost.txt")) {
$lastpost = file_get_contents("data/lastpost.txt");
$lastpost_year = substr($lastpost,0,4);
$lastpost_month = substr($lastpost,4,2);
@@ -793,14 +669,14 @@ elseif (file_exists("data/members/active/$id/bb-post.txt")) {
echo "<tr><td width=90>last post</td><td><code>$last_post</code></td></tr>";
}
-if (file_get_contents("data/username.txt") == $id) {
+if ($maj_admin_username == $id) {
if (!file_exists("data/bb-views.txt")) {
$views = 0;
}
else {
$views = file_get_contents("data/bb-views.txt");
}
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if (!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))) {
$views = $views + 1;
$views_file = fopen("data/bb-views.txt", "w");
fwrite($views_file, $views);
@@ -817,9 +693,9 @@ elseif (file_exists("data/members/active/$id")) {
$views = file_get_contents("data/members/active/$id/bb-views.txt");
}
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != $id))) {
+ if (!isset($maj_logged_in_username) or empty($maj_logged_in_username) or (isset($maj_logged_in_username) and ($maj_logged_in_username != $id))) {
- if (!isset($_SESSION['logged_in']) or empty($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt")))) {
+ if (!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))) {
$views = $views + 1;
$views_file = fopen("data/members/active/$id/bb-views.txt", "w");
fwrite($views_file, $views);
@@ -829,7 +705,7 @@ elseif (file_exists("data/members/active/$id")) {
echo "<tr><td width=90>profile views</td><td><code>$views</code></td></tr>";
}
-if ((file_get_contents("data/username.txt") == $id) and file_exists("data/bb-logins.txt")) {
+if (($maj_admin_username == $id) and file_exists("data/bb-logins.txt")) {
$logins = file_get_contents("data/bb-logins.txt");
echo "<tr><td width=90>total logins</td><td><code>$logins</code></td></tr>";
}
@@ -846,7 +722,7 @@ if ($dh_posts = opendir("data/items")) {
$total_posts[] = $member_posts;
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+ if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
continue;
}
@@ -869,7 +745,7 @@ if ($dh_posts = opendir("data/items")) {
}
}
- if (($private_cat > 0) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
+ if (($private_cat > 0) and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username)) and !file_exists("data/items/$member_posts/cat.txt")) {
continue;
}
@@ -879,7 +755,7 @@ if ($dh_posts = opendir("data/items")) {
$items_posts[] = $member_posts;
}
}
- elseif (!file_exists("data/members/active/$id") and (file_get_contents("data/username.txt") == $id) and file_exists("data/bb.txt")) {
+ elseif (!file_exists("data/members/active/$id") and ($maj_admin_username == $id) and file_exists("data/bb.txt")) {
if (file_exists("data/items/$member_posts/author.txt") and (file_get_contents("data/items/$member_posts/author.txt") == $id)) {
$items_posts[] = $member_posts;
@@ -911,11 +787,11 @@ unset($total_posts);
<?php
-if ($id == file_get_contents("data/username.txt")) {
+if ($id == $maj_admin_username) {
echo "rw";
}
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/bb-rw.txt")) {
echo "rw";
@@ -925,7 +801,7 @@ if (($id != file_get_contents("data/username.txt")) and file_exists("data/member
}
}
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/bb-ul.txt")) {
echo " upload";
@@ -938,7 +814,7 @@ if (($id != file_get_contents("data/username.txt")) and file_exists("data/member
<?php
-if (($id != file_get_contents("data/username.txt")) and file_exists("data/members/active/$id")) {
+if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
if (file_exists("data/members/active/$id/category.txt")) {
@@ -1023,7 +899,7 @@ $sess_count = 0;
<?php
-if (isset($_SESSION['logged_in'])) {
+if (isset($maj_logged_in_username)) {
echo "logout";
}
else {