# Futallaby 040103 # # For setup instructions and latest version, please visit: # http://www.1chan.net/futallaby/ # # Based on GazouBBS and Futaba include "config.php"; include "strings_e.php"; //String resource file extract($_POST); extract($_GET); extract($_COOKIE); $upfile_name=$_FILES["upfile"]["name"]; $upfile=$_FILES["upfile"]["tmp_name"]; $path = realpath("./").'/'.IMG_DIR; ignore_user_abort(TRUE); $badstring = array("dummy_string","dummy_string2"); // Refused text $badfile = array("dummy","dummy2"); //Refused files (md5 hashes) $badip = array("addr1\\.dummy\\.com","addr2\\.dummy\\.com"); //Refused hosts (IP bans) if(!$con=mysql_connect(SQLHOST,SQLUSER,SQLPASS)){ echo S_SQLCONF; //unable to connect to DB (wrong user/pass?) exit; } $db_id=mysql_select_db(SQLDB,$con); if(!$db_id){echo S_SQLDBSF;} if (!table_exist(SQLLOG)) { echo (SQLLOG.S_TCREATE); $result = mysql_call("create table ".SQLLOG." (primary key(no), no int not null auto_increment, now text, name text, email text, sub text, com text, host text, pwd text, ext text, w int, h int, tim text, time int, md5 text, fsize int, root timestamp, resto int)"); if(!$result){echo S_TCREATEF;} } function updatelog($resno=0){ global $path; $find = false; $resno=(int)$resno; if($resno){ $result = mysql_call("select * from ".SQLLOG." where root>0 and no=$resno"); if($result){ $find = mysql_fetch_row($result); mysql_free_result($result); } if(!$find) error(S_REPORTERR); } if($resno){ if(!$treeline=mysql_call("select * from ".SQLLOG." where root>0 and no=".$resno." order by root desc")){echo S_SQLFAIL;} }else{ if(!$treeline=mysql_call("select * from ".SQLLOG." where root>0 order by root desc")){echo S_SQLFAIL;} } //Finding the last entry number if(!$result=mysql_call("select max(no) from ".SQLLOG)){echo S_SQLFAIL;} $row=mysql_fetch_array($result); $lastno=(int)$row[0]; mysql_free_result($result); $counttree=mysql_num_rows($treeline); if(!$counttree){ $logfilename=PHP_SELF2; $dat=''; head($dat); form($dat,$resno); $fp = fopen($logfilename, "w"); set_file_buffer($fp, 0); rewind($fp); fputs($fp, $dat); fclose($fp); chmod($logfilename,0666); } for($page=0;$page<$counttree;$page+=PAGE_DEF){ $dat=''; head($dat); form($dat,$resno); if(!$resno){ $st = $page; } $dat.='
'; if(!$resno){ // if not in res display mode $prev = $st - PAGE_DEF; $next = $st + PAGE_DEF; // Page processing $dat.=""; }else{ $dat.=""; }else{$dat.=" | ".S_FIRSTPG." | ";} $dat.=""; for($i = 0; $i < $counttree ; $i+=PAGE_DEF){ if($i&&!($i%(PAGE_DEF*2))){$dat.=" ";} if($st==$i){$dat.="[".($i/PAGE_DEF)."] ";} else{ if($i==0){$dat.="[0] ";} else{$dat.="[".($i/PAGE_DEF)."] ";} } } $dat.=" | "; if($p >= PAGE_DEF && $counttree > $next){ $dat.=""; }else{$dat.=" | ".S_LASTPG." | ";} $dat.="