本文整理汇总了PHP中count_pages函数的典型用法代码示例。如果您正苦于以下问题:PHP count_pages函数的具体用法?PHP count_pages怎么用?PHP count_pages使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了count_pages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_clean
}
}
}
$child_ids[] = mysql_clean($category);
}
}
$search->category = $child_ids;
}
$search->date_margin = mysql_clean($_GET['datemargin']);
$search->sort_by = mysql_clean($_GET['sort']);
$search->limit = create_query_limit($page, $search->results_per_page);
$results = $search->search();
//echo $db->db_query;
//Collecting Data for Pagination
$total_rows = $search->total_results;
$total_pages = count_pages($total_rows, $search->results_per_page);
//Pagination
$pages->paginate($total_pages, $page);
Assign('results', $results);
Assign('template_var', $search->template_var);
Assign('display_template', $search->display_template);
if (empty($search->key)) {
Assign('search_type_title', $search->search_type[$type]['title']);
} else {
Assign('search_type_title', sprintf(lang('searching_keyword_in_obj'), mysql_clean(get('query')), $search->search_type[$type]['title']));
}
if (mysql_clean(get('query'))) {
subtitle($search->search_type[$type]['title'] . ' » ' . mysql_clean(get('query')));
}
//Displaying The Template
template_files('search.html');
示例2: array
$userquery->removeProfileItem();
}
//Getting Video List
$vid_array = array('user' => $udetails['userid'], 'limit' => $get_limit);
if (get('query') != '') {
$vid_array['title'] = mysql_clean(get('query'));
$vid_array['tags'] = mysql_clean(get('query'));
}
if (get('order') == 'oldest') {
$vid_array['order'] = ' date_added ASC ';
} else {
$vid_array['order'] = ' date_added DESC ';
}
if (get('broadcast') && is_valid_broadcast(get('broadcast'))) {
$vid_array['broadcast'] = mysql_clean(get('broadcast'));
}
$videos = get_videos($vid_array);
Assign('uservids', $videos);
Assign('videos', $videos);
//Collecting Data for Pagination
$vid_array['count_only'] = true;
$total_rows = get_videos($vid_array);
assign('total_videos', $total_rows);
$total_pages = count_pages($total_rows, VLISTPP);
//Pagination
$pages->paginate($total_pages, $page);
subtitle(lang("vdo_manage_vdeos"));
break;
}
template_files('manage_videos.html');
display_it();
示例3: assign
assign('mode', 'favorites');
//Removing video from favorites
if (!empty($_GET['vid_delete'])) {
$video = mysql_clean($_GET['vid_delete']);
$cbvideo->action->remove_favorite($video);
}
//Removing Multiple Videos
if (isset($_POST['delete_fav_videos'])) {
for ($id = 0; $id <= VLISTPP; $id++) {
$cbvideo->delete_video($_POST['check_vid'][$id]);
}
$eh->flush();
e(lang("vdo_multi_del_fav_msg"), m);
}
if (get('query') != '') {
$cond = " (video.title LIKE '%" . mysql_clean(get('query')) . "%' OR video.tags LIKE '%" . mysql_clean(get('query')) . "%' )";
}
$params = array('userid' => userid(), 'limit' => $get_limit, 'cond' => $cond);
$videos = $cbvid->action->get_favorites($params);
Assign('uservids', $videos);
//Collecting Data for Pagination
$params['count_only'] = 'yes';
$favorites_count = $cbvid->action->get_favorites($params);
$total_pages = count_pages($favorites_count, VLISTPP);
//Pagination
$pages->paginate($total_pages, $page);
subtitle(lang("com_manage_fav"));
break;
}
template_files('manage_videos.html');
display_it();
示例4: array
case "getComments":
$params = array();
$limit = config('comments_per_page');
$page = $_POST['page'];
$params['type'] = mysql_clean($_POST['type']);
$params['type_id'] = mysql_clean($_POST['type_id']);
$params['last_update'] = mysql_clean($_POST['last_update']);
$params['limit'] = create_query_limit($page, $limit);
$admin = "";
if ($_POST['admin'] == 'yes' && has_access('admin_access', true)) {
$params['cache'] = 'no';
$admin = "yes";
}
$comments = $myquery->getComments($params);
//Adding Pagination
$total_pages = count_pages($_POST['total_comments'], $limit);
assign('object_type', mysql_clean($_POST['object_type']));
//Pagination
$pages->paginate($total_pages, $page, NULL, NULL, '<a href="javascript:void(0)"
onClick="getComments(\'' . $params['type'] . '\',\'' . $params['type_id'] . '\',\'' . $params['last_update'] . '\',
\'#page#\',\'' . $_POST['total_comments'] . '\',\'' . mysql_clean($_POST['object_type']) . '\',\'' . $admin . '\')">#page#</a>');
assign('comments', $comments);
assign('type', $params['type']);
assign('type_id', $params['type_id']);
assign('last_update', $params['last_update']);
assign('total', $_POST['total_comments']);
assign('total_pages', $total_pages);
assign('comments_voting', $_POST['comments_voting']);
if ($_POST['admin'] == 'yes' && has_access('admin_access', true)) {
Template(BASEDIR . '/' . ADMINDIR . '/' . TEMPLATEFOLDER . '/cbv3/layout/blocks/comments.html', false);
exit;
示例5: switch
$eh->flush();
$cbphoto->action->delete_flags($_POST['check_photo'][$id]);
}
}
switch ($mode) {
case "view":
default:
assign("mode", "view");
//Getting Video List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, 5);
$photos = $cbphoto->action->get_flagged_objects($get_limit);
assign('photos', $photos);
//Collecting Data for Pagination
$total_rows = $cbphoto->action->count_flagged_objects();
$total_pages = count_pages($total_rows, 5);
//Pagination
$pages->paginate($total_pages, $page);
break;
case "view_flags":
assign("mode", "view_flags");
$pid = mysql_clean($_GET['pid']);
$pdetails = $cbphoto->get_photo($pid);
if ($pdetails) {
$flags = $cbphoto->action->get_flags($pid);
assign('flags', $flags);
assign('photo', $pdetails);
} else {
e("Photo does not exist");
}
}
示例6: count
$total = count($_POST['check_photo']);
for ($i = 0; $i < $total; $i++) {
$id_array[] = $_POST['check_photo'][$i];
}
//$eh->flush();
}
if (isset($_GET['search'])) {
$array = array('title' => $_GET['title'], 'pid' => $_GET['photoid'], 'key' => $_GET['photokey'], 'tags' => $_GET['tags'], 'featured' => $_GET['featured'], 'active' => $_GET['active'], 'user' => $_GET['userid'], 'extension' => $_GET['extension'], 'order' => $_GET['order']);
}
$parr = $array;
// Creating Limit
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, RESULTS);
$parr['limit'] = $get_limit;
if (!$parr['order']) {
$parr['order'] = " date_added DESC ";
} else {
$parr['order'] = $parr['order'] . " DESC";
}
$collections = $cbcollection->get_collections(array("type" => "photos"));
$photos = $cbphoto->get_photos($parr);
Assign('photos', $photos);
assign('c', $collections);
$pcount = $parr;
$pcount['count_only'] = true;
$total_rows = $cbphoto->get_photos($pcount);
$total_pages = count_pages($total_rows, RESULTS);
$pages->paginate($total_pages, $page);
subtitle("Photo Manager");
template_files('photo_manager.html');
display_it();
示例7: create_query_limit
}
exit;
break;
case "get_favorite_videos":
case "getFavoriteVideos":
$limit = 20;
$get_limit = create_query_limit($page, $limit);
$uid = $request['userid'];
if (!$uid) {
$uid = userid();
}
$params = array('userid' => $uid, 'limit' => $get_limit);
$videos = $cbvid->action->get_favorites($params);
$params['count_only'] = "yes";
$total_rows = $cbvid->action->get_favorites($params);
$total_pages = count_pages($total_rows, $get_limit);
if ($total_rows > 0) {
$new_videos = array();
foreach ($videos as $video) {
if (!$video['email']) {
$udetails = $userquery->get_user_details($video['userid']);
}
$video = array_merge($video, $udetails);
$video['thumbs'] = array('default' => get_thumb($video));
$video['videos'] = array('mobile' => get_mob_video(array('video' => $video)));
$video['url'] = $video['video_link'] = $video['videoLink'] = videoLink($video);
$video['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($video);
foreach ($blacklist_fields as $field) {
unset($video[$field]);
}
$new_videos[] = $video;
示例8: subtitle
subtitle(sprintf(lang("title_usr_fav_vids"), $udetails['username']));
$total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
//pr($total_pages,true);
break;
case 'playlists':
$get_limit = create_query_limit($page, 10);
$params = array('userid' => $udetails['userid'], 'limit' => $get_limit);
$playlists = get_playlists($params);
/*$items = $cbvid->get_playlist_items( $pid, 'playlist_items.date_added DESC' );
pr($items,true);
assign('items',$items);*/
assign('playlist_mode', 'on');
assign('playlists', $playlists);
$params['count_only'] = true;
$total_rows = get_playlists($params);
$total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
//pr($videos,true);
break;
}
Assign('videos', $videos);
//Pagination
$pages->paginate($total_pages, $page);
} else {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
Template('user_videos.html');
} else {
display_it();
}
示例9: switch
switch ($mode) {
case 'view_topics':
if ($_GET['topic_action'] == "delete") {
if (!empty($_GET['topic_id'])) {
$tid = $_GET['topic_id'];
$cbgroup->delete_topic($tid);
}
}
break;
}
$topics_limit = 10;
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, $topics_limit);
//Getting list of topics
$topics = $cbgroup->get_topics(array('group' => $details['group_id'], 'limit' => $get_limit));
$total_pages = count_pages($details['total_topics'], $topics_limit);
$pages->paginate($total_pages, $page);
//Group feeds
$feeds = $cbgroup->get_group_feeds($details['group_id']);
assign('feeds', $feeds);
//Group links
$group_links = $cbgroup->group_links($details);
assign('group_links', $group_links);
assign('total_topic_pages', $total_pages);
assign('topics', $topics);
assign('mode', $mode);
assign('group', $details);
//$cbgroup->add_group_status($details['group_id'],'Yar ye kamal chiz lag rae a?');
/*$cbgroup->add_group_video_feed(array(
'videoid' => '1238',
'group_id' => $details['group_id'],
示例10: cb_get_user_favorite_collections
function cb_get_user_favorite_collections()
{
global $usercontent, $pages, $cbcollection, $db;
$user = $usercontent->get_current_user();
$page = mysql_clean(get('page'));
$limit = create_query_limit($page, config('collection_user_favorites'));
$favC = array("userid" => $user['userid'], "limit", $limit);
$collections = $cbcollection->action->get_favorites($favC);
$favC['count_only'] = true;
$total_rows = $cbcollection->action->get_favorites($favC);
$total_pages = count_pages($total_rows, config('collection_user_favorites'));
$pages->paginate($total_pages, $page);
$params['file'] = 'user_collections.html';
$params['the_title'] = $params['heading'] = name($user) . " " . lang('favorite') . " " . lang('collections');
$params['collections'] = $collections;
$params['mode'] = 'favorite';
$params['total_collections'] = $total_rows;
return fetch_template_file($params);
}
示例11: create_query_limit
case "uploaded":
default:
$limit = create_query_limit($page, config('photo_user_photos'));
assign("the_title", $user['username'] . " " . lang('photos'));
$photos = get_photos(array("limit" => $limit, "user" => $user['userid']));
$total_rows = get_photos(array("count_only" => true, "user" => $user['userid']));
$total_pages = count_pages($total_rows, config('photo_user_photos'));
break;
case "favorites":
case "fav_photos":
case "favorite":
$limit = create_query_limit($page, config('photo_user_favorites'));
assign("the_title", $user['username'] . " " . lang('Favorite') . " " . lang('photos'));
$favP = array("user" => $user['userid'], "limit", $limit);
$photos = $cbphoto->action->get_favorites($favP);
$favP['count_only'] = true;
$total_rows = $cbphoto->action->get_favorites($favP);
$total_pages = count_pages($total_rows, config('photo_user_favorites'));
break;
}
assign('photos', $photos);
$pages->paginate($total_pages, $page);
} else {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
Template('user_photos.html');
} else {
display_it();
}
示例12: call_view_collection_functions
case "videos":
case "video":
case "v":
$items = $cbvideo->collection->get_collection_items_with_details($c, $order, $get_limit);
$count = $cbvideo->collection->get_collection_items_with_details($c, NULL, NULL, TRUE);
break;
case "photos":
case "photo":
case "p":
$items = $cbphoto->collection->get_collection_items_with_details($c, $order, $get_limit);
$count = $cbphoto->collection->get_collection_items_with_details($c, NULL, NULL, TRUE);
break;
}
// Calling nesscary function for view collection
call_view_collection_functions($cdetails);
$total_pages = count_pages($count, COLLIP);
//Pagination
//$pages->paginate($total_pages,$page);
$link == NULL;
$extra_params = NULL;
$tag = '<li><a #params#>#page#</a><li>';
$pages->paginate($total_pages, $page, $link, $extra_params, $tag);
assign('objects', $items);
assign("c", $cdetails);
assign("type", $type);
assign("cid", $c);
subtitle($cdetails['collection_name']);
} else {
e(lang("collection_not_exists"));
$Cbucket->show_page = false;
}
示例13: elseif
} elseif (!$cbgroup->is_member(userid(), $details['group_id'])) {
e(lang("you_not_allowed_add_grp_vids"));
} else {
$add_group_videos = 24;
$add_group_videos = apply_filters($add_group_videos, 'add_group_videos_limit');
///Getting User Videos
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, $add_group_videos);
$array = array('user' => userid(), 'limit' => $get_limit);
$usr_vids = get_videos($array);
//echo $db->db_query;
assign('usr_vids', $usr_vids);
assign('videos', $usr_vids);
$array['count_only'] = true;
$total_rows = get_videos($array);
$total_pages = count_pages($total_rows, $add_group_videos);
//Pagination
$pages->paginate($total_pages, $page);
//Adding videos to group
if (isset($_POST['add_videos'])) {
$total = count($usr_vids);
for ($i = 0; $i < $total; $i++) {
$videoid = $usr_vids[$i]['videoid'];
if ($_POST['check_video_' . $videoid] == 'yes') {
$cbgroup->add_group_video($videoid, $details['group_id'], false);
} else {
$cbgroup->remove_group_video($videoid, $details['group_id'], false);
}
}
//Update Group Total Videos
$cbgroup->update_group_videos_count($details['group_id']);
示例14: define
****************************************************************
*/
define("THIS_PAGE", "view_group_videos");
define("PARENT_PAGE", "videos");
require 'includes/config.inc.php';
$pages->page_redir();
$url = mysql_clean($_GET['url']);
$details = $cbgroup->group_details_url($url);
//Group links
$group_links = $cbgroup->group_links($details);
assign('group_links', $group_links);
assign('group', $details);
if ($details) {
$group_videos_limit = 18;
$group_videos_limit = apply_filters($group_videos_limit, 'group_videos_limit');
///Getting User Videos
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, $group_videos_limit);
//Getting List of all videos
$videos = $cbgroup->get_group_videos($details['group_id'], "yes", $get_limit);
$total_rows = $details['total_videos'];
$total_pages = count_pages($total_rows, $group_videos_limit);
//Pagination
$pages->paginate($total_pages, $page);
assign('total_pages', $total_pages);
assign("videos", $videos);
assign("mode", "view_videos");
subtitle($details['group_name']);
}
template_files('view_group.html');
display_it();
示例15: Copyright
<?php
/*
***********************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
*************************************************************************
*/
require '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
if ($_GET['kick']) {
if ($sess->kick(mysql_clean($_GET['kick']))) {
e("User has been kicked out", "m");
}
}
$results = 30;
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, $results);
$online_users = $userquery->get_online_users(false, false, $get_limit);
$total_rows = $userquery->get_online_users(false, true);
$total_pages = count_pages($total_rows, $results);
$pages->paginate($total_pages, $page);
assign('total', count($online_users));
assign('online_users', $online_users);
assign('queryString', queryString(NULL, 'kick'));
subtitle("View online users");
template_files('online_users.html');
display_it();