<?php
$admin = 2;
$file = __FILE__;
include ("../inc/inc_common.php");
include ("../inc/inc_connect.php");
include ("../inc/inc_admincheck.php");

if ($action == "go")
{

    $query = "UPDATE $grouptable SET intGallery = '0', intAllowVote = '0', intAllowRate = '0', intHbhForum = '0', intOpenForum = '0', intAllowCalendar = '0' WHERE intId = '$id'";
    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );

    if ($gallery == 1)
    {
        $vote = 0;
        $rate = 0;
        $hbh = 0;
        $open = 0;
        $calendar = 0;

        $query = "UPDATE $grouptable SET intGallery = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );

    }

    if ($open == 1)
    {
        $hbh = 0;
        $query = "UPDATE $grouptable SET intOpenForum = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
    }

    if ($vote == 1)
    {
        $query = "UPDATE $grouptable SET intAllowVote = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
    }

    if ($rate == 1)
    {
        $query = "UPDATE $grouptable SET intAllowRate = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
    }

    if ($hbh == 1)
    {
        $query = "UPDATE $grouptable SET intHbhForum = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
    }

    if ($calendar == 1)
    {
        $query = "UPDATE $grouptable SET intAllowCalendar = '1' WHERE intId = '$id'";
        mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
    }

}


$result = mysql_query( "SELECT * FROM $grouptable WHERE intId = '$id'" );
$num_rows = mysql_num_rows( $result );
//Dispay records
while ( $a_row = mysql_fetch_object( $result ) )
{
    $name = $a_row->strName;
    $vote = $a_row->intAllowVote;
    $rate = $a_row->intAllowRate;
    $hbh = $a_row->intHbhForum;
    $open = $a_row->intOpenForum;
    $gallery = $a_row->intGallery;
    $calendar = $a_row->intAllowCalendar;
}

include ("../inc/inc_getdate.php");
include ("../inc/inc_forumname.php");
$page = "Admin - Set Up $name";
$pagelink = $file;
include("../inc/inc_setonline.php");
$title = "$name1 Admin - $gfcookie[1] - Set Up \"$name\"";
include ("../inc/inc_head.php");
include ("../inc/inc_body.php");
$title = "Set Up \"$name\"";
include ("../inc/inc_title.php");

if ($vote == 1)
{
    $votech = "checked";
}
if ($rate == 1)
{
    $ratech = "checked";
}
if ($hbh == 1)
{
    $hbhch = "checked";
}
if ($open == 1)
{
    $opench = "checked";
}
if ($gallery == 1)
{
    $gallerych = "checked";
}

if ($calendar == 1)
{
    $calendarch = "checked";
}

print "<table border=1 cellpadding=3 cellspacing=0 style=\"border-collapse: collapse\" bordercolor=\"$bordercolor\" width=80% style=\"font-family: $font; font-size: $fontpoint\" bgcolor=\"$fgcolour\">
<tr><td width=100%><font size=2 face=\"$font\"><center>Current Settings<br><br>
<form method=\"post\" action=\"admin_forumsettings.php?action=go\">
<input type=\"hidden\" value=\"$id\" name=\"id\">
<table border=0 cellpadding=0 cellspacing=2 width=\"30%\" style=\"font-family: $font; font-size: $fontpoint\">
<tr><td>Allow Voting</td><td><input type=\"checkbox\" $votech name=\"vote\" value=\"1\"></td><td><a href=\"#help1\">Help</td></tr>
<tr><td>Allow Rating</td><td><input type=\"checkbox\" $ratech name=\"rate\" value=\"1\"></td><td><a href=\"#help2\">Help</td></tr>
<tr><td>Allow Calendars</td><td><input type=\"checkbox\" $calendarch name=\"calendar\" value=\"1\"></td><td><a href=\"#help6\">Help</td></tr>
<tr><td>HBH Forum</td><td><input type=\"checkbox\" $hbhch name=\"hbh\" value=\"1\"></td><td><a href=\"#help3\">Help</td></tr>
<tr><td>Open Forum</td><td><input type=\"checkbox\" $opench name=\"open\" value=\"1\"></td><td><a href=\"#help4\">Help</td></tr>
<tr><td>Gallery</td><td><input type=\"checkbox\" $gallerych name=\"gallery\" value=\"1\"></td><td><a href=\"#help5\">Help</td></tr></table><br>
<input type=\"submit\" value=\"Make Changes\"><br><br><a href=\"admin_setforums.php\">Go back to forum setup</a><br><br></form></td></tr></table>
<br><br>
<a name=\"help1\"><font size=2>
<b>Allow Voting</b><br>
Switch this option on if you want users to be able to include a vote in their new topic.<br>
A vote is a list of up to 10 options which logged-in members can choose from.
<br><br><br>
<a name=\"help2\">
<b>Allow Rating</b><br>
Switch this option on if you want users to be able to set a ratable topic.<br>
Typically, the topic author will include a picture, story, or something, and logged-in members can say if the like or dislike it, like a simple mini-vote.
<br><br><br>
<a name=\"help3\">
<b>HBH Forum</b><br>
A H.B.H. Forum is a form of open forum. Whoever starts a topic can then edit everybodies posts <i>within that topic</i>.<br>
A forum cannot be a H.B.H. forum and an open forum, for obvious reasons.
<br><br><br>
<a name=\"help4\">
<b>Open Forum</b><br>
In an open forum, anybody can edit anybody elses posts.<br>
A forum cannot be a H.B.H. forum and an open forum, for obvious reasons.
<br><br><br>
<a name=\"help5\">
<b>Gallery</b><br>
A gallery is a completly different type of forum. Users post pictures rather than words.<br>
If a forum is set to be a gallery then none of the other options will have any effect.
<br><br><br>
<a name=\"help6\">
<b>Allow Calendars</b><br>
When someone creates a calendar, they can choose which forum to automatically enter details in. Only forums that you have chosen to Allow Calendars in can be chosen from.

<br>
<br><br><center>
<font face=arial size=1>";
print "Powered by Grimforum V5.0<br>
&copy;2003
<a target= \"_blank\" href=\"http://www.hsmx.com/info\">HSMX</a> web design. All Rights Reserved. See the
<a target= \"_blank\" href=\"http://www.hsmx.com/gfinfo\">details</a>.<br><br>";


if ($cAdminLevel > 0)
{
    $pagelink = str_replace("\\\\", "\\", $pagelink);
    $last_modified = filemtime("$file");
    print("<a title=\"$pagelink\"><font color=\"RED\">Page</font></a> last modified ");
    print(date("j/m/y h:i", $last_modified));
    print ", ";
    $mtime = microtime();
    $mtime = explode(" ",$mtime);
    $mtime = $mtime[1] + $mtime[0];
    $tend = $mtime;
    $totaltime = ($tend - $tstart);
    printf ("generated in %f seconds.", $totaltime);
}

print "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";

print "</body>
</html>";
if ($useob == 1)
{
    ob_end_flush();
}
?>