本文整理汇总了PHP中create_query_limit函数的典型用法代码示例。如果您正苦于以下问题:PHP create_query_limit函数的具体用法?PHP create_query_limit怎么用?PHP create_query_limit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_query_limit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$subchilds = $childs = $cbvid->get_sub_categories($child['category_id']);
if ($subchilds) {
foreach ($subchilds as $subchild) {
$child_ids[] = $subchild['category_id'];
}
}
}
}
$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']));
}
示例2: 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();
示例3: getFeeds
private function getFeeds()
{
$request = $_REQUEST;
$page = $request['page'];
if (!$page || !is_numeric($page) || $page < 1) {
$page = 1;
}
$id = mysql_clean($request['id']);
$page = mysql_clean($page);
$type = mysql_clean($request['type']);
$limit = 20;
$get_limit = create_query_limit($page, $limit);
$params = array('id' => $id, 'limit' => $get_limit, 'type' => $type);
global $cbfeeds;
$feeds = array();
$feeds = $cbfeeds->get_feeds($params);
$the_feeds = array();
if (!empty($feeds)) {
foreach ($feeds as $feed) {
$feed['comments'] = json_encode($feed['comments']);
$the_feeds[] = $feed;
}
//echo json_encode($the_feeds);
$data = array('code' => "200", 'status' => "success", "msg" => "Success", "data" => $the_feeds);
$this->response($this->json($data));
} else {
//echo json_encode(array('err' => error()));
$data = array('code' => "204", 'status' => "success", "msg" => "No Record Found", "data" => "");
$this->response($this->json($data));
}
}
示例4: json_encode
echo json_encode($cond);
break;
/**
* Getting comments along with template
*/
/**
* Getting comments along with template
*/
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']);
示例5: e
e($total . " photos has been deleted successfully", "m");
}
if (isset($_POST['move_to_selected'])) {
$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);
示例6: create_query_limit
}
break;
case "getMessages":
case "get_messages":
$get_limit = create_query_limit($page, $content_limit);
$request['limit'] = $get_limit;
$messages = $cbpm->get_messages($request);
if ($messages) {
echo json_encode($messages);
} else {
echo json_encode(array('err' => 'No Messages were Found'));
}
break;
case "getNewMessages":
case "get_new_messages":
$get_limit = create_query_limit($page, $content_limit);
$request['limit'] = $get_limit;
$messages = $cbpm->get_new_messages($request);
if ($messages) {
echo json_encode($messages);
} else {
echo json_encode(array('err' => 'No New Messages were Found'));
}
break;
case "sendMessage":
case "send_message":
case "send_msg":
case "sndMsg":
//recipients[]=11
//message=tessttttinggggg
//thread_id=xyz
示例7: create_query_limit
$topics_limit = 20;
$get_limit = create_query_limit($page, $topics_limit);
$params = array('group' => $gid, 'limit' => $get_limit);
$topics = $cbgroup->get_group_topics($params);
if ($topics) {
echo json_encode($topics);
} else {
echo json_encode(array('err' => error()));
}
break;
case "get_feeds":
case "getFeeds":
$id = mysql_clean($request['id']);
$page = mysql_clean($request['page']);
$type = mysql_clean($request['type']);
$limit = 20;
$get_limit = create_query_limit($page, $limit);
$params = array('id' => $id, 'limit' => $get_limit, 'type' => $type);
$feeds = $cbfeeds->get_feeds($params);
$the_feeds = array();
if ($feeds) {
foreach ($feeds as $feed) {
$feed['comments'] = json_encode($feed['comments']);
$the_feeds[] = $feed;
}
echo json_encode($the_feeds);
} else {
echo json_encode(array('err' => error()));
}
break;
}
示例8: switch
$cbphoto->action->delete_flags($photo);
}
//Deleting Multiple Videos
if (isset($_POST['delete_flags'])) {
for ($id = 0; $id <= count($_POST['check_photo']); $id++) {
$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);
示例9: call_view_group_functions
}
//Calling all functions when a topic is called
call_view_group_functions($details);
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?');
示例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: assign
assign('p', $userquery->get_user_profile($udetails['userid']));
$mode = $_GET['mode'];
switch ($mode) {
case "photos":
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) {
示例12: assign
assign("u", $udetails);
assign('p', $userquery->get_user_profile($udetails['userid']));
switch ($mode) {
case 'uploads':
case 'videos':
default:
$get_limit = create_query_limit($page, config('videos_items_uvid_page'));
assign("the_title", $udetails['username'] . " videos");
$videos = get_videos(array('user' => $udetails['userid'], 'limit' => $get_limit));
$total_rows = get_videos(array('user' => $udetails['userid'], 'count_only' => true));
subtitle(sprintf(lang("users_videos"), name($udetails)));
$total_pages = count_pages($total_rows, config('videos_items_uvid_page'));
assign('mode', 'uploaded');
break;
case 'favorites':
$get_limit = create_query_limit($page, config('videos_items_ufav_page'));
assign("the_title", $udetails['username'] . " favorites");
$params = array('userid' => $udetails['userid'], 'limit' => $get_limit);
$videos = $cbvid->action->get_favorites($params);
$params['count_only'] = "yes";
$total_rows = $cbvid->action->get_favorites($params);
subtitle(sprintf(lang("title_usr_fav_vids"), name($udetails)));
$total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
assign('mode', 'favorite');
}
Assign('videos', $videos);
//Pagination
$pages->paginate($total_pages, $page);
} else {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
示例13: assign
//Group links
$group_links = $cbgroup->group_links($details);
assign('group_links', $group_links);
assign('group', $details);
if (!$details) {
e(lang("grp_exist_error"));
} elseif (!$cbgroup->is_viewable($details)) {
$Cbucket->show_page = false;
} 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'];
示例14: assign
assign('p', $userquery->get_user_profile($udetails['userid']));
$mode = $_GET['mode'];
switch ($mode) {
case "collections":
case "uploaded":
default:
$limit = create_query_limit($page, config('collection_user_collections'));
assign("the_title", $user['username'] . " " . lang('collections'));
$collections = get_collections(array("limit" => $limit, "user" => $user['userid']));
$total_rows = get_collections(array("count_only" => true, "user" => $user['userid']));
$total_pages = count_pages($total_rows, config('collection_user_collections'));
break;
case "favorites":
case "fav_collections":
case "favorite":
$limit = create_query_limit($page, config('collection_user_favorites'));
assign("the_title", $user['username'] . " " . lang('favorite') . " " . lang('collections'));
$favC = array("user" => $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'));
break;
}
assign('collections', $collections);
$pages->paginate($total_pages, $page);
} else {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
示例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();