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