phorum\include\header.ppc :: ppC++ web compiler
   <?
string pwd= ppc.read_file("dat/pwd.cgi");
if(pwd==""){
	?><script language=JavaScript>
		location.replace('setup.ppc');
		alert('setup the phorum!');  
	</script><?;exit(0);
}
bool isadmin=false, t1;
string pHTMLt(string in){
	string ret="";
	for(int i=0;i<in.length();++i){
		if(in[i]=='<')ret += "<";
		else ret += in[i];
	}
	return ret;
}
// logging administrator in:
if(cookie.ppcphorumpwd==pwd)isadmin=true;
if(!isadmin && ppc.op=="admin"){
	if(ppc.pwd==pwd){cookie.set("ppcphorumpwd="+pwd);
						isadmin=true;}
	else{?><html><body><center>
	   <?if(ppc.pwd!=""){?><span class=slred>WRONG!</span><BR><?}?>
		<form method=post action='<?=ppc.SCRIPT?>?op=admin'> 
		<span class=clred>PASSWORD:</span><br>
		<input type=password name=pwd>
		<br><input type=submit value=OK>
		</form></center></body></html>
	<?exit(0);}					
}
if(ppc.op=="logout"){isadmin=false;
	cookie.set("ppcphorumpwd=");
	?><script>alert('Logged out succesfully!')</script><?
}
?>
<?
string title="Simple ppC++ phorum";
void xredir(string a, string que=""){
?><script language='JavaScript'>
	window.location.replace('<?=ppc.SCRIPT?><?if(que!="")cout << "?"<<que?>');
	alert('<?=a?>');
</script><?
}
void oTable(int width, string border, string bgcolor){?>
	<table border=0 cellpadding=2 cellspacing=2 bgcolor='<?=border?>'
		width='<?=width?>%'>
	<tr><td align=middle valign=middle>
	<table width='100%' border=0 cellpadding=2 cellspacing=2 bgcolor='<?=bgcolor?>'>
	<tr><td>
<?}
void oTablea(int width, string border, string bgcolor){?>
	<table border=0 cellpadding=1 cellspacing=1 bgcolor='<?=border?>'
		width='<?=width?>%'>
	<tr><td align=middle valign=middle>
	<table width='100%' border=0 cellpadding=2 cellspacing=2 bgcolor='<?=bgcolor?>'>
	<tr><td>
<?}
void cTable(){?></td></tr></table></td></tr></table><?}
void oTable1(int w=100){oTable(w,"#aaaacc", "white");}
void oTable2(int w=100){oTable(w,"#aaccaa", "white");}
void oTable3(int w=100){oTable(w,"#aaaabb", "#eeeeff");}
void oTable4(int w=100){oTable(w,"#bbbbcc", "#cccfff");}
void oTable1a(int w=100){oTablea(w,"#eeffff", "white");}
void oTable2a(int w=100){oTablea(w,"#ffffff", "#eeeeee");}
void oTable3a(int w=100){oTablea(w,"#dddddd", "#cccccc");}
void oTable4a(int w=100){oTablea(w,"#efefef", "#eeeeff");}
?>
<html><head>
<style type="text/css">
    <?=ppc.read_file("include/style.css")?>
</style>

<title><?=title?></title>
</head>
<body>
<table border=0 width='100%' cellpadding=0 cellspacing=0>
<tr><td>
   <!--logo:-->
   <?oTable4()?><center>
   <a href='<?=ppc.SCRIPT?>'><h1><?=title?></h1></a></center>
   <?cTable()?>
</td></tr>
<tr><td>
   <!--main menu:-->
   <div align=right><?oTable3()?><div align=right>
	<?if(ppc.op=="fsector" || ppc.op=="ft"){?>
		<a href='<?=ppc.SCRIPT?>?op=ft&sop=new&s=<?=ppc.s?>'><b>new topic</b></a>		
	<?}?>
   &nbsp;&nbsp;&nbsp;
	<?if(!isadmin){?>
		<a href='<?=ppc.SCRIPT?>?op=admin'>admin</a>
	<?}else{?>
		<a href='<?=ppc.SCRIPT?>?op=logout' class=clred>don't forget to log out!</a>
	<?}?>
   &nbsp;&nbsp;&nbsp;
   </div><?cTable()?></div><br>
</td></tr>
<tr><td>
   <!--header end-->   
                       






General Public License
2003 ppC++ team