Revision 242
Added by stefan almost 20 years ago
| submit_comment.php | ||
|---|---|---|
| 26 | 26 |
// Include config file |
| 27 | 27 |
require('../../config.php');
|
| 28 | 28 |
|
| 29 |
// Include admin class |
|
| 30 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
| 31 |
$admin = new admin('Start', 'start', false, false);
|
|
| 32 |
|
|
| 33 |
// Include WB functions file |
|
| 34 |
if(!defined('FUNCTIONS_CLASS_LOADED')) {
|
|
| 35 |
require(WB_PATH.'/framework/functions.php'); |
|
| 36 |
} |
|
| 37 |
|
|
| 38 | 29 |
// Check if we should show the form or add a comment |
| 39 | 30 |
if(is_numeric($_GET['page_id']) AND is_numeric($_GET['section_id']) AND isset($_GET['post_id']) AND is_numeric($_GET['post_id']) AND isset($_POST['comment']) AND $_POST['comment'] != '') {
|
| 40 | 31 |
|
| ... | ... | |
| 42 | 33 |
$page_id = $_GET['page_id']; |
| 43 | 34 |
$section_id = $_GET['section_id']; |
| 44 | 35 |
$post_id = $_GET['post_id']; |
| 45 |
$title = $admin->add_slashes(strip_tags($_POST['title']));
|
|
| 46 |
$comment = $admin->add_slashes(strip_tags($_POST['comment']));
|
|
| 36 |
$title = $wb->add_slashes(strip_tags($_POST['title']));
|
|
| 37 |
$comment = $wb->add_slashes(strip_tags($_POST['comment']));
|
|
| 47 | 38 |
$commented_when = mktime(); |
| 48 |
if(isset($admin) AND $admin->is_authenticated() == true) {
|
|
| 49 |
$commented_by = $admin->get_user_id();
|
|
| 39 |
if($wb->is_authenticated() == true) {
|
|
| 40 |
$commented_by = $wb->get_user_id();
|
|
| 50 | 41 |
} else {
|
| 51 | 42 |
$commented_by = ''; |
| 52 | 43 |
} |
| ... | ... | |
| 54 | 45 |
// Get page link |
| 55 | 46 |
$query_page = $database->query("SELECT link FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'");
|
| 56 | 47 |
$page = $query_page->fetchRow(); |
| 57 |
header('Location: '.page_link($page['link']).'?id='.$post_id);
|
|
| 48 |
header('Location: '.$wb->page_link($page['link']).'?id='.$post_id);
|
|
| 58 | 49 |
|
| 59 | 50 |
} else {
|
| 60 | 51 |
header('Location: '.WB_URL.'/pages/');
|
Also available in: Unified diff
Moved page_link function to class wb and changed page_link() in functions.php to use the wb class method