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