Yet another small update.
[iDB.git] / inc / replies.php
blobb7045abcbe4b18f19e07260a6401c4025685f1e6
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: replies.php - Last Update: 05/23/2011 SVN 655 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="replies.php"||$File3Name=="/replies.php") {
18 require('index.php');
19 exit(); }
20 $pstring = null; $pagenum = null;
21 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
22 if(!is_numeric($_GET['post'])) { $_GET['post'] = null; }
23 if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
24 if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
25 if(!isset($_GET['link'])) { $_GET['link'] = "no"; }
26 if(!isset($_GET['level'])) { $_GET['level'] = 1; }
27 if(!is_numeric($_GET['level'])) { $_GET['level'] = 1; }
28 if($_GET['link']!="yes"&&$_GET['link']!="no") { $_GET['link'] = "no"; }
29 if($_GET['modact']=="pin"||$_GET['modact']=="unpin"||$_GET['modact']=="open"||
30 $_GET['modact']=="move"||$_GET['modact']=="close"||$_GET['modact']=="edit"||
31 $_GET['modact']=="delete"||$_GET['modact']=="announce")
32 { $_GET['act'] = $_GET['modact']; }
33 if($_GET['act']=="announce") { $_GET['act'] = "pin"; $_GET['level'] = 2; }
34 $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i".$ForumIgnoreList4." LIMIT 1", array($_GET['id']));
35 $preresult=sql_query($prequery,$SQLStat);
36 $prenum=sql_num_rows($preresult);
37 if($prenum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
38 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
39 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
40 if($prenum>=1) {
41 $TopicName=sql_result($preresult,0,"TopicName");
42 $TopicID=sql_result($preresult,0,"id");
43 $TopicForumID=sql_result($preresult,0,"ForumID");
44 $TopicCatID=sql_result($preresult,0,"CategoryID");
45 $TopicClosed=sql_result($preresult,0,"Closed");
46 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
47 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
48 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
49 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
50 if(!isset($_GET['post'])||$_GET['post']!==null) {
51 $NumberReplies=sql_result($preresult,0,"NumReply"); }
52 if(isset($_GET['post'])&&$_GET['post']!==null) {
53 $NumberReplies=1; }
54 $ViewTimes=sql_result($preresult,0,"NumViews");
55 sql_free_result($preresult);
56 $forumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($TopicForumID));
57 $fmckresult=sql_query($forumcheckx,$SQLStat);
58 $fmcknum=sql_num_rows($fmckresult);
59 if($fmcknum==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
60 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
61 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
62 $ForumName=sql_result($fmckresult,0,"Name");
63 $ForumType=sql_result($fmckresult,0,"ForumType");
64 $CanHaveTopics=sql_result($fmckresult,0,"CanHaveTopics");
65 $ForumPostCountView=sql_result($fmckresult,0,"PostCountView");
66 $ForumKarmaCountView=sql_result($fmckresult,0,"KarmaCountView");
67 sql_free_result($fmckresult);
68 $catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($TopicCatID));
69 $catresult=sql_query($catcheck,$SQLStat);
70 $CategoryName=sql_result($catresult,0,"Name");
71 $CategoryType=sql_result($catresult,0,"CategoryType");
72 $CategoryPostCountView=sql_result($catresult,0,"PostCountView");
73 $CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
74 sql_free_result($catresult);
75 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
76 if($MyPostCountChk==null) { $MyPostCountChk = 0; }
77 if($MyKarmaCount==null) { $MyKarmaCount = 0; }
78 if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
79 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
80 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
81 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
82 if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
83 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
84 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
85 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
86 if($ForumCheck!="skip") {
88 <div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">Board index</a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=view&id=".$TopicCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$TopicForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
89 <div class="DivNavLinks">&nbsp;</div>
90 <?php }
91 if(!isset($CatPermissionInfo['CanViewCategory'][$TopicCatID])) {
92 $CatPermissionInfo['CanViewCategory'][$TopicCatID] = "no"; }
93 if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="no"||
94 $CatPermissionInfo['CanViewCategory'][$TopicCatID]!="yes") {
95 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
96 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
97 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
98 if(!isset($PermissionInfo['CanViewForum'][$TopicForumID])) {
99 $PermissionInfo['CanViewForum'][$TopicForumID] = "no"; }
100 if($PermissionInfo['CanViewForum'][$TopicForumID]=="no"||
101 $PermissionInfo['CanViewForum'][$TopicForumID]!="yes") {
102 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
103 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
104 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
105 if($_GET['act']!="view") {
106 $CanMakeReply = "no"; $CanMakeTopic = "no";
107 if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") {
108 $CanMakeTopic = "yes"; }
109 if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
110 $CanMakeReply = "yes"; }
111 if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
112 &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
113 $CanMakeReply = "yes"; } ?>
114 <table style="width: 100%;" class="Table2">
115 <tr>
116 <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
117 <td style="width: 70%; text-align: right;">
118 <?php if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="yes"&&$PermissionInfo['CanViewForum'][$TopicForumID]=="yes") {
119 if($CanMakeReply=="yes") { ?>
120 <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>
121 <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
122 if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
123 <?php echo $ThemeSet['ButtonDivider']; } ?>
124 <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>
125 <?php } ?></td>
126 </tr>
127 </table>
128 <div class="DivTable2">&nbsp;</div>
129 <?php } } if($_GET['act']=="view") {
130 if($ForumCheck!="skip") {
131 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id']."&page=".$_GET['page'],"&","=",$prexqstr['topic'],$exqstr['topic']);
132 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
133 $_SESSION['ViewingFile'] = $exfile['topic'].$Settings['file_ext']; }
134 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
135 $_SESSION['ViewingFile'] = $exfile['topic']; }
136 $_SESSION['PreViewingTitle'] = "Viewing Topic:";
137 $_SESSION['ViewingTitle'] = $TopicName; }
138 if($NumberReplies==null) {
139 $NumberReplies = 0; }
140 $num=$NumberReplies+1;
141 //Start Reply Page Code
142 if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
143 if($_GET['page']==null) { $_GET['page'] = 1; }
144 if($_GET['page']<=0) { $_GET['page'] = 1; }
145 $nums = $_GET['page'] * $Settings['max_posts'];
146 if($nums>$num) { $nums = $num; }
147 $numz = $nums - $Settings['max_posts'];
148 if($numz<=0) { $numz = 0; }
149 //$i=$numz;
150 if($nums<$num) { $nextpage = $_GET['page'] + 1; }
151 if($nums>=$num) { $nextpage = $_GET['page']; }
152 if($numz>=$Settings['max_posts']) { $backpage = $_GET['page'] - 1; }
153 if($_GET['page']<=1) { $backpage = 1; }
154 $pnum = $num; $l = 1; $Pages = null;
155 while ($pnum>0) {
156 if($pnum>=$Settings['max_posts']) {
157 $pnum = $pnum - $Settings['max_posts'];
158 $Pages[$l] = $l; ++$l; }
159 if($pnum<$Settings['max_posts']&&$pnum>0) {
160 $pnum = $pnum - $pnum;
161 $Pages[$l] = $l; ++$l; } }
162 $snumber = $_GET['page'] - 1;
163 $PageLimit = $Settings['max_posts'] * $snumber;
164 if($PageLimit<0) { $PageLimit = 0; }
165 //End Reply Page Code
166 $i=0;
167 if(!isset($_GET['post'])||$_GET['post']!==null) {
168 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_posts'])); }
169 if(isset($_GET['post'])&&$_GET['post']!==null) {
170 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i AND \"id\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$_GET['post'],$PageLimit,$Settings['max_posts'])); }
171 $result=sql_query($query,$SQLStat);
172 $num=sql_num_rows($result);
173 if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
174 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
175 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
176 if($num!=0) {
177 if($ViewTimes==0||$ViewTimes==null) { $NewViewTimes = 1; }
178 if($ViewTimes!=0&&$ViewTimes!=null) { $NewViewTimes = $ViewTimes + 1; }
179 $viewsup = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewViewTimes,$_GET['id']));
180 sql_query($viewsup,$SQLStat); }
181 //List Page Number Code Start
182 $pagenum=count($Pages);
183 if($_GET['page']>$pagenum) {
184 $_GET['page'] = $pagenum; }
185 $pagei=0; $pstring = null;
186 if($pagenum>1) {
187 $pstring = "<div class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
188 if($_GET['page']<4) { $Pagez[0] = null; }
189 if($_GET['page']>=4) { $Pagez[0] = "First"; }
190 if($_GET['page']>=3) {
191 $Pagez[1] = $_GET['page'] - 2; }
192 if($_GET['page']<3) {
193 $Pagez[1] = null; }
194 if($_GET['page']>=2) {
195 $Pagez[2] = $_GET['page'] - 1; }
196 if($_GET['page']<2) {
197 $Pagez[2] = null; }
198 $Pagez[3] = $_GET['page'];
199 if($_GET['page']<$pagenum) {
200 $Pagez[4] = $_GET['page'] + 1; }
201 if($_GET['page']>=$pagenum) {
202 $Pagez[4] = null; }
203 $pagenext = $_GET['page'] + 1;
204 if($pagenext<$pagenum) {
205 $Pagez[5] = $_GET['page'] + 2; }
206 if($pagenext>=$pagenum) {
207 $Pagez[5] = null; }
208 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
209 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
210 $pagenumi=count($Pagez);
211 if($num==0) {
212 $pagenumi = 0;
213 $pstring = null; }
214 if($pagenum>1) {
215 while ($pagei < $pagenumi) {
216 if($_GET['page']!=1&&$pagei==1) {
217 $Pback = $_GET['page'] - 1;
218 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&lt;</a></span> "; }
219 if($Pagez[$pagei]!=null&&
220 $Pagez[$pagei]!="First"&&
221 $Pagez[$pagei]!="Last") {
222 if($pagei!=3) {
223 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; }
224 if($pagei==3) {
225 $pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; } }
226 if($Pagez[$pagei]=="First") {
227 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&laquo;</a></span> "; }
228 if($Pagez[$pagei]=="Last") {
229 $ptestnext = $pagenext + 1;
230 $paget = $pagei - 1;
231 $Pnext = $_GET['page'] + 1;
232 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&gt;</a></span> ";
233 if($ptestnext<$pagenum) {
234 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo;</a></span> "; } }
235 ++$pagei; } $pstring = $pstring."</div>"; }
236 //List Page Number Code end
237 $CanMakeReply = "no"; $CanMakeTopic = "no";
238 if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") {
239 $CanMakeTopic = "yes"; }
240 if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
241 $CanMakeReply = "yes"; }
242 if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
243 &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
244 $CanMakeReply = "yes"; }
245 if($pstring!=null||$CanMakeReply=="yes"||$CanMakeTopic=="yes") {
247 <table style="width: 100%;" class="Table2">
248 <tr>
249 <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
250 <td style="width: 70%; text-align: right;">
251 <?php if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="yes"&&$PermissionInfo['CanViewForum'][$TopicForumID]=="yes") {
252 if($CanMakeReply=="yes") { ?>
253 <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>
254 <?php } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
255 if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
256 <?php echo $ThemeSet['ButtonDivider']; } ?>
257 <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>
258 <?php } ?></td>
259 </tr>
260 </table>
261 <?php }
262 /* <div class="DivPageLinks">&nbsp;</div> */
264 <div class="DivTable2">&nbsp;</div>
265 <?php }
266 while ($i < $num) {
267 $MyPostID=sql_result($result,$i,"id");
268 $MyTopicID=sql_result($result,$i,"TopicID");
269 $MyPostIP=sql_result($result,$i,"IP");
270 $MyForumID=sql_result($result,$i,"ForumID");
271 $MyCategoryID=sql_result($result,$i,"CategoryID");
272 $MyUserID=sql_result($result,$i,"UserID");
273 $MyGuestName=sql_result($result,$i,"GuestName");
274 $MyTimeStamp=sql_result($result,$i,"TimeStamp");
275 $MyEditTime=sql_result($result,$i,"LastUpdate");
276 $MyEditUserID=sql_result($result,$i,"EditUser");
277 $MyEditUserName=sql_result($result,$i,"EditUserName");
278 $MyTimeStamp=GMTimeChange("M j Y, g:i a",$MyTimeStamp,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
279 $MyPost=sql_result($result,$i,"Post");
280 $MyDescription=sql_result($result,$i,"Description");
281 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
282 $reresult=sql_query($requery,$SQLStat);
283 $renum=sql_num_rows($reresult);
284 if($renum<1) { $MyUserID = -1;
285 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
286 $reresult=sql_query($requery,$SQLStat);
287 $renum=sql_num_rows($reresult); }
288 $memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
289 $memreresult=sql_query($memrequery,$SQLStat);
290 $memrenum=sql_num_rows($memreresult);
291 $rei=0; $ipshow = "two";
292 $User1ID=$MyUserID; $GuestsName = $MyGuestName;
293 $User1Name=sql_result($reresult,$rei,"Name");
294 $User1IP=sql_result($reresult,$rei,"IP");
295 if($User1IP==$MyPostIP) { $ipshow = "one"; }
296 $User1Email=sql_result($reresult,$rei,"Email");
297 $User1Title=sql_result($reresult,$rei,"Title");
298 $PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
299 if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
300 $PreUserCanExecPHP = "no"; }
301 $PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
302 if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
303 $PreUserCanDoHTML = "no"; }
304 $PreUserCanUseBBags=sql_result($memreresult,$rei,"CanUseBBags");
305 if($PreUserCanUseBBags!="yes"&&$PreUserCanUseBBags!="no"&&$PreUserCanUseBBags!="group") {
306 $PreUserCanUseBBags = "no"; }
307 sql_free_result($memreresult);
308 $User1Joined=sql_result($reresult,$rei,"Joined");
309 $User1Joined=GMTimeChange("M j Y",$User1Joined,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
310 $User1Hidden=sql_result($reresult,$rei,"HiddenMember");
311 $User1GroupID=sql_result($reresult,$rei,"GroupID");
312 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
313 $gresult=sql_query($gquery,$SQLStat);
314 $User1Group=sql_result($gresult,0,"Name");
315 $User1CanExecPHP = $PreUserCanExecPHP;
316 if($PreUserCanExecPHP=="group") {
317 $User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
318 if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
319 $User1CanExecPHP = "no"; }
320 $User1CanDoHTML = $PreUserCanDoHTML;
321 if($PreUserCanDoHTML=="group") {
322 $User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
323 if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
324 $User1CanDoHTML = "no"; }
325 $User1CanUseBBags = $PreUserCanUseBBags;
326 if($User1CanUseBBags=="group") {
327 $User1CanUseBBags=sql_result($gresult,0,"CanUseBBags"); }
328 if($User1CanUseBBags!="yes"&&$User1CanUseBBags!="no") {
329 $User1CanUseBBags = "no"; }
330 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
331 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
332 $User1PermissionID=sql_result($gresult,0,"PermissionID");
333 sql_free_result($gresult);
334 $per1query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i LIMIT 1", array($User1PermissionID));
335 $per1esult=sql_query($per1query,$SQLStat);
336 $per1num=sql_num_rows($per1esult);
337 $User1CanDoHTML1=sql_result($per1esult,0,"CanDoHTML");
338 if($User1CanDoHTML1!="yes"&&$User1CanDoHTML1!="no") {
339 $User1CanDoHTML1 = "no"; }
340 $User1CanUseBBags1=sql_result($per1esult,0,"CanUseBBags");
341 if($User1CanUseBBags1!="yes"&&$User1CanUseBBags1!="no") {
342 $User1CanUseBBags1 = "no"; }
343 sql_free_result($per1esult);
344 if($User1Title=="") { $User1Title = $User1Group; }
345 $User1Signature=sql_result($reresult,$rei,"Signature");
346 $User1Avatar=sql_result($reresult,$rei,"Avatar");
347 $User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
348 if ($User1Avatar=="http://"||$User1Avatar==null||
349 strtolower($User1Avatar)=="noavatar") {
350 $User1Avatar=$ThemeSet['NoAvatar'];
351 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
352 $AvatarSize1=explode("x", $User1AvatarSize);
353 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
354 $User1Website=sql_result($reresult,$rei,"Website");
355 $User1Website = urlcheck($User1Website);
356 $BoardWWWChCk = parse_url($Settings['idburl']);
357 $User1WWWChCk = parse_url($User1Website);
358 $opennew = " onclick=\"window.open(this.href);return false;\"";
359 if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
360 $opennew = null; }
361 $User1PostCount=sql_result($reresult,$rei,"PostCount");
362 $User1Karma=sql_result($reresult,$rei,"Karma");
363 $User1IP=sql_result($reresult,$rei,"IP");
364 sql_free_result($reresult);
365 if($User1Name=="Guest") { $User1Name=$GuestsName;
366 if($User1Name==null) { $User1Name="Guest"; } }
367 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
368 $User1Name = $GroupNamePrefix.$User1Name; }
369 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
370 $User1Name = $User1Name.$GroupNameSuffix; }
371 $MySubPost = null;
372 if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0) {
373 if($MyEditUserID!=$MyUserID) {
374 $euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
375 $euresult = sql_query($euquery,$SQLStat);
376 $eunum = sql_num_rows($euresult);
377 if($eunum<1) { $MyEditUserID = -1;
378 $euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
379 $euresult = sql_query($euquery,$SQLStat);
380 $eunum = sql_num_rows($euresult); }
381 $EditUserID = $MyEditUserID;
382 $EditUserGroupID = sql_result($euresult,0,"GroupID");
383 $EditUserHidden=sql_result($euresult,0,"HiddenMember");
384 $EditUserName = sql_result($euresult,0,"Name");
385 sql_free_result($euresult);
386 $eugquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($EditUserGroupID));
387 $eugresult=sql_query($eugquery,$SQLStat);
388 $EditUserGroup=sql_result($eugresult,0,"Name");
389 $EditUserNamePrefix=sql_result($eugresult,0,"NamePrefix");
390 $EditUserNameSuffix=sql_result($eugresult,0,"NameSuffix");
391 sql_free_result($eugresult); }
392 if($MyEditUserID==$MyUserID) {
393 $EditUserID = $User1ID;
394 $EditUserGroupID = $User1GroupID;
395 $EditUserHidden=$User1Hidden;
396 $EditUserName = $User1Name;
397 $EditUserGroup=$User1Group;
398 $EditUserNamePrefix=null;
399 $EditUserNameSuffix=null; }
400 if($EditUserName=="Guest") { $EditUserName=$MyEditUserName;
401 if($EditUserName==null) { $EditUserName="Guest"; } }
402 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
403 $EditUserName = $EditUserNamePrefix.$EditUserName; }
404 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
405 $EditUserName = $EditUserName.$EditUserNameSuffix; }
406 $MyEditTime = GMTimeChange("M j Y, g:i a",$MyEditTime,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
407 $MySubPost = "<div class=\"EditReply\"><br />This post has been edited by <b>".$EditUserName."</b> on ".$MyEditTime."</div>"; }
408 if($User1CanUseBBags1=="yes") { $MyPost = bbcode_parser($MyPost); }
409 if($User1CanExecPHP=="no") {
410 $MyPost = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$MyPost); }
411 if($User1CanExecPHP=="yes") { $MyPost = php_execute($MyPost); }
412 if($User1CanDoHTML1=="no") {
413 $MyPost = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$MyPost); }
414 if($User1CanDoHTML1=="yes") { $MyPost = do_html_bbcode($MyPost); }
415 $MyPost = text2icons($MyPost,$Settings['sqltable'],$SQLStat);
416 $MyPost = preg_replace("/\<br\>/", "<br />", nl2br($MyPost));
417 $MyPost = url2link($MyPost);
418 if($MySubPost!=null) { $MyPost = $MyPost."\n".$MySubPost; }
419 if($User1CanUseBBags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
420 if($User1CanExecPHP=="no") {
421 $User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
422 if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
423 if($User1CanDoHTML1=="no") {
424 $User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
425 if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
426 $User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
427 $User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
428 $User1Signature = url2link($User1Signature);
429 $CanEditReply = false; $CanDeleteReply = false;
430 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
431 if($PermissionInfo['CanEditReplys'][$MyForumID]=="yes"&&
432 $_SESSION['UserID']==$MyUserID) { $CanEditReply = true; }
433 if($PermissionInfo['CanDeleteReplys'][$MyForumID]=="yes"&&
434 $_SESSION['UserID']==$MyUserID) { $CanDeleteReply = true; }
435 if($PermissionInfo['CanModForum'][$MyForumID]=="yes") {
436 $CanEditReply = true; $CanDeleteReply = true; } }
437 if($_SESSION['UserID']==0) {
438 $CanEditReply = false; $CanDeleteReply = false; }
439 $ReplyNum = $i + $PageLimit + 1;
441 <div class="TableInfo1Border" id="reply<?php echo $ReplyNum; ?>">
442 <?php if($ThemeSet['TableStyle']=="div") { ?>
443 <div class="TableInfoRow1">
444 <span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
445 </div>
446 <?php } ?>
447 <table class="TableInfo1" id="post<?php echo $MyPostID; ?>">
448 <?php if($ThemeSet['TableStyle']=="table") { ?>
449 <tr class="TableInfoRow1">
450 <td class="TableInfoColumn1" colspan="2"><span style="font-weight: bold; text-align: left;"><?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
451 </td>
452 </tr><?php } ?>
453 <tr class="TableInfoRow2">
454 <td class="TableInfoColumn2" style="vertical-align: middle; width: 160px;">
455 &nbsp;<?php
456 if($User1ID>0&&$User1Hidden=="no") {
457 echo "<a href=\"";
458 echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
459 echo "\">".$User1Name."</a>"; }
460 if($User1ID<=0||$User1Hidden=="yes") {
461 echo "<span>".$User1Name."</span>"; }
462 ?></td>
463 <td class="TableInfoColumn2" style="vertical-align: middle;">
464 <div style="float: left; text-align: left;">
465 <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>" style="vertical-align: middle;">
466 <span style="font-weight: bold;">Time Posted: </span><?php echo $MyTimeStamp; ?></a>
467 </div>
468 <div style="float: right;">
469 <?php if(isset($ThemeSet['Report'])&&$ThemeSet['Report']!=null) { ?>
470 <a href="#Act/Report"><?php echo $ThemeSet['Report']; ?></a>
471 <?php } if($CanEditReply===true&&isset($ThemeSet['EditReply'])&&$ThemeSet['EditReply']!=null) {
472 echo $ThemeSet['LineDividerTopic']; echo "<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=edit&id=".$MyTopicID."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$ThemeSet['EditReply']; ?></a>
473 <?php } if($CanDeleteReply===true&&isset($ThemeSet['DeleteReply'])&&$ThemeSet['DeleteReply']!=null) {
474 echo $ThemeSet['LineDividerTopic']; echo "<a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=delete&id=".$MyTopicID."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$ThemeSet['DeleteReply']; ?></a>
475 <?php } if($CanMakeReply=="yes"&&isset($ThemeSet['QuoteReply'])&&$ThemeSet['QuoteReply']!=null) {
476 echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=create&id=".$TopicID."&post=".$MyPostID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $ThemeSet['QuoteReply']; ?></a>
477 <?php } ?>&nbsp;</div>
478 </td>
479 </tr>
480 <tr class="TableInfoRow3">
481 <td class="TableInfoColumn3" style="vertical-align: top; width: 180px;">
482 <?php // Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/
484 <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
485 <tr class="AvatarRow" style="width: 100%; height: 100%;">
486 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
487 <img src="<?php echo $User1Avatar; ?>" alt="<?php echo $User1Name; ?>'s Avatar" title="<?php echo $User1Name; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
488 </td>
489 </tr>
490 </table><br />
491 <?php echo $User1Title; ?><br />
492 Group: <?php echo $User1Group; ?><br />
493 Member: <?php
494 if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
495 if($User1ID<=0||$User1Hidden=="yes") { echo 0; }
496 ?><br />
497 Posts: <?php echo $User1PostCount; ?><br />
498 Karma: <?php echo $User1Karma; ?><br />
499 Joined: <?php echo $User1Joined; ?><br />
500 <?php if($GroupInfo['HasAdminCP']=="yes") { ?>
501 User IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
502 <?php echo $User1IP; ?></a><br />
503 <?php if($ipshow=="two") { ?>
504 Post IP: <a onclick="window.open(this.href);return false;" href="<?php echo sprintf($IPCheckURL,$MyPostIP); ?>">
505 <?php echo $MyPostIP; ?></a><br />
506 <?php } } ?><br />
507 </td>
508 <td class="TableInfoColumn3" style="vertical-align: middle;">
509 <div class="replypost"><?php echo $MyPost; ?></div>
510 <?php if(isset($User1Signature)&&$User1Signature!="") { ?> <br />--------------------
511 <div class="signature"><?php echo $User1Signature; ?></div><?php } ?>
512 </td>
513 </tr>
514 <tr class="TableInfoRow4">
515 <td class="TableInfoColumn4" colspan="2">
516 <span style="text-align: left;">&nbsp;<a href="<?php
517 if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
518 echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
519 if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
520 echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
521 ?>"><?php echo $ThemeSet['Profile']; ?></a>
522 <?php if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
523 echo $ThemeSet['LineDividerTopic']; ?><a href="<?php echo $User1Website; ?>"<?php echo $opennew; ?>><?php echo $ThemeSet['WWW']; ?></a><?php } echo $ThemeSet['LineDividerTopic']; ?><a href="<?php
524 if($User1ID>0&&$User1Hidden=="no"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
525 echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=create&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
526 if(($User1ID<=0||$User1Hidden=="yes")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
527 echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
528 ?>"><?php echo $ThemeSet['PM']; ?></a></span>
529 </td>
530 </tr>
531 </table></div>
532 <div class="DivReplies">&nbsp;</div>
533 <?php ++$i; } sql_free_result($result); }
534 if((GMTimeStamp()<$_SESSION['LastPostTime']&&$_SESSION['LastPostTime']!=0)&&
535 ($_GET['act']=="create"||$_GET['act']=="edit"||$_GET['act']=="makereply"||$_GET['act']=="editreply")) {
536 $_GET['act'] = "view"; $_POST['act'] = null;
537 redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE),"3"); ?>
538 <div class="Table1Border">
539 <?php if($ThemeSet['TableStyle']=="div") { ?>
540 <div class="TableRow1">
541 <span style="text-align: left;">
542 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
543 <?php } ?>
544 <table class="Table1">
545 <?php if($ThemeSet['TableStyle']=="table") { ?>
546 <tr class="TableRow1">
547 <td class="TableColumn1"><span style="text-align: left;">
548 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
549 </td>
550 </tr><?php } ?>
551 <tr class="TableRow2">
552 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
553 </tr>
554 <tr class="TableRow3">
555 <td class="TableColumn3">
556 <table style="width: 100%; height: 25%; text-align: center;">
557 <tr>
558 <td><span class="TableMessage"><br />
559 You have to wait before making/editing another post.<br />
560 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to view your reply.<br />&nbsp;
561 </span><br /></td>
562 </tr>
563 </table>
564 </td></tr>
565 <tr class="TableRow4">
566 <td class="TableColumn4">&nbsp;</td>
567 </tr>
568 </table></div>
569 <div class="DivMkReply">&nbsp;</div>
570 <?php } if($_GET['act']=="create") {
571 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
572 if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
573 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
574 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
575 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
576 if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
577 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
578 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
579 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
580 if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
581 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
582 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
583 if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
584 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
585 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
586 $QuoteReply = null; $QuoteDescription = null;
587 if($_GET['post']==null) {
588 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT 1", array($_GET['id']));
589 $result=sql_query($query,$SQLStat);
590 $num=sql_num_rows($result);
591 $QuoteDescription=sql_result($result,0,"Description");
592 $QuoteDescription = str_replace("Re: ","",$QuoteDescription);
593 $QuoteDescription = "Re: ".$QuoteDescription;
594 sql_free_result($result); }
595 if($_GET['post']!=null) {
596 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
597 $result=sql_query($query,$SQLStat);
598 $num=sql_num_rows($result);
599 if($num>=1) {
600 $QuoteReplyID=sql_result($result,0,"id");
601 $QuoteReplyFID=sql_result($result,0,"ForumID");
602 $QuoteReplyCID=sql_result($result,0,"CategoryID");
603 $QuoteUserID=sql_result($result,0,"UserID");
604 $QuoteReply=sql_result($result,0,"Post");
605 $QuoteReply = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","",$QuoteReply);
606 $QuoteDescription=sql_result($result,0,"Description");
607 $QuoteGuestName=sql_result($result,0,"GuestName");
608 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($QuoteUserID));
609 $reresult=sql_query($requery,$SQLStat);
610 $renum=sql_num_rows($reresult);
611 if($renum<1) { $QuoteUserID = -1;
612 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($QuoteUserID));
613 $reresult=sql_query($requery,$SQLStat);
614 $renum=sql_num_rows($reresult); }
615 $QuoteUserName=sql_result($reresult,0,"Name");
616 if($QuoteUserName=="Guest") { $QuoteUserName=$QuoteGuestName;
617 if($QuoteUserName==null) { $QuoteUserName="Guest"; } }
618 $QuoteUserName = stripcslashes(htmlspecialchars($QuoteUserName, ENT_QUOTES, $Settings['charset']));
619 //$QuoteUserName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $QuoteUserName);
620 $QuoteUserName = remove_spaces($QuoteUserName);
621 /*$QuoteReply = stripcslashes(htmlspecialchars($QuoteReply, ENT_QUOTES, $Settings['charset']));
622 $QuoteReply = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $QuoteReply);
623 //$QuoteReply = remove_spaces($QuoteReply);*/
624 $QuoteReply = remove_bad_entities($QuoteReply);
625 $QuoteDescription = str_replace("Re: ","",$QuoteDescription);
626 $QuoteDescription = "Re: ".$QuoteDescription;
627 $QuoteReply = $QuoteUserName.":\n(&quot;".$QuoteReply."&quot;)";
628 if(!isset($PermissionInfo['CanViewForum'][$QuoteReplyFID])) {
629 $PermissionInfo['CanViewForum'][$QuoteReplyFID] = "no"; }
630 if($PermissionInfo['CanViewForum'][$QuoteReplyFID]=="no") {
631 $QuoteReply = null; $QuoteDescription = null; }
632 if(!isset($CatPermissionInfo['CanViewCategory'][$QuoteReplyCID])) {
633 $CatPermissionInfo['CanViewCategory'][$QuoteReplyCID] = "no"; }
634 if($CatPermissionInfo['CanViewCategory'][$QuoteReplyCID]=="no") {
635 $QuoteReply = null; $QuoteDescription = null; } } }
636 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
637 if($_GET['post']!=null&&$num>=1) {
638 $rforumcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($QuoteReplyFID));
639 $rfmckresult=sql_query($rforumcheck,$SQLStat);
640 $rForumPostCountView=sql_result($rfmckresult,0,"PostCountView");
641 $rForumKarmaCountView=sql_result($rfmckresult,0,"KarmaCountView");
642 sql_free_result($rfmckresult);
643 $rcatcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i".$CatIgnoreList2." LIMIT 1", array($QuoteReplyCID));
644 $rcatresult=sql_query($rcatcheck,$SQLStat);
645 $rCategoryPostCountView=sql_result($rcatresult,0,"PostCountView");
646 $rCategoryKarmaCountView=sql_result($rcatresult,0,"KarmaCountView");
647 sql_free_result($rcatresult);
648 if($MyPostCountChk==null) { $MyPostCountChk = 0; }
649 if($rForumPostCountView!=0&&$MyPostCountChk<$rForumPostCountView) {
650 $QuoteReply = null; $QuoteDescription = null; }
651 if($rCategoryPostCountView!=0&&$MyPostCountChk<$rCategoryPostCountView) {
652 $QuoteReply = null; $QuoteDescription = null; }
653 if($rForumKarmaCountView!=0&&$MyKarmaCount<$rForumKarmaCountView) {
654 $QuoteReply = null; $QuoteDescription = null; }
655 if($rCategoryKarmaCountView!=0&&$MyKarmaCount<$rCategoryKarmaCountView) {
656 $QuoteReply = null; $QuoteDescription = null; } } }
657 if($_GET['post']==null||$num<1) { $QuoteReply = null; /*$QuoteDescription = null;*/ }
658 $UFID = rand_uuid("rand");
659 $_SESSION['UserFormID'] = $UFID;
661 <div class="Table1Border">
662 <?php if($ThemeSet['TableStyle']=="div") { ?>
663 <div class="TableRow1">
664 <span style="text-align: left;">
665 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span></div>
666 <?php } ?>
667 <table class="Table1" id="MakeReply<?php echo $TopicForumID; ?>">
668 <?php if($ThemeSet['TableStyle']=="table") { ?>
669 <tr class="TableRow1" id="ReplyStart<?php echo $TopicForumID; ?>">
670 <td class="TableColumn1" colspan="2"><span style="text-align: left;">
671 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
672 </td>
673 </tr><?php } ?>
674 <tr id="MakeReplyRow<?php echo $TopicForumID; ?>" class="TableRow2">
675 <td class="TableColumn2" colspan="2" style="width: 100%;">Making a Reply in Topic <?php echo $TopicName; ?></td>
676 </tr>
677 <tr class="TableRow3" id="MkReply<?php echo $TopicForumID; ?>">
678 <td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
679 <div style="width: 100%; height: 160px; overflow: auto;">
680 <table style="width: 100%; text-align: center;"><?php
681 $renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
682 $renee_result=sql_query($renee_query,$SQLStat);
683 $renee_num=sql_num_rows($renee_result);
684 $renee_s=0; $rose_a=0; $SmileRow=0; $SmileCRow=0;
685 while ($renee_s < $renee_num) { ++$SmileRow;
686 $FileName=sql_result($renee_result,$renee_s,"FileName");
687 $SmileName=sql_result($renee_result,$renee_s,"SmileName");
688 $SmileText=sql_result($renee_result,$renee_s,"SmileText");
689 $SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
690 $ShowSmile=sql_result($renee_result,$renee_s,"Display");
691 $ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
692 if($SmileRow==1) { ?><tr>
693 <?php } if($SmileRow<5) { ++$SmileCRow; ?>
694 <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
695 <?php ++$rose_a; } if($SmileRow==5) { ++$SmileCRow; $rose_a = 0; ?>
696 <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
697 <?php $SmileCRow=0; $SmileRow=0; }
698 ++$renee_s; }
699 if($SmileCRow<5&&$SmileCRow!=0) {
700 $SmileCRowL = 5 - $SmileCRow;
701 echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
702 echo "</table>";
703 sql_free_result($renee_result);
704 ?></div></td>
705 <td class="TableColumn3" style="width: 85%;">
706 <form style="display: inline;" 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']); ?>">
707 <table style="text-align: left;">
708 <tr style="text-align: left;">
709 <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
710 <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $QuoteDescription; ?>" /></td>
711 </tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
712 <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
713 <?php if(!isset($_SESSION['GuestName'])) { ?>
714 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
715 <?php } if(isset($_SESSION['GuestName'])) { ?>
716 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
717 <?php } ?></tr><?php } ?>
718 </table>
719 <table style="text-align: left;">
720 <tr style="text-align: left;">
721 <td style="width: 100%;">
722 <label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
723 <textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $QuoteReply; ?></textarea><br />
724 <?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
725 <label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
726 <input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
727 <?php } ?>
728 <input type="hidden" name="act" value="makereplies" style="display: none;" />
729 <input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
730 <?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
731 <input type="hidden" name="GuestName" value="null" style="display: none;" />
732 <?php } ?>
733 <input type="submit" class="Button" value="Make Reply" name="make_reply" />
734 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
735 </td></tr></table>
736 </form></td></tr>
737 <tr id="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
738 <td class="TableColumn4" colspan="2">&nbsp;</td>
739 </tr>
740 </table></div>
741 <div class="DivMkReply">&nbsp;</div>
742 <?php } if($_GET['act']=="makereply"&&$_POST['act']=="makereplies") {
743 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
744 if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
745 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
746 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
747 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
748 if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
749 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
750 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
751 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
752 if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
753 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
754 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
755 if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
756 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
757 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
758 $MyUsersID = $_SESSION['UserID']; if($MyUsersID=="0"||$MyUsersID==null) { $MyUsersID = -1; }
759 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
760 $URL['REFERER'] = $REFERERurl['host'];
761 $URL['HOST'] = $_SERVER["SERVER_NAME"];
762 $REFERERurl = null;
763 if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
764 if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
765 if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
766 if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
767 $Settings['captcha_guest']=="on") {
768 require($SettDir['inc']."captcha.php"); }
770 <div class="Table1Border">
771 <?php if($ThemeSet['TableStyle']=="div") { ?>
772 <div class="TableRow1">
773 <span style="text-align: left;">
774 <?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></div>
775 <?php } ?>
776 <table class="Table1">
777 <?php if($ThemeSet['TableStyle']=="table") { ?>
778 <tr class="TableRow1">
779 <td class="TableColumn1"><span style="text-align: left;">
780 <?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>
781 </td>
782 </tr><?php } ?>
783 <tr class="TableRow2">
784 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Make Reply Message: </th>
785 </tr>
786 <tr class="TableRow3">
787 <td class="TableColumn3">
788 <table style="width: 100%; height: 25%; text-align: center;">
789 <?php if (pre_strlen($_POST['ReplyDesc'])>"80") { $Error="Yes"; ?>
790 <tr>
791 <td><span class="TableMessage">
792 <br />Your Reply Description is too big.<br />
793 </span>&nbsp;</td>
794 </tr>
795 <?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
796 $Settings['captcha_guest']=="on") {
797 if (PhpCaptcha::Validate($_POST['signcode'])) {
798 //echo 'Valid code entered';
799 } else { $Error="Yes"; ?>
800 <tr>
801 <td><span class="TableMessage">
802 <br />Invalid code entered<br />
803 </span>&nbsp;</td>
804 </tr>
805 <?php } } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
806 pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?>
807 <tr>
808 <td><span class="TableMessage">
809 <br />You Guest Name is too big.<br />
810 </span>&nbsp;</td>
811 </tr>
812 <?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?>
813 <tr>
814 <td><span class="TableMessage">
815 <br />Sorry the referering url dose not match our host name.<br />
816 </span>&nbsp;</td>
817 </tr>
818 <?php } if ($Settings['TestReferer']=="on") {
819 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
820 <tr>
821 <td><span class="TableMessage">
822 <br />Sorry the referering url dose not match our host name.<br />
823 </span>&nbsp;</td>
824 </tr>
825 <?php } }
826 $_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES, $Settings['charset']));
827 //$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
828 $_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
829 $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
830 //$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
831 $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
832 $_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES, $Settings['charset']));
833 //$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
834 //$_POST['ReplyPost'] = remove_spaces($_POST['ReplyPost']);
835 $_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
836 if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
837 if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
838 if($cookieDomain==null) {
839 setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir); }
840 if($cookieDomain!=null) {
841 if($cookieSecure===true) {
842 setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
843 if($cookieSecure===false) {
844 setcookie("GuestName", $_POST['GuestName'], time() + (7 * 86400), $cbasedir, $cookieDomain); } }
845 $_SESSION['GuestName']=$_POST['GuestName']; } }
846 /* <_< iWordFilter >_>
847 by Kazuki Przyborowski - Cool Dude 2k */
848 $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
849 $katarzynart=sql_query($katarzynaqy,$SQLStat);
850 $katarzynanm=sql_num_rows($katarzynart);
851 $katarzynas=0;
852 while ($katarzynas < $katarzynanm) {
853 $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
854 $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
855 $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
856 if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
857 if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
858 if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
859 $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
860 if($WholeWord=="on") { $WholeWord = "yes"; }
861 if($WholeWord=="off") { $WholeWord = "no"; }
862 if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
863 $Filter = preg_quote($Filter, "/");
864 if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
865 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyDesc']);
866 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyPost']); }
867 if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
868 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyDesc']);
869 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyPost']); }
870 if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
871 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyDesc']);
872 $_POST['ReplyPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyPost']); }
873 if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
874 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyDesc']);
875 $_POST['ReplyPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyPost']); }
876 ++$katarzynas; } sql_free_result($katarzynart);
877 if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?>
878 <tr>
879 <td><span class="TableMessage">
880 <br />You need to enter a Reply Description.<br />
881 </span>&nbsp;</td>
882 </tr>
883 <?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
884 $_POST['GuestName']==null) { $Error="Yes"; ?>
885 <tr>
886 <td><span class="TableMessage">
887 <br />You need to enter a Guest Name.<br />
888 </span>&nbsp;</td>
889 </tr>
890 <?php } if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { $Error="Yes"; ?>
891 <tr>
892 <td><span class="TableMessage">
893 <br />You do not have permission to make a reply here.<br />
894 </span>&nbsp;</td>
895 </tr>
896 <?php } if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&
897 $TopicClosed==1) { $Error="Yes"; ?>
898 <tr>
899 <td><span class="TableMessage">
900 <br />You do not have permission to make a reply here.<br />
901 </span>&nbsp;</td>
902 </tr>
903 <?php } if ($_POST['ReplyPost']==null) { $Error="Yes"; ?>
904 <tr>
905 <td><span class="TableMessage">
906 <br />You need to enter a Reply.<br />
907 </span>&nbsp;</td>
908 </tr>
909 <?php } if ($Error=="Yes") {
910 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?>
911 <tr>
912 <td><span class="TableMessage">
913 <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
914 </span><br /></td>
915 </tr>
916 <?php } if ($Error!="Yes") { $LastActive = GMTimeStamp();
917 $gnrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($TopicForumID));
918 $gnrresult=sql_query($gnrquery,$SQLStat); $gnrnum=sql_num_rows($gnrresult);
919 $NumberPosts=sql_result($gnrresult,0,"NumPosts");
920 $PostCountAdd=sql_result($gnrresult,0,"PostCountAdd");
921 sql_free_result($gnrresult);
922 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUsersID));
923 $reresult=sql_query($requery,$SQLStat);
924 $renum=sql_num_rows($reresult);
925 $rei=0;
926 while ($rei < $renum) {
927 $User1ID=$MyUsersID;
928 $User1Name=sql_result($reresult,$rei,"Name");
929 if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
930 $User1Email=sql_result($reresult,$rei,"Email");
931 $User1Title=sql_result($reresult,$rei,"Title");
932 $User1GroupID=sql_result($reresult,$rei,"GroupID");
933 $PostCount=sql_result($reresult,$rei,"PostCount");
934 $NewPostCount = null;
935 if($PostCountAdd=="on") { $NewPostCount = $PostCount + 1; }
936 if(!isset($NewPostCount)) { $NewPostCount = $PostCount; }
937 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
938 $gresult=sql_query($gquery,$SQLStat);
939 $User1Group=sql_result($gresult,0,"Name");
940 sql_free_result($gresult);
941 $User1IP=$_SERVER['REMOTE_ADDR'];
942 ++$rei; } sql_free_result($reresult);
943 $query = sql_pre_query("INSERT INTO \"".$Settings['sqltable']."posts\" (\"TopicID\", \"ForumID\", \"CategoryID\", \"UserID\", \"GuestName\", \"TimeStamp\", \"LastUpdate\", \"EditUser\", \"EditUserName\", \"Post\", \"Description\", \"IP\", \"EditIP\") VALUES\n".
944 "(%i, %i, %i, %i, '%s', %i, %i, 0, '', '%s', '%s', '%s', '0')", array($TopicID,$TopicForumID,$TopicCatID,$User1ID,$User1Name,$LastActive,$LastActive,$_POST['ReplyPost'],$_POST['ReplyDesc'],$User1IP));
945 sql_query($query,$SQLStat);
946 $postid = sql_get_next_id($Settings['sqltable'],"posts",$SQLStat);
947 $_SESSION['LastPostTime'] = GMTimeStamp() + $GroupInfo['FloodControl'];
948 if($User1ID!=0&&$User1ID!=-1) {
949 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s',\"PostCount\"=%i,\"LastPostTime\"=%i WHERE \"id\"=%i", array($LastActive,$User1IP,$NewPostCount,$_SESSION['LastPostTime'],$User1ID));
950 sql_query($queryupd,$SQLStat); }
951 $NewNumPosts = $NumberPosts + 1; $NewNumReplies = $NumberReplies + 1;
952 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$TopicForumID));
953 sql_query($queryupd,$SQLStat);
954 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumReply\"=%i,LastUpdate=%i WHERE \"id\"=%i", array($NewNumReplies,$LastActive,$TopicID));
955 sql_query($queryupd,$SQLStat);
956 $MyPostNum = $NewNumReplies + 1; $NumPages = null;
957 if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
958 if($MyPostNum>$Settings['max_posts']) {
959 $NumPages = ceil($MyPostNum/$Settings['max_posts']); }
960 if($MyPostNum<=$Settings['max_posts']) {
961 $NumPages = 1; }
962 redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE).$Settings['qstr']."#reply".$MyPostNum,"3");
963 ?><tr>
964 <td><span class="TableMessage"><br />
965 Reply to Topic <?php echo $TopicName; ?> was posted.<br />
966 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$NumPages,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>&amp;&#35;reply<?php echo $MyPostNum; ?>">here</a> to view your reply.<br />&nbsp;
967 </span><br /></td>
968 </tr>
969 <?php } ?>
970 </table>
971 </td></tr>
972 <tr class="TableRow4">
973 <td class="TableColumn4">&nbsp;</td>
974 </tr>
975 </table></div>
976 <div class="DivMkReply">&nbsp;</div>
977 <?php } if($_GET['act']=="pin"||$_GET['act']=="unpin") {
978 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
979 $gtsresult=sql_query($gtsquery,$SQLStat);
980 $gtsnum=sql_num_rows($gtsresult);
981 $TTopicID=sql_result($gtsresult,0,"id");
982 $TForumID=sql_result($gtsresult,0,"ForumID");
983 $TUsersID=sql_result($gtsresult,0,"UserID");
984 $TPinned=sql_result($gtsresult,0,"Pinned");
985 $TClosed=sql_result($gtsresult,0,"Closed");
986 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
987 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
988 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
989 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
990 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
991 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
992 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
993 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
994 if ($TPinned>2) { $TPinned = 1; }
995 if ($TPinned<0) { $TPinned = 0; }
996 $CanPinTopics = false;
997 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
998 if($PermissionInfo['CanPinTopics'][$TForumID]=="yes"&&
999 $_SESSION['UserID']==$TUsersID) { $CanPinTopics = true; }
1000 if($PermissionInfo['CanPinTopics'][$TForumID]=="yes"&&
1001 $PermissionInfo['CanModForum'][$TForumID]=="yes") {
1002 $CanPinTopics = true; }
1003 if($PermissionInfo['CanPinTopics'][$TForumID]=="no"&&
1004 $TopicClosed==1) { $CanPinTopics = false; } }
1005 if($_SESSION['UserID']==0) { $CanPinTopics = false; }
1006 if($_GET['level']<1) { $_GET['level'] = 1; }
1007 if($_GET['level']>2) { $_GET['level'] = 1; }
1008 if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
1009 if($_GET['level']>1) { $_GET['level'] = 1; } }
1010 if($CanPinTopics===false) {
1011 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1012 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1013 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1014 sql_free_result($gtsresult);
1015 if($CanPinTopics===true) {
1016 if($_GET['act']=="pin") {
1017 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Pinned\"=%i WHERE \"id\"=%i", array($_GET['level'],$TTopicID)); }
1018 if($_GET['act']=="unpin") {
1019 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Pinned\"=0 WHERE \"id\"=%i", array($TTopicID)); }
1020 sql_query($queryupd,$SQLStat);
1021 redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false).$Settings['qstr']."#post".$_GET['post'],"4");
1023 <div class="Table1Border">
1024 <?php if($ThemeSet['TableStyle']=="div") { ?>
1025 <div class="TableRow1">
1026 <span style="text-align: left;">
1027 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
1028 <?php } ?>
1029 <table class="Table1">
1030 <?php if($ThemeSet['TableStyle']=="table") { ?>
1031 <tr class="TableRow1">
1032 <td class="TableColumn1"><span style="text-align: left;">
1033 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
1034 </td>
1035 </tr><?php } ?>
1036 <tr class="TableRow2">
1037 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Pin/Unpin Topic Message: </th>
1038 </tr>
1039 <tr class="TableRow3" style="text-align: center;">
1040 <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
1041 Topic was successfully unpinned/pinned.<br />
1042 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
1043 </span><br /></td>
1044 </tr>
1045 <tr class="TableRow4">
1046 <td class="TableColumn4">&nbsp;</td>
1047 </tr>
1048 </table></div>
1049 <?php } } if($_GET['act']=="open"||$_GET['act']=="close") {
1050 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
1051 $gtsresult=sql_query($gtsquery,$SQLStat);
1052 $gtsnum=sql_num_rows($gtsresult);
1053 $TTopicID=sql_result($gtsresult,0,"id");
1054 $TForumID=sql_result($gtsresult,0,"ForumID");
1055 $TUsersID=sql_result($gtsresult,0,"UserID");
1056 $TClosed=sql_result($gtsresult,0,"Closed");
1057 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1058 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1059 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1060 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1061 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1062 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1063 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1064 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1065 if ($TClosed>3) { $TClosed = 3; }
1066 if ($TClosed<0) { $TClosed = 0; }
1067 $CanCloseTopics = false;
1068 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
1069 if($PermissionInfo['CanCloseTopics'][$TForumID]=="yes"&&
1070 $_SESSION['UserID']==$TUsersID) { $CanCloseTopics = true; }
1071 if($PermissionInfo['CanCloseTopics'][$TForumID]=="yes"&&
1072 $PermissionInfo['CanModForum'][$TForumID]=="yes") {
1073 $CanCloseTopics = true; } }
1074 if($_GET['level']<1) { $_GET['level'] = 1; }
1075 if($_GET['level']>3) { $_GET['level'] = 1; }
1076 if($PermissionInfo['CanModForum'][$UseThisFonum]=="no") {
1077 if($_GET['level']>1) { $_GET['level'] = 1; } }
1078 if($_SESSION['UserID']==0) { $CanCloseTopics = false; }
1079 if($CanCloseTopics===false) {
1080 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1081 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1082 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1083 sql_free_result($gtsresult);
1084 if($CanCloseTopics===true) {
1085 if($_GET['act']=="close") {
1086 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Closed\"=%i WHERE \"id\"=%i", array($_GET['level'],$TTopicID)); }
1087 if($_GET['act']=="open") {
1088 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"Closed\"=0 WHERE \"id\"=%i", array($TTopicID)); }
1089 sql_query($queryupd,$SQLStat);
1090 redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false).$Settings['qstr']."#post".$_GET['post'],"4");
1092 <div class="Table1Border">
1093 <?php if($ThemeSet['TableStyle']=="div") { ?>
1094 <div class="TableRow1">
1095 <span style="text-align: left;">
1096 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
1097 <?php } ?>
1098 <table class="Table1">
1099 <?php if($ThemeSet['TableStyle']=="table") { ?>
1100 <tr class="TableRow1">
1101 <td class="TableColumn1"><span style="text-align: left;">
1102 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
1103 </td>
1104 </tr><?php } ?>
1105 <tr class="TableRow2">
1106 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Open/Close Topic Message: </th>
1107 </tr>
1108 <tr class="TableRow3" style="text-align: center;">
1109 <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
1110 Topic was successfully opened/closed.<br />
1111 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
1112 </span><br /></td>
1113 </tr>
1114 <tr class="TableRow4">
1115 <td class="TableColumn4">&nbsp;</td>
1116 </tr>
1117 </table></div>
1118 <?php } } if($_GET['act']=="move") {
1119 if(!isset($_GET['newid'])) {
1120 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1121 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1122 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1123 if(!is_numeric($_GET['newid'])) {
1124 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1125 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1126 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1127 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
1128 $gtsresult=sql_query($gtsquery,$SQLStat);
1129 $gtsnum=sql_num_rows($gtsresult);
1130 $TTopicID=sql_result($gtsresult,0,"id");
1131 $OldForumID=sql_result($gtsresult,0,"ForumID");
1132 $OldCatID=sql_result($gtsresult,0,"CategoryID");
1133 $TClosed=sql_result($gtsresult,0,"Closed");
1134 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$OldForumID]=="no") {
1135 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1136 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1137 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1138 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$OldForumID]=="no") {
1139 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1140 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1141 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1142 $CanMoveTopics = false;
1143 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
1144 if($PermissionInfo['CanCloseTopics'][$OldForumID]=="yes"&&
1145 $PermissionInfo['CanModForum'][$OldForumID]=="yes") {
1146 $CanMoveTopics = true; }
1147 if($PermissionInfo['CanCloseTopics'][$_GET['newid']]=="yes"&&
1148 $PermissionInfo['CanModForum'][$_GET['newid']]=="yes") {
1149 $CanMoveTopics = true; } }
1150 if($_SESSION['UserID']==0) { $CanMoveTopics = false; }
1151 //if($CanMoveTopics===false||$_GET['newid']==$OldForumID) {
1152 if($CanMoveTopics===false) {
1153 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1154 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1155 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1156 sql_free_result($gtsresult);
1157 if($CanMoveTopics===true) {
1158 $TNumberPosts = $NumberReplies + 1;
1159 $mvquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($_GET['newid']));
1160 $mvresult=sql_query($mvquery,$SQLStat);
1161 $mvnum=sql_num_rows($mvresult);
1162 if($mvnum<1) {
1163 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($gtsresult);
1164 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($mvresult);
1165 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1166 $NumberPosts=sql_result($mvresult,0,"NumPosts");
1167 $NumberPosts = $NumberPosts + $TNumberPosts;
1168 $NumberTopics=sql_result($mvresult,0,"NumTopics");
1169 $NumberTopics = $NumberTopics + 1;
1170 $NewCatID=sql_result($mvresult,0,"CategoryID");
1171 sql_free_result($mvresult);
1172 $recountq = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NumberPosts,$NumberTopics,$_GET['newid']));
1173 sql_query($recountq,$SQLStat);
1174 $mvquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($OldForumID));
1175 $mvresult=sql_query($mvquery,$SQLStat);
1176 $mvnum=sql_num_rows($mvresult);
1177 $NumberPosts=sql_result($mvresult,0,"NumPosts");
1178 $NumberPosts = $NumberPosts - $TNumberPosts;
1179 $NumberTopics=sql_result($mvresult,0,"NumTopics");
1180 $NumberTopics = $NumberTopics - 1;
1181 sql_free_result($mvresult);
1182 $recountq = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NumberPosts,$NumberTopics,$OldForumID));
1183 sql_query($recountq,$SQLStat);
1184 if($_GET['link']=="no") {
1185 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"ForumID\"=%i,\"CategoryID\"=%i,\"OldForumID\"=%i,\"OldCategoryID\"=%i WHERE \"id\"=%i", array($_GET['newid'],$NewCatID,$_GET['newid'],$NewCatID,$TTopicID)); }
1186 if($_GET['link']=="yes") {
1187 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"ForumID\"=%i,\"CategoryID\"=%i,\"OldForumID\"=%i,\"OldCategoryID\"=%i WHERE \"id\"=%i", array($_GET['newid'],$NewCatID,$OldForumID,$OldCatID,$TTopicID)); }
1188 sql_query($queryupd,$SQLStat);
1189 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"ForumID\"=%i,\"CategoryID\"=%i WHERE \"TopicID\"=%i", array($_GET['newid'],$NewCatID,$TTopicID));
1190 sql_query($queryupd,$SQLStat);
1192 redirect("refresh",$rbasedir.url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],false),"4");
1194 <div class="Table1Border">
1195 <?php if($ThemeSet['TableStyle']=="div") { ?>
1196 <div class="TableRow1">
1197 <span style="text-align: left;">
1198 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
1199 <?php } ?>
1200 <table class="Table1">
1201 <?php if($ThemeSet['TableStyle']=="table") { ?>
1202 <tr class="TableRow1">
1203 <td class="TableColumn1"><span style="text-align: left;">
1204 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
1205 </td>
1206 </tr><?php } ?>
1207 <tr class="TableRow2">
1208 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Move Topic Message: </th>
1209 </tr>
1210 <tr class="TableRow3" style="text-align: center;">
1211 <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
1212 Topic was successfully moved.<br />
1213 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TTopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">here</a> to go back to topic.<br />&nbsp;
1214 </span><br /></td>
1215 </tr>
1216 <tr class="TableRow4">
1217 <td class="TableColumn4">&nbsp;</td>
1218 </tr>
1219 </table></div>
1220 <?php } if($_GET['act']=="delete") {
1221 $predquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
1222 $predresult=sql_query($predquery,$SQLStat);
1223 $prednum=sql_num_rows($predresult);
1224 $ReplyID=sql_result($predresult,0,"id");
1225 $ReplyTopicID=sql_result($predresult,0,"TopicID");
1226 $ReplyForumID=sql_result($predresult,0,"ForumID");
1227 $ReplyUserID=sql_result($predresult,0,"UserID");
1228 sql_free_result($predresult);
1229 $CanDeleteReply = false;
1230 if($_SESSION['UserID']!=0) {
1231 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
1232 if($PermissionInfo['CanDeleteReplys'][$ReplyForumID]=="yes"&&
1233 $_SESSION['UserID']==$ReplyUserID) { $CanDeleteReply = true; }
1234 if($PermissionInfo['CanDeleteReplys'][$ReplyForumID]=="yes"&&
1235 $PermissionInfo['CanModForum'][$ReplyForumID]=="yes") {
1236 $CanDeleteReply = true; } }
1237 if($PermissionInfo['CanDeleteReplysClose'][$TopicForumID]=="no"&&
1238 $TopicClosed==1) { $CanDeleteReply = false; } }
1239 if($_SESSION['UserID']==0) { $CanDeleteReply = false; }
1240 if($CanDeleteReply===false) {
1241 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1242 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1243 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1244 $delquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($_GET['id']));
1245 $delresult=sql_query($delquery,$SQLStat);
1246 $delnum=sql_num_rows($delresult);
1247 $DelTopic = false;
1248 $gnrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i".$ForumIgnoreList2." LIMIT 1", array($ReplyForumID));
1249 $gnrresult=sql_query($gnrquery,$SQLStat); $gnrnum=sql_num_rows($gnrresult);
1250 $NumberPosts=sql_result($gnrresult,0,"NumPosts"); $NumberTopics=sql_result($gnrresult,0,"NumTopics");
1251 sql_free_result($gnrresult);
1252 $FReplyID=sql_result($delresult,0,"id");
1253 if($ReplyID==$FReplyID) { $DelTopic = true;
1254 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($ReplyTopicID));
1255 $gtsresult=sql_query($gtsquery,$SQLStat);
1256 $gtsnum=sql_num_rows($gtsresult);
1257 $TUsersID=sql_result($gtsresult,0,"UserID");
1258 $TForumID=sql_result($gtsresult,0,"ForumID");
1259 $TClosed=sql_result($gtsresult,0,"Closed");
1260 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1261 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1262 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1263 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1264 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1265 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1266 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1267 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1268 $CanDeleteTopics = false;
1269 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
1270 if($PermissionInfo['CanDeleteTopics'][$ReplyForumID]=="yes"&&
1271 $_SESSION['UserID']==$TUsersID) { $CanDeleteTopics = true; }
1272 if($PermissionInfo['CanDeleteTopics'][$ReplyForumID]=="yes"&&
1273 $PermissionInfo['CanModForum'][$ReplyForumID]=="yes") {
1274 $CanDeleteTopics = true; }
1275 if($PermissionInfo['CanDeleteTopicsClose'][$TopicForumID]=="no"&&
1276 $TopicClosed==1) { $CanDeleteTopics = false; } }
1277 if($_SESSION['UserID']==0) { $CanDeleteTopics = false; }
1278 if($CanDeleteTopics===false) {
1279 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($delresult);
1280 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1281 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1282 if($CanDeleteTopics===true) { $NewNumTopics = $NumberTopics - 1; $NewNumPosts = $NumberPosts - $delnum;
1283 $drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i", array($ReplyTopicID));
1284 sql_query($drquery,$SQLStat);
1285 $dtquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i", array($ReplyTopicID));
1286 sql_query($dtquery,$SQLStat);
1287 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i,\"NumTopics\"=%i WHERE \"id\"=%i", array($NewNumPosts,$NewNumTopics,$ReplyForumID));
1288 sql_query($queryupd,$SQLStat); } }
1289 if($ReplyID!=$FReplyID) {
1290 $LReplyID=sql_result($delresult,$delnum-1,"id");
1291 $SLReplyID=sql_result($delresult,$delnum-2,"id");
1292 $NewLastUpdate=sql_result($delresult,$delnum-2,"TimeStamp");
1293 if($ReplyID==$LReplyID) { $NewNumReplies = $NumberReplies - 1; $NewNumPosts = $NumberPosts - 1;
1294 $drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i", array($ReplyID));
1295 sql_query($drquery,$SQLStat);
1296 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$ReplyForumID));
1297 sql_query($queryupd,$SQLStat);
1298 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"LastUpdate\"=%i,\"NumReply\"=%i WHERE \"id\"=%i", array($NewLastUpdate,$NewNumReplies,$ReplyTopicID));
1299 sql_query($queryupd,$SQLStat); } }
1300 if($ReplyID!=$FReplyID&&$ReplyID!=$LReplyID) { $NewNumReplies = $NumberReplies - 1; $NewNumPosts = $NumberPosts - 1;
1301 $drquery = sql_pre_query("DELETE FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i", array($ReplyID));
1302 sql_query($drquery,$SQLStat);
1303 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."forums\" SET \"NumPosts\"=%i WHERE \"id\"=%i", array($NewNumPosts,$ReplyForumID));
1304 sql_query($queryupd,$SQLStat);
1305 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumReply\"=%i WHERE \"id\"=%i", array($NewNumReplies,$ReplyTopicID));
1306 sql_query($queryupd,$SQLStat); }
1307 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
1308 sql_free_result($delresult);
1310 <div class="Table1Border">
1311 <?php if($ThemeSet['TableStyle']=="div") { ?>
1312 <div class="TableRow1">
1313 <span style="text-align: left;">
1314 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $TopicName; ?></a></span></div>
1315 <?php } ?>
1316 <table class="Table1">
1317 <?php if($ThemeSet['TableStyle']=="table") { ?>
1318 <tr class="TableRow1">
1319 <td class="TableColumn1"><span style="text-align: left;">
1320 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php echo $TopicName; ?></a></span>
1321 </td>
1322 </tr><?php } ?>
1323 <tr class="TableRow2">
1324 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Delete Reply Message: </th>
1325 </tr>
1326 <tr class="TableRow3" style="text-align: center;">
1327 <td class="TableColumn3" style="text-align: center;"><span class="TableMessage"><br />
1328 Reply was deleted successfully.<br />
1329 Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to go back to index.<br />&nbsp;
1330 </span><br /></td>
1331 </tr>
1332 <tr class="TableRow4">
1333 <td class="TableColumn4">&nbsp;</td>
1334 </tr>
1335 </table></div>
1336 <?php } if($_GET['act']=="edit") {
1337 if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no"||$_SESSION['UserID']==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1338 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1339 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1340 if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1341 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1342 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1343 $ShowEditTopic = null;
1344 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1345 $editquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
1346 $editresult=sql_query($editquery,$SQLStat);
1347 $editnum=sql_num_rows($editresult);
1348 $FReplyID=sql_result($editresult,0,"id");
1349 sql_free_result($editresult);
1350 if($_GET['post']==$FReplyID) { $ShowEditTopic = true; } }
1351 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="no") { $ShowEditTopic = null; }
1352 $ersquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
1353 $ersresult=sql_query($ersquery,$SQLStat);
1354 $ersnum=sql_num_rows($ersresult);
1355 if($ersnum==0) { sql_free_result($ersresult);
1356 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1357 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1358 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1359 $ReplyPost=sql_result($ersresult,0,"Post");
1360 /*$ReplyPost = stripcslashes(htmlspecialchars($ReplyPost, ENT_QUOTES, $Settings['charset']));
1361 $ReplyPost = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyPost);
1362 //$ReplyPost = remove_spaces($ReplyPost);*/
1363 $ReplyPost = remove_bad_entities($ReplyPost);
1364 $ReplyDescription=sql_result($ersresult,0,"Description");
1365 /*$ReplyDescription = stripcslashes(htmlspecialchars($ReplyDescription, ENT_QUOTES, $Settings['charset']));
1366 $ReplyDescription = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyDescription);
1367 //$ReplyDescription = remove_spaces($ReplyDescription);*/
1368 $ReplyGuestName=sql_result($ersresult,0,"GuestName");
1369 //$ReplyGuestName = stripcslashes(htmlspecialchars($ReplyGuestName, ENT_QUOTES, $Settings['charset']));
1370 //$ReplyGuestName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $ReplyGuestName);
1371 $ReplyGuestName = remove_spaces($ReplyGuestName);
1372 $ReplyUser=sql_result($ersresult,0,"UserID");
1373 if($_SESSION['UserID']!=$ReplyUser&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
1374 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1375 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1376 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1377 sql_free_result($ersresult);
1378 if($ShowEditTopic===true) {
1379 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($TopicID));
1380 $gtsresult=sql_query($gtsquery,$SQLStat);
1381 $gtsnum=sql_num_rows($gtsresult);
1382 $TUsersID=sql_result($gtsresult,0,"UserID");
1383 $TForumID=sql_result($gtsresult,0,"ForumID");
1384 $TClosed=sql_result($gtsresult,0,"Closed");
1385 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1386 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1387 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1388 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1389 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1390 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1391 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1392 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1393 if($_SESSION['UserID']!=$TUsersID) { $ShowEditTopic = null; }
1394 if($PermissionInfo['CanModForum'][$TopicForumID]=="yes"&&
1395 $PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1396 $ShowEditTopic = true; }
1397 if($PermissionInfo['CanEditTopicsClose'][$TopicForumID]=="no"&&$TopicClosed==1) {
1398 $ShowEditTopic = null; } }
1399 //$TopicName = stripcslashes(htmlspecialchars($TopicName, ENT_QUOTES, $Settings['charset']));
1400 //$TopicName = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $TopicName);
1401 $TopicName = remove_spaces($TopicName);
1402 if($ShowEditTopic===true) {
1403 sql_free_result($gtsresult); }
1404 $UFID = rand_uuid("rand");
1405 $_SESSION['UserFormID'] = $UFID;
1407 <div class="Table1Border">
1408 <?php if($ThemeSet['TableStyle']=="div") { ?>
1409 <div class="TableRow1">
1410 <span style="text-align: left;">
1411 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
1412 <?php } ?>
1413 <table class="Table1" id="EditReply<?php echo $_GET['post']; ?>">
1414 <?php if($ThemeSet['TableStyle']=="table") { ?>
1415 <tr class="TableRow1" id="ReplyEdit<?php echo $_GET['post']; ?>">
1416 <td class="TableColumn1" colspan="2"><span style="text-align: left;">
1417 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
1418 </td>
1419 </tr><?php } ?>
1420 <tr id="EditReplyRow<?php echo $_GET['post']; ?>" class="TableRow2">
1421 <td class="TableColumn2" colspan="2" style="width: 100%;">Editing a Reply in Topic <?php echo $TopicName; ?></td>
1422 </tr>
1423 <tr class="TableRow3" id="EditReplies<?php echo $_GET['post']; ?>">
1424 <td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
1425 <div style="width: 100%; height: 160px; overflow: auto;"><?php
1426 $renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
1427 $renee_result=sql_query($renee_query,$SQLStat);
1428 $renee_num=sql_num_rows($renee_result);
1429 $renee_s=0; $SmileRow=1;
1430 while ($renee_s < $renee_num) {
1431 $FileName=sql_result($renee_result,$renee_s,"FileName");
1432 $SmileName=sql_result($renee_result,$renee_s,"SmileName");
1433 $SmileText=sql_result($renee_result,$renee_s,"SmileText");
1434 $SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
1435 $ShowSmile=sql_result($renee_result,$renee_s,"Display");
1436 $ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
1437 if($SmileRow<5) { ?>
1438 <img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" />&nbsp;&nbsp;
1439 <?php } if($SmileRow==5) { ?>
1440 <img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /><br />
1441 <?php $SmileRow=1; }
1442 ++$renee_s; ++$SmileRow; }
1443 sql_free_result($renee_result);
1444 ?></div></td>
1445 <td class="TableColumn3" style="width: 85%;">
1446 <form style="display: inline;" method="post" id="EditReplyForm" action="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=editreply&id=".$TopicID."&post=".$_GET['post'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>">
1447 <table style="text-align: left;">
1448 <tr style="text-align: left;">
1449 <?php if($ShowEditTopic===true) { ?>
1450 <td style="width: 50%;"><label class="TextBoxLabel" for="TopicName">Insert Topic Name:</label></td>
1451 <td style="width: 50%;"><input maxlength="30" type="text" name="TopicName" class="TextBox" id="TopicName" size="20" value="<?php echo $TopicName; ?>" /></td>
1452 </tr><tr style="text-align: left;"><?php } ?>
1453 <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
1454 <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $ReplyDescription; ?>" /></td>
1455 </tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
1456 <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
1457 <?php if(!isset($_SESSION['GuestName'])) { ?>
1458 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
1459 <?php } if(isset($_SESSION['GuestName'])) { ?>
1460 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
1461 <?php } ?></tr><?php } ?>
1462 </table>
1463 <table style="text-align: left;">
1464 <tr style="text-align: left;">
1465 <td style="width: 100%;">
1466 <label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
1467 <textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $ReplyPost; ?></textarea><br />
1468 <input type="hidden" name="act" value="editreplies" style="display: none;" />
1469 <input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
1470 <?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
1471 <input type="hidden" name="GuestName" value="null" style="display: none;" />
1472 <?php } ?>
1473 <input type="submit" class="Button" value="Edit Reply" name="edit_reply" />
1474 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
1475 </td></tr></table>
1476 </form></td></tr>
1477 <tr id="EditReplyEnd<?php echo $_GET['post']; ?>" class="TableRow4">
1478 <td class="TableColumn4" colspan="2">&nbsp;</td>
1479 </tr>
1480 </table></div>
1481 <div class="DivMkReply">&nbsp;</div>
1482 <?php } if($_GET['act']=="editreply"&&$_POST['act']=="editreplies") {
1483 if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no"||$_SESSION['UserID']==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1484 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1485 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1486 if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1487 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1488 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1489 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
1490 $URL['REFERER'] = $REFERERurl['host'];
1491 $URL['HOST'] = $_SERVER["SERVER_NAME"];
1492 $REFERERurl = null;
1493 if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
1494 if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
1495 if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
1496 if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; }
1497 if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1498 $Settings['captcha_guest']=="on") {
1499 require($SettDir['inc']."captcha.php"); }
1500 $ShowEditTopic = null;
1501 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1502 $editquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
1503 $editresult=sql_query($editquery,$SQLStat);
1504 $editnum=sql_num_rows($editresult);
1505 $FReplyID=sql_result($editresult,0,"id");
1506 sql_free_result($editresult);
1507 if($_GET['post']==$FReplyID) { $ShowEditTopic = true; } }
1508 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="no") { $ShowEditTopic = null; }
1509 $ersquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
1510 $ersresult=sql_query($ersquery,$SQLStat);
1511 $ersnum=sql_num_rows($ersresult);
1512 if($ersnum==0) { sql_free_result($ersresult);
1513 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1514 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1515 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1516 $ReplyUser=sql_result($ersresult,0,"UserID");
1517 if($_SESSION['UserID']!=$ReplyUser&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
1518 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1519 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1520 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1521 sql_free_result($ersresult);
1522 if($ShowEditTopic===true) {
1523 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($TopicID));
1524 $gtsresult=sql_query($gtsquery,$SQLStat);
1525 $gtsnum=sql_num_rows($gtsresult);
1526 $TUsersID=sql_result($gtsresult,0,"UserID");
1527 $TForumID=sql_result($gtsresult,0,"ForumID");
1528 $TClosed=sql_result($gtsresult,0,"Closed");
1529 if($_SESSION['UserID']!=$TUsersID) { $ShowEditTopic = null; }
1530 if($PermissionInfo['CanModForum'][$TopicForumID]=="yes"&&
1531 $PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1532 $ShowEditTopic = true; }
1533 if($PermissionInfo['CanEditTopicsClose'][$TopicForumID]=="no"&&$TopicClosed==1) {
1534 $ShowEditTopic = null; } }
1535 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1536 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1537 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1538 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1539 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1540 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
1541 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
1542 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1544 <div class="Table1Border">
1545 <?php if($ThemeSet['TableStyle']=="div") { ?>
1546 <div class="TableRow1">
1547 <span style="text-align: left;">
1548 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span></div>
1549 <?php } ?>
1550 <table class="Table1">
1551 <?php if($ThemeSet['TableStyle']=="table") { ?>
1552 <tr class="TableRow1">
1553 <td class="TableColumn1"><span style="text-align: left;">
1554 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>"><?php echo $TopicName; ?></a></span>
1555 </td>
1556 </tr><?php } ?>
1557 <tr class="TableRow2">
1558 <th class="TableColumn2" style="width: 100%; text-align: left;">&nbsp;Edit Reply Message: </th>
1559 </tr>
1560 <tr class="TableRow3">
1561 <td class="TableColumn3">
1562 <table style="width: 100%; height: 25%; text-align: center;">
1563 <?php if (pre_strlen($_POST['ReplyDesc'])>"80") { $Error="Yes"; ?>
1564 <tr>
1565 <td><span class="TableMessage">
1566 <br />Your Reply Description is too big.<br />
1567 </span>&nbsp;</td>
1568 </tr>
1569 <?php } if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?>
1570 <tr>
1571 <td><span class="TableMessage">
1572 <br />Sorry the referering url dose not match our host name.<br />
1573 </span>&nbsp;</td>
1574 </tr>
1575 <?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1576 $Settings['captcha_guest']=="on") {
1577 if (PhpCaptcha::Validate($_POST['signcode'])) {
1578 //echo 'Valid code entered';
1579 } else { $Error="Yes"; ?>
1580 <tr>
1581 <td><span class="TableMessage">
1582 <br />Invalid code entered<br />
1583 </span>&nbsp;</td>
1584 </tr>
1585 <?php } } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1586 pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?>
1587 <tr>
1588 <td><span class="TableMessage">
1589 <br />You Guest Name is too big.<br />
1590 </span>&nbsp;</td>
1591 </tr>
1592 <?php } if($ShowEditTopic===true&&
1593 pre_strlen($_POST['TopicName'])>"50") { $Error="Yes"; ?>
1594 <tr>
1595 <td><span class="TableMessage">
1596 <br />You Topic Name is too big.<br />
1597 </span>&nbsp;</td>
1598 </tr>
1599 <?php } if ($Settings['TestReferer']=="on") {
1600 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
1601 <tr>
1602 <td><span class="TableMessage">
1603 <br />Sorry the referering url dose not match our host name.<br />
1604 </span>&nbsp;</td>
1605 </tr>
1606 <?php } }
1607 $_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES, $Settings['charset']));
1608 //$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
1609 $_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
1610 $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
1611 //$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
1612 $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
1613 $_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES, $Settings['charset']));
1614 //$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
1615 $_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
1616 if($ShowEditTopic===true) {
1617 $_POST['TopicName'] = stripcslashes(htmlspecialchars($_POST['TopicName'], ENT_QUOTES, $Settings['charset']));
1618 //$_POST['TopicName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicName']);
1619 $_POST['TopicName'] = remove_spaces($_POST['TopicName']); }
1620 /* <_< iWordFilter >_>
1621 by Kazuki Przyborowski - Cool Dude 2k */
1622 $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
1623 $katarzynart=sql_query($katarzynaqy,$SQLStat);
1624 $katarzynanm=sql_num_rows($katarzynart);
1625 $katarzynas=0;
1626 while ($katarzynas < $katarzynanm) {
1627 $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
1628 $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
1629 $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
1630 if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
1631 if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
1632 if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
1633 $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
1634 if($WholeWord=="on") { $WholeWord = "yes"; }
1635 if($WholeWord=="off") { $WholeWord = "no"; }
1636 if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
1637 $Filter = preg_quote($Filter, "/");
1638 if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
1639 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyDesc']);
1640 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyPost']); }
1641 if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
1642 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyDesc']);
1643 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyPost']); }
1644 if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
1645 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyDesc']);
1646 $_POST['ReplyPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyPost']); }
1647 if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
1648 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyDesc']);
1649 $_POST['ReplyPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyPost']); }
1650 ++$katarzynas; } sql_free_result($katarzynart);
1651 $lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedTopicName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
1652 $lonewolfrt=sql_query($lonewolfqy,$SQLStat);
1653 $lonewolfnm=sql_num_rows($lonewolfrt);
1654 $lonewolfs=0; $RMatches = null; $RGMatches = null;
1655 while ($lonewolfs < $lonewolfnm) {
1656 $RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
1657 $RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
1658 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
1659 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
1660 if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
1661 $RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
1662 if($RWholeWord=="on") { $RWholeWord = "yes"; }
1663 if($RWholeWord=="off") { $RWholeWord = "no"; }
1664 if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
1665 $RestrictedTopicName=sql_result($lonewolfrt,$lonewolfs,"RestrictedTopicName");
1666 if($RestrictedTopicName=="on") { $RestrictedTopicName = "yes"; }
1667 if($RestrictedTopicName=="off") { $RestrictedTopicName = "no"; }
1668 if($RestrictedTopicName!="yes"||$RestrictedTopicName!="no") { $RestrictedTopicName = "no"; }
1669 $RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
1670 if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
1671 if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
1672 if($RestrictedUserName!="yes"||$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
1673 $RWord = preg_quote($RWord, "/");
1674 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
1675 if($RestrictedTopicName=="yes") {
1676 $RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['TopicName']);
1677 if($RMatches==true) { break 1; } }
1678 if($RestrictedUserName=="yes") {
1679 $RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
1680 if($RGMatches==true) { break 1; } } }
1681 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
1682 if($RestrictedTopicName=="yes") {
1683 $RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['TopicName']);
1684 if($RMatches==true) { break 1; } }
1685 if($RestrictedUserName=="yes") {
1686 $RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
1687 if($RGMatches==true) { break 1; } } }
1688 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
1689 if($RestrictedTopicName=="yes") {
1690 $RMatches = preg_match("/".$RWord."/", $_POST['TopicName']);
1691 if($RMatches==true) { break 1; } }
1692 if($RestrictedUserName=="yes") {
1693 $RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
1694 if($RGMatches==true) { break 1; } } }
1695 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
1696 if($RestrictedTopicName=="yes") {
1697 $RMatches = preg_match("/".$RWord."/i", $_POST['TopicName']);
1698 if($RMatches==true) { break 1; } }
1699 if($RestrictedUserName=="yes") {
1700 $RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
1701 if($RGMatches==true) { break 1; } } }
1702 ++$lonewolfs; } sql_free_result($lonewolfrt);
1703 if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?>
1704 <tr>
1705 <td><span class="TableMessage">
1706 <br />You need to enter a Reply Description.<br />
1707 </span>&nbsp;</td>
1708 </tr>
1709 <?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1710 $_POST['GuestName']==null) { $Error="Yes"; ?>
1711 <tr>
1712 <td><span class="TableMessage">
1713 <br />You need to enter a Guest Name.<br />
1714 </span>&nbsp;</td>
1715 </tr>
1716 <?php } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1717 $RGMatches==true) { $Error="Yes"; ?>
1718 <tr>
1719 <td><span class="TableMessage">
1720 <br />This Guest Name is restricted to use.<br />
1721 </span>&nbsp;</td>
1722 </tr>
1723 <?php } if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no") { $Error="Yes"; ?>
1724 <tr>
1725 <td><span class="TableMessage">
1726 <br />You do not have permission to edit a reply here.<br />
1727 </span>&nbsp;</td>
1728 </tr>
1729 <?php } if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { $Error="Yes"; ?>
1730 <tr>
1731 <td><span class="TableMessage">
1732 <br />You do not have permission to edit a reply here.<br />
1733 </span>&nbsp;</td>
1734 </tr>
1735 <?php } if($ShowEditTopic===true&&$_POST['TopicName']==null) { $Error="Yes"; ?>
1736 <tr>
1737 <td><span class="TableMessage">
1738 <br />You need to enter a Topic Name.<br />
1739 </span>&nbsp;</td>
1740 </tr>
1741 <?php } if ($_POST['ReplyPost']==null) { $Error="Yes"; ?>
1742 <tr>
1743 <td><span class="TableMessage">
1744 <br />You need to enter a Reply.<br />
1745 </span>&nbsp;</td>
1746 </tr>
1747 <?php } if($RMatches==true) { $Error="Yes"; ?>
1748 <tr>
1749 <td><span class="TableMessage">
1750 <br />This Topic Name is restricted to use.<br />
1751 </span>&nbsp;</td>
1752 </tr>
1753 <?php } if ($Error=="Yes") {
1754 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']),"3"); ?>
1755 <tr>
1756 <td><span class="TableMessage">
1757 <br />Click <a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here</a> to goto index page.<br />&nbsp;
1758 </span><br /></td>
1759 </tr>
1760 <?php } if ($Error!="Yes") { $LastActive = GMTimeStamp();
1761 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
1762 $reresult=sql_query($requery,$SQLStat);
1763 $renum=sql_num_rows($reresult);
1764 $rei=0;
1765 while ($rei < $renum) {
1766 $User1ID=$_SESSION['UserID'];
1767 $User1Name=sql_result($reresult,$rei,"Name");
1768 if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
1769 ++$rei; }
1770 sql_free_result($reresult);
1771 $EditUserIP=$_SERVER['REMOTE_ADDR'];
1772 $_SESSION['LastPostTime'] = GMTimeStamp() + $GroupInfo['FloodControl'];
1773 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=-1) {
1774 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LastActive\"=%i,\"IP\"='%s',\"LastPostTime\"=%i WHERE \"id\"=%i", array($LastActive,$EditUserIP,$_SESSION['LastPostTime'],$_SESSION['UserID']));
1775 sql_query($queryupd,$SQLStat); }
1776 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."posts\" SET \"LastUpdate\"=%i,\"EditUser\"=%i,\"EditUserName\"='%s',\"Post\"='%s',\"Description\"='%s',\"EditIP\"='%s' WHERE \"id\"=%i", array($LastActive,$User1ID,$User1Name,$_POST['ReplyPost'],$_POST['ReplyDesc'],$EditUserIP,$_GET['post']));
1777 sql_query($queryupd,$SQLStat);
1778 if($ShowEditTopic===true) {
1779 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"TopicName\"='%s',\"Description\"='%s' WHERE \"id\"=%i", array($_POST['TopicName'],$_POST['ReplyDesc'],$TopicID));
1780 sql_query($queryupd,$SQLStat); } }
1781 redirect(url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'],FALSE).$Settings['qstr']."#post".$_GET['post'],"3");
1783 <tr>
1784 <td><span class="TableMessage"><br />
1785 Reply to Topic <?php echo $TopicName; ?> was edited.<br />
1786 Click <a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."&#35;post".$_GET['post']; ?>">here</a> to view topic.<br />&nbsp;
1787 </span><br /></td>
1788 </tr>
1789 </table>
1790 </td></tr>
1791 <tr class="TableRow4">
1792 <td class="TableColumn4">&nbsp;</td>
1793 </tr>
1794 </table></div>
1795 <?php } $frnext = "off";
1796 if(!isset($_GET['fastreply'])) {
1797 $_GET['fastreply'] = "off"; }
1798 if($_GET['fastreply']=="on") {
1799 $frnext = "off"; $extrafe = null; }
1800 if($_GET['fastreply']!="on") {
1801 $frnext = "on"; $extrafe = "&#35;FastReply"; }
1802 if($pstring!=null||$CanMakeReply=="yes"||$CanMakeTopic=="yes") {
1804 <table class="Table2" style="width: 100%;">
1805 <tr>
1806 <td style="width: 30%; text-align: left;"><?php echo $pstring; ?></td>
1807 <td style="width: 70%; text-align: right;">
1808 <?php if($CanMakeReply=="yes") { ?>
1809 <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>
1810 <?php if(isset($ThemeSet['FastReply'])&&$ThemeSet['FastReply']!=null) { ?>
1811 <?php echo $ThemeSet['ButtonDivider']; ?>
1812 <a onclick="toggletag('FastReply'); toggletag('MkFastReply'); return false;" href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$_GET['id']."&page=".$_GET['page']."&fastreply=".$frnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$extrafe; ?>"><?php echo $ThemeSet['FastReply']; ?></a>
1813 <?php } } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
1814 if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?>
1815 <?php echo $ThemeSet['ButtonDivider']; } ?>
1816 <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>
1817 <?php } ?></td>
1818 </tr>
1819 </table>
1820 <div class="DivTable2">&nbsp;</div>
1821 <?php } }
1822 if($_GET['act']=="view"&&$CanMakeReply=="yes") {
1823 if(!isset($_GET['fastreply'])) { $_GET['fastreply'] = false; }
1824 if($_GET['fastreply']===true||
1825 $_GET['fastreply']=="on") { $fps = " "; }
1826 if($_GET['fastreply']!==true&&
1827 $_GET['fastreply']!="on") { $fps = " style=\"display: none;\" "; }
1828 $QuoteReply = null; $QuoteDescription = null;
1829 $queryra = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT 1", array($_GET['id']));
1830 $resultra=sql_query($queryra,$SQLStat);
1831 $numrose=sql_num_rows($resultra);
1832 $QuoteDescription=sql_result($resultra,0,"Description");
1833 $QuoteDescription = str_replace("Re: ","",$QuoteDescription);
1834 $QuoteDescription = "Re: ".$QuoteDescription;
1835 sql_free_result($resultra);
1836 $UFID = rand_uuid("rand");
1837 $_SESSION['UserFormID'] = $UFID;
1839 <div class="Table1Border"<?php echo $fps; ?>id="FastReply">
1840 <?php if($ThemeSet['TableStyle']=="div") { ?>
1841 <div class="TableRow1">
1842 <span style="text-align: left;">
1843 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span></div>
1844 <?php } ?>
1845 <table class="Table1" id="MakeReply<?php echo $TopicForumID; ?>">
1846 <?php if($ThemeSet['TableStyle']=="table") { ?>
1847 <tr class="TableRow1" id="ReplyStart<?php echo $TopicForumID; ?>">
1848 <td class="TableColumn1" colspan="2"><span style="text-align: left;">
1849 <?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']); ?>#<?php echo $TopicID; ?>"><?php echo $TopicName; ?></a></span>
1850 </td>
1851 </tr><?php } ?>
1852 <tr id="MakeReplyRow<?php echo $TopicForumID; ?>" class="TableRow2">
1853 <td class="TableColumn2" colspan="2" style="width: 100%;">Making a Reply in Topic <?php echo $TopicName; ?></td>
1854 </tr>
1855 <tr class="TableRow3" id="MkReply<?php echo $TopicForumID; ?>">
1856 <td class="TableColumn3" style="width: 15%; vertical-align: middle; text-align: center;">
1857 <div style="width: 100%; height: 160px; overflow: auto;">
1858 <table style="width: 100%; text-align: center;"><?php
1859 $renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
1860 $renee_result=sql_query($renee_query,$SQLStat);
1861 $renee_num=sql_num_rows($renee_result);
1862 $renee_s=0; $SmileRow=0; $SmileCRow=0;
1863 while ($renee_s < $renee_num) { ++$SmileRow;
1864 $FileName=sql_result($renee_result,$renee_s,"FileName");
1865 $SmileName=sql_result($renee_result,$renee_s,"SmileName");
1866 $SmileText=sql_result($renee_result,$renee_s,"SmileText");
1867 $SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
1868 $ShowSmile=sql_result($renee_result,$renee_s,"Display");
1869 $ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
1870 if($SmileRow==1) { ?><tr>
1871 <?php } if($SmileRow<5) { ++$SmileCRow; ?>
1872 <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td>
1873 <?php } if($SmileRow==5) { ++$SmileCRow; ?>
1874 <td><img src="<?php echo $SmileDirectory."".$FileName; ?>" style="vertical-align: middle; border: 0px; cursor: pointer;" title="<?php echo $SmileName; ?>" alt="<?php echo $SmileName; ?>" onclick="addsmiley('ReplyPost','&nbsp;<?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?>&nbsp;')" /></td></tr>
1875 <?php $SmileCRow=0; $SmileRow=0; }
1876 ++$renee_s; }
1877 if($SmileCRow<5&&$SmileCRow!=0) {
1878 $SmileCRowL = 5 - $SmileCRow;
1879 echo "<td colspan=\"".$SmileCRowL."\">&nbsp;</td></tr>"; }
1880 echo "</table>";
1881 sql_free_result($renee_result);
1882 ?></div></td>
1883 <td class="TableColumn3" style="width: 85%;">
1884 <form style="display: inline;" 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']); ?>">
1885 <table style="text-align: left;">
1886 <tr style="text-align: left;">
1887 <td style="width: 50%;"><label class="TextBoxLabel" for="ReplyDesc">Insert Reply Description:</label></td>
1888 <td style="width: 50%;"><input maxlength="45" type="text" name="ReplyDesc" class="TextBox" id="ReplyDesc" size="20" value="<?php echo $QuoteDescription; ?>" /></td>
1889 </tr><?php if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?><tr style="text-align: left;">
1890 <td style="width: 50%;"><label class="TextBoxLabel" for="GuestName">Insert Guest Name:</label></td>
1891 <?php if(!isset($_SESSION['GuestName'])) { ?>
1892 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" /></td>
1893 <?php } if(isset($_SESSION['GuestName'])) { ?>
1894 <td style="width: 50%;"><input maxlength="25" type="text" name="GuestName" class="TextBox" id="GuestName" size="20" value="<?php echo $_SESSION['GuestName']; ?>" /></td>
1895 <?php } ?></tr><?php } ?>
1896 </table>
1897 <table style="text-align: left;">
1898 <tr style="text-align: left;">
1899 <td style="width: 100%;">
1900 <label class="TextBoxLabel" for="ReplyPost">Insert Your Reply:</label><br />
1901 <textarea rows="10" name="ReplyPost" id="ReplyPost" cols="40" class="TextBox"><?php echo $QuoteReply; ?></textarea><br />
1902 <?php if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?>
1903 <label class="TextBoxLabel" for="signcode"><img src="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=MkCaptcha",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
1904 <input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br />
1905 <?php } ?>
1906 <input type="hidden" name="act" value="makereplies" style="display: none;" />
1907 <input type="hidden" style="display: none;" name="fid" value="<?php echo $UFID; ?>" />
1908 <?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
1909 <input type="hidden" name="GuestName" value="null" style="display: none;" />
1910 <?php } ?>
1911 <input type="hidden" name="act" value="makereplies" style="display: none;" />
1912 <?php if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?>
1913 <input type="hidden" name="GuestName" value="null" style="display: none;" />
1914 <?php } ?>
1915 <input type="submit" class="Button" value="Make Reply" name="make_reply" />
1916 <input type="reset" value="Reset Form" class="Button" name="Reset_Form" />
1917 </td></tr></table>
1918 </form></td></tr>
1919 <tr id="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
1920 <td class="TableColumn4" colspan="2">&nbsp;</td>
1921 </tr>
1922 </table></div>
1923 <div<?php echo $fps; ?>id="MkFastReply" class="MkFastReply">&nbsp;</div>
1924 <?php } ?>