<?
$page = "sitefeed.php";
include "manager_header.php";
if($owner_group_info[allow_rss] != "1") { exit(); }
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }

if($user_status == "member") { exit(); }
$result = "";



if($task == "dosave") {
$rss_on = $_POST['rss_on'];
$rss_entries = $_POST['rss_entries'];
$rss_html = $_POST['rss_html'];

mysql_query("UPDATE bhost_weblogs SET rss_on='$rss_on', rss_entries='$rss_entries', rss_html='$rss_html' 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]'"));
$result = "<img src='../images/saved_icon.gif' border='0' class='success'> <font class='success'>$sitefeed2</font><br><br>";
$task = "main";
}






if($task == "main") {
echo $head;

if($weblog_info[rss_on] == 1) {
$rss_url = url("rss", "$weblog_info[weblog]");
$feedurl = " <font class='url'>( <a href='$rss_url' target='_blank'>$rss_url</a> )</font>";
}

echo "
<h2>$sitefeed1$feedurl</h2>
$sitefeed4

<br><br>
$result
<table cellpadding='0' cellspacing='0' class='form'>
<form action='sitefeed.php' method='POST'>
<tr>
<td class='form1'>$sitefeed5</td>
<td class='form2'>
<select name='rss_on'>
<option value='0'"; if($weblog_info[rss_on] == 0) { echo " SELECTED"; } echo ">$sitefeed6</option>
<option value='1'"; if($weblog_info[rss_on] == 1) { echo " SELECTED"; } echo ">$sitefeed7</option>
</select>
</td>
</tr>
<tr>
<td class='form1'>$sitefeed8</td>
<td class='form2'>
<select name='rss_entries'>
<option"; if($weblog_info[rss_entries] == 1) { echo " SELECTED"; } echo ">1</option>
<option"; if($weblog_info[rss_entries] == 2) { echo " SELECTED"; } echo ">2</option>
<option"; if($weblog_info[rss_entries] == 3) { echo " SELECTED"; } echo ">3</option>
<option"; if($weblog_info[rss_entries] == 4) { echo " SELECTED"; } echo ">4</option>
<option"; if($weblog_info[rss_entries] == 5) { echo " SELECTED"; } echo ">5</option>
<option"; if($weblog_info[rss_entries] == 10) { echo " SELECTED"; } echo ">10</option>
<option"; if($weblog_info[rss_entries] == 20) { echo " SELECTED"; } echo ">20</option>
</select>
</td>
</tr>
<tr>
<td class='form1'>$sitefeed9</td>
<td class='form2'>
<select name='rss_html'>
<option value='1'"; if($weblog_info[rss_html] == "1") { echo " SELECTED"; } echo ">$sitefeed10</option>
<option value='0'"; if($weblog_info[rss_html] == "0") { echo " SELECTED"; } echo ">$sitefeed11</option>
</select>
</td>
</tr>
</table>

<br>

<input type='submit' class='button' value='$sitefeed12'>
<input type='hidden' name='task' value='dosave'>
</form>

";
echo $foot;
exit();
}

?>