<?php

	echo 'Updating from version 0.75 to 0.76<br>';

	// Alter Database Tables	
	$sql = "ALTER TABLE ".$bbTable['forums']." ADD subforum_count INT( 10 ) UNSIGNED NOT NULL";
	if(!$db->query($sql)) die('ERROR: '.$db->error());
	
	$res = $db->query("SELECT * from ".$bbTable['forums']);
	while ($row = $db->fetch_object($res))
	{
		if($row->parent_forum > 0)
		{
			$sql = "UPDATE ".$bbTable['forums']." SET subforum_count=subforum_count+1 where forum_id=".$row->parent_forum;
			$db->query($sql);
		}
	}
	
	// Remove unwanted files
?>
