1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
<?php ob_start(); session_start(); ?> <? if (!isset($_GET["id"])) header("Location: index.php");
include("config.php"); include("lib.php"); include("wb_header.php"); ?>
<?
$ins2 = mysql_query("UPDATE mtalk_topic SET topic_views=topic_views+1 WHERE topic_id=$id");
// load Data
$sql="SELECT mtalk_topic.*, mtalk_post.poster, mtalk_post.email, mtalk_post.web, mtalk_post.post_id, mtalk_postext.post_text, mtalk_postext.attached FROM (mtalk_topic INNER JOIN mtalk_post ON mtalk_topic.topic_id = mtalk_post.topic_id) INNER JOIN mtalk_postext ON mtalk_post.post_id = mtalk_postext.post_id WHERE (((mtalk_topic.topic_id)=$id)) limit 0,1;";
$result= mysql_query($sql); $rs = mysql_fetch_array($result) or die("No topic found!"); $pid=$rs['post_id']; $ti=$rs['topic_time']; //$web=" <a href=".$rs['web'].">(http://..)</a> "; $email=trim($rs['email']); $poster = ($rs['poster']) ? "<a href=mailto:$email>".$rs['poster']."</a>" : $rs['poster']; $bt="» ตั้งหัวข้อโดย $poster $web เมื่อ $ti | ตอบ: ".$rs['topic_replies'].", ชม: ".$rs['topic_views']. " |"; $cat_id=explode("/",$rs['topic_category']); for ($i=1; $i<=3; $i++) { if ($cat_id[$i]) { $cn=mysql_result(@mysql_query("select cat_name from mtalk_category where cat_id=".$cat_id[$i]),0,0); $cat_name=$cat_name."<a href=index.php?cat_id=".$cat_id[$i].">$cn</a>, "; } }
?>
<div id="title_topic"> <div id="title_view"> <h1><? echo $rs['topic_title']?></h1> <p><?php echo $bt?> หมวดหมู่ » <? echo $cat_name?></p> </div> <div id="title_text"> <? echo $rs['post_text']."<br>"; if ($rs['attached']){ $imgs=explode("/",substr($rs['attached'],1)); foreach($imgs as $img) { echo "<div class=\"post_img\"><img class=\"img_in_post\" src=\"uploads/$img\" width=\"100%\"/></div><br>\n"; } } ?> </div> <div id="title_sign"> โดย <? echo $rs['poster'];?> <span class="txtnormal"><? echo $www ?></span><br /> </div> </div><!--end title_topic -->
<div class="clear"></div>
<div id="topic_nav"> | <a href="index.php"><? echo $forum_name?></a> | <a href="#form">ร่วมแสดงความคิดเห็น</a> <!--| ติดตามความคิดห็น --> <?php if (!isset($start) OR ($start == "")) $start = 0 ; $query_jumlah = mysql_query("SELECT count(*) FROM mtalk_post WHERE topic_id=$id"); $data_jumlah = mysql_fetch_row($query_jumlah); $all_record = $data_jumlah[0];
$sql="SELECT mtalk_post.*, post_text, attached FROM mtalk_post INNER JOIN mtalk_postext ON mtalk_post.post_id = mtalk_postext.post_id WHERE (((mtalk_post.topic_id)=$id) AND ((mtalk_post.post_id)<>$pid)) ORDER BY mtalk_post.post_time LIMIT $start, $itemperpage";
$result = mysql_query($sql); $nRow = @mysql_num_rows($result); $paging = generate_pagination("viewtopic.php?id=$id", $all_record, $itemperpage, $start); if (!$paging == "") echo " -- "; echo $paging; ?> </div>
<div style="margin-top:10px"><b><u>ความเห็น-คำตอบจากผู้ชมหัวข้อนี้</u></b></div> <div id="reply"> <? if (! $nRow) { echo "<p style='color:red'> ยังไม่มีความคิดเห็นจากผู้เข้าชม สำหรับหัวข้อนี้ <a href='#form'>คลิกที่นี่</a> เพื่อร่วมแสดงข้อคิดเห็น-ตอบตำถาม</p>"; }else{ for ($i=1; $i<=$nRow; $i++) { // for 1 $rs = mysql_fetch_array($result); $bg=($bg=="rp bg0") ? "rp bg1" : "rp bg0"; $text= smile($rs['post_text']); $text = auto_url($text); $web=" <a style='font size:10px' href=".$rs['web'].">»url</a> | "; $email=trim($rs['email']); $poster = ($rs['poster']) ? "โดย : <a href=mailto:$email>".$rs['poster']."</a>" : $rs['poster']; if (trim($rs['web'])) $poster=$poster.$web; ?> <div class='<? echo $bg?>'> <div class="cm_title">ความเห็นที่ <? echo $i ?></div> <div class="cm_time"><? echo "» เมื่อ ".$rs['post_time'];;?></div> <div class="reply_text"> <? echo $text."<br>"; if ($rs['attached']){ $imgs=explode("/",substr($rs['attached'],1)); foreach($imgs as $img) { echo "<div class=\"post_img\"><img class=\"img_in_post\" src=\"uploads/$img\" width=\"100%\"/></div><br>\n"; } } ?> </div> <div class="cm_sign"><? echo $poster;?></div> </div> <? } // end for 1 } // end if nRow ?> </div><!--end Reply -->
<div id="topic_nav"> | <a href="index.php"><? echo $forum_name?></a> <? if (!$paging == "") echo " -- "; echo $paging; ?> </div>
<img src="images/space.gif" width="100" height="5"><br><a name="form"></a> <form method="post" action="reply.php" name="posting" <? //onsubmit="return validate()" ?> enctype="multipart/form-data" > <table width="100%" border="0"> <tr> <td><table width="500" border="0" cellspacing="0" cellpadding="10" class="replyform" bgcolor="#FBFBF0"> <tr> <td><table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td colspan="3" class="normal"><?php $pecah = explode(".",$REMOTE_ADDR); $pecah3 = $pecah[0] . $pecah[1] . $pecah[2] . session_id(); ?> <input type="hidden" name="verify" value="<?php echo md5($floodpass.$pecah3); ?>" /> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <b><font color="#990000">กรอกข้อความที่ต้องการแสดงความคิดเห็น-ตอบ ข้างล่างนี้:</font></b> </td> </tr> <tr> <td colspan="3" class="normal"><hr size="1" noshade="noshade" /> </td> </tr> <tr> <td width="150" class="normal"><div align="right"><b>ชื่อ</b></div></td> <td nowrap="nowrap" class="normal" style="width:20px;"><strong><font color="#FF0000">*</font></strong></td> <td width="72%" class="normal"><input name="nama" type="text" value="<? echo $_SESSION['tdata']['nama']?>" size="40" /> </td> </tr> <tr> <td class="normal"><div align="right"><b>email</b></div></td> <td class="normal"> </td> <td width="72%" class="normal"><input name="email" type="text" value="<? echo $_SESSION['tdata']['email']?>" size="40" /> </td> </tr> <tr> <td valign="top" nowrap="nowrap" class="normal"><div align="right"><b>ข้อคิดเห็น<br /> หรือคำตอบ</b></div></td> <td nowrap="nowrap" class="normal" style="width:20px;"><strong><font color="#FF0000">*</font></strong></td> <td width="72%" class="normal"><textarea name="topictext" rows="12" cols="50"><? echo $_SESSION['tdata']['topictext']?></textarea> <br /> </td> </tr> <tr> <td valign="top" class="normal"><div align="right"><b>แนบรูปภาพ<br /> </b></div></td> <td valign="top" class="normal"> </td> <td><div class="attachment-row"> <input type="file" class="input-field" name="attachment[]"> </div> <div onClick="addMoreAttachment();" class="icon-add-more-attachemnt" title="Add More Attachments"> <img src="images/icon-add-more-attachment.png" alt="Add More Attachments"> </div> <div id="statusMessage"> <?php if (! empty($message)) { ?> <p class='<?php echo $type; ?>Message'><?php echo $message; ?></p> <?php } ?> </div></td> </tr> <tr> <td nowrap class="normal"><div align="right"><b>ระบุคำตอบเพื่อยืนยัน</b></div></td> <td nowrap="nowrap" class="normal" style="width:20px;"><strong><font color="#FF0000">*</font></strong></td> <td class="normal"> <div id="verify_math"> <span class="digital" style="background-position:<?php echo($_SESSION['num_to_check'][0]*-30)?>px 0px;"></span> <span>+</span> <span class="digital" style="background-position:<?php echo($_SESSION['num_to_check'][1]*-30)?>px 0px;"></span> <span>=</span> <span> <input name="vcaptcha" type="text" id="vcaptcha" maxlength="2" /> </span> </div> </td> </tr> <tr> <td class="normal"> </td> <td class="normal"> </td> <td class="normal"> </td> </tr> <tr> <td width="150" class="normal"> </td> <td width="150" class="normal"> </td> <td width="72%" class="normal"><input type="submit" name="Submit" value="ตกลง" /> </td> </tr> </table></td> </tr> </table></td> <td bgcolor="#EFEFEF" style="padding:5px"><p>ทุกความคิดเห็นของทุกมีคุณค่า มีประโยชน์ต่อการพัฒนาเมืองโนนดินแดงให้เป็นเมืองน่าอยู่...</p> <p>กรุณาแสดงความคิดเห็นอย่างเหมาะสม</p> </td> </tr> </table> </form>
<center><div style=" text-align:center; margin:20px 0px; padding:10px; background:#FCC; width:300px;" ><a href="index.php">« หน้ารวมรายการทั้งหมด</a></div></center>
<?php include("wb_footer.php"); ?>
|