[ Index ] |
PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // ---------------------------------------------------------------- 24 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 31 32 // Content Type Forum 33 34 $CNT_TMP .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]); 35 36 $content['forum'] = unserialize($crow["acontent_form"]); 37 $content['forum']["tmpl"] = @file_get_contents(PHPWCMS_TEMPLATE.'inc_cntpart/forum/'.$content['forum']["template"]); 38 39 // get forum sections 40 //$content['forum']['form'] = get_tmpl_section('FORM', $content['forum']["tmpl"]); 41 42 43 $content['forum']['ACTION'] = 0; 44 $content['forum']['GET'] = 0; 45 $content['forum']['ARTICLE'] = 'index.php?id='.implode(',', $aktion); 46 $content['forum']['MODE'] = ''; 47 48 if(!empty($_GET['forum'])) { 49 // define topic listing for selected forum 50 $content['forum']['ACTION'] = 1; 51 $content['forum']['GET'] = intval($_GET['forum']); 52 } 53 if(!empty($_GET['topic'])) { 54 // define posts listing for current topic 55 $content['forum']['ACTION'] = 2; 56 $content['forum']['GET'] = intval($_GET['topic']); 57 } 58 if(!empty($_GET['post'])) { 59 // define which post is selected 60 $content['forum']['ACTION'] = 3; 61 $content['forum']['GET'] = intval($_GET['post']); 62 } 63 if(!empty($_GET['mode'])) { 64 // define what action 65 $content['forum']['MODE'] = $_GET['mode']; 66 } 67 68 69 /** 70 * FORUM 71 */ 72 if($content['forum']['ACTION'] === 0) { 73 74 // List forums 75 76 $content['forum']['sel'] = ''; 77 $content['forum']['sel'] = trim(implode(' OR forum_id=', $content['forum']['selection'])); 78 79 $CNT_TMP .= '<table width="100%" cellpadding="2" cellspacing="1" border="0" class="tableForum">'; 80 $CNT_TMP .= "\n<tr>\n"; 81 $CNT_TMP .= '<th colspan="2" nowrap="nowrap" class="thForum"> Forum </th>'."\n"; 82 $CNT_TMP .= '<th width="50" class="thTopic" nowrap="nowrap"> Topics </th>'."\n"; 83 $CNT_TMP .= '<th width="50" class="thPost" nowrap="nowrap"> Posts </th>'."\n"; 84 $CNT_TMP .= '<th class="thLastPost" nowrap="nowrap" align="center"> Last </th>'; 85 $CNT_TMP .= "\n</tr>\n"; 86 87 if($content['forum']['sel'] != '') { 88 $content['forum']['sel'] = 'AND (forum_id='.$content['forum']['sel'].')'; 89 } 90 91 $content["forum"]['selected'] = array(); 92 foreach($content["forum"]['selection'] as $content["forum"]['selected_value']) { 93 $content["forum"]['selected'][intval($content["forum"]['selected_value'])] = ''; 94 } 95 96 $sql_f = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=0 AND forum_deleted=0 ".$content['forum']['sel']; 97 if($result_f = mysql_query($sql_f, $db) or die("error while listing forums")) { 98 while($row_f = mysql_fetch_assoc($result_f)) { 99 if(isset($content["forum"]['selected'][$row_f["forum_id"]]) && $row_f['forum_title']) { 100 101 102 $CNT_TMP .= "<tr>\n"; 103 $CNT_TMP .= '<td width="19" class="rowIcon" align="center" valign="middle"><img src="img/forum/silver/folder.gif" alt=""></td>'."\n"; 104 $CNT_TMP .= '<td width="100%" class="rowForum"><span class="rowTextForumlink">'; 105 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"].'">'; 106 $CNT_TMP .= html_specialchars($row_f["forum_title"]).'</a></span>'; 107 if($row_f['forum_text'] != '') { 108 $CNT_TMP .= '<br /><span class="rowTextMed">'.html_specialchars($row_f['forum_text']).'</span>'; 109 } 110 $CNT_TMP .= "</td>\n"; 111 112 $CNT_TMP .= '<td width="50" class="rowTopic" align="center" valign="middle"><span class="rowTextSmall">'; 113 $CNT_TMP .= $row_f['forum_ctopic'].'</span></td>'."\n"; 114 115 $CNT_TMP .= '<td width="50" class="rowPost" align="center" valign="middle"><span class="rowTextSmall">'; 116 $CNT_TMP .= $row_f['forum_cpost'].'</span></td>'."\n"; 117 118 $CNT_TMP .= '<td class="rowLastPost" align="center" valign="middle" nowrap="nowrap"><span class="rowTextSmall"> '; 119 120 if(!empty($row_f['forum_lastpost'])) { 121 $content["forum"]['lastpost'] = explode(':', $row_f['forum_lastpost']); 122 $CNT_TMP .= date('Y/m/d H:i', $content["forum"]['lastpost'][0]); 123 124 } else { 125 $CNT_TMP .= date('Y/m/d H:i', $row_f['forum_created']); 126 } 127 128 $CNT_TMP .= ' '; 129 $CNT_TMP .= '</span></td>'."\n"; 130 131 $CNT_TMP .= "\n</tr>\n"; 132 133 } 134 } 135 mysql_free_result($result_f); 136 } 137 138 $CNT_TMP .= '</table>'; 139 // end List forums 140 141 142 /** 143 * FORUM 144 */ 145 } elseif($content['forum']['ACTION'] === 1) { 146 // list topics 147 148 $row_f['forum_id'] = $content['forum']['GET']; 149 $row_f["forum_title"] = 'Current'; 150 $sql_f = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=0 AND forum_deleted=0 "; 151 $sql_f .= "AND forum_id=".$content['forum']['GET']." LIMIT 1"; 152 if($result_f = mysql_query($sql_f, $db) or die("error while retrieving forum info")) { 153 $row_f = mysql_fetch_assoc($result_f); 154 mysql_free_result($result_f); 155 } 156 157 158 switch($content['forum']['MODE']) { 159 160 case 'newtopic': 161 162 $content['forum']['topic'] = array('subject' => '', 'message' => '', 'notify' => 1, 'error' => ''); 163 164 // Process newtopic POST values 165 if(isset($_POST['forum_subject'])) { 166 167 $content['forum']['topic']['subject'] = remove_unsecure_rptags(clean_slweg($_POST['forum_subject'])); 168 $content['forum']['topic']['message'] = remove_unsecure_rptags(clean_slweg($_POST['forum_message'])); 169 $content['forum']['topic']['notify'] = isset($_POST['forum_notify']) ? 1 : 0; 170 171 if(empty($content['forum']['topic']['message'])) { 172 $content['forum']['topic']['error'] = 'There has to be a message for your topic'; 173 } 174 175 // if no error fill in or update topic 176 if(empty($content['forum']['topic']['error'])) { 177 178 $sql_topic = "INSERT INTO ".DB_PREPEND."phpwcms_forum SET "; 179 $sql_topic .= "forum_entry = '1', "; // a topic 180 $sql_topic .= "forum_cid = '".$row_f["forum_id"]."', "; 181 $sql_topic .= "forum_title = '".aporeplace($content['forum']['topic']['subject'])."', "; 182 $sql_topic .= "forum_created = '".time()."', "; 183 $sql_topic .= "forum_text = '".aporeplace($content['forum']['topic']['message'])."'"; 184 185 // save new topic 186 if(@mysql_query($sql_topic, $db)) { 187 188 //update forum info 189 $sql_topic = "UPDATE ".DB_PREPEND."phpwcms_forum SET "; 190 $sql_topic .= "forum_ctopic='".($row_f["forum_ctopic"]+1)."', "; 191 $sql_topic .= "forum_cpost='".($row_f["forum_cpost"]+1)."', "; 192 $sql_topic .= "forum_lastpost='".time().':'.intval(mysql_insert_id()).":2' "; 193 $sql_topic .= "WHERE forum_entry=0 AND forum_id=".$row_f["forum_id"]." LIMIT 1"; 194 @mysql_query($sql_topic, $db); 195 196 headerRedirect($content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"]); 197 198 } else { 199 $content['forum']['topic']['error'] = 'Error while creating new topic.'; 200 } 201 202 } 203 204 205 } 206 207 // Topic new form 208 $CNT_TMP .= '<form name="newtopic" action="'.$content['forum']['ARTICLE'].'&mode=newtopic'; 209 $CNT_TMP .= '&forum='.$row_f["forum_id"].'" method="post">'; 210 211 $CNT_TMP .= '<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">'; 212 $CNT_TMP .= "\n<tr>\n".'<td align="left" class="navForum">'; 213 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'">Forum overview</a> / '; 214 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"].'">'; 215 $CNT_TMP .= html_specialchars($row_f["forum_title"])."</a></td>\n</tr>\n</table>"; 216 217 218 $CNT_TMP .= '<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tableForum">'."\n<tr>\n"; 219 $CNT_TMP .= '<th colspan="2" nowrap="nowrap" class="thForum"><strong>Write New Topic</strong></th>'."\n</tr>\n"; 220 221 // Topic message Error 222 if(!empty($content['forum']['topic']['error'])) { 223 $CNT_TMP .= "<tr>\n"; 224 $CNT_TMP .= '<td class="rowError" width="20%"> </td>'."\n"; 225 $CNT_TMP .= '<td class="rowError" width="80%">'.html_specialchars($content['forum']['topic']['error']); 226 $CNT_TMP .= "</td>\n</tr>\n"; 227 } 228 229 // Topic Subject 230 $CNT_TMP .= "<tr>\n"; 231 $CNT_TMP .= '<td class="rowLabel" width="20%"><span class="rowTextLabel">title</span></td>'."\n"; 232 $CNT_TMP .= '<td class="rowPost" width="80%"><input type="text" name="forum_subject" size="45" maxlength="60" '; 233 $CNT_TMP .= 'style="width:425px" class="forumInputText" value="'.html_specialchars($content['forum']['topic']['subject']).'" /></td>'; 234 $CNT_TMP .= "\n</tr>\n"; 235 236 // Topic Message 237 $CNT_TMP .= "<tr>\n"; 238 $CNT_TMP .= '<td class="rowLabel" width="20%" valign="top"><span class="rowTextLabel" style="line-height:23px">message</span></td>'."\n"; 239 $CNT_TMP .= '<td class="rowPost" width="80%"><textarea name="forum_message" wrap="VIRTUAL" cols="35" rows="15" '; 240 $CNT_TMP .= 'style="width:425px" class="forumTextareaText">'.html_specialchars($content['forum']['topic']['message']).'</textarea></td>'; 241 $CNT_TMP .= "\n</tr>\n"; 242 243 // Topic Options 244 $CNT_TMP .= "<tr>\n"; 245 $CNT_TMP .= '<td class="rowLabel" width="20%"><span class="rowTextLabel">options</span></td>'."\n"; 246 $CNT_TMP .= '<td class="rowPost" width="80%"><table cellspacing="0" cellpadding="1" border="0">'; 247 $CNT_TMP .= '<tr><td><input type="checkbox" name="forum_notify" id="forum_notify" value="1"'.is_checked(1, $content['forum']['topic']['notify'], 1, 0); 248 $CNT_TMP .= ' /></td><td><label for="forum_notify"><span class="rowText">Notify me on reply</span></label>'; 249 $CNT_TMP .= "</td></tr></table></td>\n</tr>\n"; 250 251 // Topic Send Button 252 $CNT_TMP .= "<tr>\n"; 253 $CNT_TMP .= '<td colspan="2" class="catBottom">'; 254 $CNT_TMP .= '<input type="submit" name="forum_topic_submit" value="Send" class="forumButton" />'; 255 $CNT_TMP .= "</td>\n</tr>\n"; 256 257 258 $CNT_TMP .= '</table>'; 259 $CNT_TMP .= '</form>'; 260 261 262 break; 263 264 265 default: 266 $CNT_TMP .= '<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">'."\n<tr>\n"; 267 $CNT_TMP .= '<td width="50" valign="middle"><a href="'.$content['forum']['ARTICLE'].'&mode=newtopic'; 268 $CNT_TMP .= '&forum='.$row_f["forum_id"].'">'; 269 $CNT_TMP .= '<img src="img/forum/silver/post.gif" alt="Post new topic" border="0"></a></td>'."\n"; 270 $CNT_TMP .= '<td width="95%" align="left" valign="middle"><span class="navForum"> '; 271 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'">Forum overview</a> / '; 272 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"].'">'; 273 $CNT_TMP .= html_specialchars($row_f["forum_title"])."</a></span></td>\n"; 274 $CNT_TMP .= '<td align="left" nowrap="nowrap" valign="middle"> </td>'; 275 $CNT_TMP .= "\n</tr>\n</table>"; 276 277 $CNT_TMP .= '<table width="100%" cellpadding="2" cellspacing="1" border="0" class="tableForum">'; 278 $CNT_TMP .= "\n<tr>\n"; 279 $CNT_TMP .= '<th colspan="2" nowrap="nowrap" class="thForum"> Topics </th>'."\n"; 280 $CNT_TMP .= '<th width="50" class="thTopic" nowrap="nowrap"> Replies </th>'."\n"; 281 $CNT_TMP .= '<th width="50" class="thPost" nowrap="nowrap"> Author </th>'."\n"; 282 $CNT_TMP .= '<th class="thLastPost" nowrap="nowrap" align="center"> Last </th>'; 283 $CNT_TMP .= "\n</tr>\n"; 284 285 286 $sql_topic = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=1 AND forum_deleted=0 "; 287 $sql_topic .= "AND forum_cid=".$row_f["forum_id"]." ORDER BY forum_changed DESC"; 288 289 if($result_t = mysql_query($sql_topic, $db) or die("error while listing topic for current forum")) { 290 while($row_t = mysql_fetch_assoc($result_t)) { 291 292 get_fe_userinfo($row_t['forum_uid']); 293 294 $CNT_TMP .= "<tr>\n"; 295 $CNT_TMP .= '<td width="19" class="rowIcon" align="center" valign="middle"><img src="img/forum/silver/folder.gif" alt=""></td>'."\n"; 296 297 $CNT_TMP .= '<td width="100%" class="rowForum"><span class="rowTextForumlink">'; 298 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&topic='.$row_t["forum_id"].'">'; 299 $CNT_TMP .= html_specialchars($row_t["forum_title"])."</a></span></td>\n"; 300 301 $CNT_TMP .= '<td width="50" class="rowTopic" align="center" valign="middle"><span class="rowTextSmall">'; 302 $CNT_TMP .= $row_t['forum_cpost'].'</span></td>'."\n"; 303 304 $CNT_TMP .= '<td width="50" class="rowPost" align="center" valign="middle"><span class="rowTextSmall"> '; 305 $CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_t['forum_uid']]['login']).' </span></td>'."\n"; 306 307 $CNT_TMP .= '<td class="rowLastPost" align="center" valign="middle" nowrap="nowrap"><span class="rowTextSmall"> '; 308 309 if(!empty($row_t['forum_lastpost'])) { 310 $content["forum"]['lastpost'] = explode(':', $row_t['forum_lastpost']); 311 $CNT_TMP .= date('Y/m/d H:i', $content["forum"]['lastpost'][0]); 312 } else { 313 $CNT_TMP .= date('Y/m/d H:i', $row_t["forum_created"]); 314 } 315 316 $CNT_TMP .= ' </span></td>'."\n"; 317 318 $CNT_TMP .= "\n</tr>\n"; 319 320 } 321 mysql_free_result($result_t); 322 } 323 324 $CNT_TMP .= '</table>'; 325 326 } 327 328 } elseif($content['forum']['ACTION'] === 2) { 329 // show topic and related posts 330 331 $row_t['forum_id'] = $content['forum']['GET']; 332 $row_t["forum_title"] = 'Current'; 333 $sql_t = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=1 AND forum_deleted=0 "; 334 $sql_t .= "AND forum_id=".$content['forum']['GET']." LIMIT 1"; 335 if($result_t = mysql_query($sql_t, $db) or die("error while retrieving topic info")) { 336 $row_t = mysql_fetch_assoc($result_t); 337 mysql_free_result($result_t); 338 339 $sql_f = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=0 AND forum_deleted=0 "; 340 $sql_f .= "AND forum_id=".$row_t['forum_cid']." LIMIT 1"; 341 if($result_f = mysql_query($sql_f, $db) or die("error while retrieving related forum info")) { 342 $row_f = mysql_fetch_assoc($result_f); 343 mysql_free_result($result_f); 344 } 345 } 346 347 348 switch($content['forum']['MODE']) { 349 350 351 case 'reply': 352 353 $content['forum']['reply'] = array('subject' => '', 'message' => '', 'notify' => 1, 'error' => ''); 354 355 // Process newtopic POST values 356 if(isset($_POST['forum_subject'])) { 357 358 $content['forum']['reply']['subject'] = remove_unsecure_rptags(clean_slweg($_POST['forum_subject'])); 359 $content['forum']['reply']['message'] = remove_unsecure_rptags(clean_slweg($_POST['forum_message'])); 360 $content['forum']['reply']['notify'] = isset($_POST['forum_notify']) ? 1 : 0; 361 362 if(empty($content['forum']['reply']['message'])) { 363 $content['forum']['reply']['error'] = 'There has to be a message for your reply'; 364 } 365 366 // if no error fill in or update topic 367 if(empty($content['forum']['reply']['error'])) { 368 369 $sql_reply = "INSERT INTO ".DB_PREPEND."phpwcms_forum SET "; 370 $sql_reply .= "forum_entry = '2', "; // a reply 371 $sql_reply .= "forum_cid = '".$row_t["forum_id"]."', "; 372 $sql_reply .= "forum_title = '".aporeplace($content['forum']['reply']['subject'])."', "; 373 $sql_reply .= "forum_created = '".time()."', "; 374 $sql_reply .= "forum_text = '".aporeplace($content['forum']['reply']['message'])."'"; 375 376 // save new topic 377 if(@mysql_query($sql_reply, $db)) { 378 379 //update forum info 380 $sql_reply = "UPDATE ".DB_PREPEND."phpwcms_forum SET "; 381 $sql_reply .= "forum_cpost='".($row_f["forum_cpost"]+1)."', "; 382 $sql_reply .= "forum_lastpost='".time().':'.intval(mysql_insert_id()).":2' "; 383 $sql_reply .= "WHERE forum_entry=0 AND forum_id=".$row_f["forum_id"]." LIMIT 1"; 384 @mysql_query($sql_reply, $db); 385 386 //update topic info 387 $sql_reply = "UPDATE ".DB_PREPEND."phpwcms_forum SET "; 388 $sql_reply .= "forum_cpost='".($row_t["forum_cpost"]+1)."', "; 389 $sql_reply .= "forum_lastpost='".time().':'.intval(mysql_insert_id()).":2' "; 390 $sql_reply .= "WHERE forum_entry=1 AND forum_id=".$row_t["forum_id"]." LIMIT 1"; 391 @mysql_query($sql_reply, $db); 392 393 headerRedirect($content['forum']['ARTICLE'].'&topic='.$row_t["forum_id"]); 394 395 } else { 396 $content['forum']['topic']['error'] = 'Error while creating new reply.'; 397 } 398 399 } 400 401 402 } 403 404 // reply new form 405 $CNT_TMP .= '<form name="newreply" action="'.$content['forum']['ARTICLE'].'&mode=reply'; 406 $CNT_TMP .= '&topic='.$row_t["forum_id"].'" method="post">'; 407 408 $CNT_TMP .= '<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">'; 409 $CNT_TMP .= "\n<tr>\n".'<td align="left" class="navForum">'; 410 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'">Forum overview</a> / '; 411 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"].'">'; 412 $CNT_TMP .= html_specialchars($row_f["forum_title"])."</a></td>\n</tr>\n</table>"; 413 414 415 $CNT_TMP .= '<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tableForum">'."\n<tr>\n"; 416 $CNT_TMP .= '<th colspan="2" nowrap="nowrap" class="thForum"><strong>Write Reply</strong></th>'."\n</tr>\n"; 417 418 // Reply message Error 419 if(!empty($content['forum']['reply']['error'])) { 420 $CNT_TMP .= "<tr>\n"; 421 $CNT_TMP .= '<td class="rowError" width="20%"> </td>'."\n"; 422 $CNT_TMP .= '<td class="rowError" width="80%">'.html_specialchars($content['forum']['reply']['error']); 423 $CNT_TMP .= "</td>\n</tr>\n"; 424 } 425 426 // reply Subject 427 $CNT_TMP .= "<tr>\n"; 428 $CNT_TMP .= '<td class="rowLabel" width="20%"><span class="rowTextLabel">title</span></td>'."\n"; 429 $CNT_TMP .= '<td class="rowPost" width="80%"><input type="text" name="forum_subject" size="45" maxlength="60" '; 430 $CNT_TMP .= 'style="width:425px" class="forumInputText" value="'.html_specialchars($content['forum']['reply']['subject']).'" /></td>'; 431 $CNT_TMP .= "\n</tr>\n"; 432 433 // Reply Message 434 $CNT_TMP .= "<tr>\n"; 435 $CNT_TMP .= '<td class="rowLabel" width="20%" valign="top"><span class="rowTextLabel" style="line-height:23px">message</span></td>'."\n"; 436 $CNT_TMP .= '<td class="rowPost" width="80%"><textarea name="forum_message" wrap="VIRTUAL" cols="35" rows="15" '; 437 $CNT_TMP .= 'style="width:425px" class="forumTextareaText">'.html_specialchars($content['forum']['reply']['message']).'</textarea></td>'; 438 $CNT_TMP .= "\n</tr>\n"; 439 440 // Reply Options 441 $CNT_TMP .= "<tr>\n"; 442 $CNT_TMP .= '<td class="rowLabel" width="20%"><span class="rowTextLabel">options</span></td>'."\n"; 443 $CNT_TMP .= '<td class="rowPost" width="80%"><table cellspacing="0" cellpadding="1" border="0">'; 444 $CNT_TMP .= '<tr><td><input type="checkbox" name="forum_notify" id="forum_notify" value="1"'.is_checked(1, $content['forum']['reply']['notify'], 1, 0); 445 $CNT_TMP .= ' /></td><td><label for="forum_notify"><span class="rowText">Notify me on reply</span></label>'; 446 $CNT_TMP .= "</td></tr></table></td>\n</tr>\n"; 447 448 // Reply Send Button 449 $CNT_TMP .= "<tr>\n"; 450 $CNT_TMP .= '<td colspan="2" class="catBottom">'; 451 $CNT_TMP .= '<input type="submit" name="forum_reply_submit" value="Send" class="forumButton" />'; 452 $CNT_TMP .= "</td>\n</tr>\n"; 453 454 455 $CNT_TMP .= '</table>'; 456 $CNT_TMP .= '</form>'; 457 458 break; 459 460 461 462 default: 463 $CNT_TMP .= '<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">'."\n<tr>\n"; 464 $CNT_TMP .= '<td valign="middle"><a href="'.$content['forum']['ARTICLE'].'&mode=newtopic'; 465 $CNT_TMP .= '&forum='.$row_f["forum_id"].'">'; 466 $CNT_TMP .= '<img src="img/forum/silver/post.gif" alt="Post new topic" border="0"></a>'; 467 $CNT_TMP .= ' '; 468 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&mode=reply'; 469 $CNT_TMP .= '&topic='.$row_t["forum_id"].'">'; 470 $CNT_TMP .= '<img src="img/forum/silver/reply.gif" alt="Post reply" border="0"></a>'; 471 472 $CNT_TMP .= '</td>'."\n"; 473 $CNT_TMP .= '<td width="100%" align="left" valign="middle"><span class="navForum"> '; 474 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'">Forum overview</a> / '; 475 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&forum='.$row_f["forum_id"].'">'; 476 $CNT_TMP .= html_specialchars($row_f["forum_title"])."</a></span></td>\n"; 477 $CNT_TMP .= '<td align="left" nowrap="nowrap" valign="middle"> </td>'; 478 $CNT_TMP .= "\n</tr>\n</table>"; 479 480 // list posts 481 $CNT_TMP .= '<table width="100%" cellpadding="2" cellspacing="1" border="0" class="tableForum">'; 482 $CNT_TMP .= "\n<tr>\n"; 483 $CNT_TMP .= '<th width="150" class="thPost" nowrap="nowrap" align="center"> Author </th>'."\n"; 484 $CNT_TMP .= '<th width="100%" class="thPost" nowrap="nowrap" align="center"> Message </th>'."\n"; 485 $CNT_TMP .= "\n</tr>\n"; 486 487 $CNT_TMP .= "\n<tr>\n"; 488 $CNT_TMP .= '<td width="150" class="rowReply" align="left" valign="top"><a name="'.$row_t["forum_id"].'"></a>'; 489 490 get_fe_userinfo($row_t["forum_uid"]); 491 492 $CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_t['forum_uid']]['login'])."</td>\n"; 493 $CNT_TMP .= '<td width="100%" class="rowReply"><div class="postdetails">'; 494 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&topic='.$row_t["forum_id"].'#'.$row_t["forum_id"].'">'; 495 $CNT_TMP .= '<img src="img/forum/silver/icon_minipost.gif" alt="Post" title="Post" border="0"></a>composed: '; 496 $CNT_TMP .= international_date_format($phpwcms['default_lang'], 'j F Y H:i', $row_t["forum_created"]); 497 $CNT_TMP .= ' title: '.html_specialchars($row_t["forum_title"]); 498 $CNT_TMP .= '<hr /></div><div class="postbody">'.html_specialchars($row_t["forum_text"]); 499 $CNT_TMP .= "</div></td>\n</tr>\n"; 500 501 502 503 $sql_post = "SELECT * FROM ".DB_PREPEND."phpwcms_forum WHERE forum_entry=2 AND forum_deleted=0 "; 504 $sql_post .= "AND forum_cid=".$row_t["forum_id"]." ORDER BY forum_created ASC"; 505 506 if($result_p = mysql_query($sql_post, $db) or die("error while listing topic for current forum")) { 507 $row_p_alter = 0; 508 while($row_p = mysql_fetch_assoc($result_p)) { 509 510 $CNT_TMP .= '<tr><td colspan="2" class="row3"><img src="img/leer.gif" alt="" height="1" width="1" border="0" /></td>'."</tr>\n"; 511 512 $row_p_alter_class = ($row_p_alter % 2) ? 'rowReply' : 'rowReplyA'; 513 514 get_fe_userinfo($row_p["forum_uid"]); 515 516 $CNT_TMP .= "\n<tr>\n"; 517 $CNT_TMP .= '<td width="150" class="'.$row_p_alter_class.'" align="left" valign="top"><a name="'.$row_p["forum_id"].'"></a>'; 518 $CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_p['forum_uid']]['login'])."</td>\n"; 519 $CNT_TMP .= '<td width="100%" class="'.$row_p_alter_class.'"><div class="postdetails">'; 520 $CNT_TMP .= '<a href="'.$content['forum']['ARTICLE'].'&topic='.$row_t["forum_id"].'#'.$row_p["forum_id"].'">'; 521 $CNT_TMP .= '<img src="img/forum/silver/icon_minipost.gif" alt="Post" title="Post" border="0"></a>composed: '; 522 $CNT_TMP .= international_date_format($phpwcms['default_lang'], 'j F Y H:i', $row_p["forum_created"]); 523 $CNT_TMP .= ' title: '.html_specialchars($row_p["forum_title"]); 524 $CNT_TMP .= '<hr /></div><div class="postbody">'.html_specialchars($row_p["forum_text"]); 525 $CNT_TMP .= "</div></td>\n</tr>\n"; 526 527 $row_p_alter++; 528 529 } 530 mysql_free_result($result_p); 531 } 532 533 $CNT_TMP .= '<tr><td colspan="2" class="row3"><img src="img/leer.gif" alt="" height="1" width="1" border="0" /></td>'."</tr>\n"; 534 $CNT_TMP .= '</table>'; 535 536 537 } 538 539 } 540 541 unset($content['forum']); 542 543 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 30 05:55:15 2009 | Cross-referenced by PHPXref 0.7 |