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

if ($action =="go")
{
    $query = "UPDATE $admintable SET strAllowGalleryUpload = '$Allowgalleryupload', strGalleryRate = '$Galleryrate', strMaxImageWidth = '$Maximagewidth', strUseMainForThumb = '$Usemainforthumb', strThumbsPerRow = '$Thumbsperrow', strGalleryComments = '$Gallerycomments', strAllowGalleryCommentFormatting = '$Allowgallerycommentformatting'";
    mysql_query( $query, $link ) or die ( "Error! : ".mysql_error() );
}

include ("../inc/inc_common.php");
include ("../inc/inc_admincheck.php");
include ("../inc/inc_getdate.php");
include ("../inc/inc_forumname.php");
$page = "Admin - Customise Galleries";
$pagelink = $file;
include("../inc/inc_setonline.php");
$title = "$name1 Admin - $gfcookie[1] - Customise Galleries";
include ("../inc/inc_head.php");
include ("../inc/inc_body.php");
$title = "Customise Galleries";
include ("../inc/inc_title.php");

if ($allowgalleryupload == 1)
{
    $Allowgalleryuploadch = "Checked";
}
if ($galleryrate == 1)
{
    $Galleryratech = "Checked";
}
if ($usemainforthumb == 1)
{
    $Usemainforthumbch = "Checked";
}
if ($gallerycomments == 1)
{
    $gallerycommentsch = "Checked";
}
if ($allowgallerycommentformatting == 1)
{
    $allowgallerycommentformattingch = "Checked";
}

$result=mysql_query("SELECT * FROM $admintable LIMIT 0, 1");
$num_rows = mysql_num_rows( $result );
while ( $a_row = mysql_fetch_object( $result ) )
{
    print "<table border=1 cellpadding=5 cellspacing=0 style=\"border-collapse: collapse\" bordercolor=\"$bordercolor\" style=\"font-family: $font; font-size: $fontpoint\" bgcolor=\"$fgcolour\"><tr><td width=\"100%\" align=\"center\">

    <form method=\"post\" action=\"admin_cus_gallery.php?action=go\"><br>

    <table border=0 cellpadding=3 cellspacing=0 width=100% style=\"font-family: $font; font-size: $fontpoint\">

    <tr><td align=\"center\">
    Allow Users To Upload Pictures To Your Server</td><td align=\"center\"><input type=\"checkbox\" $Allowgalleryuploadch name=\"Allowgalleryupload\" value=\"1\"></td></tr>

    <tr><td align=\"center\">
    Use Main Image For Thumbnail If None Is Provided</td><td align=\"center\"><input type=\"checkbox\" $Usemainforthumbch name=\"Usemainforthumb\" value=\"1\"></td></tr>

    <tr><td align=\"center\">
    Allow Image Comments</td><td align=\"center\"><input type=\"checkbox\" $gallerycommentsch name=\"Gallerycomments\" value=\"1\"></td></tr>

    <tr><td align=\"center\">
    Do Full Text Formatting On Picture Comments</td><td align=\"center\"><input type=\"checkbox\" $allowgallerycommentformattingch name=\"Allowgallerycommentformatting\" value=\"1\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Maximum Image Width</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Maximagewidth\" value=\"$a_row->strMaxImageWidth\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td width=\"50%\" align=\"center\">
    Thumnails Per Row</td><td align=\"center\"><input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"Thumbsperrow\" value=\"$a_row->strThumbsPerRow\" style=\"color: #FFFFFF; background-image: url('../images/textbox_background_red.gif')\"></td></tr>

    <tr><td align=\"center\">
    Allow Rating Of Gallery Images</td><td align=\"center\"><input type=\"checkbox\" $Galleryratech name=\"Galleryrate\" value=\"1\"></td></tr>


    </table><br><br><input type=\"submit\" value=\"Set This Value\"></form></td></tr></table><br><br><a href=\"admin_customise.php\"><font size=2>Back to the Main Customise Page</a>";

}

include ("../inc/inc_footer.php");