Location: PHPKode > scripts > OekakiPoteto > oekakipoteto/update.php
<?
	include('dbconn.php'); 
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakichat RENAME ".$OekakiPoteto_MemberPrefix."oekakichat");
		echo mysql_error()."<br>";	
		@$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakionline RENAME ".$OekakiPoteto_MemberPrefix."oekakionline");												echo mysql_error()."<br>";
		@$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakikill RENAME ".$OekakiPoteto_MemberPrefix."oekakikill");			echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekakionline ADD onlineboard TEXT NOT NULL");												echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki CHANGE commcount commcount INT(11) DEFAULT '0' NOT NULL");												echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki CHANGE piccount piccount INT(11) DEFAULT '0' NOT NULL");						
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekakionline CHANGE OID OID BIGINT(255) NOT NULL AUTO_INCREMENT");						
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekakionline CHANGE locale locale VARCHAR(30) DEFAULT NULL ");						
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakidta CHANGE PIC_ID PIC_ID int(11) DEFAULT '0' NOT NULL ");
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakidta CHANGE edittime edittime int(20) unsigned default NULL");
			
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakidta ADD postlock tinyint(4) NOT NULL default '0' ");						
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki ADD age text");						
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_Prefix."oekakidta add animation tinyint(2) default '0'"); 
		echo mysql_error()."<br>";
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki ADD gender text");						
		echo mysql_error()."<br>";
		$result = mysql_query("UPDATE ".$OekakiPoteto_Prefix."oekakidta set postlock='1'");						
		echo mysql_error()."<br>";
		$result = mysql_query("CREATE TABLE ".$OekakiPoteto_MemberPrefix."oekakimailbox (MID int(11) NOT NULL auto_increment, sender varchar(255) NOT NULL default '', reciever varchar(255) NOT NULL default '', subject text NOT NULL,  body longtext NOT NULL,  mstatus smallint(10) NOT NULL default '0', senddate datetime NOT NULL default '0000-00-00 00:00:00',  PRIMARY KEY  (MID), KEY sender(sender), KEY reciever (reciever))"); 
		echo mysql_error()."<br>";		
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki ADD language TEXT NOT NULL ");	
		echo mysql_error()."<br>"; 
		$result = mysql_query("UPDATE ".$OekakiPoteto_MemberPrefix."oekaki SET language='english'");	
		echo mysql_error()."<br>"; 
		$result = mysql_query("CREATE TABLE ".$OekakiPoteto_Prefix."oekakimisc (MiscID int(11) NOT NULL auto_increment, miscname varchar(255) NOT NULL default '',  miscvalue bigint(255) NOT NULL,  PRIMARY KEY  (MiscID),  KEY miscname (miscname))");						
		echo mysql_error()."<br>";
				@$fp2 = fopen("count","r");
					if($fp2){
					$resno = fread ($fp2, filesize ("count"));
					fclose($fp2);
				}
		$result = mysql_query("INSERT INTO ".$OekakiPoteto_Prefix."oekakimisc VALUES (1,'piccount','$resno')");				echo mysql_error()."<br>";				
		$result = mysql_query("ALTER TABLE ".$OekakiPoteto_MemberPrefix."oekaki ADD picview TINYINT(11) DEFAULT '0' NOT NULL");
		echo mysql_error()."<br>";

$result = mysql_query("CREATE TABLE ".$OekakiPoteto_MemberPrefix."oekakichatmod (usrname varchar(255) NOT NULL default '',  command varchar(32) NOT NULL default 'MESSAGE',  comment tinytext NOT NULL,  posttime timestamp(14) NOT NULL,  hostname text NOT NULL,  email varchar(255) default NULL,  url text,  IP text NOT NULL,  postname varchar(50) NOT NULL default '',  PRIMARY KEY (posttime)) TYPE=MyISAM;"); 
		echo mysql_error()."<br>";	

$result = mysql_query("CREATE TABLE ".$OekakiPoteto_MemberPrefix."oekakichatmodusers (usrname varchar(255) NOT NULL,  lastmessage timestamp(14) NOT NULL, afk ENUM('no','yes') NOT NULL default 'no', PRIMARY KEY (usrname)) TYPE=MyISAM;"); 
		echo mysql_error()."<br>";	

		mysql_close();
	include('config.php');
	chmod("config.php", 0666);
	chmod("dbconn.php", 0666);
	//Remove install.php if it exists
	@unlink("install.php");
	$fp = fopen("config.php","w"); 
	fwrite($fp,"<?\n \$saltenc=\"".$saltenc."\"; \n \$OPpics=\"".$OPpics."\"; \n \$killuser=\"".$killuser."\"; \n \$template=\"".$template."\"; \n \$BBStitle=\"".$BBStitle."\"; \n \$eaddr=\"".$eaddr."\"; \n \$okurl=\"".$okurl."\"; \n \$apostrophes=\"".$apostrophes."\"; \n \$pstore=\"".$pstore."\"; \n \$ppage=\"".$ppage."\"; \n \$approval=\"".$approval."\"; \n \$drawaccess=\"".$drawaccess."\"; \n \$animationaccess=\"".$animationaccess."\"; \n \$xCanvas=\"".$xCanvas."\"; \n \$yCanvas=\"".$yCanvas."\"; \n \$xDefault=\"".$xDefault."\"; \n \$yDefault=\"".$yDefault."\"; \n \$chatMax=\"".$chatMax."\"; \n \$chatDisp=\"".$chatDisp."\"; \n \$language=\""."english"."\"; \n \$archivedir=\"".$archivedir."\"; \n \$guestpost=\"".$guestpost."\";\n \$anisize=\"".$anisize."\"; \n \$jpgcompression=\""."no"."\"; \n \$jpgcompressqual=\""."100"."\";?>"); 
	fclose($fp); 


		echo "Update complete! If you have multiple boards, make sure each board is at the current version. Please read manual.html if you are getting language file errors. Ignore the chmod errors if your board is running fine."
?>
Return current item: OekakiPoteto