<?PHP
ob_start();
session_start();
include("../includes/globals.php.inc");
include("../includes/functions.php");
include("../lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("../lang/".$sxSetup['Language'].".php");
include("../themes/$THEME_FOLDER/config.php.inc");
if((!userEditor())AND(!userAdmin())) loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsCommentsManager'])) loginError($sxLang['LoginRequired']);
if(!$entryid)
{
header("Location: comments_manager.php");
die();
}
else
$entryid = intval($entryid);
if($Submit)
{
$query = "UPDATE $DB_Comments SET name='".$name."', email='".$email."', comments='".$comments."' WHERE id='$entryid'";
$result = mysql_query($query, $Link) or queryError("10", mysql_error());
header("Location: comments_manager.php?message=".urlencode($sxLang['MessageCommentEdited']));
die();
}
$query = "SELECT * FROM $DB_Comments WHERE id='$entryid'";
$result = mysql_query($query, $Link) or queryError("10", mysql_error());
$sxComment = mysql_fetch_object($result);
$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<div class="bodyWrapper">
<h1 class="sxAdminHeading"><?PHP echo $sxLang['CommentsHeadingEdit']; ?></h1>
<div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <a href="comments_manager.php"><?PHP echo $sxLang['CommentsManageHeading']; ?></a> > <?PHP echo $sxLang['CommentsHeadingEdit']; ?></div>
<?PHP echoMessage($message); ?>
<form name="sxFormCommentsAdd" method="post" action="<?PHP echo $PHP_SELF; ?>?entryid=<?PHP echo $entryid; ?>">
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="sxTdItem"><?PHP echo $sxLang['GeneralItemName']; ?>:</td>
<td><input name="name" type="text" id="name" maxlength="80"<?PHP echo ' value="' . $sxComment->name . '"'; ?> /></td>
</tr>
<tr>
<td class="sxTdItem"><?PHP echo $sxLang['GeneralItemEmail']; ?>:</td>
<td><input name="email" type="text" id="email" maxlength="80"<?PHP echo ' value="' . $sxComment->email . '"'; ?> /></td>
</tr>
<tr>
<td class="sxTdItem"><?PHP echo $sxLang['CommentsItemComments']; ?>:</td>
<td><textarea name="comments" id="comments" style="width:300px;height:200px;"><?PHP echo $sxComment->comments; ?></textarea></td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="Submit" value="<?PHP echo $sxLang['CommentsButtonEdit']; ?>" class="sxButton" /></td>
</tr>
</table>
</form>
</div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>