Code: Select all
<?php
if(isset($_POST["n_submit"]))
{
?>
<TABLE class="FORMAT" width="80%">
<tr><TD class="lhead" width="100%" colspan="2"><a class=white><center>
Welcome Administrator/Moderator
</td></tr></center></a>
<tr><TD class=light ><center>
<a class=hsblue>Title : </a><input type="text" name="news_h" size="40" maxlength="40"
value="<?php if ($nrow[2]!=NULL){echo $nrow['2'];}?>"/><br></a>
</td></tr>
<tr><TD class=light ><center><textarea name="news_b" rows="4" cols="40" wrap><?php if (isset($_POST['news_b'])){echo $_POST['news_b'];} ?></textarea></center>
<br><center><input type="submit" name="n_submit" value="Update"/></center>
</td></tr></TABLE></center>
<?php
}else{
if ($dbc = @mysql_connect($dbhost, $dbuser, $dbpass))
{//make the connection
if (!mysql_select_db($dbname))
{//handle error
my_error_handler (mysql_errno(), 'Could not select the database:' . mysql_error());
echo '<font color="red">The site is currenty experiencing technical difficulties. We apologize for any inconvenience.</font>';
include_once ("$path_include . menu.php");
exit();
}
}else{
my_error_handler (mysql_errno(), 'Could not select the database:' . mysql_error());
echo '<font color="red">The site is currenty experiencing technical difficulties. We apologize for any inconvenience.</font>';
include_once ("$path_include . menu.php");
exit();
}
echo '<TABLE class="FORMAT" width="100%"><tr><TD class="head" width="100%"><a class=large_white><center><b>FORUM NEWS</b></center></td></tr>';
include_once ("mysql_connect.php");
if($news_result){
while($nrow=mysql_fetch_array($news_result, MYSQL_NUM)){
//display head
$poster_identifier=$nrow['4'];
$npic_query = "SELECT * FROM forum_users WHERE uid=$poster_identifier";
$npic_result = mysql_query($npic_query);
$npic_row = mysql_fetch_row($npic_result);
echo '<TABLE class="white" border=0 width="600"><tr><TD class="light" width="600" colspan=2 border="0"><a class=hgrey><center>' . '<b>'."$nrow[2]".'</a></b>' .
'</center></a></TD></tr><tr><td><table><tr><td class="light_blue" width="100"><img src='."$path_avatar"."$npic_row[13]".' width="100%" height="100%"></td></tr><tr><td><a class="sgrey">Posted by:</a><tr><td><center><a class="grey">'.' '."$npic_row[4]".'</a></center></td></tr></td></tr></table></td><TD valign="top" width="500" border="10" class="light_blue" cellpadding="5">'.'<a class="hsgrey">'.'<br>'."$nrow[3]".'</a></td></td><tr><td class="light_blue" width="600" colspan="2"><a class=hssgrey>'."$nrow[1]".'</a>'.
'</td></tr>';
$_SESSION['head'] = $nrow[2];
if($user_type==1){
?>
<tr><td>
<form action="<?php
echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="submit" name="n_submit" value="Edit"/>
</td></tr>
<?php
}
echo '</TABLE><br><br>';
}
}
echo '</table>';
}
?>