<?php

/*++++++++++++++++++++++++++++++++++++++++

  Script: Maian Gallery v2.0
  Written by: David Ian Bennett
  E-Mail: support@maianscriptworld.co.uk
  Website: http://www.maianscriptworld.co.uk

  ++++++++++++++++++++++++++++++++++++++++
  
  This File: comments.php
  Description: View Comments

  ++++++++++++++++++++++++++++++++++++++++*/

// Make sure that this file is being called from parent file
if (!defined('INCLUDE_FILES')) {
  accessDenied($msg_script18,$msg_script19);
  exit;
}

$q_comments = mysql_query("SELECT *,DATE_FORMAT(addDate,'".$SETTINGS->mysql_date."') AS cdate
                           FROM ".$database['prefix']."comments 
                           WHERE id = '".(isset($_POST['cid']) ? $_POST['cid'] : $_GET['cid'])."'
                           LIMIT 1") or die(mysql_error());
$COMMENT = mysql_fetch_object($q_comments);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $msg_charset; ?>">
<title><?php echo $msg_manage11; ?></title>
<link href="css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
body {
  margin:0;
  padding:0;
}
</style>
</head>

<body>
<form method="post" action="index.php?cmd=comments">
<input type="hidden" name="edit_comment" value="1">
<input type="hidden" name="cid" value="<?php echo $COMMENT->id; ?>">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
    <td align="left" style="padding:5px;background-color:#1EB5DD;color:#FFFFFF">
    <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
      <td align="left" class="popCell">
      <?php echo str_replace(array('{name}','{date}'),array(cleanData($COMMENT->name),$COMMENT->cdate),$msg_comments13); ?>
      </td>
    </tr>
    <tr>
      <td align="left" style="border-bottom:1px solid #083253;border-right:1px solid #083253;border-left:1px solid #083253;padding:5px;background-color:#1EB5DD">
      <?php echo cleanData(nl2br($COMMENT->comments),COMMENTS_TEXT_WRAP); ?>
      </td>
    </tr>
    </table>
    <div style="margin-top:5px;border:1px solid #FFFFFF;padding:5px;background-color:#0F5B96">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="30%" align="left" style="padding:5px" valign="top">
        <span style="display:block;margin-bottom:4px;font-weight:bold"><b><?php echo $msg_addimg7; ?>:</span>
        <input class="formbox" type="text" name="name" maxlength="25" size="25" value="<?php echo cleanData($COMMENT->name); ?>" style="width:90%"><br><br>
        <span style="display:block;margin-bottom:4px;font-weight:bold"><?php echo $msg_settings4; ?>:</span>
        <input class="formbox" type="text" name="email" maxlength="25" size="25" value="<?php echo $COMMENT->email; ?>" style="width:90%"><br>
        <span style="display:block;margin-bottom:4px;margin-top:15px;font-style:italic;font-weight:bold">IP: <?php echo $COMMENT->ip_address; ?></span>
        </td>
        <td width="70%" align="left" style="padding:5px"><textarea name="comments" rows="8" cols="40" style="width:98%"><?php echo cleanData($COMMENT->comments); ?></textarea></td>
      </tr>
      </table></div>
      <p style="display:block;margin-top:5px;text-align:center"><input type="submit" class="formbutton" value="<?php echo $msg_comments12; ?>" title="<?php echo $msg_comments12; ?>"></p>
    </td>
</tr>
</table>    
</form>
</body>
</html>
