View file chat spall script/user/preview.htm

File size: 2.58Kb
<?php
include("../wap/config.php");
include("../wap/core.php");
include("outfn.php");
connectdb();
$mime="text/html";
$charset = "utf-8";
$sid = $_GET["sid"];
$bgcl = $_POST["bgcl"];
$thnm = $_POST["thnm"];
$txcl = $_POST["txcl"];
$lncl = $_POST["lncl"];
$hdcl = $_POST["hdcl"];
$htcl = $_POST["htcl"];
header("content-type:$mime;charset=$charset");
echo("<?xml version=\"1.0\"?>\n");
	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
	$uid = getuid_sid($sid);
	$pstyle = gettheme($uid);
	$ret = '<html xmlns="http://www.w3.org/1999/xhtml">';
	$ret .= "\n<head>\n<title>Afta-Dark</title>\n";
	$ret .= '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />';
	$ret .= "<style type=\"text/css\">\n";
	$ret .= "body {background-color:#$bgcl; color:#$txcl}\n";
	$ret .= "h3 {background-color:#$hdcl; color:#$htcl}\n";
	$ret .= "a:link {color:#$lncl}\n";
	$ret .= "a:visited {color:#$lncl}\n";
	$ret .= "</style>";
	$ret .= "\n</head>\n<body>";
	echo $ret;
	echo "<h3 align=\"center\">Preview</h3>\n";
	
		echo "<p>";
		if(!isadmin($uid))
		{
			echo "You can't view this page";
		}else{
		addonline ($uid, "Admin CP","");
			if(!isset($a))
			{
				?>
				This is a sample text, just a sample preview<br/>
				click <form action="preview.php?a=acpt&amp;sid=<?=$sid?>" method="post">
				<input type="hidden" name="thnm" value="<?=$thnm?>"/>
				<input type="hidden" name="bgcl" value="<?=$bgcl?>"/>
				<input type="hidden" name="txcl" value="<?=$txcl?>"/>
				<input type="hidden" name="lncl" value="<?=$lncl?>"/>
				<input type="hidden" name="hdcl" value="<?=$hdcl?>"/>
				<input type="hidden" name="htcl" value="<?=$htcl?>"/>
				<input type="submit" value="HERE"/>
				</form>

				to accept<br/>
				or <a href="themes.php?sid=<?=$sid?>">HERE</a> to return to previous page.
				<?php
			}else{
			 
				if($a=="acpt")
				{
					echo "<b>$thnm</b><br/>";
					
					$res = mysql_query("INSERT INTO ibwf_themes SET name='".$thnm."', bgc='".$bgcl."', txc='".$txcl."', lnk='".$lncl."', hdc='".$htcl."', hbg='".$hdcl."'");
					if($res)
					{
						echo "Theme saved successfully<br/>";
					}else{
						echo "BUMMER! database error!<br/>";
						echo mysql_error()."<br/>";
					}
					?>
						<a href="themes.php?sid=<?=$sid?>">Add another theme</a>
					<?php
					
				}
			}
		}
		echo "</p>";
		echo "<p align=\"center\">";
		echo "<a href=\"../index.php?action=main&amp;sid=$sid\">HOME</a>";
		echo "</p>";
		echo "\n</body>\n</html>";
?>