OSDN Git Service

Small changes and updated file(/inc/admin/main.php).
[idb/iDB.git.git] / inc / lowreplies.php
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.
5
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.
10
11     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: lowreplies.php - Last Update: 12/10/2009 SVN 391 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="replies.php"||$File3Name=="/replies.php") {
18         require('index.php');
19         exit(); }
20 $pstring = null; $pagenum = null;
21 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
22 if(!is_numeric($_GET['post'])) { $_GET['post'] = null; }
23 if(!is_numeric($_GET['page'])) { $_GET['page'] = 1; }
24 if(!isset($_GET['modact'])) { $_GET['modact'] = null; }
25 if($_GET['modact']=="pin"||$_GET['modact']=="unpin"||$_GET['modact']=="open"||
26         $_GET['modact']=="close"||$_GET['modact']=="edit"||$_GET['modact']=="delete")
27                 { $_GET['act'] = $_GET['modact']; }
28 $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."topics\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
29 $preresult=sql_query($prequery,$SQLStat);
30 $prenum=sql_num_rows($preresult);
31 if($prenum==0) { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult);
32 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
33 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
34 if($prenum>=1) {
35 $TopicName=sql_result($preresult,0,"TopicName");
36 $TopicID=sql_result($preresult,0,"id");
37 $TopicForumID=sql_result($preresult,0,"ForumID");
38 $TopicCatID=sql_result($preresult,0,"CategoryID");
39 $TopicClosed=sql_result($preresult,0,"Closed");
40 $NumberReplies=sql_result($preresult,0,"NumReply");
41 $ViewTimes=sql_result($preresult,0,"NumViews");
42 sql_free_result($preresult);
43 $forumcheckx = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHERE \"id\"=%i  LIMIT 1", array($TopicForumID));
44 $fmckresult=sql_query($forumcheckx,$SQLStat);
45 $ForumName=sql_result($fmckresult,0,"Name");
46 $ForumType=sql_result($fmckresult,0,"ForumType");
47 $CanHaveTopics=sql_result($fmckresult,0,"CanHaveTopics");
48 $ForumPostCountView=sql_result($fmckresult,0,"PostCountView");
49 $ForumKarmaCountView=sql_result($fmckresult,0,"KarmaCountView");
50 sql_free_result($fmckresult);
51 $catcheck = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."categories\" WHERE \"id\"=%i  LIMIT 1", array($TopicCatID));
52 $catresult=sql_query($catcheck,$SQLStat);
53 $CategoryName=sql_result($catresult,0,"Name");
54 $CategoryType=sql_result($catresult,0,"CategoryType");
55 $CategoryPostCountView=sql_result($catresult,0,"PostCountView");
56 $CategoryKarmaCountView=sql_result($catresult,0,"KarmaCountView");
57 sql_free_result($catresult);
58 if($GroupInfo['HasAdminCP']!="yes"||$GroupInfo['HasModCP']!="yes") {
59 if($MyPostCountChk==null) { $MyPostCountChk = 0; }
60 if($MyKarmaCount==null) { $MyKarmaCount = 0; }
61 if($ForumPostCountView!=0&&$MyPostCountChk<$ForumPostCountView) {
62 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
63 if($CategoryPostCountView!=0&&$MyPostCountChk<$CategoryPostCountView) {
64 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
65 if($ForumKarmaCountView!=0&&$MyKarmaCount<$ForumKarmaCountView) {
66 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
67 if($CategoryKarmaCountView!=0&&$MyKarmaCount<$CategoryKarmaCountView) {
68 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); } }
69 if($ForumCheck!="skip") {
70 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id']."&page=".$_GET['page'],"&","=",$prexqstr['topic'],$exqstr['topic']);
71 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
72 $_SESSION['ViewingFile'] = $exfile['topic'].$Settings['file_ext']; }
73 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
74 $_SESSION['ViewingFile'] = $exfile['topic']; }
75 $_SESSION['PreViewingTitle'] = "Viewing Topic:";
76 $_SESSION['ViewingTitle'] = $TopicName;
77 ?>
78 <div style="font-size: 1.0em; font-weight: bold; margin-bottom: 10px; padding-top: 3px; width: auto;">Full Version: <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 $TopicName; ?></a></div>
79 <div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;"><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">Board index</a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$CategoryType],$Settings['file_ext'],"act=lowview&id=".$TopicCatID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$CategoryType],$exqstr[$CategoryType]); ?>"><?php echo $CategoryName; ?></a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile[$ForumType],$Settings['file_ext'],"act=lowview&id=".$TopicForumID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?>"><?php echo $ForumName; ?></a></div>
80 <div>&nbsp;</div>
81 <?php }
82 if(!isset($CatPermissionInfo['CanViewCategory'][$TopicCatID])) {
83         $CatPermissionInfo['CanViewCategory'][$TopicCatID] = "no"; }
84 if($CatPermissionInfo['CanViewCategory'][$TopicCatID]=="no"||
85         $CatPermissionInfo['CanViewCategory'][$TopicCatID]!="yes") {
86 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
87 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
88 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
89 if(!isset($PermissionInfo['CanViewForum'][$TopicForumID])) {
90         $PermissionInfo['CanViewForum'][$TopicForumID] = "no"; }
91 if($PermissionInfo['CanViewForum'][$TopicForumID]=="no"||
92         $PermissionInfo['CanViewForum'][$TopicForumID]!="yes") {
93 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
94 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
95 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
96 if($_GET['act']!="view") { 
97 $CanMakeReply = "no"; $CanMakeTopic = "no";
98 if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
99         $CanMakeTopic = "yes"; }
100 if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
101         $CanMakeReply = "yes"; }
102 if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
103         &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
104                 $CanMakeReply = "yes"; } } 
105 if($_GET['act']=="lowview") {
106 if($NumberReplies==null) { 
107         $NumberReplies = 0; }
108 $num=$NumberReplies+1;
109 //Start Reply Page Code
110 if(!isset($Settings['max_posts'])) { $Settings['max_posts'] = 10; }
111 if($_GET['page']==null) { $_GET['page'] = 1; } 
112 if($_GET['page']<=0) { $_GET['page'] = 1; }
113 $nums = $_GET['page'] * $Settings['max_posts'];
114 if($nums>$num) { $nums = $num; }
115 $numz = $nums - $Settings['max_posts'];
116 if($numz<=0) { $numz = 0; }
117 //$i=$numz;
118 if($nums<$num) { $nextpage = $_GET['page'] + 1; }
119 if($nums>=$num) { $nextpage = $_GET['page']; }
120 if($numz>=$Settings['max_posts']) { $backpage = $_GET['page'] - 1; }
121 if($_GET['page']<=1) { $backpage = 1; }
122 $pnum = $num; $l = 1; $Pages = null;
123 while ($pnum>0) {
124 if($pnum>=$Settings['max_posts']) { 
125         $pnum = $pnum - $Settings['max_posts']; 
126         $Pages[$l] = $l; ++$l; }
127 if($pnum<$Settings['max_posts']&&$pnum>0) { 
128         $pnum = $pnum - $pnum; 
129         $Pages[$l] = $l; ++$l; } }
130 $snumber = $_GET['page'] - 1;
131 $PageLimit = $Settings['max_posts'] * $snumber;
132 if($PageLimit<0) { $PageLimit = 0; }
133 //End Reply Page Code
134 $i=0;
135 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."posts\" WHERE \"TopicID\"=%i ORDER BY \"TimeStamp\" ASC ".$SQLimit, array($_GET['id'],$PageLimit,$Settings['max_posts']));
136 $result=sql_query($query,$SQLStat);
137 $num=sql_num_rows($result);
138 if($num==0) { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
139 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
140 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
141 if($num!=0) { 
142 if($ViewTimes==0||$ViewTimes==null) { $NewViewTimes = 1; }
143 if($ViewTimes!=0&&$ViewTimes!=null) { $NewViewTimes = $ViewTimes + 1; }
144 $viewsup = sql_pre_query("UPDATE \"".$Settings['sqltable']."topics\" SET \"NumViews\"='%s' WHERE \"id\"=%i", array($NewViewTimes,$_GET['id']));
145 sql_query($viewsup,$SQLStat); }
146 //List Page Number Code Start
147 $pagenum=count($Pages);
148 if($_GET['page']>$pagenum) {
149         $_GET['page'] = $pagenum; }
150 $pagei=0; $pstring = null;
151 if($pagenum>1) {
152 $pstring = "<div style=\"\" class=\"PageList\"><span class=\"pagelink\">".$pagenum." Pages:</span> "; }
153 if($_GET['page']<4) { $Pagez[0] = null; }
154 if($_GET['page']>=4) { $Pagez[0] = "First"; }
155 if($_GET['page']>=3) {
156 $Pagez[1] = $_GET['page'] - 2; }
157 if($_GET['page']<3) {
158 $Pagez[1] = null; }
159 if($_GET['page']>=2) {
160 $Pagez[2] = $_GET['page'] - 1; }
161 if($_GET['page']<2) {
162 $Pagez[2] = null; }
163 $Pagez[3] = $_GET['page'];
164 if($_GET['page']<$pagenum) {
165 $Pagez[4] = $_GET['page'] + 1; }
166 if($_GET['page']>=$pagenum) {
167 $Pagez[4] = null; }
168 $pagenext = $_GET['page'] + 1;
169 if($pagenext<$pagenum) {
170 $Pagez[5] = $_GET['page'] + 2; }
171 if($pagenext>=$pagenum) {
172 $Pagez[5] = null; }
173 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
174 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
175 $pagenumi=count($Pagez);
176 if($num==0) {
177 $pagenumi = 0;
178 $pstring = null; }
179 if($pagenum>1) {
180 while ($pagei < $pagenumi) {
181 if($_GET['page']!=1&&$pagei==1) {
182 $Pback = $_GET['page'] - 1;
183 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pback,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&lt;</a></span> "; }
184 if($Pagez[$pagei]!=null&&
185    $Pagez[$pagei]!="First"&&
186    $Pagez[$pagei]!="Last") {
187 if($pagei!=3) { 
188 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; }
189 if($pagei==3) { 
190 $pstring = $pstring."<span class=\"pagecurrent\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">".$Pagez[$pagei]."</a></span> "; } }
191 if($Pagez[$pagei]=="First") {
192 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&laquo;</a></span> "; }
193 if($Pagez[$pagei]=="Last") {
194 $ptestnext = $pagenext + 1;
195 $paget = $pagei - 1;
196 $Pnext = $_GET['page'] + 1;
197 $pstring = $pstring."<span class=\"pagelink\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$Pnext,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&gt;</a></span> ";
198 if($ptestnext<$pagenum) {
199 $pstring = $pstring."<span class=\"pagelinklast\"><a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=lowview&id=".$_GET['id']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."\">&raquo;</a></span> "; } }
200         ++$pagei; } $pstring = $pstring."</div>"; }
201 //List Page Number Code end
202 $CanMakeReply = "no"; $CanMakeTopic = "no";
203 if($PermissionInfo['CanMakeTopics'][$TopicForumID]=="yes"&&$CanHaveTopics=="yes") { 
204         $CanMakeTopic = "yes"; }
205 if($TopicClosed==0&&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
206         $CanMakeReply = "yes"; }
207 if($TopicClosed==1&&$PermissionInfo['CanMakeReplysClose'][$TopicForumID]=="yes"
208         &&$PermissionInfo['CanMakeReplys'][$TopicForumID]=="yes") {
209                 $CanMakeReply = "yes"; }
210 ?>
211 <div style="font-size: 11px; font-weight: bold; padding: 10px; border: 1px solid gray;">
212 <?php echo $pstring; ?></div>
213 <div>&nbsp;</div>
214 <div style="padding: 10px; border: 1px solid gray;">
215 <?php while ($i < $num) {
216 $MyPostID=sql_result($result,$i,"id");
217 $MyTopicID=sql_result($result,$i,"TopicID");
218 $MyPostIP=sql_result($result,$i,"IP");
219 $MyForumID=sql_result($result,$i,"ForumID");
220 $MyCategoryID=sql_result($result,$i,"CategoryID");
221 $MyUserID=sql_result($result,$i,"UserID");
222 $MyGuestName=sql_result($result,$i,"GuestName");
223 $MyTimeStamp=sql_result($result,$i,"TimeStamp");
224 $MyEditTime=sql_result($result,$i,"LastUpdate");
225 $MyEditUserID=sql_result($result,$i,"EditUser");
226 $MyEditUserName=sql_result($result,$i,"EditUserName");
227 $MyTimeStamp=GMTimeChange("M j, Y, g:i a",$MyTimeStamp,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
228 $MyPost=sql_result($result,$i,"Post");
229 $MyPost = preg_replace("/\<br\>/", "<br />", nl2br($MyPost));
230 $MyDescription=sql_result($result,$i,"Description");
231 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
232 $reresult=sql_query($requery,$SQLStat);
233 $renum=sql_num_rows($reresult);
234 if($renum<1) { $MyUserID = -1;
235 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
236 $reresult=sql_query($requery,$SQLStat);
237 $renum=sql_num_rows($reresult); }
238 $rei=0; $ipshow = "two";
239 $User1ID=$MyUserID; $GuestsName = $MyGuestName;
240 $User1Name=sql_result($reresult,$rei,"Name");
241 $User1IP=sql_result($reresult,$rei,"IP");
242 if($User1IP==$MyPostIP) { $ipshow = "one"; }
243 $User1Email=sql_result($reresult,$rei,"Email");
244 $User1Title=sql_result($reresult,$rei,"Title");
245 $User1Joined=sql_result($reresult,$rei,"Joined");
246 $User1Joined=GMTimeChange("M j Y",$User1Joined,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
247 $User1GroupID=sql_result($reresult,$rei,"GroupID");
248 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
249 $gresult=sql_query($gquery,$SQLStat);
250 $User1Group=sql_result($gresult,0,"Name");
251 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
252 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
253 sql_free_result($gresult);
254 $User1Signature=sql_result($reresult,$rei,"Signature");
255 $User1Avatar=sql_result($reresult,$rei,"Avatar");
256 $User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
257 if ($User1Avatar=="http://"||$User1Avatar==null||
258         strtolower($User1Avatar)=="noavatar") {
259 $User1Avatar=$ThemeSet['NoAvatar'];
260 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
261 $AvatarSize1=explode("x", $User1AvatarSize);
262 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
263 $User1Website=sql_result($reresult,$rei,"Website");
264 $BoardWWWChCk = parse_url($Settings['idburl']);
265 $User1WWWChCk = parse_url($User1Website);
266 $User1Website = urlcheck($User1Website);
267 $opennew = " onclick=\"window.open(this.href);return false;\"";
268 if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
269         $opennew = null; }
270 $User1PostCount=sql_result($reresult,$rei,"PostCount");
271 $User1Karma=sql_result($reresult,$rei,"Karma");
272 $User1IP=sql_result($reresult,$rei,"IP");
273 sql_free_result($reresult);
274 if($User1Name=="Guest") { $User1Name=$GuestsName;
275 if($User1Name==null) { $User1Name="Guest"; } }
276 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
277         $User1Name = $GroupNamePrefix.$User1Name; }
278 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
279         $User1Name = $User1Name.$GroupNameSuffix; }
280 $MySubPost = null;
281 if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0) {
282 if($MyEditUserID!=$MyUserID) {
283 $euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
284 $euresult = sql_query($euquery,$SQLStat);
285 $eunum = sql_num_rows($euresult);
286 if($eunum<1) { $MyEditUserID = -1;
287 $euquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyEditUserID));
288 $euresult = sql_query($euquery,$SQLStat);
289 $eunum = sql_num_rows($euresult); }
290         $EditUserID = $MyEditUserID;
291         $EditUserGroupID = sql_result($euresult,0,"GroupID");
292         $EditUserHidden=sql_result($euresult,0,"HiddenMember");
293         $EditUserName = sql_result($euresult,0,"Name");
294         sql_free_result($euresult);
295         $eugquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($EditUserGroupID));
296         $eugresult=sql_query($eugquery,$SQLStat);
297         $EditUserGroup=sql_result($eugresult,0,"Name");
298         $EditUserNamePrefix=sql_result($eugresult,0,"NamePrefix");
299         $EditUserNameSuffix=sql_result($eugresult,0,"NameSuffix");
300         sql_free_result($eugresult);    }
301         if($MyEditUserID==$MyUserID) {
302         $EditUserID = $User1ID;
303         $EditUserGroupID = $User1GroupID;
304         $EditUserHidden=$User1Hidden;
305         $EditUserName = $User1Name;
306         $EditUserGroup=$User1Group;
307         $EditUserNamePrefix=null;
308         $EditUserNameSuffix=null; }
309         if($EditUserName=="Guest") { $EditUserName=$MyEditUserName;
310         if($EditUserName==null) { $EditUserName="Guest"; } }
311         if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
312                 $EditUserName = $EditUserNamePrefix.$EditUserName; }
313         if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
314                 $EditUserName = $EditUserName.$EditUserNameSuffix; }
315         $MyEditTime = GMTimeChange("M j, Y, g:i a",$MyEditTime,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
316         $MySubPost = "<div class=\"EditReply\"><br />This post has been edited by <b>".$EditUserName."</b> on ".$MyEditTime."</div>"; }
317 if($MyEditTime!=$MyTimeStamp&&$MyEditUserID!=0&&$MyEditUserID!=$MyUserID) {
318 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($MyUserID));
319 $reresult=sql_query($requery,$SQLStat);
320 $renum=sql_num_rows($reresult);
321 $rei=0; $ipshow = "two";
322 $User1ID=$MyUserID; $GuestsName = $MyGuestName;
323 $User1Name=sql_result($reresult,$rei,"Name");
324 $User1IP=sql_result($reresult,$rei,"IP");
325 if($User1IP==$MyPostIP) { $ipshow = "one"; }
326 $User1Email=sql_result($reresult,$rei,"Email");
327 $User1Title=sql_result($reresult,$rei,"Title");
328 $User1Joined=sql_result($reresult,$rei,"Joined");
329 $User1Joined=GMTimeChange("M j Y",$User1Joined,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
330 $User1Hidden=sql_result($reresult,$rei,"HiddenMember");
331 $User1GroupID=sql_result($reresult,$rei,"GroupID");
332 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
333 $gresult=sql_query($gquery,$SQLStat);
334 $User1Group=sql_result($gresult,0,"Name");
335 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
336 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
337 sql_free_result($gresult); }
338 $MyPost = url2link($MyPost);
339 $MyPost = text2icons($MyPost,$Settings['sqltable'],$SQLStat);
340 if($MySubPost!=null) { $MyPost = $MyPost."\n".$MySubPost; }
341 $User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
342 $User1Signature = url2link($User1Signature);
343 $User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
344 $CanEditReply = false; $CanDeleteReply = false;
345 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) {
346 if($PermissionInfo['CanEditReplys'][$MyForumID]=="yes"&&
347         $_SESSION['UserID']==$MyUserID) { $CanEditReply = true; }
348 if($PermissionInfo['CanDeleteReplys'][$MyForumID]=="yes"&&
349         $_SESSION['UserID']==$MyUserID) { $CanDeleteReply = true; }
350 if($PermissionInfo['CanModForum'][$MyForumID]=="yes") { 
351         $CanEditReply = true; $CanDeleteReply = true; } }
352 if($_SESSION['UserID']==0) { 
353         $CanEditReply = false; $CanDeleteReply = false; }
354 $ReplyNum = $i + $PageLimit + 1;
355 ?>
356 <div style="border:1px solid #E6E3E4; padding:1px; margin-bottom: 15px;">
357 <div style="border: 1px solid #E6E3E4; padding:1px; margin-bottom: 15px; background-color: #E6E3E4; padding: 6px;">
358 <div style="font-weight: bold; font-size: 0.8em; width: auto; float: left;"><?php echo $User1Name; ?></div>
359 <div style="width:auto; font-size: 0.8em; color: gray; text-align:right;"><?php echo $MyTimeStamp; ?></div>
360 </div>
361 <div style="padding: 6px; font-size: 0.8em;"><?php echo $MyPost; ?></div></div>
362 <?php ++$i; } sql_free_result($result); 
363 ?></div><div>&nbsp;</div><?php } } ?>