OSDN Git Service

Fixed some errors and added make replys in /idb/inc/replys.php
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 31 Jul 2007 04:35:35 +0000 (04:35 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 31 Jul 2007 04:35:35 +0000 (04:35 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@56 2b68903e-0b30-0410-9a39-a2e4f3c5be39

forum.php
inc/replys.php
inc/topics.php
inc/versioninfo.php
topic.php

index b1e9960..a9fd7ad 100644 (file)
--- a/forum.php
+++ b/forum.php
@@ -11,7 +11,7 @@
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: forum.php - Last Update: 07/30/2007 SVN 54 - Author: cooldude2k $
+    $FileInfo: forum.php - Last Update: 07/30/2007 SVN 56 - Author: cooldude2k $
 */
 require('preindex.php');
 $usefileext = $Settings['file_ext'];
index 67715d3..82a4668 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: replys.php - Last Update: 07/23/2007 SVN 51 - Author: cooldude2k $
+    $FileInfo: replys.php - Last Update: 07/30/2007 SVN 56 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="replys.php"||$File3Name=="/replys.php") {
@@ -23,8 +23,11 @@ $prenum=mysql_num_rows($preresult);
 $prei=0;
 while ($prei < $prenum) {
 $TopicName=mysql_result($preresult,$prei,"TopicName");
+$TopicID=mysql_result($preresult,$prei,"id");
 $TopicForumID=mysql_result($preresult,$prei,"ForumID");
 $TopicCatID=mysql_result($preresult,$prei,"CategoryID");
+$TopicClosed=mysql_result($preresult,$prei,"Closed");
+$NumberReplies=mysql_result($preresult,$prei,"NumReply");
 $ViewTimes=mysql_result($preresult,$prei,"NumViews");
 if(!isset($CatPermissionInfo['CanViewCategory'][$TopicCatID])) {
        $CatPermissionInfo['CanViewCategory'][$TopicCatID] = "no"; }
@@ -47,17 +50,18 @@ if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="yes"&&
 <tr>
  <td style="width: 0%; text-align: left;">&nbsp;</td>
  <td style="width: 100%; text-align: right;">
- <?php if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") { ?>
- <a href="#Act/Reply"><?php echo $ThemeSet['AddReply']; ?></a>
+ <?php if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes"&&$TopicClosed==0) { ?>
+ <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['AddReply']; ?></a>
  <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
-       if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") { ?>
+       if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes"&&$TopicClosed==0) { ?>
  <?php echo $ThemeSet['ButtonDivider']; } ?>
- <a href="#Act/Topic"><?php echo $ThemeSet['NewTopic']; ?></a>
+ <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$TopicForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
  <?php } ?></td>
 </tr>
 </table>
 <div>&nbsp;</div>
 <?php
+if($_GET['act']=="view") {
 $query = query("select * from `".$Settings['sqltable']."posts` where `TopicID`=%i ORDER BY `TimeStamp` ASC", array($_GET['id']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
@@ -95,6 +99,7 @@ $MyEditTime=mysql_result($result,$i,"LastUpdate");
 $MyEditUserID=mysql_result($result,$i,"EditUser");
 $MyTimeStamp=GMTimeChange("M j, Y, g:i a",$MyTimeStamp,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
 $MyPost=mysql_result($result,$i,"Post");
+$MyPost = preg_replace("/\<br\>/", "<br />\n", nl2br($MyPost));
 $MyDescription=mysql_result($result,$i,"Description");
 $requery = query("select * from `".$Settings['sqltable']."members` where `id`=%i", array($MyUserID));
 $reresult=mysql_query($requery);
@@ -209,19 +214,191 @@ echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr
 </tr>
 </table></div>
 <div>&nbsp;</div>
-<?php ++$i; } @mysql_free_result($result); ?>
+<?php ++$i; } @mysql_free_result($result); }
+if($_GET['act']=="create") {
+if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no"||$TopicClosed==1) { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
+ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
+gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
+?>
+<div class="Table1Border">
+<table class="Table1" id="MakeReply<?php echo $ForumID; ?>">
+<tr class="TableRow1" id="ReplyStart<?php echo $ForumID; ?>">
+<td class="TableRow1" colspan="2"><span style="float: left;">
+<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
+<?php echo "<span style=\"float: right;\">&nbsp;</span>"; ?></td>
+</tr>
+<tr id="MakeReplyRow<?php echo $ForumID; ?>" class="TableRow2">
+<td class="TableRow2" colspan="2" style="width: 100%;">Making a Reply in <?php echo $ForumName; ?></td>
+</tr>
+<tr class="TableRow3" id="MkReply<?php echo $ForumID; ?>">
+<td class="TableRow3">
+<form method="post" id="MkReplyForm" action="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=makereply&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">
+<table style="text-align: left;">
+<tr style="text-align: left;">
+       <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
+       <td style="width: 50%;"><input type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" /></td>
+</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr>
+       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
+       <td style="width: 50%;"><input type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
+</tr><?php } ?>
+</table>
+<table style="text-align: left;">
+<tr style="text-align: left;">
+<td style="width: 100%;">
+<label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
+<textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"></textarea><br />
+<input type="hidden" name="act" value="makereplies" style="display: none;" />
+<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
+<input type="hidden" name="GuestName" value="null" style="display: none;" />
+<?php } ?>
+<input type="submit" class="Button" value="Make Reply" name="make_reply" />
+<input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
+</td></tr></table>
+</form></td></tr>
+<tr id="MkReplyEnd<?php echo $ForumID; ?>" class="TableRow4">
+<td class="TableRow4" colspan="5">&nbsp;</td>
+</tr>
+</table></div>
+<?php } if($_GET['act']=="makereply"||$_POST['act']=="makereplies") {
+if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no"||$TopicClosed==1) { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
+ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
+gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
+$REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
+$URL['REFERER'] = $REFERERurl['host'];
+$URL['HOST'] = $_SERVER["SERVER_NAME"];
+$REFERERurl = null; unset($REFERERurl);
+if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
+if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
+if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
+?>
+<div class="Table1Border">
+<table class="Table1">
+<tr class="TableRow1">
+<td class="TableRow1"><span style="float: left;">
+<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
+<?php echo "<span style=\"float: right;\">&nbsp;</span>"; ?></td>
+</tr>
+<tr class="TableRow2">
+<th class="TableRow2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
+</tr>
+<?php if (strlen($_POST['ReplyDesc'])=="30") { $Error="Yes";  ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />Your Reply Description is too big.<br />
+       </span></td>
+</tr>
+<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
+       strlen($_POST['GuestName'])=="30") { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You Guest Name is too big.<br />
+       </span></td>
+</tr>
+<?php } if ($Settings['TestReferer']==true) {
+       if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />Sorry the referering url dose not match our host name.<br />
+       </span></td>
+</tr>
+<?php } }
+$_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES));
+$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
+$_POST['ReplyDesc'] = @remove_spaces($_POST['ReplyDesc']);
+$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES));
+$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
+$_POST['GuestName'] = @remove_spaces($_POST['GuestName']);
+$_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES));
+$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
+//$_POST['ReplyPost'] = @remove_spaces($_POST['ReplyPost']);
+if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You need to enter a Reply Description.<br />
+       </span></td>
+</tr>
+<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
+       $_POST['GuestName']==null) { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You need to enter a Guest Name.<br />
+       </span></td>
+</tr>
+<?php } if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no"||$TopicClosed==1) { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You do not have permission to make a reply here.<br />
+       </span></td>
+</tr>
+<?php } if ($_POST['ReplyPost']==null) { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You need to enter a Reply.<br />
+       </span></td>
+</tr>
+<?php } if ($Error=="Yes") {
+@redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); }
+if ($Error!="Yes") { $LastActive = GMTimeStamp();
+$gnrquery = query("select * from `".$Settings['sqltable']."forums` where `id`=%s", array($TopicForumID));
+$gnrresult=mysql_query($gnrquery); $gnrnum=mysql_num_rows($gnrresult);
+$NumberPosts=mysql_result($gnrresult,0,"NumPosts"); 
+$PostCountAdd=mysql_result($gnrresult,0,"PostCountAdd"); 
+@mysql_free_result($gnrresult);
+$postid = getnextid($Settings['sqltable'],"posts");
+$requery = query("select * from `".$Settings['sqltable']."members` where `id`=%i", array($_SESSION['UserID']));
+$reresult=mysql_query($requery);
+$renum=mysql_num_rows($reresult);
+$rei=0;
+while ($rei < $renum) {
+$User1ID=$_SESSION['UserID'];
+$User1Name=mysql_result($reresult,$rei,"Name");
+if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
+$User1Email=mysql_result($reresult,$rei,"Email");
+$User1Title=mysql_result($reresult,$rei,"Title");
+$User1GroupID=mysql_result($reresult,$rei,"GroupID");
+$PostCount=mysql_result($reresult,$rei,"PostCount");
+if($PostCountAdd=="on") { $NewPostCount = $PostCount + 1; }
+$gquery = query("select * from `".$Settings['sqltable']."groups` where `id`=%i", array($User1GroupID));
+$gresult=mysql_query($gquery);
+$User1Group=mysql_result($gresult,0,"Name");
+@mysql_free_result($gresult);
+$User1IP=$_SERVER['REMOTE_ADDR'];
+++$rei; } @mysql_free_result($reresult);
+$query = query("insert into `".$Settings['sqltable']."posts` values (".$postid.",%i,%i,%i,%i,'%s',%i,%i,0,'%s','%s','%s')", array($TopicID,$TopicForumID,$TopicCatID,$User1ID,$User1Name,$LastActive,$LastActive,$_POST['ReplyPost'],$_POST['ReplyDesc'],$User1IP));
+mysql_query($query);
+$queryupd = query("update `".$Settings['sqltable']."members` set `LastActive`='%s',`IP`='%s',`PostCount`=%i WHERE `id`='%s'", array($LastActive,$User1IP,$NewPostCount,$User1ID));
+mysql_query($queryupd);
+$NewNumPosts = $NumberPosts + 1; $NewNumReplies = $NumberReplies + 1;
+$queryupd = query("update `".$Settings['sqltable']."forums` set `NumPosts`='%s' WHERE `id`='%s'", array($NewNumPosts,$TopicForumID));
+mysql_query($queryupd);
+$queryupd = query("update `".$Settings['sqltable']."topics` set `NumReply`='%s',LastUpdate=%i WHERE `id`='%s'", array($NewNumReplies,$LastActive,$TopicID));
+mysql_query($queryupd);
+@redirect("refresh",$basedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$topicid,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE),"3");
+$MyPostNum = $NewNumReplies + 1;
+?><tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage"><br />
+       Reply to Topic <?php echo $TopicName; ?> was posted.<br />
+       Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#post<?php echo $MyPostNum; ?>">here</a> to view your reply.<br />&nbsp;
+       </span><br /></td>
+</tr>
+<?php } ?>
+<tr class="TableRow4">
+<td class="TableRow4">&nbsp;</td>
+</tr>
+</table></div>
+<?php } ?>
 <table class="Table2" style="width: 100%;">
 <tr>
  <td style="width: 0%; text-align: left;">&nbsp;</td>
  <td style="width: 100%; text-align: right;">
- <?php if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") { ?>
- <a href="#Act/Reply"><?php echo $ThemeSet['AddReply']; ?></a>
+ <?php if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes"&&$TopicClosed==0) { ?>
+ <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['AddReply']; ?></a>
  <?php echo $ThemeSet['ButtonDivider']; ?>
- <a href="#Act/Reply"><?php echo $ThemeSet['FastReply']; ?></a>
+ <a href="#Act/FastReply"><?php echo $ThemeSet['FastReply']; ?></a>
  <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
-       if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") { ?>
+       if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes"&&$TopicClosed==0) { ?>
  <?php echo $ThemeSet['ButtonDivider']; } ?>
- <a href="#Act/Topic"><?php echo $ThemeSet['NewTopic']; ?></a>
+ <a href="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=create&id=".$TopicForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>"><?php echo $ThemeSet['NewTopic']; ?></a>
  <?php } ?></td>
 </tr>
 </table>
index ce30c43..b9bf37a 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: topics.php - Last Update: 07/30/2007 SVN 54 - Author: cooldude2k $
+    $FileInfo: topics.php - Last Update: 07/30/2007 SVN 56 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="topics.php"||$File3Name=="/topics.php") {
@@ -34,7 +34,7 @@ $RedirectTimes=mysql_result($preresult,$prei,"Redirects");
 $NumberViews=mysql_result($preresult,$prei,"NumViews");
 $NumberPosts=mysql_result($preresult,$prei,"NumPosts");
 $NumberTopics=mysql_result($preresult,$prei,"NumTopics");
-$PostCountAdd=mysql_result($preresult,$prei,"NumTopics");
+$PostCountAdd=mysql_result($preresult,$prei,"PostCountAdd");
 $ForumType = strtolower($ForumType);
 if(!isset($CatPermissionInfo['CanViewCategory'][$ForumCatID])) {
        $CatPermissionInfo['CanViewCategory'][$ForumCatID] = "no"; }
@@ -223,12 +223,15 @@ gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
 </tr>
 <tr class="TableRow3" id="MkTopic<?php echo $ForumID; ?>">
 <td class="TableRow3">
-<form method="post" id="MkTopicForm" action="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=maketopic",$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>">
+<form method="post" id="MkTopicForm" action="<?php echo url_maker($exfile['forum'],$Settings['file_ext'],"act=maketopic&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr['forum'],$exqstr['forum']); ?>">
 <table style="text-align: left;">
 <tr style="text-align: left;">
        <td style="width: 50%;"><label class="TextBoxLabel" for="TopicName">Insert Topic Name:</label></td>
        <td style="width: 50%;"><input type="text" name="TopicName" class="TextBox" id="TopicName" size="20" /></td>
-</tr><tr>
+</tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr>
+       <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
+       <td style="width: 50%;"><input type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
+</tr><?php } ?><tr>
        <td style="width: 50%;"><label class="TextBoxLabel" for="TopicDesc">Insert Topic Description:</label></td>
        <td style="width: 50%;"><input type="text" name="TopicDesc" class="TextBox" id="TopicDesc" size="20" /></td>
 </tr>
@@ -239,6 +242,9 @@ gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
 <label class="TextBoxLabel" for="TopicPost">Insert Your Post:</label><br />
 <textarea rows="10" name="TopicPost" id="TopicPost" cols="40" class="TextBox"></textarea><br />
 <input type="hidden" name="act" value="maketopics" style="display: none;" />
+<?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
+<input type="hidden" name="GuestName" value="null" style="display: none;" />
+<?php } ?>
 <input type="submit" class="Button" value="Make Topic" name="make_topic" />
 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
 </td></tr></table>
@@ -258,6 +264,7 @@ $REFERERurl = null; unset($REFERERurl);
 if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; }
 if(!isset($_POST['TopicDesc'])) { $_POST['TopicDesc'] = null; }
 if(!isset($_POST['TopicPost'])) { $_POST['TopicPost'] = null; }
+if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
 ?>
 <div class="Table1Border">
 <table class="Table1">
@@ -281,6 +288,13 @@ if(!isset($_POST['TopicPost'])) { $_POST['TopicPost'] = null; }
        <br />Your Topic Description is too big.<br />
        </span></td>
 </tr>
+<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
+       strlen($_POST['GuestName'])=="30") { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You Guest Name is too big.<br />
+       </span></td>
+</tr>
 <?php } if ($Settings['TestReferer']==true) {
        if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes";  ?>
 <tr style="text-align: center;">
@@ -295,6 +309,9 @@ $_POST['TopicName'] = @remove_spaces($_POST['TopicName']);
 $_POST['TopicDesc'] = stripcslashes(htmlspecialchars($_POST['TopicDesc'], ENT_QUOTES));
 $_POST['TopicDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicDesc']);
 $_POST['TopicDesc'] = @remove_spaces($_POST['TopicDesc']);
+$_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES));
+$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
+$_POST['GuestName'] = @remove_spaces($_POST['GuestName']);
 $_POST['TopicPost'] = stripcslashes(htmlspecialchars($_POST['TopicPost'], ENT_QUOTES));
 $_POST['TopicPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicPost']);
 //$_POST['TopicPost'] = @remove_spaces($_POST['TopicPost']);
@@ -310,6 +327,13 @@ if ($_POST['TopicName']==null) { $Error="Yes"; ?>
        <br />You need to enter a Topic Description.<br />
        </span></td>
 </tr>
+<?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
+       $_POST['GuestName']==null) { $Error="Yes"; ?>
+<tr style="text-align: center;">
+       <td style="text-align: center;"><span class="TableMessage">
+       <br />You need to enter a Guest Name.<br />
+       </span></td>
+</tr>
 <?php } if($PermissionInfo['CanMakeTopics'][$ForumID]=="no") { $Error="Yes"; ?>
 <tr style="text-align: center;">
        <td style="text-align: center;"><span class="TableMessage">
@@ -324,8 +348,7 @@ if ($_POST['TopicName']==null) { $Error="Yes"; ?>
 </tr>
 <?php } if ($Error=="Yes") {
 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); }
-if ($Error!="Yes") {
-$LastActive = GMTimeStamp();
+if ($Error!="Yes") { $LastActive = GMTimeStamp();
 $topicid = getnextid($Settings['sqltable'],"topics");
 $postid = getnextid($Settings['sqltable'],"posts");
 $requery = query("select * from `".$Settings['sqltable']."members` where `id`=%i", array($_SESSION['UserID']));
@@ -335,6 +358,7 @@ $rei=0;
 while ($rei < $renum) {
 $User1ID=$_SESSION['UserID'];
 $User1Name=mysql_result($reresult,$rei,"Name");
+if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
 $User1Email=mysql_result($reresult,$rei,"Email");
 $User1Title=mysql_result($reresult,$rei,"Title");
 $User1GroupID=mysql_result($reresult,$rei,"GroupID");
index 3b23a14..d39e050 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: versioninfo.php - Last Update: 07/30/2007 SVN 55 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 07/30/2007 SVN 56 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,7 +27,7 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 1; $VER1[2] = 6; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 55; $RName = "iDB"; $SFName = "IntDB";
+$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 56; $RName = "iDB"; $SFName = "IntDB";
 $SVNDay[0] = 07; $SVNDay[1] = 30; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false);
 $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true);
index d35ed64..85cd666 100644 (file)
--- a/topic.php
+++ b/topic.php
@@ -11,7 +11,7 @@
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: topic.php - Last Update: 06/07/2007 SVN 20 - Author: cooldude2k $
+    $FileInfo: topic.php - Last Update: 07/30/2007 SVN 56 - Author: cooldude2k $
 */
 require('preindex.php');
 $usefileext = $Settings['file_ext'];
@@ -27,7 +27,8 @@ if($_GET['act']==null)
 { $_GET['act']="view"; }
 if(!is_numeric($_GET['id']))
 { $_GET['id']="1"; }
-if($_GET['act']=="view")
+if($_GET['act']=="view"||$_GET['act']=="create"||
+       $_GET['act']=="makereply"||$_POST['act']=="makereplies")
 { require($SettDir['inc'].'replys.php'); }
 require($SettDir['inc'].'endpage.php');
 if(!isset($TopicName)) { $TopicName = null; }
@@ -35,4 +36,11 @@ if(!isset($TopicName)) { $TopicName = null; }
 
 </body>
 </html>
-<?php change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Viewing Topic ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); ?>
+<?php 
+if($_GET['act']=="view") {
+change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Viewing Topic ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); } 
+if($_GET['act']=="create") {
+change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making Reply in Topic ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); }
+if($_GET['act']=="maketopic"&&$_POST['act']=="maketopics") {
+change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Making Reply in Topic ".$TopicName,$Settings['use_gzip'],$GZipEncode['Type']); }
+?>