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: 06/14/2011 SVN 672 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="replies.php"||
$File3Name=="/replies.php") {
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']); $urlstatus = 302;
39 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
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']); $urlstatus = 302;
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) {
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']); $urlstatus = 302;
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"> 
;</div
>
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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">
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
>
128 <div
class="DivTable2"> 
;</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; }
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;
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
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']); $urlstatus = 302;
175 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
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;
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) {
194 if($_GET['page']>=2) {
195 $Pagez[2] = $_GET['page'] - 1; }
196 if($_GET['page']<2) {
198 $Pagez[3] = $_GET['page'];
199 if($_GET['page']<$pagenum) {
200 $Pagez[4] = $_GET['page'] +
1; }
201 if($_GET['page']>=$pagenum) {
203 $pagenext = $_GET['page'] +
1;
204 if($pagenext<$pagenum) {
205 $Pagez[5] = $_GET['page'] +
2; }
206 if($pagenext>=$pagenum) {
208 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
209 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
210 $pagenumi=count($Pagez);
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'])."\"><</a></span> "; }
219 if($Pagez[$pagei]!=null&&
220 $Pagez[$pagei]!="First"&&
221 $Pagez[$pagei]!="Last") {
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> "; }
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'])."\">«</a></span> "; }
228 if($Pagez[$pagei]=="Last") {
229 $ptestnext = $pagenext +
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'])."\">></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'])."\">»</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">
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
>
262 /* <div class="DivPageLinks"> </div> */
264 <div
class="DivTable2"> 
;</div
>
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']) {
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; }
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."#reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
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."#reply".$ReplyNum; ?>"><?php echo $TopicName; ?></a> ( <?php echo $MyDescription; ?> )</span>
453 <tr
class="TableInfoRow2">
454 <td
class="TableInfoColumn2" style
="vertical-align: middle; width: 160px;">
456 if($User1ID>0&&$User1Hidden=="no") {
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>"; }
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
>
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."&page=".$_GET['page'],$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
} ?
> 
;</div
>
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;" />
491 <?php
echo $User1Title; ?
><br
/>
492 Group
: <?php
echo $User1Group; ?
><br
/>
494 if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
495 if($User1ID<=0||
$User1Hidden=="yes") { echo 0; }
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
/>
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
} ?
>
514 <tr
class="TableInfoRow4">
515 <td
class="TableInfoColumn4" colspan
="2">
516 <span style
="text-align: left;"> 
;<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
>
532 <div
class="DivReplies"> 
;</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
>
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
>
551 <tr
class="TableRow2">
552 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Make Reply Message
: </th
>
554 <tr
class="TableRow3">
555 <td
class="TableColumn3">
556 <table style
="width: 100%; height: 25%; text-align: center;">
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
/> 
;
565 <tr
class="TableRow4">
566 <td
class="TableColumn4"> 
;</td
>
569 <div
class="DivMkReply"> 
;</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']); $urlstatus = 302;
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']); $urlstatus = 302;
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);
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("/&#(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("/&#(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("".$QuoteReply."")";
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
>
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
>
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
>
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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></td
></tr
>
697 <?php
$SmileCRow=0; $SmileRow=0; }
699 if($SmileCRow<5&&$SmileCRow!=0) {
700 $SmileCRowL = 5 - $SmileCRow;
701 echo "<td colspan=\"".$SmileCRowL."\"> </td></tr>"; }
703 sql_free_result($renee_result);
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
} ?
>
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
/>
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;" />
733 <input type
="submit" class="Button" value
="Make Reply" name
="make_reply" />
734 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />
737 <tr id
="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
738 <td
class="TableColumn4" colspan
="2"> 
;</td
>
741 <div
class="DivMkReply"> 
;</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']); $urlstatus = 302;
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']); $urlstatus = 302;
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"];
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
>
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
>
783 <tr
class="TableRow2">
784 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Make Reply Message
: </th
>
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"; ?
>
791 <td
><span
class="TableMessage">
792 <br
/>Your Reply Description is too big
.<br
/>
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"; ?
>
801 <td
><span
class="TableMessage">
802 <br
/>Invalid code entered
<br
/>
805 <?php
} } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
806 pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?
>
808 <td
><span
class="TableMessage">
809 <br
/>You Guest Name is too big
.<br
/>
812 <?php
} if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?
>
814 <td
><span
class="TableMessage">
815 <br
/>Sorry the referering url dose not match our host name
.<br
/>
818 <?php
} if ($Settings['TestReferer']=="on") {
819 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?
>
821 <td
><span
class="TableMessage">
822 <br
/>Sorry the referering url dose not match our host name
.<br
/>
826 $_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES
, $Settings['charset']));
827 //$_POST['ReplyDesc'] = preg_replace("/&#(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("/&#(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("/&#(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);
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"; ?
>
879 <td
><span
class="TableMessage">
880 <br
/>You need to enter a Reply Description
.<br
/>
883 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
884 $_POST['GuestName']==null) { $Error="Yes"; ?
>
886 <td
><span
class="TableMessage">
887 <br
/>You need to enter a Guest Name
.<br
/>
890 <?php
} if($PermissionInfo['CanMakeReplys'][$TopicForumID]=="no") { $Error="Yes"; ?
>
892 <td
><span
class="TableMessage">
893 <br
/>You
do not have permission to make a reply here
.<br
/>
896 <?php
} if($PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="no"&&
897 $TopicClosed==1) { $Error="Yes"; ?
>
899 <td
><span
class="TableMessage">
900 <br
/>You
do not have permission to make a reply here
.<br
/>
903 <?php
} if ($_POST['ReplyPost']==null) { $Error="Yes"; ?
>
905 <td
><span
class="TableMessage">
906 <br
/>You need to enter a Reply
.<br
/>
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"); ?
>
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
/> 
;
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);
926 while ($rei < $renum) {
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']) {
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");
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']); ?>&#reply<?php echo $MyPostNum; ?>">here
</a
> to view your reply
.<br
/> 
;
972 <tr
class="TableRow4">
973 <td
class="TableColumn4"> 
;</td
>
976 <div
class="DivMkReply"> 
;</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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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
>
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
>
1036 <tr
class="TableRow2">
1037 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Pin
/Unpin Topic Message
: </th
>
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
/> 
;
1045 <tr
class="TableRow4">
1046 <td
class="TableColumn4"> 
;</td
>
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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'][$TForumID]=="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']); $urlstatus = 302;
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
>
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
>
1105 <tr
class="TableRow2">
1106 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Open
/Close Topic Message
: </th
>
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
/> 
;
1114 <tr
class="TableRow4">
1115 <td
class="TableColumn4"> 
;</td
>
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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);
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); $urlstatus = 302;
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
>
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
>
1207 <tr
class="TableRow2">
1208 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Move Topic Message
: </th
>
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
/> 
;
1216 <tr
class="TableRow4">
1217 <td
class="TableColumn4"> 
;</td
>
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']); $urlstatus = 302;
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);
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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
>
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
>
1323 <tr
class="TableRow2">
1324 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Delete Reply Message
: </th
>
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
/> 
;
1332 <tr
class="TableRow4">
1333 <td
class="TableColumn4"> 
;</td
>
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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("/&#(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("/&#(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("/&#(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']); $urlstatus = 302;
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']); $urlstatus = 302;
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']); $urlstatus = 302;
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("/&#(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
>
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
>
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
>
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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /> 
; 
;
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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /><br
/>
1441 <?php
$SmileRow=1; }
1442 ++
$renee_s; ++
$SmileRow; }
1443 sql_free_result($renee_result);
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
} ?
>
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(isset($_GET['page'])&&is_numeric($_GET['page'])) { ?
>
1471 <input type
="hidden" style
="display: none;" name
="page" value
="<?php echo $_GET['page']; ?>" />
1472 <?php
} if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?
>
1473 <input type
="hidden" name
="GuestName" value
="null" style
="display: none;" />
1475 <input type
="submit" class="Button" value
="Edit Reply" name
="edit_reply" />
1476 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />
1479 <tr id
="EditReplyEnd<?php echo $_GET['post']; ?>" class="TableRow4">
1480 <td
class="TableColumn4" colspan
="2"> 
;</td
>
1483 <div
class="DivMkReply"> 
;</div
>
1484 <?php
} if($_GET['act']=="editreply"&&$_POST['act']=="editreplies") {
1485 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));
1486 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1487 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1488 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));
1489 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1490 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1491 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
1492 $URL['REFERER'] = $REFERERurl['host'];
1493 $URL['HOST'] = $_SERVER["SERVER_NAME"];
1495 if(!isset($_POST['ReplyDesc'])) { $_POST['ReplyDesc'] = null; }
1496 if(!isset($_POST['ReplyPost'])) { $_POST['ReplyPost'] = null; }
1497 if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
1498 if(!isset($_POST['TopicName'])) { $_POST['TopicName'] = null; }
1499 if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1500 $Settings['captcha_guest']=="on") {
1501 require($SettDir['inc']."captcha.php"); }
1502 $ShowEditTopic = null;
1503 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1504 $editquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC", array($TopicID));
1505 $editresult=sql_query($editquery,$SQLStat);
1506 $editnum=sql_num_rows($editresult);
1507 $FReplyID=sql_result($editresult,0,"id");
1508 sql_free_result($editresult);
1509 if($_GET['post']==$FReplyID) { $ShowEditTopic = true; } }
1510 if($PermissionInfo['CanEditTopics'][$TopicForumID]=="no") { $ShowEditTopic = null; }
1511 $ersquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"id\"=%i LIMIT 1", array($_GET['post']));
1512 $ersresult=sql_query($ersquery,$SQLStat);
1513 $ersnum=sql_num_rows($ersresult);
1514 if($ersnum==0) { sql_free_result($ersresult);
1515 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1516 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1517 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1518 $ReplyUser=sql_result($ersresult,0,"UserID");
1519 if($_SESSION['UserID']!=$ReplyUser&&$PermissionInfo['CanModForum'][$TopicForumID]=="no") {
1520 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
1521 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1522 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1523 sql_free_result($ersresult);
1524 if($ShowEditTopic===true) {
1525 $gtsquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($TopicID));
1526 $gtsresult=sql_query($gtsquery,$SQLStat);
1527 $gtsnum=sql_num_rows($gtsresult);
1528 $TUsersID=sql_result($gtsresult,0,"UserID");
1529 $TForumID=sql_result($gtsresult,0,"ForumID");
1530 $TClosed=sql_result($gtsresult,0,"Closed");
1531 if($_SESSION['UserID']!=$TUsersID) { $ShowEditTopic = null; }
1532 if($PermissionInfo['CanModForum'][$TopicForumID]=="yes"&&
1533 $PermissionInfo['CanEditTopics'][$TopicForumID]=="yes") {
1534 $ShowEditTopic = true; }
1535 if($PermissionInfo['CanEditTopicsClose'][$TopicForumID]=="no"&&$TopicClosed==1) {
1536 $ShowEditTopic = null; } }
1537 if($TopicClosed==2&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1538 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);
1539 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1540 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1541 if($TopicClosed==3&&$PermissionInfo['CanModForum'][$TForumID]=="no") {
1542 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);
1543 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
1544 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
1546 <div
class="Table1Border">
1547 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
1548 <div
class="TableRow1">
1549 <span style
="text-align: left;">
1550 <?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
>
1552 <table
class="Table1">
1553 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
1554 <tr
class="TableRow1">
1555 <td
class="TableColumn1"><span style
="text-align: left;">
1556 <?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
>
1559 <tr
class="TableRow2">
1560 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Edit Reply Message
: </th
>
1562 <tr
class="TableRow3">
1563 <td
class="TableColumn3">
1564 <table style
="width: 100%; height: 25%; text-align: center;">
1565 <?php
if (pre_strlen($_POST['ReplyDesc'])>"80") { $Error="Yes"; ?
>
1567 <td
><span
class="TableMessage">
1568 <br
/>Your Reply Description is too big
.<br
/>
1571 <?php
} if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?
>
1573 <td
><span
class="TableMessage">
1574 <br
/>Sorry the referering url dose not match our host name
.<br
/>
1577 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1578 $Settings['captcha_guest']=="on") {
1579 if (PhpCaptcha
::Validate($_POST['signcode'])) {
1580 //echo 'Valid code entered';
1581 } else { $Error="Yes"; ?
>
1583 <td
><span
class="TableMessage">
1584 <br
/>Invalid code entered
<br
/>
1587 <?php
} } if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1588 pre_strlen($_POST['GuestName'])>"30") { $Error="Yes"; ?
>
1590 <td
><span
class="TableMessage">
1591 <br
/>You Guest Name is too big
.<br
/>
1594 <?php
} if($ShowEditTopic===true&&
1595 pre_strlen($_POST['TopicName'])>"50") { $Error="Yes"; ?
>
1597 <td
><span
class="TableMessage">
1598 <br
/>You Topic Name is too big
.<br
/>
1601 <?php
} if ($Settings['TestReferer']=="on") {
1602 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?
>
1604 <td
><span
class="TableMessage">
1605 <br
/>Sorry the referering url dose not match our host name
.<br
/>
1609 $_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES
, $Settings['charset']));
1610 //$_POST['ReplyDesc'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
1611 $_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
1612 $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES
, $Settings['charset']));
1613 //$_POST['GuestName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
1614 $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
1615 $_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES
, $Settings['charset']));
1616 //$_POST['ReplyPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
1617 $_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
1618 if($ShowEditTopic===true) {
1619 $_POST['TopicName'] = stripcslashes(htmlspecialchars($_POST['TopicName'], ENT_QUOTES
, $Settings['charset']));
1620 //$_POST['TopicName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicName']);
1621 $_POST['TopicName'] = remove_spaces($_POST['TopicName']); }
1622 /* <_< iWordFilter >_>
1623 by Kazuki Przyborowski - Cool Dude 2k */
1624 $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
1625 $katarzynart=sql_query($katarzynaqy,$SQLStat);
1626 $katarzynanm=sql_num_rows($katarzynart);
1628 while ($katarzynas < $katarzynanm) {
1629 $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
1630 $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
1631 $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
1632 if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
1633 if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
1634 if($CaseInsensitive!="yes"||
$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
1635 $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
1636 if($WholeWord=="on") { $WholeWord = "yes"; }
1637 if($WholeWord=="off") { $WholeWord = "no"; }
1638 if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
1639 $Filter = preg_quote($Filter, "/");
1640 if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
1641 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyDesc']);
1642 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['ReplyPost']); }
1643 if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
1644 $_POST['ReplyDesc'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyDesc']);
1645 $_POST['ReplyPost'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['ReplyPost']); }
1646 if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
1647 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyDesc']);
1648 $_POST['ReplyPost'] = preg_replace("/".$Filter."/", $Replace, $_POST['ReplyPost']); }
1649 if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
1650 $_POST['ReplyDesc'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyDesc']);
1651 $_POST['ReplyPost'] = preg_replace("/".$Filter."/i", $Replace, $_POST['ReplyPost']); }
1652 ++
$katarzynas; } sql_free_result($katarzynart);
1653 $lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedTopicName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
1654 $lonewolfrt=sql_query($lonewolfqy,$SQLStat);
1655 $lonewolfnm=sql_num_rows($lonewolfrt);
1656 $lonewolfs=0; $RMatches = null; $RGMatches = null;
1657 while ($lonewolfs < $lonewolfnm) {
1658 $RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
1659 $RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
1660 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
1661 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
1662 if($RCaseInsensitive!="yes"||
$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
1663 $RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
1664 if($RWholeWord=="on") { $RWholeWord = "yes"; }
1665 if($RWholeWord=="off") { $RWholeWord = "no"; }
1666 if($RWholeWord!="yes"||
$RWholeWord!="no") { $RWholeWord = "no"; }
1667 $RestrictedTopicName=sql_result($lonewolfrt,$lonewolfs,"RestrictedTopicName");
1668 if($RestrictedTopicName=="on") { $RestrictedTopicName = "yes"; }
1669 if($RestrictedTopicName=="off") { $RestrictedTopicName = "no"; }
1670 if($RestrictedTopicName!="yes"||
$RestrictedTopicName!="no") { $RestrictedTopicName = "no"; }
1671 $RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
1672 if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
1673 if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
1674 if($RestrictedUserName!="yes"||
$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
1675 $RWord = preg_quote($RWord, "/");
1676 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
1677 if($RestrictedTopicName=="yes") {
1678 $RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['TopicName']);
1679 if($RMatches==true) { break 1; } }
1680 if($RestrictedUserName=="yes") {
1681 $RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
1682 if($RGMatches==true) { break 1; } } }
1683 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
1684 if($RestrictedTopicName=="yes") {
1685 $RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['TopicName']);
1686 if($RMatches==true) { break 1; } }
1687 if($RestrictedUserName=="yes") {
1688 $RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
1689 if($RGMatches==true) { break 1; } } }
1690 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
1691 if($RestrictedTopicName=="yes") {
1692 $RMatches = preg_match("/".$RWord."/", $_POST['TopicName']);
1693 if($RMatches==true) { break 1; } }
1694 if($RestrictedUserName=="yes") {
1695 $RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
1696 if($RGMatches==true) { break 1; } } }
1697 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
1698 if($RestrictedTopicName=="yes") {
1699 $RMatches = preg_match("/".$RWord."/i", $_POST['TopicName']);
1700 if($RMatches==true) { break 1; } }
1701 if($RestrictedUserName=="yes") {
1702 $RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
1703 if($RGMatches==true) { break 1; } } }
1704 ++
$lonewolfs; } sql_free_result($lonewolfrt);
1705 if ($_POST['ReplyDesc']==null) { $Error="Yes"; ?
>
1707 <td
><span
class="TableMessage">
1708 <br
/>You need to enter a Reply Description
.<br
/>
1711 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1712 $_POST['GuestName']==null) { $Error="Yes"; ?
>
1714 <td
><span
class="TableMessage">
1715 <br
/>You need to enter a Guest Name
.<br
/>
1718 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
1719 $RGMatches==true) { $Error="Yes"; ?
>
1721 <td
><span
class="TableMessage">
1722 <br
/>This Guest Name is restricted to
use.<br
/>
1725 <?php
} if($PermissionInfo['CanEditReplys'][$TopicForumID]=="no") { $Error="Yes"; ?
>
1727 <td
><span
class="TableMessage">
1728 <br
/>You
do not have permission to edit a reply here
.<br
/>
1731 <?php
} if($PermissionInfo['CanEditReplysClose'][$TopicForumID]=="no"&&$TopicClosed==1) { $Error="Yes"; ?
>
1733 <td
><span
class="TableMessage">
1734 <br
/>You
do not have permission to edit a reply here
.<br
/>
1737 <?php
} if($ShowEditTopic===true&&$_POST['TopicName']==null) { $Error="Yes"; ?
>
1739 <td
><span
class="TableMessage">
1740 <br
/>You need to enter a Topic Name
.<br
/>
1743 <?php
} if ($_POST['ReplyPost']==null) { $Error="Yes"; ?
>
1745 <td
><span
class="TableMessage">
1746 <br
/>You need to enter a Reply
.<br
/>
1749 <?php
} if($RMatches==true) { $Error="Yes"; ?
>
1751 <td
><span
class="TableMessage">
1752 <br
/>This Topic Name is restricted to
use.<br
/>
1755 <?php
} if ($Error=="Yes") {
1756 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']),"3"); ?
>
1758 <td
><span
class="TableMessage">
1759 <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
/> 
;
1762 <?php
} if ($Error!="Yes") { $LastActive = GMTimeStamp();
1763 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID']));
1764 $reresult=sql_query($requery,$SQLStat);
1765 $renum=sql_num_rows($reresult);
1767 while ($rei < $renum) {
1768 $User1ID=$_SESSION['UserID'];
1769 $User1Name=sql_result($reresult,$rei,"Name");
1770 if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
1772 sql_free_result($reresult);
1773 $EditUserIP=$_SERVER['REMOTE_ADDR'];
1774 $_SESSION['LastPostTime'] = GMTimeStamp() +
$GroupInfo['FloodControl'];
1775 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=-1) {
1776 $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']));
1777 sql_query($queryupd,$SQLStat); }
1778 $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']));
1779 sql_query($queryupd,$SQLStat);
1780 if($ShowEditTopic===true) {
1781 $queryupd = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"TopicName\"='%s',\"Description\"='%s' WHERE \"id\"=%i", array($_POST['TopicName'],$_POST['ReplyDesc'],$TopicID));
1782 sql_query($queryupd,$SQLStat); } }
1783 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");
1784 $erpage = "&page=1";
1785 if(isset($_POST['page'])&&is_numeric($_POST['page'])) {
1786 $erpage = "&page=".$_POST['page']; }
1789 <td
><span
class="TableMessage"><br
/>
1790 Reply to Topic
<?php
echo $TopicName; ?
> was edited
.<br
/>
1791 Click
<a href
="<?php echo url_maker($exfile['topic'],$Settings['file_ext'],"act
=view
&id
=".$TopicID.$erpage,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic']).$qstrhtml."#post".$_GET['post']; ?>">here</a> to view topic.<br />
1796 <tr
class="TableRow4">
1797 <td
class="TableColumn4"> 
;</td
>
1800 <?php
} $frnext = "off";
1801 if(!isset($_GET['fastreply'])) {
1802 $_GET['fastreply'] = "off"; }
1803 if($_GET['fastreply']=="on") {
1804 $frnext = "off"; $extrafe = null; }
1805 if($_GET['fastreply']!="on") {
1806 $frnext = "on"; $extrafe = "#FastReply"; }
1807 if($pstring!=null||
$CanMakeReply=="yes"||
$CanMakeTopic=="yes") {
1809 <table
class="Table2" style
="width: 100%;">
1811 <td style
="width: 30%; text-align: left;"><?php
echo $pstring; ?
></td
>
1812 <td style
="width: 70%; text-align: right;">
1813 <?php
if($CanMakeReply=="yes") { ?
>
1814 <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
>
1815 <?php
if(isset($ThemeSet['FastReply'])&&$ThemeSet['FastReply']!=null) { ?
>
1816 <?php
echo $ThemeSet['ButtonDivider']; ?
>
1817 <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
>
1818 <?php
} } if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes") {
1819 if($CanMakeTopic=="yes"&&$CanMakeReply=="yes") { ?
>
1820 <?php
echo $ThemeSet['ButtonDivider']; } ?
>
1821 <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
>
1825 <div
class="DivTable2"> 
;</div
>
1827 if($_GET['act']=="view"&&$CanMakeReply=="yes") {
1828 if(!isset($_GET['fastreply'])) { $_GET['fastreply'] = false; }
1829 if($_GET['fastreply']===true||
1830 $_GET['fastreply']=="on") { $fps = " "; }
1831 if($_GET['fastreply']!==true&&
1832 $_GET['fastreply']!="on") { $fps = " style=\"display: none;\" "; }
1833 $QuoteReply = null; $QuoteDescription = null;
1834 $queryra = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC LIMIT 1", array($_GET['id']));
1835 $resultra=sql_query($queryra,$SQLStat);
1836 $numrose=sql_num_rows($resultra);
1837 $QuoteDescription=sql_result($resultra,0,"Description");
1838 $QuoteDescription = str_replace("Re: ","",$QuoteDescription);
1839 $QuoteDescription = "Re: ".$QuoteDescription;
1840 sql_free_result($resultra);
1841 $UFID = rand_uuid("rand");
1842 $_SESSION['UserFormID'] = $UFID;
1844 <div
class="Table1Border"<?php
echo $fps; ?
>id
="FastReply">
1845 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
1846 <div
class="TableRow1">
1847 <span style
="text-align: left;">
1848 <?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
>
1850 <table
class="Table1" id
="MakeReply<?php echo $TopicForumID; ?>">
1851 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
1852 <tr
class="TableRow1" id
="ReplyStart<?php echo $TopicForumID; ?>">
1853 <td
class="TableColumn1" colspan
="2"><span style
="text-align: left;">
1854 <?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
>
1857 <tr id
="MakeReplyRow<?php echo $TopicForumID; ?>" class="TableRow2">
1858 <td
class="TableColumn2" colspan
="2" style
="width: 100%;">Making a Reply in Topic
<?php
echo $TopicName; ?
></td
>
1860 <tr
class="TableRow3" id
="MkReply<?php echo $TopicForumID; ?>">
1861 <td
class="TableColumn3" style
="width: 15%; vertical-align: middle; text-align: center;">
1862 <div style
="width: 100%; height: 160px; overflow: auto;">
1863 <table style
="width: 100%; text-align: center;"><?php
1864 $renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
1865 $renee_result=sql_query($renee_query,$SQLStat);
1866 $renee_num=sql_num_rows($renee_result);
1867 $renee_s=0; $SmileRow=0; $SmileCRow=0;
1868 while ($renee_s < $renee_num) { ++
$SmileRow;
1869 $FileName=sql_result($renee_result,$renee_s,"FileName");
1870 $SmileName=sql_result($renee_result,$renee_s,"SmileName");
1871 $SmileText=sql_result($renee_result,$renee_s,"SmileText");
1872 $SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
1873 $ShowSmile=sql_result($renee_result,$renee_s,"Display");
1874 $ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
1875 if($SmileRow==1) { ?
><tr
>
1876 <?php
} if($SmileRow<5) { ++
$SmileCRow; ?
>
1877 <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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></td
>
1878 <?php
} if($SmileRow==5) { ++
$SmileCRow; ?
>
1879 <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',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></td
></tr
>
1880 <?php
$SmileCRow=0; $SmileRow=0; }
1882 if($SmileCRow<5&&$SmileCRow!=0) {
1883 $SmileCRowL = 5 - $SmileCRow;
1884 echo "<td colspan=\"".$SmileCRowL."\"> </td></tr>"; }
1886 sql_free_result($renee_result);
1888 <td
class="TableColumn3" style
="width: 85%;">
1889 <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']); ?>">
1890 <table style
="text-align: left;">
1891 <tr style
="text-align: left;">
1892 <td style
="width: 50%;"><label
class="TextBoxLabel" for="ReplyDesc">Insert Reply Description
:</label
></td
>
1893 <td style
="width: 50%;"><input maxlength
="45" type
="text" name
="ReplyDesc" class="TextBox" id
="ReplyDesc" size
="20" value
="<?php echo $QuoteDescription; ?>" /></td
>
1894 </tr
><?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?
><tr style
="text-align: left;">
1895 <td style
="width: 50%;"><label
class="TextBoxLabel" for="GuestName">Insert Guest Name
:</label
></td
>
1896 <?php
if(!isset($_SESSION['GuestName'])) { ?
>
1897 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" /></td
>
1898 <?php
} if(isset($_SESSION['GuestName'])) { ?
>
1899 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" value
="<?php echo $_SESSION['GuestName']; ?>" /></td
>
1900 <?php
} ?
></tr
><?php
} ?
>
1902 <table style
="text-align: left;">
1903 <tr style
="text-align: left;">
1904 <td style
="width: 100%;">
1905 <label
class="TextBoxLabel" for="ReplyPost">Insert Your Reply
:</label
><br
/>
1906 <textarea rows
="10" name
="ReplyPost" id
="ReplyPost" cols
="40" class="TextBox"><?php
echo $QuoteReply; ?
></textarea
><br
/>
1907 <?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?
>
1908 <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
/>
1909 <input maxlength
="25" type
="text" class="TextBox" name
="signcode" size
="20" id
="signcode" value
="Enter SignCode" /><br
/>
1911 <input type
="hidden" name
="act" value
="makereplies" style
="display: none;" />
1912 <input type
="hidden" style
="display: none;" name
="fid" value
="<?php echo $UFID; ?>" />
1913 <?php
if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?
>
1914 <input type
="hidden" name
="GuestName" value
="null" style
="display: none;" />
1916 <input type
="hidden" name
="act" value
="makereplies" style
="display: none;" />
1917 <?php
if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?
>
1918 <input type
="hidden" name
="GuestName" value
="null" style
="display: none;" />
1920 <input type
="submit" class="Button" value
="Make Reply" name
="make_reply" />
1921 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />
1924 <tr id
="MkReplyEnd<?php echo $TopicForumID; ?>" class="TableRow4">
1925 <td
class="TableColumn4" colspan
="2"> 
;</td
>
1928 <div
<?php
echo $fps; ?
>id
="MkFastReply" class="MkFastReply"> 
;</div
>