if($_SERVER['PHP_SELF'] == "/index.php" || $_SERVER['PHP_SELF'] == "/forum/portal.php")
{
$data = "<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">\n<tr>\n<td class=\"thead\"><strong>Quick Theme</strong></td>\n</tr>\n<tr>\n<td class=\"trow1\" align=\"center\">\n";
$data .= "<form method=\"post\" action=\"{$mybb->settings['homeurl']}/index.php?action=quicktheme\">\n";
$data .= "<input type=\"hidden\" name=\"uid\" value=\"{$mybb->user['uid']}\" />\n";
$data .= "<div style=\"margin:{$theme['tablespace']}px;\">\n{$theme_select}\n</div>\n";
$data .= "<input type=\"submit\" value=\"Change Theme\" />\n";
$data .= "</form>\n";
$data .= "</td>\n</tr>\n</table>\n<br />\n";
preg_match('#'.preg_quote('<!-- end: portal_latestthreads -->').'#i', $page, $matches);
if($matches[0])
{
$page = str_replace($matches[0], "<!-- end: portal_latestthreads -->\n".$data."", $page);
}
}
else
{
$data = "<form method=\"post\" action=\"{$mybb->settings['homeurl']}/index.php?action=quicktheme\">\n";
$data .= "<span class=\"trow2\" style=\"float: right; border: 1px solid #000000; padding: 1px;\">\n";
$data .= "<input type=\"hidden\" name=\"uid\" value=\"{$mybb->user['uid']}\" />\n";
$data .= "<span class=\"smalltext\"><strong> Quick Theme:</strong> {$theme_select}</span>\n";
$data .= "<input type=\"submit\" value=\"Change Theme\" />\n";
$data .= "</span>\n";
$data .= "</form>\n<br />\n";
preg_match('#'.preg_quote('<!-- start: footer -->').'#i', $page, $matches);
if($matches[0])
{
$page = str_replace($matches[0], "<br />".$data."\n<!-- start: footer -->", $page);
}
}