<?php
$file = __FILE__;
include ("inc/inc_common.php");
include ("inc/inc_connect.php");
include ("inc/inc_admincheck.php");
include ("inc/inc_getdate.php");
include ("inc/inc_forumname.php");
$page = "New Topic in Group $name3";
$pagelink = $file."?groupid=".$groupid;
include("inc/inc_setonline.php");
$title = "$name3 - New Topic";
include ("inc/inc_head.php");
include ("inc/inc_body.php");
$title = "New Topic";
include ("inc/inc_title.php");

print "</centeR><table border=0 width=\"100%\" cellpadding=1 cellspacing=0><tr><td  width=\"20%\">
<table border=0 cellpadding=1 cellspacing=0><tr><td>
<font face=\"$font\" size=$fontsize><image src=\"images/folder_icon.gif\">&nbsp;<a href=\"index.php\">$name1&nbsp;Home</a>
</td></tr>
<tr><td><image src=\"images/folder_line.gif\">
<font face=\"$font\" size=$fontsize><image src=\"images/folder_icon.gif\">&nbsp;<a href=\"forums.php\">$name2</a></td></tr>
<tr><td><font face=\"$font\" size=$fontsize>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<image src=\"images/folder_line.gif\">
<image src=\"images/folder_icon.gif\">&nbsp;<a href=\"topics.php?groupid=$groupid\">$name3</a></td></tr>
</table>
</td><td><center>";

include ("inc/inc_navigation.php");
include ("inc/inc_newmailsdisplay.php");
print "</td></tr></table><br><center>";


//end of include files...

print "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"60%\" id=\"AutoNumber15\" bgcolor=\"$fgcolour\"><tr><td width=\"100%\">
<p align=\"center\"><br><b><font face=\"$font\">&nbsp;&nbsp;&nbsp;Create New Topic</b>";

$result=mysql_query("SELECT * FROM $grouptable where intId = '$groupid' LIMIT 0, 1");
$num_rows = mysql_num_rows( $result );
while ( $a_row = mysql_fetch_object( $result ) )
{
    if ($a_row->intAllowVote == 1)
    {
        print "<br><br>
        <font size=\"$fontsize\">&nbsp;&nbsp;&nbsp;<a href=\"new_vote.php?groupid=$groupid\">I want to make a vote</a>";
    }
    if ($a_row->intAllowVote == 1 AND $a_row->intAllowRate == 1)
    {
        print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    if ($a_row->intAllowVote == 0 AND $a_row->intAllowRate == 1)
    {
        print "<br><br>&nbsp;&nbsp;&nbsp;<font size=\"$fontsize\">";
    }
    if ($a_row->intAllowRate == 1)
    {
        print "<a href=\"new_rated_topic.php?groupid=$groupid\">I want to make a rated topic</a>";
    }
}

print "</p>
<form method=\"POST\" action=\"add_new_topic.php\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"$bordercolor\" width=\"100%\">
<tr><td width=\"40%\"><br><br><br><br><br>";


include("inc_smilies.php");

print "<td width=\"40%\"><font face=$font size=2><input type=\"radio\" value=\"images/1px_spacer.gif\" checked name=\"R1\">
<img border=\"0\" src=\"images/1px_spacer.gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/smile[1].gif\">
<img border=\"0\" src=\"images/smilies/smile[1].gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/worry[1].gif\">
<img border=\"0\" src=\"images/smilies/worry[1].gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/tongue[1].gif\">
<img border=\"0\" src=\"images/smilies/tongue[1].gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/teeth[1].gif\">
<img border=\"0\" src=\"images/smilies/teeth[1].gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/talker[1].gif\">
<img border=\"0\" src=\"images/smilies/talker[1].gif\" width=\"15\" height=\"15\">
<br>
<input type=\"radio\" name=\"R1\" value=\"images/smilies/rolleyes[1].gif\">
<img border=\"0\" src=\"images/smilies/rolleyes[1].gif\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/angryfire[1].gif\">
<img border=\"0\" src=\"images/smilies/angryfire[1].gif\" alt=\":angry:\" width=\"16\" height=\"16\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/laughing[1].gif\">
<img border=\"0\" src=\"images/smilies/laughing[1].gif\" alt=\":laugh:\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/eek[1].gif\">
<img border=\"0\" src=\"images/smilies/eek[1].gif\" alt=\":eek:\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/cry-anim[1].gif\">
<img border=\"0\" src=\"images/smilies/cry-anim[1].gif\" alt=\":'(\" width=\"15\" height=\"15\">&nbsp;&nbsp;
<input type=\"radio\" name=\"R1\" value=\"images/smilies/naughty[1].gif\">
<img border=\"0\" src=\"images/smilies/naughty[1].gif\" alt=\":naughty:\" width=\"15\" height=\"15\">
<br><br>
&nbsp;&nbsp;<input type=\"text\" onfocus=\"document.onkeypress=function(){};\" name=\"topicname\" size=\"45\" style=\"background-image: url('images/text_subject_background.gif')\"><br><br>";
?>



<script language=javascript>
<!--

function markSelection ( txtObj ) {
 if ( txtObj.createTextRange ) {
   txtObj.caretPos = document.selection.createRange().duplicate();
   isSelected = true;
 }
}

function insertTag ( txtName, tag, enclose ) {
 var closeTag = tag;
 if ( enclose ) {
   var attribSplit = tag.indexOf ( ' ' );
   if ( tag.indexOf ( ' ' ) > -1 )
     closeTag = tag.substring ( 0, attribSplit );
 }
 if ( isSelected ) {
   var txtObj = eval ( "document.forms[0]." + txtName );
   if (txtObj.createTextRange && txtObj.caretPos) {
     var caretPos = txtObj.caretPos;
     caretPos.text = ( ( enclose ) ? "["+tag+"]"+caretPos.text+"[/"+closeTag+"]" : ""+tag+""+caretPos.text );
     markSelection ( txtObj );
     if ( txtObj.caretPos.text=='' ) {
       isSelected=false;
    txtObj.focus();
     }
   }
 } else {
   // placeholder for loss of focus handler
 }
}

//-->
</script>

<form>
<textarea onfocus="document.onkeypress=function(){};" rows="11" cols="36" style="background-image: url('images/big_area_background.gif')" name="tsttxt" ONSELECT="markSelection(this);" ONCLICK="markSelection(this);" ONKEYUP="markSelection(this);"></textarea><br>

<?php
include ("inc_buttons.php");

print "<br><center>";



// Add the priority setter if the admin level is high enough...

if ($cAdminLevel >= 3)
{
    print "<select size=1 name=\"priority\">
    <option selected value=\"0\">Normal Priority</option>
    <option value=\"1\">High Priority</option>
    </select>&nbsp;";
}
print "<input type=\"hidden\" name=\"groupid\" value=\"$groupid\">
<font size=3>

<input type=\"submit\" value=\"Create This Subject!\">


</td><td width=\"20%\">&nbsp;</td></tr></table>
</form>&nbsp;</td></tr></table>
<br><br>";

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