View file mc-2.7.0/modules/comments/helpers/comments.php

File size: 801B
<?php

/**
 * MobileCMS
 *
 * Open source content management system for mobile sites
 *
 * @author MobileCMS Team <[email protected]>
 * @copyright Copyright (c) 2011-2019, MobileCMS Team
 * @link https://mobilecms.pro Official site
 * @license MIT license
 */
defined('IN_SYSTEM') or die('<b>403<br />Запрет доступа!</b>');

/**
 * Хелпер модуля комментариев
 */
class comments {

    /**
     * Получение количества комментов
     */
    public static function get_count_comments($db, $module, $item_id) {
        $count = $db->get_one("SELECT COUNT(*) FROM #__comments_posts WHERE
            module = '" . a_safe($module) . "' AND
            item_id = '" . intval($item_id) . "'
        ");

        return $count;
    }

}

?>