This blob has been accessed 421 times via Git panel.
- <?php
- require("core.php");
- if (file_exists("data/lite.txt")) {
- }
- if (!file_exists("data/bb.txt")) {
- }
- if (!isset($_REQUEST['id']) or empty($_REQUEST['id'])) {
- }
- if (isset($_REQUEST['id']) and ($_REQUEST['id'] != $maj_admin_username) and !file_exists("data/members/active/{$_REQUEST['id']}") and ($_REQUEST['id'] != "all")) {
- }
- if (!isset($maj_logged_in_username) and file_exists("data/nomem.txt")) {
- header("Location: login.php");
- }
- $id = $_REQUEST['id'];
- $maj_server = sha1($_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
- 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");
- }
- if ($id == "all") {
- echo "<title>Members</title>";
- }
- else {
- if ($id == $maj_admin_username) {
- $author = file_get_contents("data/author.txt");
- echo "<title>$author</title>";
- }
- else {
- echo "<title>$member_firstname $member_lastname</title>";
- }
- }
- include("css.php");
- echo "\n<style>body { margin: {$maj_wspace}px; } .input { width: 200px; } .click { width: 100px; }</style>\n";
- 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($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");
- }
- if ((!isset($_POST['rw']) or empty($_POST['rw'])) and file_exists("data/members/active/{$_POST['username']}/bb-rw.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-rw.txt");
- }
- if (isset($_POST['ul']) and !empty($_POST['ul']) and ($_POST['ul'] == "on") and !file_exists("data/members/active/{$_POST['username']}/bb-ul.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-ul.txt");
- }
- if ((!isset($_POST['ul']) or empty($_POST['ul'])) and file_exists("data/members/active/{$_POST['username']}/bb-ul.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-ul.txt");
- }
- if (isset($_POST['adm']) and !empty($_POST['adm']) and ($_POST['adm'] == "on") and !file_exists("data/members/active/{$_POST['username']}/bb-adm.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-adm.txt");
- }
- if ((!isset($_POST['adm']) or empty($_POST['adm'])) and file_exists("data/members/active/{$_POST['username']}/bb-adm.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-adm.txt");
- }
- if (isset($_POST['noml']) and !empty($_POST['noml']) and ($_POST['noml'] == "on") and !file_exists("data/members/active/{$_POST['username']}/bb-noml.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-noml.txt");
- }
- if ((!isset($_POST['noml']) or empty($_POST['noml'])) and file_exists("data/members/active/{$_POST['username']}/bb-noml.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-noml.txt");
- }
- if (isset($_POST['lockout']) and !empty($_POST['lockout']) and ($_POST['lockout'] == "on")) {
- if (!file_exists("data/members/active/{$_POST['username']}/bb-lockout.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-lockout.txt");
- }
- if (file_exists("data/members/active/{$_POST['username']}/bb-noml.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-noml2.txt");
- }
- if (!file_exists("data/members/active/{$_POST['username']}/bb-noml.txt")) {
- touch("data/members/active/{$_POST['username']}/bb-noml.txt");
- }
- }
- if ((!isset($_POST['lockout']) or empty($_POST['lockout'])) and file_exists("data/members/active/{$_POST['username']}/bb-lockout.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-lockout.txt");
- if (file_exists("data/members/active/{$_POST['username']}/bb-noml.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-noml.txt");
- }
- if (file_exists("data/members/active/{$_POST['username']}/bb-noml2.txt")) {
- rename("data/members/active/{$_POST['username']}/bb-noml2.txt","data/members/active/{$_POST['username']}/bb-noml.txt");
- }
- }
- if (isset($_POST['rank']) and !empty($_POST['rank']) and (mb_strtolower($_POST['rank']) != "member")) {
- $rank_file = "data/members/active/{$_POST['username']}/rank.txt";
- }
- if ((!isset($_POST['rank']) or empty($_POST['rank'])) and file_exists("data/members/active/{$_POST['username']}/rank.txt")) {
- unlink("data/members/active/{$_POST['username']}/rank.txt");
- }
- if (isset($_POST['category']) and !empty($_POST['category']) and (mb_strtolower($_POST['category']) != "none") and (file_exists("data/categories/{$_POST['category']}"))) {
- $category_file = "data/members/active/{$_POST['username']}/category.txt";
- }
- if ((!isset($_POST['category']) or empty($_POST['category']) or ($_POST['category'] == "none")) and file_exists("data/members/active/{$_POST['username']}/category.txt")) {
- unlink("data/members/active/{$_POST['username']}/category.txt");
- }
- if (file_exists("data/members/active/{$_POST['username']}/bb-ul.txt") and !file_exists("data/members/active/{$_POST['username']}/bb-rw.txt") and !file_exists("data/members/active/{$_POST['username']}/category.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-ul.txt");
- }
- if (file_exists("data/members/active/{$_POST['username']}/bb-adm.txt") and !file_exists("data/members/active/{$_POST['username']}/bb-rw.txt") and !file_exists("data/members/active/{$_POST['username']}/category.txt")) {
- unlink("data/members/active/{$_POST['username']}/bb-adm.txt");
- }
- if (isset($_POST['del']) and !empty($_POST['del']) and ($_POST['del'] == "on")) {
- rmdirr("data/members/active/{$_POST['username']}");
- }
- }
- ?>
- <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($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">adm</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>';
- }
- ?></tr>
- <?php
- $show_member_list[] = $maj_admin_username;
- if (file_exists("data/members/active")) {
- if ($dh_member_list = opendir("data/members/active")) {
- while (($entry_member_list = readdir($dh_member_list)) !== false) {
- if ($entry_member_list != "." && $entry_member_list != "..") {
- $show_member_list[] = $entry_member_list;
- }
- }
- closedir($dh_member_list);
- }
- sort($show_member_list);
- $count_member_list = count($show_member_list);
- if ($count_member_list > 0) {
- $sess_dir = session_save_path();
- if (file_exists("data/bb-idle.txt")) {
- $idle = file_get_contents("data/bb-idle.txt");
- }
- else {
- $idle = 15;
- }
- foreach ($show_member_list as $member_list_entry) {
- /* remove the lines below in version 3.0 */
- if (file_exists("data/members/active/$member_list_entry/rw.txt")) {
- rename("data/members/active/$member_list_entry/rw.txt","data/members/active/$member_list_entry/bb-rw.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/vacation.txt")) {
- rename("data/members/active/$member_list_entry/vacation.txt","data/members/active/$member_list_entry/bb-vacation.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/ul.txt")) {
- rename("data/members/active/$member_list_entry/ul.txt","data/members/active/$member_list_entry/bb-ul.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/noml.txt")) {
- rename("data/members/active/$member_list_entry/noml.txt","data/members/active/$member_list_entry/bb-noml.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/noml2.txt")) {
- rename("data/members/active/$member_list_entry/noml2.txt","data/members/active/$member_list_entry/bb-noml2.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/resetx.txt")) {
- rename("data/members/active/$member_list_entry/resetx.txt","data/members/active/$member_list_entry/bb-resetx.txt");
- }
- if (file_exists("data/members/active/$member_list_entry/resetl.txt")) {
- rename("data/members/active/$member_list_entry/resetl.txt","data/members/active/$member_list_entry/bb-resetl.txt");
- }
- /* remove the lines above in version 3.0 */
- echo "<tr><td bgcolor=#ffffff align=center>";
- $sess_count = 0;
- if (is_dir($sess_dir)) {
- if ($sess_dh = opendir($sess_dir)) {
- while (($sess_file = readdir($sess_dh)) !== false) {
- if ($sess_file != '.' && $sess_file != '..') {
- $sess_content = file_get_contents("$sess_dir/$sess_file");
- if (preg_match("/logged_in/",$sess_content) and preg_match("/$maj_server/",$sess_content) and preg_match("/$member_list_entry/",$sess_content)) {
- $sess_count++;
- }
- }
- }
- }
- closedir($sess_dh);
- }
- }
- if ($sess_count > 0) {
- echo "<img src=\"images/smileys/smile.png\">";
- }
- else {
- 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>";
- 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 == $maj_admin_username) {
- $member_name = file_get_contents("data/author.txt");
- }
- echo "<td bgcolor=#ffffff>$member_name</td>";
- }
- 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 != $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 = mb_substr($joined,0,4);
- $joined_month = mb_substr($joined,4,2);
- $joined_day = mb_substr($joined,6,2);
- echo "<td bgcolor=#ffffff align=center><nobr><code>$member_since</code></nobr></td>";
- }
- 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>";
- }
- elseif (file_exists("data/members/active/$member_list_entry") and file_exists("data/members/active/$member_list_entry/bb-logins.txt")) {
- $logins = file_get_contents("data/members/active/$member_list_entry/bb-logins.txt");
- echo "<td bgcolor=#ffffff align=right><code>$logins</code></td>";
- }
- 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")) {
- echo "<td bgcolor=#ffffff align=right><code>0</code></td>";
- }
- if ($dh_posts_all = opendir("data/items")) {
- while (($member_posts = readdir($dh_posts_all)) !== false) {
- if ($member_posts != "." && $member_posts != "..") {
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- $private_cat = "0";
- if (file_exists("data/items/$member_posts/categories")) {
- if ($dh_member_posts_cat2 = opendir("data/items/$member_posts/categories")) {
- while (($member_posts_cat2 = readdir($dh_member_posts_cat2)) !== false) {
- if ($member_posts_cat2 != "." && $member_posts_cat2 != "..") {
- if (file_exists("data/categories/$member_posts_cat2/private.txt")) {
- $private_cat = $private_cat + 1;
- }
- }
- }
- closedir($dh_member_posts_cat2);
- }
- }
- 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;
- }
- if (file_exists("data/members/active/$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;
- }
- }
- else {
- 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;
- }
- }
- }
- }
- }
- closedir($dh_posts_all);
- }
- $posts = count($items_posts);
- echo "<td bgcolor=#ffffff align=right><code>$posts</code></td>";
- unset($items_posts);
- if (isset($maj_logged_in_username) and !empty($maj_logged_in_username) and ($maj_logged_in_username == $maj_admin_username)) {
- 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";
- if (file_exists("data/members/active/$member_list_entry/bb-rw.txt")) {
- echo " checked";
- }
- echo "></td><td bgcolor=#ffffff align=center><input type=checkbox name=ul";
- if (file_exists("data/members/active/$member_list_entry/bb-ul.txt")) {
- echo " checked";
- }
- echo "></td><td bgcolor=#ffffff align=center><input type=checkbox name=adm";
- if (file_exists("data/members/active/$member_list_entry/bb-adm.txt")) {
- echo " checked";
- }
- echo "></td><td bgcolor=#ffffff align=center><input type=checkbox name=noml";
- if (file_exists("data/members/active/$member_list_entry/bb-noml.txt")) {
- echo " checked";
- }
- echo "></td><td bgcolor=#ffffff align=center><input type=checkbox name=lockout";
- if (file_exists("data/members/active/$member_list_entry/bb-lockout.txt")) {
- echo " checked";
- }
- echo "></td><td bgcolor=#ffffff align=center><input type=checkbox name=del></td><td bgcolor=#ffffff align=center><input class=input type=text name=rank autocomplete=off value=\"";
- if (file_exists("data/members/active/$member_list_entry/rank.txt")) {
- readfile("data/members/active/$member_list_entry/rank.txt");
- }
- else {
- echo member;
- }
- echo "\"></td><td bgcolor=#ffffff><select name=category><option>none";
- if (file_exists("data/members/active/$member_list_entry/category.txt")) {
- $bb_cat = file_get_contents("data/members/active/$member_list_entry/category.txt");
- if (!file_exists("data/categories/$bb_cat")) {
- unlink("data/members/active/$member_list_entry/category.txt");
- }
- }
- if (file_exists("data/categories")) {
- if ($dh_cat = opendir("data/categories")) {
- while (($entry_cat = readdir($dh_cat)) !== false) {
- if ($entry_cat != "." && $entry_cat != "..") {
- $show_cat[] = $entry_cat;
- }
- }
- closedir($dh_cat);
- }
- sort($show_cat);
- foreach ($show_cat as $category) {
- echo "<option";
- if (file_get_contents("data/members/active/$member_list_entry/category.txt") == $category) {
- echo " selected";
- }
- echo ">";
- echo mb_strtolower($category);
- unset($show_cat);
- }
- }
- echo "</select></td><td bgcolor=#ffffff align=center><input class=click type=submit value=submit></td></form>";
- }
- if ($member_list_entry == $maj_admin_username) {
- echo "<td colspan=9 bgcolor=#ffffff align=center><a href=settings.php>administrator settings</a></td>";
- }
- }
- }
- }
- }
- ?>
- </table></div><div class="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($maj_logged_in_username)) {
- echo "logout";
- }
- else {
- echo "login";
- }
- ?>
- </a></font></div>
- </td></tr></table>
- <table border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC" style="background-color: transparent;">
- <tr><td width="525">
- <?php
- if ($maj_admin_username == $id) {
- readfile("data/author.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}")) {
- echo " <";
- readfile("data/email.txt");
- echo " >";
- }
- }
- else {
- echo "$member_firstname $member_lastname";
- 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>";
- }
- }
- ?>
- </div>
- <table border="0" cellspacing="0" cellpadding="0"><tr><td width="<?php echo $maj_ablock; ?>" valign="top">
- <?php
- maj_avatar_image($id,$maj_aimage);
- ?>
- </td><td width="435" valign="top"><table border="0" cellspacing="0" cellpadding="2">
- <?php
- if (file_exists("data/members/active/$id/org.txt") and ($maj_logged_in_username == $maj_admin_username)) {
- $org = file_get_contents("data/members/active/$id/org.txt");
- echo "<tr><td width=90>organization</td><td><code>$org</code></td></tr>";
- }
- 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($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/tel.txt") and ($maj_logged_in_username == $maj_admin_username)) {
- $tel = file_get_contents("data/members/active/$id/tel.txt");
- echo "<tr><td width=90>mobile number</td><td><code>$tel</code></td></tr>";
- }
- 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 = mb_substr($bday,0,4);
- $bday_month = mb_substr($bday,4,2);
- $bday_day = mb_substr($bday,6,2);
- echo "<tr><td width=90>birthdate</td><td><code>$bday</code></td></tr>";
- }
- if (file_exists("data/members/active/$id/timestamp.txt")) {
- $joined = file_get_contents("data/members/active/$id/timestamp.txt");
- $joined_year = mb_substr($joined,0,4);
- $joined_month = mb_substr($joined,4,2);
- $joined_day = mb_substr($joined,6,2);
- $joined_hh = mb_substr($joined,8,2);
- $joined_mm = mb_substr($joined,10,2);
- $member_since = date("d M Y H:i", mktime($joined_hh, $joined_mm, 0, $joined_month, $joined_day, $joined_year));
- echo "<tr><td width=90>member since</td><td><code>$member_since</code></td></tr>";
- }
- if (($maj_admin_username == $id) and file_exists("data/lastlog.txt")) {
- $lastlog = file_get_contents("data/lastlog.txt");
- $lastlog_year = mb_substr($lastlog,0,4);
- $lastlog_month = mb_substr($lastlog,4,2);
- $lastlog_day = mb_substr($lastlog,6,2);
- $lastlog_hh = mb_substr($lastlog,8,2);
- $lastlog_mm = mb_substr($lastlog,10,2);
- $last_login = date("d M Y H:i", mktime($lastlog_hh, $lastlog_mm, 0, $lastlog_month, $lastlog_day, $lastlog_year));
- echo "<tr><td width=90>last login</td><td><code>$last_login</code></td></tr>";
- }
- elseif (file_exists("data/members/active/$id/bb-last.txt")) {
- $lastlog = file_get_contents("data/members/active/$id/bb-last.txt");
- $lastlog_year = mb_substr($lastlog,0,4);
- $lastlog_month = mb_substr($lastlog,4,2);
- $lastlog_day = mb_substr($lastlog,6,2);
- $lastlog_hh = mb_substr($lastlog,8,2);
- $lastlog_mm = mb_substr($lastlog,10,2);
- $last_login = date("d M Y H:i", mktime($lastlog_hh, $lastlog_mm, 0, $lastlog_month, $lastlog_day, $lastlog_year));
- echo "<tr><td width=90>last login</td><td><code>$last_login</code></td></tr>";
- }
- if (($maj_admin_username == $id) and file_exists("data/lastpost.txt")) {
- $lastpost = file_get_contents("data/lastpost.txt");
- $lastpost_year = mb_substr($lastpost,0,4);
- $lastpost_month = mb_substr($lastpost,4,2);
- $lastpost_day = mb_substr($lastpost,6,2);
- $lastpost_hh = mb_substr($lastpost,8,2);
- $lastpost_mm = mb_substr($lastpost,10,2);
- $last_post = date("d M Y H:i", mktime($lastpost_hh, $lastpost_mm, 0, $lastpost_month, $lastpost_day, $lastpost_year));
- echo "<tr><td width=90>last post</td><td><code>$last_post</code></td></tr>";
- }
- elseif (file_exists("data/members/active/$id/bb-post.txt")) {
- $lastpost = file_get_contents("data/members/active/$id/bb-post.txt");
- $lastpost_year = mb_substr($lastpost,0,4);
- $lastpost_month = mb_substr($lastpost,4,2);
- $lastpost_day = mb_substr($lastpost,6,2);
- $lastpost_hh = mb_substr($lastpost,8,2);
- $lastpost_mm = mb_substr($lastpost,10,2);
- $last_post = date("d M Y H:i", mktime($lastpost_hh, $lastpost_mm, 0, $lastpost_month, $lastpost_day, $lastpost_year));
- echo "<tr><td width=90>last post</td><td><code>$last_post</code></td></tr>";
- }
- 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($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;
- }
- echo "<tr><td width=90>profile views</td><td><code>$views</code></td></tr>";
- }
- elseif (file_exists("data/members/active/$id")) {
- if (!file_exists("data/members/active/$id/bb-views.txt")) {
- $views = 0;
- }
- else {
- $views = file_get_contents("data/members/active/$id/bb-views.txt");
- }
- 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($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;
- }
- }
- echo "<tr><td width=90>profile views</td><td><code>$views</code></td></tr>";
- }
- 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>";
- }
- elseif (file_exists("data/members/active/$id") and file_exists("data/members/active/$id/bb-logins.txt")) {
- $logins = file_get_contents("data/members/active/$id/bb-logins.txt");
- echo "<tr><td width=90>total logins</td><td><code>$logins</code></td></tr>";
- }
- if ($dh_posts = opendir("data/items")) {
- while (($member_posts = readdir($dh_posts)) !== false) {
- if ($member_posts != "." && $member_posts != "..") {
- $total_posts[] = $member_posts;
- if (file_exists("data/items/$member_posts/private.txt") and (!isset($maj_logged_in_username) or ($maj_logged_in_username != $maj_admin_username))) {
- continue;
- }
- $private_cat = "0";
- if (file_exists("data/items/$member_posts/categories")) {
- if ($dh_member_posts_cat2 = opendir("data/items/$member_posts/categories")) {
- while (($member_posts_cat2 = readdir($dh_member_posts_cat2)) !== false) {
- if ($member_posts_cat2 != "." && $member_posts_cat2 != "..") {
- if (file_exists("data/categories/$member_posts_cat2/private.txt")) {
- $private_cat = $private_cat + 1;
- }
- }
- }
- closedir($dh_member_posts_cat2);
- }
- }
- 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;
- }
- if (file_exists("data/members/active/$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;
- }
- }
- 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;
- }
- }
- }
- }
- closedir($dh_posts);
- }
- $posts = count($items_posts);
- $all_posts = count($total_posts);
- $ratio_posts = (($posts/$all_posts) * 100);
- $ratio_posts = number_format($ratio_posts,2);
- echo "<tr><td width=90>total posts</td><td><code>$posts</code></td></tr>";
- echo "<tr><td width=90> </td><td><code>{$ratio_posts}% of total</code></td></tr>";
- if ($posts > 0) {
- echo "<tr><td width=90> </td><td><a href=index.php?author=$id><code>find all posts by $id</code></a></td></tr>";
- }
- unset($items_posts);
- unset($total_posts);
- ?>
- <tr><td>permissions</td><td><code>
- <?php
- if ($id == $maj_admin_username) {
- echo "rw";
- }
- if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
- if (file_exists("data/members/active/$id/bb-rw.txt")) {
- echo "rw";
- }
- else {
- echo "ro";
- }
- }
- if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
- if (file_exists("data/members/active/$id/bb-ul.txt")) {
- echo " upload";
- }
- }
- ?>
- </code></td></tr>
- <?php
- if (($id != $maj_admin_username) and file_exists("data/members/active/$id")) {
- if (file_exists("data/members/active/$id/category.txt")) {
- $bb_cat = file_get_contents("data/members/active/$id/category.txt");
- if (!file_exists("data/categories/$bb_cat")) {
- unlink("data/members/active/$id/category.txt");
- }
- }
- if (file_exists("data/members/active/$id/category.txt")) {
- echo "<tr><td>group (rw)</td><td><code>";
- $category_name = file_get_contents("data/members/active/$id/category.txt");
- if (file_exists("data/categories/$category_name/title.txt")) {
- readfile("data/categories/$category_name/title.txt");
- }
- else {
- echo $category_name;
- }
- echo "</code></td></tr>";
- }
- }
- ?>
- <tr><td>status</td><td><code>
- <?php
- $sess_dir = session_save_path();
- if (file_exists("data/bb-idle.txt")) {
- $idle = file_get_contents("data/bb-idle.txt");
- }
- else {
- $idle = 15;
- }
- $sess_count = 0;
- if (is_dir($sess_dir)) {
- if ($sess_dh = opendir($sess_dir)) {
- while (($sess_file = readdir($sess_dh)) !== false) {
- if ($sess_file != '.' && $sess_file != '..') {
- $sess_content = file_get_contents("$sess_dir/$sess_file");
- if (preg_match("/logged_in/",$sess_content) and preg_match("/$maj_server/",$sess_content) and preg_match("/$id/",$sess_content)) {
- $sess_count++;
- }
- }
- }
- }
- closedir($sess_dh);
- }
- }
- if ($sess_count > 0) {
- echo "online";
- }
- else {
- echo "offline";
- }
- $sess_count = 0;
- ?>
- </code></td></tr>
- </table></td></tr></table></div>
- <div class="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($maj_logged_in_username)) {
- echo "logout";
- }
- else {
- echo "login";
- }
- ?>
- </a></font></div>
- </td></tr></table>