<?
$page = "comments.php";
include "manager_header.php";

// CHECK IF COMMENTS ARE DISABLED BY ADMIN
if($owner_group_info[allow_comments] != "1") { exit(); }

if(isset($_POST['task'])) { $task = $_POST['task']; } else { $task = "main"; }
if($user_status == "member") { exit(); }
$result = "";


if($task == "dosave") {
$show_comments = $_POST['show_comments'];
$who_comments = $_POST['who_comments'];
$default_comments = $_POST['default_comments'];
$notify_comments = $_POST['notify_comments'];
$logip_comments = $_POST['logip_comments'];
$manage_comments = $_POST['manage_comments'];

mysql_query("UPDATE bhost_weblogs SET show_comments='$show_comments', who_comments='$who_comments', default_comments='$default_comments', notify_comments='$notify_comments', logip_comments='$logip_comments', manage_comments='$manage_comments' WHERE w_id='$weblog_info[w_id]'");
$weblog_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_weblogs WHERE w_id='$weblog_info[w_id]'"));
$task = "main";
$result = "<img src='../images/saved_icon.gif' border='0' class='success'> <font class='success'>$comments2</font><br><br>";

}





if($task == "main") {
echo $head;
echo "
<h2>$comments1</h2>
$comments4
<br><br>
$result
<table cellpadding='0' cellspacing='0' class='form'>
<form action='comments.php' method='POST'>

<tr>
<td class='form1' valign='top'>$comments5</td>
<td class='form2'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='show_comments' value='3'"; if($weblog_info[show_comments] == "3") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments6</td></tr>
 <tr><td><input type='radio' name='show_comments' value='2'"; if($weblog_info[show_comments] == "2") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments7</td></tr>
 "; if($owner_group_info[allow_friends] == "1") { echo "<tr><td><input type='radio' name='show_comments' value='1'"; if($weblog_info[show_comments] == "1") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments8</td></tr>"; } echo "
 <tr><td><input type='radio' name='show_comments' value='0'"; if($weblog_info[show_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments9</td></tr>
 </td></tr></table>
</td>
</tr>

<tr>
<td class='form1' valign='top'>$comments10</td>
<td class='form2'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='who_comments' value='3'"; if($weblog_info[who_comments] == "3") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments11</td></tr>
 <tr><td><input type='radio' name='who_comments' value='2'"; if($weblog_info[who_comments] == "2") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments12</td></tr>
 "; if($owner_group_info[allow_friends] == "1") { echo "<tr><td><input type='radio' name='who_comments' value='1'"; if($weblog_info[who_comments] == "1") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments13</td></tr>"; } echo "
 <tr><td><input type='radio' name='who_comments' value='0'"; if($weblog_info[who_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments14</td></tr>
 </td></tr></table>
</td>
</tr>

<tr>
<td class='form1' valign='top'>$comments15</td>
<td class='form2'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='default_comments' value='1'"; if($weblog_info[default_comments] == "1") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments16</td></tr>
 <tr><td><input type='radio' name='default_comments' value='0'"; if($weblog_info[default_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments17</td></tr>
 </td></tr></table>
</td>
</tr>

<tr>
<td class='form1' valign='top'>$comments18</td>
<td class='form2'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td valign='top'><input type='radio' name='notify_comments' value='1'"; if($weblog_info[notify_comments] == "1") { echo " CHECKED"; } echo "></td><td valign='top' style='padding-top: 3px;'>&nbsp;$comments19</td></tr>
 <tr><td><input type='radio' name='notify_comments' value='0'"; if($weblog_info[notify_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments20</td></tr>
 </td></tr></table>
</td>
</tr>

<tr>
<td class='form1' valign='top'>$comments21</td>
<td class='form2'>
 <table cellpadding='0' cellspacing='0'>
 <tr><td valign='top'><input type='radio' name='logip_comments' value='1'"; if($weblog_info[logip_comments] == "1") { echo " CHECKED"; } echo "></td><td valign='top' style='padding-top: 3px;'>&nbsp;$comments22</td></tr>
 <tr><td><input type='radio' name='logip_comments' value='0'"; if($weblog_info[logip_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments23</td></tr>
 </td></tr></table>
</td>
</tr>

<tr>
<td class='form1' valign='top'>$comments24</td>
<td class='form2'>
 <table  cellpadding='0' cellspacing='0'>
 <tr><td><input type='radio' name='manage_comments' value='3'"; if($weblog_info[manage_comments] == "3") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments25</td></tr>
 <tr><td><input type='radio' name='manage_comments' value='2'"; if($weblog_info[manage_comments] == "2") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments26</td></tr>
 <tr><td><input type='radio' name='manage_comments' value='1'"; if($weblog_info[manage_comments] == "1") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments27</td></tr>
 <tr><td><input type='radio' name='manage_comments' value='0'"; if($weblog_info[manage_comments] == "0") { echo " CHECKED"; } echo "></td><td>&nbsp;$comments28</td></tr>
 </td></tr></table>
</td>
</tr>
</table>

<br>

<input type='submit' class='button' value='$comments29'>
<input type='hidden' name='task' value='dosave'>
</form>
";
echo $foot;
}
?>