function upboard_tags() { // if you add tags to this, make sure to keep the numbers the same // (they can be out of order) static $tags = array( 0 => array("long" => "Hentai", "short" => "[H]"), 6 => array("long" => "Porn", "short" => '[P]'), 1 => array("long" => "Japanese", "short" => "[J]"), 2 => array("long" => "Anime", "short" => "[A]"), 3 => array("long" => "Game", "short" => "[G]"), 5 => array("long" => "Loop", "short" => "[L]"), 4 => array("long" => "Other", "short" => "[?]") ); return $tags; } function updatelog( $resno = 0, $rebuild = 0 ) { $tags = upboard_tags(); $imgdir = IMG_DIR2; $thumbdir = THUMB_DIR2; $imgurl = STATIC_IMG_DIR2; $sqlog = SQLLOG; // to make this a shite load easier $find = false; $resno = (int)$resno; log_cache(); if( $resno ) { $result = mysql_board_call( "SELECT `no` FROM `$sqlog` WHERE `root` > 0 AND `no` = '$resno'" ); if( $result ) { $find = mysql_fetch_row( $result ); mysql_free_result( $result ); } if( !$find ) { $result2 = mysql_board_call( "SELECT `no`, `resto` FROM `$sqlog` WHERE `no` = '$resno'" ); list( $chkno, $resto ) = mysql_fetch_row( $result2 ); if( !$resto ) { error( S_REPORTERR ); } mysql_free_result( $result2 ); $result3 = mysql_board_call( "SELECT `no` FROM `$sqlog` WHERE `no` = '$resto'" ); if( $result3 ) { $chkfind = mysql_fetch_row( $result3 ); mysql_free_result( $result3 ); } if( !$chkfind ) { error( S_REPORTERR ); } } } if( $resno ) { if( !$treeline = mysql_board_call( "SELECT * FROM `$sqlog` WHERE `root` > 0 AND `no` = '$resno' ORDER BY `root` DESC" ) ) { echo S_SQLFAIL; } } else { if( !$treeline = mysql_board_call( "SELECT * FROM `$sqlog` WHERE `root` > 0 ORDER BY `root` DESC" ) ) { echo S_SQLFAIL; } } if( $resno ) { //logtime("Generating thread JSON"); if( ENABLE_JSON ) generate_thread_json( $resno ); //$treeline = array( $resno ); //logtime("Formatting thread page"); } else { //logtime("Generating index JSON"); if( ENABLE_JSON_INDEXES ) generate_index_json(); if( ENABLE_JSON_CATALOG ) generate_board_catalogue(); if( ENABLE_JSON_THREADS ) generate_board_threads_json(); //$treeline = $log['THREADS']; //logtime("Formatting index page"); } if( !$result = mysql_board_call( "SELECT MAX(`no`) FROM `$sqlog`" ) ) { echo S_SQLFAIL; } $row = mysql_fetch_array( $result ); $lastno = (int)$row[0]; mysql_free_result( $result ); $counttree = mysql_num_rows( $treeline ); if( !$counttree ) { $logfilename = SELF_PATH2_FILE; $dat = ''; head( $dat, $resno ); form( $dat, $resno ); print_page( $logfilename, $dat ); } $page = 0; $dat = ''; head( $dat, $resno ); form( $dat, $resno ); if( !$resno ) { $st = $page; } $dat .= '