本文整理汇总了PHP中Stats::addViews方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::addViews方法的具体用法?PHP Stats::addViews怎么用?PHP Stats::addViews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats::addViews方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
die("Direct Access Not Allowed!");
}
/**
* GeniXCMS - Content Management System
*
* PHP Based Content Management System and Framework
*
* @package GeniXCMS
* @since 0.0.1 build date 20141006
* @version 0.0.6
* @link https://github.com/semplon/GeniXCMS
* @link http://genixcms.org
* @author Puguh Wijayanto (www.metalgenix.com)
* @copyright 2014-2015 Puguh Wijayanto
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
$post = $_GET[$vars];
$data['posts'] = Db::result(sprintf("SELECT * FROM `posts` \n WHERE `id` = '%d' \n AND `type` = 'post'\n AND `status` = '1' \n LIMIT 1", $post));
if (Db::$num_rows > 0) {
Theme::theme('header', $data);
Theme::theme('single', $data);
Theme::footer();
Stats::addViews($post);
exit;
} else {
Control::error('404');
exit;
}
/* End of file post.control.php */
/* Location: ./inc/lib/Control/Frontend/post.control.php */
示例2: switch
* @link https://github.com/semplon/GeniXCMS
* @link http://genixcms.org
* @author Puguh Wijayanto (www.metalgenix.com)
* @copyright 2014-2015 Puguh Wijayanto
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
switch ($_GET['page']) {
case 'sitemap':
# code...
Sitemap::create();
exit;
break;
default:
# code...
$page = Typo::cleanX(Typo::strip($_GET['page']));
$data['posts'] = Db::result(sprintf("SELECT * FROM `posts` \n WHERE (`id` = '%d' OR `slug` = '%s')\n AND `type` = 'page'\n AND `status` = '1'\n LIMIT 1", $page, $page));
if (Db::$num_rows > 0) {
Theme::theme('header', $data);
Theme::theme('page', $data);
Theme::footer();
Stats::addViews($page);
exit;
} else {
Control::error('404');
exit;
}
break;
}
/* End of file page.control.php */
/* Location: ./inc/lib/Control/Frontend/page.control.php */