"; } function getNextValidId($db, $id) { $idfile = file("$db.id"); $id_last = trim($idfile[0]); $ck_id = $id; if($id_last > $id) { while($id_last>=$ck_id) { $ck_id++; $ck_rec = get($ck_id, $db); if(isset($ck_rec["id"])) { return $ck_rec["id"]; } unset($ck_rec); } return false; } } function getLastValidId($db, $id) { $idfile = file("$db.id"); $id_last = trim($idfile[0]); $ck_id = $id; while($ck_id>0) { $ck_id--; $ck_rec = get($ck_id, $db); if(isset($ck_rec["id"])) { return $ck_rec["id"]; } unset($ck_rec); } return false; } function checkAlphaNumeric($string) { if(ereg("^[a-zA-Z0-9]", $string)) return true; return false; } function createUserSelectFormObject($object_name, $restrict_mod, $restrict_admin, $restrict_self, $id_selected, $restrict_ids) { global $id_env; if(!is_array($restrict_ids)) { echo "Warning: Unable to execute \"createUserSelectFormObject()\", Argument (\$restrict_ids) not valid"; return false; } $c1 = count($restrict_ids); $reg = array(); $irreg = array(); $all = listall("./db/users"); $c = count($all); for($i=1;$i<$c;$i++) { $rec = def($all[$i], "./db/users"); $boolean = true; if($rec["level"] == 2) { if($restrict_mod) $boolean = false; } elseif($rec["level"] == 3) { if($restrict_admin) $boolean = false; } for($k=0;$k<$c1;$k++) { if($restrict_ids[$k] == $rec["id"]) { $boolean = false; $k = $c1 + 1; } } if($restrict_self) { if($rec["id"] == $id_env) $boolean = false; } if($boolean) { if(!(checkAlphaNumeric($rec["user_name"]{0}))) $irreg[$rec["id"]] = $rec["user_name"]; else $reg[$rec["id"]] = $rec["user_name"]; } } $c = count($reg); for($i=1;$i<$c;$i++) { if(!isset($reg[$i])) $reg[$i] = "NULL"; } $c = count($irreg); for($i=1;$i<$c;$i++) { if(!isset($irreg[$i])) $irreg[$i] = "NULL"; } $return = ""; return $return; } function login_user ($user, $pass, $verify) { global $key; $d = listall("./db/users"); $c = count($d); $flag = "0"; $ar = ""; for($i=0;$i<$c;$i++) { $rec = def($d[$i], "./db/users"); if (@$rec[user_name] == $user) { $flag = "1"; if(@$rec[password] == stripslashes(t_encrypt($pass, $key))) { $flag = "2"; @$ar[] = $rec[user_name]; @$ar[] = stripslashes($rec[password]); @$ar[] = $rec[level]; @$ar[] = $rec[id]; break; } } } return $ar; }//end function login_user function print_error($error = ""){ print $error; }//end function print_error function d_delTopic() { global $id, $t_id, $font_m, $font_face, $font_color_main; echo " Delete Topic "; }//end function displayAdminControls function message_icons() { $dir = opendir("./icon"); $r = ""; while($file = readdir($dir)) { $str = strpos($file, "con", 0); if ($str == "1") { $fileext = explode(".", $file); $fileext = end($fileext); if ($fileext == "gif" or $fileext =="jpg") { if($file != "icon1.gif"){ $r .= ""; } } } } return $r; } function deleteWhiteIndex(&$array) { for($i=0;$i ".$vars["pageStr"]."

"; }//end function d_topic function get_pass ($user) { global $key; $d = listall("./db/users"); $c = count($d); $flag = "0"; $ar = ""; for($i=0;$i<$c;$i++) { $rec = def($d[$i], "./db/users"); if (@$rec[user_name] == $user) { $flag = "1"; $flag = "2"; @$ar[] = $rec[user_name]; @$ar[] = stripslashes($rec[password]); @$ar[] = $rec[level]; @$ar[] = $rec[id]; @$ar[] = $rec[email]; break; } } return $ar; } function d_posting($p) { global $page, $id, $t_id, $font_m, $font_face, $font_color_main, $table_width_main, $border; echo "
$p

"; if(is_writable("./db/$id/".$t_id.".dat")) { echo " "; } else { echo " "; } echo "

"; }//end function d_posting function is_logged_in($user, $pass, $power, $id) { if($user == "" || $pass == "" || $power == "" || $id == "") { return false; } else { $rec = get($id, "./db/users"); if(@(stripslashes($user) == $rec[user_name] and stripslashes($pass) == $rec[password] and stripslashes($power) == $rec[level])) { return true; } else { return false; } } }//end function is_logged_in ?> Login or Register."; $loginlink = "login.php?ref="; } else { $login = "Welcome, $user_env! Log off?"; $loginlink = "logoff.php"; $pm_display = " pmsystem.php"; $login = "Welcome, $user_env! Log off?"; $all_pm = listall("./db/pms/".$id_env."_inbox"); $count_pm = count($all_pm); if($count_pm == 1) { $pm_rec = def($all_pm[0], "./db/pms/inbox"); if($pm_rec[icon] == "") { $no_pm = 1; } } $new_pm = 0; $old_pm = 0; if($count_pm > 1 || !isset($no_pm)) { for($i=0;$i<$count_pm;$i++) { $pm_rec = def($all_pm[$i], "./db/pms/inbox"); if(@strtotime($pm_rec[date]) > strtotime($lastvisit)) { if($all_pm[$i] != "") { $new_pm++; } } else { if($all_pm[$i] != "") { $old_pm++; } } if(@strtotime($pm_rec[date]) > strtotime(date("M d, Y g:i:s a",time()-300))) { $NewPm[] = $pm_rec[id]; } } } else { $new_pm = 0; } if($new_pm > 0) { $login .= "
$new_pm new PMs in your inbox"; } else { $login .="
"; } if($power_env == 3) { $login .= "
Admin Panel"; } $login .= "
Mark all posts read"; } header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); $skin_tableheadingforheader = "

Welcome $user_env

"; $skin_tableheadingforservice = "

Announcements

"; //Start Header echo " $title $css "; if(count($NewPm) == 1) { $upb["def"] = "./db/pms/inbox"; $ck_pm = get($NewPm, "./db/pms/".$id_env."_inbox"); if($ck_pm[icon] == "") { $no_newpm = 1; } } if(count($NewPm) > 1|| !isset($no_newpm)) { for($i++;$i

$skin_tableheadingforheader
$title $where $login
$skin_tablefooter"; if (isset($servicemessage)) { if ($servicemessage != "") { echo "
$skin_tableheadingforservice
$servicemessage
$skin_tablefooter"; } else { } } else { } echo "

"; //End Header ?>