# BitOwl Application Suit Patch
# Alpha 1 - Alpha 2
# 
# Instructions:
# copy any files in the zip to script directory
# Login to BitOwl Application Suit
# BOASL (You must be an admin)
# copy this entire patch into the box.
# delete images\poll_right.gif
# delete images\poll_center.gif
# delete images\poll_left.gif
# (these are repalced with new ones in templates/BitOwl/)
open("init.php")
Find:
$fullpath = str_replace($_SERVER["DOCUMENT_ROOT"], "", str_replace("\\", "/", $path)); //fullpath is for html pointing to script directory
$fullpath = "http://".$_bitowl["master"]["domain"].$fullpath;
$isloggedin = false;
$isloggedinas = "";
Add:
//template parser
function parse_template($template, $data, $type = false)
{
	global $path, $fullpath;
	$template_name = $_bitowl["master"]["template"];
	$template_url = $fullpath."/templates/".$template_name;
	if($type == false)
	{
		$template_type = substr($template, 0, strpos($template, "-")); //determine type
	}
	else
	{
		$template_type = $type;
	}
	$template = $path."/templates/".$template_name."/".$template;
	$template = file_get_contents($template);
	switch($template_type)
	{
		case "news":
			$return_string = array(
				"in" => array(
					"{template-directory}",
					"{author}",
					"{date}",
					"{title}",
					"{message}",
					"{category-list}",
				),
				"out" => array(
					$template_url,
					$data["author"],
					$data["date"],
					$data["title"],
					$data["message"],
					$data["categories"]
				)
			);
			$return = str_replace($return_string["in"], $return_string["out"], $template);
			break;
		case "poll":
			$return_string = array(
				"in" => array(
					"{template-directory}",
					"{poll-question}",
					"{poll-options}",
					"{poll-options-result}",
					"{poll-option}",
					"{poll-option-name}",
					"{poll-option-percent}",
					"{poll-submit}",
					"{poll-special}",
					"{results-link}"
				),
				"out" => array(
					$template_url,
					$data["poll_question"],
					$data["poll_options"],
					$data["poll_options_result"],
					"type=\"radio\" name=\"vote\" value=\"".$data["poll_option_number"]."\"",
					$data["poll_option_name"],
					$data["poll_option_percent"],
					"type=\"submit\" value=\"Cast Vote\"",
					"type=\"text\" name=\"".$data["poll_option_special_name"]."\"",
					$data["results_url"]
				)
			);
			$return = str_replace($return_string["in"], $return_string["out"], $template);
			if(empty($data["poll_option_special_name"]))
			{
				$return = preg_replace("/{special (.*?) \/}/", "", $return);
			}
			else
			{
				$return = preg_replace("/{special (.*?) \/}/", "$1", $return);
			}
			break;
		case "gallery":
			$return_string = array(
				"in" => array(
					"{template-directory}",
					"{album-statistics}",
					"{album-name}",
					"{album-trace}",
					"{album-link}",
					"{album-description}",
					"{pages}",
					"{previous-link}",
					"{next-link}",
					"{image-description}",
					"{image-file}",
					"{image-height}",
					"{image-width}",
					"{image-link}",
					"{list-albums}",
					"{list-images}",
					"{gallery-name}",
					"{gallery-description}"
				),
				"out" => array(
					$template_url,
					$data["album_stats"],
					$data["album_name"],
					$data["album_trace"],
					$data["album_link"],
					$data["album_description"],
					$data["pages"],
					$data["previous"],
					$data["next"],
					$data["image_description"],
					$data["image_file"],
					$data["image_height"],
					$data["image_width"],
					$data["image_link"],
					$data["album_list"],
					$data["image_list"],
					$data["gallery_name"],
					$data["gallery_description"]
				)
			);
			$return = str_replace($return_string["in"], $return_string["out"], $template);
			//image array (for image listing)
			if(is_array($data["image_file"]))
			{
				for(preg_replace("/{image-file (.*?)}/", "$1", $return, -1, $i);$i != 0;preg_replace("/{image-file (.*?)}/", "$1", $return, -1, $i))
				{
					preg_match("/{image-file (.*?)}/", $return, $imagefile);
					if(isset($data["image_file"][$imagefile[1]]))
					{
						$return = preg_replace("/{image-file (.*?)}/", $data["image_file"][$imagefile[1]], $return, 1);
					}
					else
					{
						$return = preg_replace("/{image-file (.*?)}/", "&nbsp;", $return, 1);
					}
				}
				for(preg_replace("/{image-height (.*?)}/", "$1", $return, -1, $i);$i != 0;preg_replace("/{image-height (.*?)}/", "$1", $return, -1, $i))
				{
					preg_match("/{image-height (.*?)}/", $return, $imagefile);
					if(isset($data["image_height"][$imagefile[1]]))
					{
						$return = preg_replace("/{image-height (.*?)}/", $data["image_height"][$imagefile[1]], $return, 1);
					}
					else
					{
						$return = preg_replace("/{image-height (.*?)}/", "&nbsp;", $return, 1);
					}
				}
				for(preg_replace("/{image-width (.*?)}/", "$1", $return, -1, $i);$i != 0;preg_replace("/{image-width (.*?)}/", "$1", $return, -1, $i))
				{
					preg_match("/{image-width (.*?)}/", $return, $imagefile);
					if(isset($data["image_width"][$imagefile[1]]))
					{
						$return = preg_replace("/{image-width (.*?)}/", $data["image_width"][$imagefile[1]], $return, 1);
					}
					else
					{
						$return = preg_replace("/{image-width (.*?)}/", "&nbsp;", $return, 1);
					}
				}
				for(preg_replace("/{image-link (.*?)}/", "$1", $return, -1, $i);$i != 0;preg_replace("/{image-link (.*?)}/", "$1", $return, -1, $i))
				{
					preg_match("/{image-link (.*?)}/", $return, $imagefile);
					if(isset($data["image_link"][$imagefile[1]]))
					{
						$return = preg_replace("/{image-link (.*?)}/", $data["image_link"][$imagefile[1]], $return, 1);
					}
					else
					{
						$return = preg_replace("/{image-link (.*?)}/", "&nbsp;", $return, 1);
					}
				}
			}
			if($data["previous"] == "&nbsp;")
			{
				$return = preg_replace("/{previous-exists (.*?) \/}/s", "&nbsp;", $return);
			}
			else
			{
				$return = preg_replace("/{previous-exists (.*?) \/}/s", "$1", $return);
			}
			if($data["next"] == "&nbsp;")
			{
				$return = preg_replace("/{next-exists (.*?) \/}/s", "&nbsp;", $return);
			}
			else
			{
				$return = preg_replace("/{next-exists (.*?) \/}/s", "$1", $return);
			}
			if($data["image_file"] == "&nbsp;")
			{
				$return = preg_replace("/{image-exists (.*?) \/}/s", "No Image", $return);
			}
			else
			{
				$return = preg_replace("/{image-exists (.*?) \/}/s", "$1", $return);
			}
			if(isset($_GET["album"]))
			{
				$return = preg_replace("/{root (.*?) \/}/s", "", $return);
				$return = preg_replace("/{album (.*?) \/}/s", "$1", $return);
			}
			else
			{
				$return = preg_replace("/{root (.*?) \/}/s", "$1", $return);
				$return = preg_replace("/{album (.*?) \/}/s", "", $return);
			}
			break;
	}
	$return = preg_replace("/{if-exists &nbsp;, (.*?) \/}/s", "&nbsp;", $return);
	$return = preg_replace("/{if-exists (.*?), (.*?) \/}/s", "$2", $return);
	for(preg_replace("/{template (.*?)}/", "$1", $return, -1, $i);$i != 0;preg_replace("/{template (.*?)}/", "$1", $return, -1, $i))
	{
		preg_match("/{template (.*?)}/", $return, $include);
		$include = parse_template($include[1].".html", $data, $template_type);
		$return = preg_replace("/{template (.*?)}/", $include, $return, 1);
	}
	return $return;
}
open("install.php")
Find:
	$ver_root = "0.1.0 A1";
Replace:
	$ver_root = "0.2.0 A2";
Find:
	$config = "<?php\n\$_bitowl[\"version\"] = \"$ver_root\";\n\n\$_bitowl[\"master\"][\"version\"] = \"$ver_master\";\n\$_bitowl[\"master\"][\"domain\"] = \"".$_POST["domain"]."\";\n\n\$_bitowl[\"news\"][\"version\"] = \"$ver_news\";\n\$_bitowl[\"news\"][\"date\"] = \"".$_POST["date"]."\";\n\$_bitowl[\"news\"][\"pages\"] = ".bool2string($_POST["pages"]).";\n\$_bitowl[\"news\"][\"itemperpage\"] = ".$_POST["itemperpage"].";\n\n\$_bitowl[\"poll\"][\"version\"] = \"$ver_poll\";\n\$_bitowl[\"poll\"][\"display\"] = ".$_POST["polldisplay"].";\n\$_bitowl[\"poll\"][\"iplog\"] = ".bool2string($_POST["iplog"]).";\n\n\$_bitowl[\"login\"][\"version\"] = \"$ver_login\";\n\n\$_bitowl[\"gallery\"][\"version\"] = \"$ver_gallery\";\n\$_bitowl[\"gallery\"][\"watermark\"] = ".bool2string($_POST["wm"]).";\n\$_bitowl[\"gallery\"][\"wmposition\"] = \"".$_POST["wmpos"]."\";\n\$_bitowl[\"gallery\"][\"imagetype\"] = \"".$_POST["imgtype"]."\";\n\$_bitowl[\"gallery\"][\"jpgquility\"] = ".$_POST["jpgquil"].";\n\$_bitowl[\"gallery\"][\"createthumb\"] = ".bool2string($_POST["thumbcreate"]).";\n\$_bitowl[\"gallery\"][\"maxthumbwidth\"] = ".$_POST["width"].";\n\$_bitowl[\"gallery\"][\"maxthumbheight\"] = ".$_POST["height"].";\n\$_bitowl[\"gallery\"][\"wmmarginlr\"] = ".$_POST["margin1"].";\n\$_bitowl[\"gallery\"][\"wmmargintb\"] = ".$_POST["margin2"].";\n?>";
Replace:
	$config = "<?php\n\$_bitowl[\"version\"] = \"$ver_root\";\n\n\$_bitowl[\"master\"][\"version\"] = \"$ver_master\";\n\$_bitowl[\"master\"][\"domain\"] = \"".$_POST["domain"]."\";\n\$_bitowl[\"master\"][\"template\"] = \"BitOwl\";\n\n\$_bitowl[\"news\"][\"version\"] = \"$ver_news\";\n\$_bitowl[\"news\"][\"date\"] = \"".$_POST["date"]."\";\n\$_bitowl[\"news\"][\"pages\"] = ".bool2string($_POST["pages"]).";\n\$_bitowl[\"news\"][\"itemperpage\"] = ".$_POST["itemperpage"].";\n\n\$_bitowl[\"poll\"][\"version\"] = \"$ver_poll\";\n\$_bitowl[\"poll\"][\"display\"] = ".$_POST["polldisplay"].";\n\$_bitowl[\"poll\"][\"iplog\"] = ".bool2string($_POST["iplog"]).";\n\n\$_bitowl[\"login\"][\"version\"] = \"$ver_login\";\n\n\$_bitowl[\"gallery\"][\"version\"] = \"$ver_gallery\";\n\$_bitowl[\"gallery\"][\"watermark\"] = ".bool2string($_POST["wm"]).";\n\$_bitowl[\"gallery\"][\"wmposition\"] = \"".$_POST["wmpos"]."\";\n\$_bitowl[\"gallery\"][\"imagetype\"] = \"".$_POST["imgtype"]."\";\n\$_bitowl[\"gallery\"][\"jpgquility\"] = ".$_POST["jpgquil"].";\n\$_bitowl[\"gallery\"][\"createthumb\"] = ".bool2string($_POST["thumbcreate"]).";\n\$_bitowl[\"gallery\"][\"maxthumbwidth\"] = ".$_POST["width"].";\n\$_bitowl[\"gallery\"][\"maxthumbheight\"] = ".$_POST["height"].";\n\$_bitowl[\"gallery\"][\"wmmarginlr\"] = ".$_POST["margin1"].";\n\$_bitowl[\"gallery\"][\"wmmargintb\"] = ".$_POST["margin2"].";\n?>";
open("news/addnews.php")
Find:
	$_POST["message"] = str_replace("\n", "<br />", $_POST["message"]);
Replace:
	$_POST["message"] = str_replace(array("\n","&gt;","&lt;"), array("<br />",">","<"), $_POST["message"]);
open("news/mngnews.php")
Find:
		$_POST["message"] = str_replace("\n", "<br />", $_POST["message"]);
Replace:
		$_POST["message"] = str_replace(array("\n","&gt;","&lt;"), array("<br />",">","<"), $_POST["message"]);
open("viewalbums.php")
Find:
	elseif(strpos($_bitowl["temp"][$i], "image=") !== false)
	{
		unset($_bitowl["temp"][$i]);
	}
Add:
	elseif(strpos($_bitowl["temp"][$i], "start=") !== false)
	{
		unset($_bitowl["temp"][$i]);
	}
Find:
include "config.php"; //remove later
//bars and templates
function header_bar($text)
{
	?>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td width="10%" style="background-color: #A00000">&nbsp;</td>
			<th width="90%" bgcolor="#EEEEEE" style="background-color: #A00000">
				<b><?php echo $text; ?></b>
			</th>
		</tr>
	</table>
	<?php
}
function nav_bar($texta, $textb)
{
	?>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td style="background-color: #A00000;color: #FFFFFF;font-size: small">
				<?php echo $texta; ?>
			</td>
		</tr>
		<tr>
			<td style="background-color: #EEEEEE" align="center"><?php echo $textb; ?></td>
		</tr>
	</table><br>
	<?php
}
function foot_bar($text)
{
	?>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td style="background-color: #EEEEEE" align="center"><?php echo $text; ?></td>
		</tr>
	</table>
	<?php
}

function thumb($x, $y, $arr) //calculations
Replace:
function thumb($x, $y, $arr) //calculations
open("viewnews.php")
Find:
		if(strpos($_bitowl["temp"][$i], "newspage=") !== false)
		{
			unset($_bitowl["temp"][$i]);
		}
Add:
		elseif(strpos($_bitowl["temp"][$i], "category=") !== false)
		{
			unset($_bitowl["temp"][$i]);
		}
Find:
	$_bitowl["temp"] = implode("&amp;", $_bitowl["temp"])."&amp;";
	$_SERVER["QUERY_STRING"] = $_bitowl["temp"];
	require "$path/news.php";
Add:
	function category_id2name($cid) //converts category id to name
	{
		global $categories;
		for($i = 0;$i < count($categories);$i++)
		{
			if($categories[$i]["id"] == $cid)
			{
				return $categories[$i]["name"];
			}
		}
	}
Find:
	function display_news_item($id) //this displays the post
	{
		global $news, $categories, $_bitowl;
		$title = stripslashes($news[$id]["title"]);
		$message = stripslashes($news[$id]["message"]);
		$date = date($_bitowl["news"]["date"], $news[$id]["date"]);
		$author = $news[$id]["author"];
Add:
		for($i = 0;$i < count($news[$id]["categories"]);$i++)
		{
			$news[$id]["categories"][$i] = "<a href=\"?".$_SERVER["QUERY_STRING"]."category=".$news[$id]["categories"][$i]."\">".category_id2name($news[$id]["categories"][$i])."</a>";
		}
Find:
		?>
		<table border="0" cellspacing="0" cellpadding="0" class="item" width="100%">
			<tr>
				<th><?php echo $date; ?> - <?php echo $title; ?></th>
			</tr>
			<tr>
				<td><?php echo $message; ?><br /><br />-<?php echo $author; ?></td>
			</tr>
		</table>
		<br />
		<?php
Replace:
		$data = array("author" => $author, "categories" => $news_categories, "date" => $date, "title" => $title, "message" => $message);
		echo parse_template("news-item.html", $data);
open("viewpoll.php")
Find:
<?php
require "$path/polls.php";
Add:
$_bitowl["temp"] = explode("&", $_SERVER["QUERY_STRING"]); //get all variables from url
$_bitowl["temp2"] = count($_bitowl["temp"]);
for($i = 0;$i < $_bitowl["temp2"];$i++) //strip certain ones
{
	if(strpos($_bitowl["temp"][$i], "showresults=") !== false)
	{
		unset($_bitowl["temp"][$i]);
	}
	elseif(strpos($_bitowl["temp"][$i], "display=") !== false)
	{
		unset($_bitowl["temp"][$i]);
	}
}
$_bitowl["temp"] = implode("&amp;", $_bitowl["temp"])."&amp;";
$_SERVER["QUERY_STRING"] = $_bitowl["temp"];
unset($_bitowl["temp"], $_bitowl["temp2"]);
Find:
function display_poll($id,$results)
{
	global $poll, $path, $fullpath;
	$this_poll = $poll[$id];

	if($results)
	{
		echo stripslashes($this_poll[0])."<br />";
Replace:
function display_poll($id,$results)
{
	global $poll, $path, $fullpath;
	$this_poll = $poll[$id];
	$poll_option_result = "";
	if($results)
	{
Find:
			echo stripslashes($this_poll[1][$i][0])."<br><img src=\"$fullpath/images/poll_left.gif\" alt=\"[\" /><img src=\"$fullpath/images/poll_center.gif\" width=\"$percent\" height=\"16\" alt=\"";
			for($j = 0;$j < $percent;$j++)
			{
				echo "|";
			}
			echo "\" /><img src=\"$fullpath/images/poll_right.gif\" alt=\"]\" />&nbsp;".$percent."%<br />";
		}


	}
	else
	{
		?>
		<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>?display=<?php echo $_GET["display"]; ?>">
		<?php
		echo stripslashes($this_poll[0])."<br />";
		for($i = 0;$i < count($this_poll[1]);$i++)
		{
			?>
			<input type="radio" name="vote" value="<?php echo $i; ?>" /> <?php echo stripslashes($this_poll[1][$i][0]); ?><br />
			<?php
		}
		if($this_poll[3] !== false)
		{
			?>
			<input type="radio" name="vote" value="new" /> New: <input type="text" name="votenew" size="8" /><br />
			<?php
		}
		if($this_poll[4] !== false)
		{
			?>
			<input type="radio" name="vote" value="other" /> Other: <input type="text" name="voteother" size="8" /><br />
			<?php
		}
		?>
		<input type="submit" value="Cast Vote" /><br />
		<a href="?showresults=true&amp;display=<?php echo $_GET["display"]; ?>">Show Results</a>
		</form>
		<?php
	}
Replace:
			$data = array("poll_question" => stripslashes($this_poll[0]), "poll_options_result" => "", "poll_options" => "", "poll_option_name" => $this_poll[1][$i][0], "poll_option_number" => "", "poll_option_percent" => $percent, "poll_option_special_name" => "", "results_url" => "");
			$poll_option_result = $poll_option_result.parse_template("poll-option-result.html", $data);




		}
		$data = array("poll_question" => stripslashes($this_poll[0]), "poll_options_result" => $poll_option_result, "poll_options" => "", "poll_option_name" => "", "poll_option_number" => "", "poll_option_percent" => "", "poll_option_special_name" => "", "results_url" => "");
		echo parse_template("poll-result.html", $data);
	}
	else
	{
		?>
		<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>?display=<?php echo $_GET["display"]; ?>">
		<?php
		$poll_options = "";
		for($i = 0;$i < count($this_poll[1]);$i++)
		{
			$data = array("poll_question" => "", "poll_options" => "", "poll_options_result" => "", "poll_option_number" => $i, "poll_option_name" => stripslashes($this_poll[1][$i][0]), "poll_option_percent" => "", "poll_option_special_name" => "", "results_url" => "");
			$poll_options = $poll_options.parse_template("poll-option.html", $data);

		}
		if($this_poll[3] !== false)
		{
			$data = array("poll_question" => "", "poll_options" => "", "poll_options_result" => "", "poll_option_number" => "new", "poll_option_name" => "New: ", "poll_option_percent" => "", "poll_option_special_name" => "votenew", "results_url" => "");
			$poll_options = $poll_options.parse_template("poll-option.html", $data);

		}
		if($this_poll[4] !== false)
		{
			$data = array("poll_question" => "", "poll_options" => "", "poll_options_result" => "", "poll_option_number" => "other", "poll_option_name" => "Other: ", "poll_option_percent" => "", "poll_option_special_name" => "voteother", "results_url" => "");
			$poll_options = $poll_options.parse_template("poll-option.html", $data);

		}
		$data = array("poll_question" => stripslashes($this_poll[0]), "poll_options" => $poll_options, "poll_options_result" => "", "poll_option_name" => "", "poll_option_number" => "", "poll_option_percent" => "", "poll_option_special_name" => "", "results_url" => "?".$_SERVER["QUERY_STRING"]."showresults=true&amp;display=".$_GET["display"]);
		echo parse_template("poll-vote.html", $data);
		echo "</form>";


	}
	
new("templates/BitOwl/gallery-album.html")
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<th rowspan="2" width="25%">{image-exists <img src="{image-file}" alt="First Image" width="{image-width}" height="{image-height}" /> /}</td>
		<th bgcolor="#A00000" width="75%" height="1">
			<b><a href="{album-link}">{album-name}</a></b>
		</th>
	</tr>
	<tr>
		<td width="75%" height="{image-height}">{album-description}</td>
	</tr>
</table><br>
new("templates/BitOwl/gallery-footer.html")
<div style="width: 100%;background-color: #EEEEEE;color: #000000">&nbsp;</div>
new("templates/BitOwl/gallery-image.html")
{album-trace}<br />
{template gallery-navbar-image}<br />
<div align="center"><img src="{image-file}" alt="{image-description}" /><br />
{image-description}</div><br />
{template gallery-footer}
new("templates/BitOwl/gallery-image-list.html")
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<th style="background-color: #A00000;color: #FFFFFF" colspan="4">{album-name}</th>
	</tr>
	<tr>
		<td width="25%" align="center">
			{if-exists {image-file 0}, <a href="{image-link 0}"><img src="{image-file 0}" width="{image-width 0}" height="{image-height 0}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 1}, <a href="{image-link 1}"><img src="{image-file 1}" width="{image-width 1}" height="{image-height 1}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 2}, <a href="{image-link 2}"><img src="{image-file 2}" width="{image-width 2}" height="{image-height 2}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 3}, <a href="{image-link 3}"><img src="{image-file 3}" width="{image-width 3}" height="{image-height 3}" /></a> /}
		</td>
	</tr>
	<tr>
		<td width="25%" align="center">
			{if-exists {image-file 4}, <a href="{image-link 4}"><img src="{image-file 4}" width="{image-width 4}" height="{image-height 4}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 5}, <a href="{image-link 5}"><img src="{image-file 5}" width="{image-width 5}" height="{image-height 5}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 6}, <a href="{image-link 6}"><img src="{image-file 6}" width="{image-width 6}" height="{image-height 6}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 7}, <a href="{image-link 7}"><img src="{image-file 7}" width="{image-width 7}" height="{image-height 7}" /></a> /}
		</td>
	</tr>
	<tr>
		<td width="25%" align="center">
			{if-exists {image-file 8}, <a href="{image-link 8}"><img src="{image-file 8}" width="{image-width 8}" height="{image-height 8}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 9}, <a href="{image-link 9}"><img src="{image-file 9}" width="{image-width 9}" height="{image-height 9}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 10}, <a href="{image-link 10}"><img src="{image-file 10}" width="{image-width 10}" height="{image-height 10}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 11}, <a href="{image-link 11}"><img src="{image-file 11}" width="{image-width 11}" height="{image-height 11}" /></a> /}
		</td>
	</tr>
	<tr>
		<td width="25%" align="center">
			{if-exists {image-file 12}, <a href="{image-link 12}"><img src="{image-file 12}" width="{image-width 12}" height="{image-height 12}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 13}, <a href="{image-link 13}"><img src="{image-file 13}" width="{image-width 13}" height="{image-height 13}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 14}, <a href="{image-link 14}"><img src="{image-file 14}" width="{image-width 14}" height="{image-height 14}" /></a> /}
		</td>
		<td width="25%" align="center">
			{if-exists {image-file 15}, <a href="{image-link 15}"><img src="{image-file 15}" width="{image-width 15}" height="{image-height 15}" /></a> /}
		</td>
	</tr>
</table>
new("templates/BitOwl/gallery-index.html")
{root <font size="5" color="#FF0000">{gallery-name}</font><br />{gallery-description}<br /> /}
{template gallery-navbar-album}
{album-trace}<br />
{list-albums}
{album {list-images} /}
{template gallery-footer}
new("templates/BitOwl/gallery-navbar-album.html")
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td style="background-color: #A00000;color: #FFFFFF;font-size: small">
			{album-statistics}
		</td>
	</tr>
	<tr>
		<td style="background-color: #EEEEEE" align="center">{pages}</td>
	</tr>
</table><br>
new("templates/BitOwl/gallery-navbar-image.html")
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td style="background-color: #A00000;color: #FFFFFF;font-size: small" colspan="2">
			<div align="center"><b>{album-name}</b></div>
		</td>
	</tr>
	<tr>
		<td width="50%" style="background-color: #EEEEEE">{previous-exists <a href="{previous-link}">&lt;</a> /}</td><td width="50%" align="right" style="background-color: #EEEEEE">{next-exists <a href="{next-link}">&gt;</a> /}</td>
	</tr>
</table>
new("templates/BitOwl/news-item.html")
<table border="0" cellspacing="0" cellpadding="0" width="99%" style="border: #000000 1px solid" align="center">
	<tr>
		<th style="background-color: #E3DFC9;color: #000000">{date} - {title} Written by: {author}</th>
	</tr>
	<tr>
		<td style="background-color: #EAEAEA;color: #000000">{message}</td>
	</tr>
	<tr>
		<td style="background-color: #EAEAEA;color: #000000">Filed in: {category-list}</td>
	</tr>
</table>
<br />
new("templates/BitOwl/poll-option.html")
<input {poll-option} /> {poll-option-name} {special <input {poll-special} size="8" /> /}<br />
new("templates/BitOwl/poll-option-result.html")
{poll-option-name}<br />
<img src="{template-directory}/poll_left.gif" width="4" height="16" alt="[" /><img src="{template-directory}/poll_center.gif" width="{poll-option-percent}" height="16" alt="|" /><img src="{template-directory}/poll_right.gif" width="4" height="16" alt="]" /> {poll-option-percent}%<br />
new("templates/BitOwl/poll-result.html")
<b>{poll-question}</b><br />
{poll-options-result}
new("templates/BitOwl/poll-vote.html")
<b>{poll-question}</b><br />
{poll-options}<br />
<input {poll-submit} /><br />
<a href="{results-link}">Show Results</a>
open("config.php")
Find:
$_bitowl["version"] = "0.1.0 A1";
Replace:
$_bitowl["version"] = "0.2.0 A2";
Add:
<?php
$_bitowl["master"]["template"] = "BitOwl";
?>