File size: 4.02Kb
<?
if ($nsauth == ok) {
include("configure.php");
$table_name = "ns_staff";
$connection = @mysql_connect("$db_server", "$db_name", "$db_password") or die("Couldn't connect.");
$db = @mysql_select_db($db_database, $connection) or die("Couldn't select database.");
$sql = "SELECT username, password, email, delall, delown, addmembers, delmembers, modifydisplay
FROM $table_name
WHERE username = \"$nsun\" and password = password(\"$nspw\")
";
$result = @mysql_query($sql, $connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
$username = $row['username'];
$email = $row['email'];
$delall = $row['delall'];
$delown = $row['delown'];
$addmembers = $row['addmembers'];
$delmembers = $row['delmembers'];
$modifydisplay = $row['modifydisplay'];
}
$sql2 = "SELECT bsize, bcolor, titlebgcolor, titletextcolor, msgbgcolor, msgtextcolor, newswidth, titletextsize, msgtextsize
FROM ns_display
";
$result2 = @mysql_query($sql2, $connection) or die("Couldn't execute query.");
while ($row2 = mysql_fetch_array($result2)) {
$bsize = $row2['bsize'];
$bcolor = $row2['bcolor'];
$titlebgcolor = $row2['titlebgcolor'];
$titletextcolor = $row2['titletextcolor'];
$msgbgcolor = $row2['msgbgcolor'];
$msgtextcolor = $row2['msgtextcolor'];
$newswidth = $row2['newswidth'];
$titletextsize = $row2['titletextsize'];
$msgtextsize = $row2['msgtextsize'];
}
if ($delall == yes) {
$showdel = "<br><a href=\"delnewsall_1.php\">Delete/Edit a news item posted by one of the other staff members.</a>";
}
if ($delown == yes) {
$showdel2 = "<br><a href=\"delnewsown_1.php\">Delete/Edit a news item posted by you.</a>";
}
if ($addmembers == yes) {
$showaddmembers = "<a href=\"addstaff_1.php\">Add a staff member.</a>";
}
if ($delmembers == yes) {
$showdelmembers = "<br><a href=\"delstaff_1.php\">Delete/Modify a staff member.</a>";
}
if ($modifydisplay == yes) {
$display = "<a href=\"modifydisplay_1.php\">Modify News Display</a> <br> <a href=\"modifyheadlines.php?view=modify\">Modify Headlines Display</a>";
}
$display_block = "
<font size=4>
<p>
Welcome back <i>$username</i>!
</p>
<p>
<table border=\"$bsize\" bordercolor=\"$bcolor\" cellpadding=0 cellspacing=0 style=\"border-collapse: collapse\" width=$newswidth>
<tr bgcolor=\"$titlebgcolor\">
<td>
<font color=\"$titletextcolor\" size=$titletextsize>News</font>
</td>
</tr>
<tr bgcolor=\"$msgbgcolor\">
<td>
<font color=\"$msgtextcolor\" size=$msgtextsize>
<a href=\"postnews_1.php\">Post news.</a>
$showdel
$showdel2
</font>
</td>
</tr>
<tr height=5 bgcolor=\"$titlebgcolor\">
<td>
</td>
</tr>
</table>
</p>
<p>
<table border=\"$bsize\" bordercolor=\"$bcolor\" style=\"border-collapse: collapse\" width=$newswidth>
<tr bgcolor=\"$titlebgcolor\">
<td>
<font color=\"$titletextcolor\" size=$titletextsize>Staff</font>
</td>
</tr>
<tr bgcolor=\"$msgbgcolor\">
<td>
<font color=\"$msgtextcolor\" size=$msgtextsize>
$showaddmembers
$showdelmembers
</font>
</td>
</tr>
<tr height=5 bgcolor=\"$titlebgcolor\">
<td>
</td>
</tr>
</table>
</p>
<p>
<table border=\"$bsize\" bordercolor=\"$bcolor\" style=\"border-collapse: collapse\" width=$newswidth>
<tr bgcolor=\"$titlebgcolor\">
<td>
<font color=\"$titletextcolor\" size=$titletextsize>Configure</font>
</td>
</tr>
<tr bgcolor=\"$msgbgcolor\">
<td>
<font color=\"$msgtextcolor\" size=$msgtextsize>
$display
<br>
</font>
</td>
</tr>
<tr height=5 bgcolor=\"$titlebgcolor\">
<td>
</td>
</tr>
</table>
</p>
</font>
";
} else {
header("location: login_admin.php");
}
?>
<body bgcolor=#D1E7FE>
<title>Admin / Logged In</title>
<? echo $display_block; ?>
<p>
<a href="http://www.hammer-time.net/files/download.php?dl=ns"><img border=0 src=http://www.hammer-time.net/images/button.jpg></a>
</p>