| 1 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        <?php
  | 
      
      
        | 2 | 
        
         | 
        
         | 
        
  | 
      
      
        | 3 | 
        
         | 
        
         | 
        // $Id$
  | 
      
      
        | 4 | 
        
         | 
        
         | 
        
  | 
      
      
        | 5 | 
        
         | 
        
         | 
        /*
  | 
      
      
        | 6 | 
        
         | 
        
         | 
        
  | 
      
      
        | 7 | 
        
         | 
        
         | 
         Website Baker Project <http://www.websitebaker.org/>
  | 
      
      
        | 8 | 
        
         | 
        
         | 
         Copyright (C) 2004-2008, Ryan Djurovich
  | 
      
      
        | 9 | 
        
         | 
        
         | 
        
  | 
      
      
        | 10 | 
        
         | 
        
         | 
         Website Baker is free software; you can redistribute it and/or modify
  | 
      
      
        | 11 | 
        
         | 
        
         | 
         it under the terms of the GNU General Public License as published by
  | 
      
      
        | 12 | 
        
         | 
        
         | 
         the Free Software Foundation; either version 2 of the License, or
  | 
      
      
        | 13 | 
        
         | 
        
         | 
         (at your option) any later version.
  | 
      
      
        | 14 | 
        
         | 
        
         | 
        
  | 
      
      
        | 15 | 
        
         | 
        
         | 
         Website Baker is distributed in the hope that it will be useful,
  | 
      
      
        | 16 | 
        
         | 
        
         | 
         but WITHOUT ANY WARRANTY; without even the implied warranty of
  | 
      
      
        | 17 | 
        
         | 
        
         | 
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  | 
      
      
        | 18 | 
        
         | 
        
         | 
         GNU General Public License for more details.
  | 
      
      
        | 19 | 
        
         | 
        
         | 
        
  | 
      
      
        | 20 | 
        
         | 
        
         | 
         You should have received a copy of the GNU General Public License
  | 
      
      
        | 21 | 
        
         | 
        
         | 
         along with Website Baker; if not, write to the Free Software
  | 
      
      
        | 22 | 
        
         | 
        
         | 
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  | 
      
      
        | 23 | 
        
         | 
        
         | 
        
  | 
      
      
        | 24 | 
        
         | 
        
         | 
        */
  | 
      
      
        | 25 | 
        
         | 
        
         | 
        
  | 
      
      
        | 26 | 
        
         | 
        
         | 
        // Make sure page cannot be accessed directly
  | 
      
      
        | 27 | 
        
         | 
        
         | 
        if(!defined('WB_URL')) {
 | 
      
      
        | 28 | 
        
         | 
        
         | 
        	header('Location: ../index.php');
 | 
      
      
        | 29 | 
        
         | 
        
         | 
        	exit(0);
  | 
      
      
        | 30 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 31 | 
        
            596
         | 
        
            thorn
         | 
        
  | 
      
      
        | 32 | 
        
         | 
        
         | 
        require_once(WB_PATH.'/include/captcha/captcha.php');
  | 
      
      
        | 33 | 
        
            739
         | 
        
            thorn
         | 
        require_once(WB_PATH.'/include/captcha/asp.php');
  | 
      
      
        | 34 | 
        
            596
         | 
        
            thorn
         | 
        
  | 
      
      
        | 35 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        // Get comments page template details from db
  | 
      
      
        | 36 | 
        
            596
         | 
        
            thorn
         | 
        $query_settings = $database->query("SELECT comments_page,use_captcha,commenting FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '".SECTION_ID."'");
 | 
      
      
        | 37 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        if($query_settings->numRows() == 0) {
 | 
      
      
        | 38 | 
        
         | 
        
         | 
        	header("Location: ".WB_URL.PAGES_DIRECTORY."");
 | 
      
      
        | 39 | 
        
         | 
        
         | 
        	exit(0);
  | 
      
      
        | 40 | 
        
         | 
        
         | 
        } else {
 | 
      
      
        | 41 | 
        
         | 
        
         | 
        	$settings = $query_settings->fetchRow();
  | 
      
      
        | 42 | 
        
            596
         | 
        
            thorn
         | 
        
  | 
      
      
        | 43 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	// Print comments page
  | 
      
      
        | 44 | 
        
         | 
        
         | 
        	echo str_replace('[POST_TITLE]', POST_TITLE, ($settings['comments_page']));
 | 
      
      
        | 45 | 
        
         | 
        
         | 
        	?>
  | 
      
      
        | 46 | 
        
         | 
        
         | 
        	<form name="comment" action="<?php echo WB_URL.'/modules/news/submit_comment.php?page_id='.PAGE_ID.'§ion_id='.SECTION_ID.'&post_id='.POST_ID; ?>" method="post">
  | 
      
      
        | 47 | 
        
            596
         | 
        
            thorn
         | 
        	<?php if(ENABLED_ASP) { // add some honeypot-fields
 | 
      
      
        | 48 | 
        
         | 
        
         | 
        	?>
  | 
      
      
        | 49 | 
        
         | 
        
         | 
        	<input type="hidden" name="submitted_when" value="<?php $t=time(); echo $t; $_SESSION['submitted_when']=$t; ?>" />
  | 
      
      
        | 50 | 
        
            739
         | 
        
            thorn
         | 
        	<p class="nixhier">
  | 
      
      
        | 51 | 
        
            596
         | 
        
            thorn
         | 
        	email address:
  | 
      
      
        | 52 | 
        
         | 
        
         | 
        	<label for="email">We dont want to know your email-address. Leave this field empty:</label>
  | 
      
      
        | 53 | 
        
         | 
        
         | 
        	<input id="email" name="email" size="60" value="" /><br />
  | 
      
      
        | 54 | 
        
         | 
        
         | 
        	Homepage:
  | 
      
      
        | 55 | 
        
         | 
        
         | 
        	<label for="homepage">Do not enter a homepage-url here, use field comment instead if you want:</label>
  | 
      
      
        | 56 | 
        
         | 
        
         | 
        	<input id="homepage" name="homepage" size="60" value="" /><br />
  | 
      
      
        | 57 | 
        
         | 
        
         | 
        	URL:
  | 
      
      
        | 58 | 
        
         | 
        
         | 
        	<label for="url">Don't write anything in this url field:</label>
  | 
      
      
        | 59 | 
        
         | 
        
         | 
        	<input id="url" name="url" size="60" value="" /><br />
  | 
      
      
        | 60 | 
        
            605
         | 
        
            thorn
         | 
        	Comment:
  | 
      
      
        | 61 | 
        
         | 
        
         | 
        	<label for="comment">Leave not your comment here:</label>
  | 
      
      
        | 62 | 
        
         | 
        
         | 
        	<input id="comment" name="comment" size="60" value="" /><br />
  | 
      
      
        | 63 | 
        
            596
         | 
        
            thorn
         | 
        	</p>
  | 
      
      
        | 64 | 
        
         | 
        
         | 
        	<?php }
  | 
      
      
        | 65 | 
        
         | 
        
         | 
        	?>
  | 
      
      
        | 66 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	<?php echo $TEXT['TITLE']; ?>:
  | 
      
      
        | 67 | 
        
         | 
        
         | 
        	<br />
  | 
      
      
        | 68 | 
        
         | 
        
         | 
        	<input type="text" name="title" maxlength="255" style="width: 90%;"<?php if(isset($_SESSION['comment_title'])) { echo ' value="'.$_SESSION['comment_title'].'"'; unset($_SESSION['comment_title']); } ?> />
 | 
      
      
        | 69 | 
        
         | 
        
         | 
        	<br /><br />
  | 
      
      
        | 70 | 
        
            605
         | 
        
            thorn
         | 
        	<?php echo $TEXT['COMMENT'];
  | 
      
      
        | 71 | 
        
         | 
        
         | 
        	?>:
  | 
      
      
        | 72 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	<br />
  | 
      
      
        | 73 | 
        
            649
         | 
        
            thorn
         | 
        	<?php if(ENABLED_ASP) { ?>
 | 
      
      
        | 74 | 
        
         | 
        
         | 
        		<textarea name="c0mment_<?php echo date('W'); ?>" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
 | 
      
      
        | 75 | 
        
         | 
        
         | 
        	<?php } else { ?>
 | 
      
      
        | 76 | 
        
         | 
        
         | 
        		<textarea name="comment" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
 | 
      
      
        | 77 | 
        
         | 
        
         | 
        	<?php } ?>
  | 
      
      
        | 78 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	<br /><br />
  | 
      
      
        | 79 | 
        
         | 
        
         | 
        	<?php
  | 
      
      
        | 80 | 
        
         | 
        
         | 
        	if(isset($_SESSION['captcha_error'])) {
 | 
      
      
        | 81 | 
        
         | 
        
         | 
        		echo '<font color="#FF0000">'.$_SESSION['captcha_error'].'</font><br />';
  | 
      
      
        | 82 | 
        
            605
         | 
        
            thorn
         | 
        		$_SESSION['captcha_retry_news'] = true;
  | 
      
      
        | 83 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	}
  | 
      
      
        | 84 | 
        
         | 
        
         | 
        	// Captcha
  | 
      
      
        | 85 | 
        
         | 
        
         | 
        	if($settings['use_captcha']) {
 | 
      
      
        | 86 | 
        
         | 
        
         | 
        	?>
  | 
      
      
        | 87 | 
        
         | 
        
         | 
        	<table cellpadding="2" cellspacing="0" border="0">
  | 
      
      
        | 88 | 
        
         | 
        
         | 
        	<tr>
  | 
      
      
        | 89 | 
        
            596
         | 
        
            thorn
         | 
        		<td><?php echo $TEXT['VERIFICATION']; ?>:</td>
  | 
      
      
        | 90 | 
        
         | 
        
         | 
        		<td><?php call_captcha(); ?></td>
  | 
      
      
        | 91 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	</tr></table>
  | 
      
      
        | 92 | 
        
         | 
        
         | 
        	<br />
  | 
      
      
        | 93 | 
        
         | 
        
         | 
        	<?php
  | 
      
      
        | 94 | 
        
            676
         | 
        
            thorn
         | 
        	if(isset($_SESSION['captcha_error'])) {
 | 
      
      
        | 95 | 
        
         | 
        
         | 
        		unset($_SESSION['captcha_error']);
  | 
      
      
        | 96 | 
        
         | 
        
         | 
        		?><script>document.comment.captcha.focus();</script><?php
  | 
      
      
        | 97 | 
        
         | 
        
         | 
        	}?>
  | 
      
      
        | 98 | 
        
         | 
        
         | 
        	<?php
  | 
      
      
        | 99 | 
        
            562
         | 
        
            Ruebenwurz
         | 
        	}
  | 
      
      
        | 100 | 
        
         | 
        
         | 
        	?>
  | 
      
      
        | 101 | 
        
         | 
        
         | 
        	<input type="submit" name="submit" value="<?php echo $TEXT['ADD']; ?> <?php echo $TEXT['COMMENT']; ?>" />
  | 
      
      
        | 102 | 
        
         | 
        
         | 
        	</form>
  | 
      
      
        | 103 | 
        
         | 
        
         | 
        	<?php
  | 
      
      
        | 104 | 
        
         | 
        
         | 
        }
  | 
      
      
        | 105 | 
        
         | 
        
         | 
        
  | 
      
      
        | 106 | 
        
            596
         | 
        
            thorn
         | 
        ?>
  |