page = $page; $this->emotions = array('wink', 'winked', 'smile', 'am', 'belay', 'feel', 'fellow', 'laughing', 'lol', 'love', 'no', 'recourse', 'request', 'sad', 'tongue', 'wassat', 'crying', 'what', 'bully', 'angry'); $this->Handlers(); } function Handlers() { global $cms; if (isset($_GET['json']) and $_GET['json'] == 1 and isset($_GET['action']) and $_GET['action'] == 'comment' and ctype_digit($_GET['comment_id'])) { if (!($_GET['rating'] == '+1' or $_GET['rating'] == '-1')) exit; if ($comment = Core_Database::loadById('comments__list', $_GET['comment_id'])) { if (!Core_Database::load('comments__rating', "comment_id='" . $_GET['comment_id'] . "' and ip='" . $_SERVER['REMOTE_ADDR'] . "' and time_add>" . (time() - 3600 * 24), null, 1, true)) { $comment['votes_total'] += 1; $comment['votes_summ'] += $_GET['rating']; $d = array( 'comment_id' => $_GET['comment_id'], 'rating' => $_GET['rating'], 'time_add' => time(), 'ip' => $_SERVER['REMOTE_ADDR'] ); Core_Database::insert('comments__rating', $d); Core_Database::update('comments__list', $comment, $comment['id']); echo json_encode(array("votes_summ" => $comment['votes_summ'])); } } exit; } if (isset($_POST['action']) and $_POST['action'] == 'comment') { if (Core_Database::load('comments__blocked_ips', "ip='" . $_SERVER['REMOTE_ADDR'] . "'", null, 1, true)) { header("Location: " . $_SERVER['REQUEST_URI']); exit; } if (User::isSignedIn()) { if ($_POST['text']) { $d = array( 'author' => User::getCurrentUserId(), 'comment' => strip_tags($_POST['text']), 'page' => $this->page, 'time_add' => time(), 'ip' => $_SERVER['REMOTE_ADDR'] ); $_SESSION['content']['info'][] = Core_Language::g('comments__info_added'); Core_Database::insert('comments__list', $d); header("Location: " . $_SERVER['REQUEST_URI']); exit; } } } } function AddComment() { global $cms; Core_Layout::assign('emotions', $this->emotions); $return .= Core_Layout::fetch('comments.form.tpl'); return $return; } function CommentsList() { global $cms; $return = ''; if ($list = Core_Database::load('comments__list', "page='" . $this->page . "'", 'time_add DESC')) { foreach ($this->emotions as $e) { $emotions[':' . $e . ':'] .= 'smilie'; } $paginator = new Paginator($cms->settings['comments_per_page'], (isset($_GET['page']) ? $_GET['page'] : 0), count($list)); $count = 0; $user__list = Core_Database::load('user__list'); foreach ($list as $row) { // Paginator counter $count++; if ($count > $paginator->limit_max) break; if ($count <= $paginator->limit_min) continue; if ($comments__rating = Core_Database::load('comments__rating', "comment_id='" . $row['id'] . "' and ip='" . $_SERVER['REMOTE_ADDR'] . "' and time_add>" . (time() - 3600 * 24), null, 1, true)) { $row['vote'] = 'denied'; } else { $row['vote'] = ''; } $row['comment_text'] = strtr($row['comment'], $emotions); $list_small[$row['id']] = $row; } Core_Layout::assign('list', $list_small); Core_Layout::assign('user__list', $user__list); $return .= Core_Layout::fetch('comments.list.tpl'); $return .= $paginator->pages(); } return $return; } function CountComments() { global $cms; $count = Core_Database::loadBySql("SELECT COUNT(id) as c FROM comments__list WHERE page='" . $this->page . "'", 1); return $count['c']; } }
Fatal error: Uncaught Error: Class 'Comments' not found in /mnt/public_html/production/prod/taxisos/engine/News.php:119 Stack trace: #0 /mnt/public_html/production/prod/taxisos/engine/News.php(20): News->showObject('39') #1 /mnt/public_html/production/prod/taxisos/engine/core/Bootstrap.php(199): News->__construct() #2 /mnt/public_html/production/prod/taxisos/engine/core/Bootstrap.php(43): Core_Bootstrap::makeCommon() #3 /mnt/public_html/production/prod/taxisos/engine/index.php(13): Core_Bootstrap::make() #4 {main} thrown in /mnt/public_html/production/prod/taxisos/engine/News.php on line 119