本文整理汇总了PHP中do_pages函数的典型用法代码示例。如果您正苦于以下问题:PHP do_pages函数的具体用法?PHP do_pages怎么用?PHP do_pages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_pages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group_read
function group_read($from_where, $order_by)
{
global $db, $main_smarty, $view, $user, $rows, $page_size, $offset;
// figure out what "page" of the results we're on
$offset = (get_current_page() - 1) * $page_size;
// pagesize set in the admin panel
$search->pagesize = $page_size;
if ($order_by == "") {
$order_by = "group_date DESC";
}
include_once mnminclude . 'smartyvariables.php';
global $db, $main_smarty;
$rows = $db->get_var("SELECT count(*) FROM " . table_groups . " WHERE " . $from_where . " ");
$group = $db->get_results("SELECT distinct(group_id) as group_id FROM " . table_groups . " WHERE " . $from_where . " ORDER BY group_status DESC, " . $order_by . " LIMIT {$offset},{$page_size} ");
if ($group) {
foreach ($group as $groupid) {
$group_display .= group_print_summary($groupid->group_id);
}
$main_smarty->assign('group_display', $group_display);
}
if (Auto_scroll == 2 || Auto_scroll == 3) {
$main_smarty->assign("scrollpageSize", $page_size);
} else {
$main_smarty->assign('group_pagination', do_pages($rows, $page_size, "groups", true));
}
return true;
}
示例2: define
if (isset($_GET['order'])) {
$search->ords = $db->escape($_GET['order']);
}
$new_search = $search->new_search();
$linksum_count = $search->countsql;
$linksum_sql = $search->sql;
$main_smarty->assign('sql', $linksum_sql);
// pagename
define('pagename', 'search');
$main_smarty->assign('pagename', pagename);
$fetch_link_summary = true;
include './libs/link_summary.php';
// this is the code that show the links / stories
if ($rows == false) {
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Search_NoResults') . ' ' . stripslashes($search->searchTerm) . stripslashes($search->url));
$main_smarty->assign('pagename', 'noresults');
}
$pages = do_pages($rows, $page_size, "search", true);
if ($_REQUEST['tag']) {
$pages = str_replace('/search/', '/tag/', $pages);
}
if (Auto_scroll == 2 || Auto_scroll == 3) {
$main_smarty->assign("scrollpageSize", $page_size);
} else {
$main_smarty->assign('search_pagination', $pages);
}
$main_smarty->assign('total_row_for_search', $rows);
}
// show the template
$main_smarty->assign('tpl_center', $the_template . '/search_center');
$main_smarty->display($the_template . '/pligg.tpl');
示例3: implode
die;
}
$friends = $db->get_col("select friend_to from friends where friend_type = 'manual' and friend_from = {$current_user->user_id} and friend_value > 0");
if ($friends) {
$friends_list = implode(',', $friends);
$sql = "select distinct vote_link_id as link_id from votes where vote_type = 'links' and vote_user_id in ({$friends_list}) and vote_value > 0 order by vote_link_id desc";
$links = $db->get_results("{$sql} LIMIT {$offset},{$page_size}");
}
do_header(_('votadas por amigos') . ' | ' . _('menéame'));
$globals['tag_status'] = 'published';
do_tabs('main', 'friends');
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_banner_promotions();
do_best_comments();
do_vertical_tags('published');
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap">' . "\n";
if ($links) {
foreach ($links as $dblink) {
$link = Link::from_db($dblink->link_id);
$link->do_inline_friend_votes = true;
$link->print_summary();
}
}
do_pages(-1, $page_size);
echo '</div>' . "\n";
do_footer_menu();
do_footer();
示例4: do_pages
<?php
$this->assign('navbar_where', $this->_confs['PLIGG_Visual_Published_News']);
}
?>
<?php
$this->assign('header_id', "home");
?>
<div id="center">
<div class="ce-l">
<div class="ce-r">
<div class="ce-lt">
<div class="ce-br">
<div class="text">
<!-- list topics start here -->
<?php
global $db, $main_smarty, $page_size, $from_where, $rows, $order_by, $offset, $linksum_sql, $linksum_count, $page_size, $rows;
include './libs/link_summary.php';
// this is the code that show the links / stories
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
do_pages($rows, $page_size, "index");
// show the "page" buttons at the bottom
// this will eventually be a smarty include
示例5: do_shaken
do_shaken();
$main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true));
break;
case 'commented':
do_commented();
$main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true));
break;
case 'voted':
// Voted
do_voted();
$main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true));
break;
case 'saved':
// Saved
do_stories();
$main_smarty->assign('user_pagination', do_pages($rows, $page_size, $the_page, true));
break;
case 'removefriend':
do_removefriend();
break;
case 'addfriend':
do_addfriend();
break;
case 'viewfriends':
do_viewfriends($current_user->user_id);
break;
case 'viewfriends2':
do_viewfriends2();
break;
case 'sendmessage':
do_sendmessage();
示例6: do_pages
<div id="center">
<div class="ce-l">
<div class="ce-r">
<div class="ce-lt">
<div class="ce-br">
<div class="text">
<!-- list topics start here -->
<?php
global $db, $dblang, $globals, $main_smarty, $search, $offset, $from_where, $page_size, $link_id, $linksum_sql, $linksum_count;
include './libs/link_summary.php';
// this is the code that show the links / stories
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
do_pages($rows, $page_size, "upcoming");
// show the "page" buttons at the bottom
示例7: User
}
echo '</tr>';
$user = new User();
$rows = $db->get_var("SELECT SQL_CACHE count(*) as count {$from_where}");
$users = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$page_size}");
if ($users) {
foreach ($users as $dbuser) {
$user->id = $dbuser->user_id;
$user->read();
$user->all_stats();
echo '<tr>';
echo '<td style="font-size:100%"><a href="' . get_user_uri($user->username) . '"><img class="avatar" src="' . get_avatar_url($user->id, $user->avatar, 20) . '" width="20" height="20" alt="avatar" onmouseover="return tooltip.ajax_delayed(event, \'get_user_info.php\', ' . $user->id . ');" onmouseout="tooltip.clear(event); " /> ' . $user->username . '</a></td>';
echo '<td class="short">' . $user->karma . ' ';
$user->print_medals();
echo '</td>';
echo '<td class="short">' . $user->total_links . '</td>';
if ($user->total_links > 0) {
echo '<td class="short">' . $user->published_links . ' (' . intval($user->published_links / $user->total_links * 100) . '%)</td>';
} else {
echo '<td class="short">' . $user->published_links . ' (-)</td>';
}
echo '<td class="short">' . $user->total_comments . '</td>';
echo '<td class="short">' . $user->total_votes . '</td>';
echo '</tr>';
}
}
echo "</table>\n\n";
do_pages($rows, $page_size, false);
echo "</div>\n";
do_footer_menu();
do_footer();
示例8: Link
$stories = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$top_users_size}");
$link = new Link();
//$user = new User;
if ($stories) {
foreach ($stories as $dblink) {
$link->id = $dblink->link_id;
$cached_links[$dblink->link_id] = $dblink;
$link->read();
$live_item['link_date'] = txt_time_diff($link->date);
$live_item['link_title'] = $link->title;
if (Voting_Method == 2) {
$live_item['link_votes'] = $link->rating($link->id) / 2;
} else {
$live_item['link_votes'] = $link->votes;
}
$live_item['link_username'] = $dblink->user_login;
$live_item['link_category'] = GetCatName($link->category);
$live_item['link_category_url'] = getmyurl("queuedcategory", $link->category_safe_name());
# $live_item['link_category_url'] = $link->category_safe_name();
$live_item['link_url'] = $link->get_internal_url();
$live_items[] = $live_item;
}
$main_smarty->assign('live_items', $live_items);
}
// pagination
$main_smarty->assign('live_pagination', do_pages($rows, $top_users_size, "unpublished", true));
// sidebar
$main_smarty = do_sidebar($main_smarty);
// show the template
$main_smarty->assign('tpl_center', $the_template . '/live_unpublished_center');
$main_smarty->display($the_template . '/pligg.tpl');
示例9: print_result
function print_result()
{
global $response, $page_size;
if ($response['ids']) {
$rows = min($response['rows'], 1000);
foreach ($response['ids'] as $id) {
switch ($_REQUEST['w']) {
case 'posts':
$obj = Post::from_db($id);
break;
case 'comments':
$obj = Comment::from_db($id);
break;
case 'links':
default:
$obj = Link::from_db($id);
}
if (!$obj) {
continue;
}
$obj->basic_summary = true;
switch ($_REQUEST['w']) {
case 'posts':
$obj->print_summary(800);
break;
case 'comments':
if ($obj->type == 'admin' && !$current_user->admin) {
continue;
}
$obj->print_summary(false, 800);
break;
case 'links':
default:
$obj->print_summary();
}
}
}
do_pages($rows, $page_size);
}
示例10: do_pages
</div>
<?php
do_pages($rows, $page_size, $the_page);
break;
case 'voted':
do_voted();
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
do_pages($rows, $page_size, $the_page);
break;
case 'profile':
default:
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="pagers">
<div class="pbg">
<div class="list">
</div>
示例11: intval
$main_smarty->assign('user_total_links', $user->total_links);
$main_smarty->assign('user_published_links', $user->published_links);
if ($user->total_links > 0) {
$main_smarty->assign('user_published_links_percent', intval($user->published_links / $user->total_links * 100));
} else {
$main_smarty->assign('user_published_links_percent', '');
}
$main_smarty->assign('user_total_comments', $user->total_comments);
$main_smarty->assign('user_total_votes', $user->total_votes);
$main_smarty->assign('user_published_votes', $user->published_votes);
if ($user->total_votes > 0) {
$main_smarty->assign('user_published_votes_percent', intval($user->published_votes / $user->total_votes * 100));
} else {
$main_smarty->assign('user_published_votes_percent', '');
}
$main_smarty->assign('user_karma', $user->karma);
$main_smarty->assign('user_avatar', get_avatar('large', "", $user->username, $user->email));
$users_table .= $main_smarty->fetch(The_Template . "/topusers_data.tpl");
}
}
$main_smarty->assign('users_table', $users_table);
// pagename
define('pagename', 'topusers');
$main_smarty->assign('pagename', pagename);
// sidebar
$main_smarty = do_sidebar($main_smarty);
$main_smarty->assign('headers', $header_items);
$main_smarty->assign('topusers_pagination', do_pages($rows, $top_users_size, "topusers", true));
// show the template
$main_smarty->assign('tpl_center', $the_template . '/topusers_center');
$main_smarty->display($the_template . '/pligg.tpl');
示例12: admin_bans
//.........这里部分代码省略.........
echo 'orderby=ban_expire">' . _('fecha caducidad') . '</a></th>';
echo '<th>' . _('Editar / Borrar') . '</th></tr>';
switch ($_REQUEST["op"]) {
case 'new':
echo '<tr><td>';
echo '<input type="text" id="ban_text" name="ban_text" size="30" maxlength="' . $ban_text_length . '" value="" />';
echo ' <span id="checkit"><input type="button" id="checkbutton1" value="' . _('verificar') . '" onclick="checkfield(\'ban_' . $ban_type . '\', this.form, this.form.ban_text)"/></span>' . "\n";
echo '<br /><span id="ban_' . $ban_type . 'checkitvalue"></span>' . "\n";
echo '</td><td>';
echo '<input class="form-full" type="text" name="ban_comment" id="ban_comment" />';
echo '</td><td>';
echo '</td><td>';
echo '<select name="ban_expire" id="ban_expire">';
print_expiration_dates();
echo '</select>';
echo '</td><td>';
echo '<input type="hidden" name="new_ban" value="1" />';
echo '<input type="submit" name="submit" value="' . _('Crear ban') . '" />';
echo '</td></tr>';
break;
case 'news':
echo '<tr><td>';
echo '<textarea id="ban_text" name="ban_text" /></textarea>';
echo '</td><td>';
echo '<input class="form-full" type="text" name="ban_comment" id="ban_comment" />';
echo '</td><td>';
echo '</td><td>';
echo '<select name="ban_expire" id="ban_expire">';
print_expiration_dates();
echo '</select>';
echo '</td><td>';
echo '<input type="hidden" name="new_bans" value="1" />';
echo '<input type="submit" name="submit" value="' . _('Crear bans') . '" />';
echo '</td></tr>';
break;
case 'edit':
$ban = new Ban();
$ban->ban_id = (int) $_REQUEST["id"];
$ban->read();
echo '<tr><td>';
echo '<input type="text" name="ban_text" id="ban_text" size="30" maxlength="' . $ban_text_length . '" value="' . $ban->ban_text . '" />';
echo '</td><td>';
echo '<input type="text" class="form-full" name="ban_comment" id="ban_comment" value="' . $ban->ban_comment . '" />';
echo '</td><td>';
echo $ban->ban_date;
echo '</td><td>';
echo '<select name="ban_expire" id="ban_expire">';
echo '<option value="' . $ban->ban_expire . '">' . $ban->ban_expire . '</option>';
print_expiration_dates();
echo '</select>';
echo '</td><td>';
echo '<input type="hidden" name="ban_id" value="' . $ban->ban_id . '" />';
echo '<input type="submit" name="edit_ban" value="' . _('Editar ban') . '" />';
echo '</td></tr>';
break;
}
if (empty($_REQUEST["op"])) {
//listado de bans
if (empty($_REQUEST["orderby"])) {
$_REQUEST["orderby"] = "ban_text";
} else {
$_REQUEST["orderby"] = preg_replace('/[^a-z_]/i', '', $_REQUEST["orderby"]);
if ($_REQUEST["orderby"] == 'ban_date') {
$order = "DESC";
}
}
$where = "WHERE ban_type='" . $ban_type . "'";
if ($_REQUEST["s"]) {
$search_text = $db->escape($_REQUEST["s"]);
$where .= " AND (ban_text LIKE '%{$search_text}%' OR ban_comment LIKE '%{$search_text}%')";
}
$bans = $db->get_col("SELECT ban_id FROM bans " . $where . " ORDER BY " . $_REQUEST["orderby"] . " {$order} LIMIT {$offset},{$page_size}");
$rows = $db->get_var("SELECT count(*) FROM bans " . $where);
if ($bans) {
$ban = new Ban();
foreach ($bans as $ban_id) {
$ban->ban_id = $ban_id;
$ban->read();
echo '<tr>';
echo '<td onmouseover="return tooltip.ajax_delayed(event, \'get_ban_info.php\', ' . $ban->ban_id . ');" onmouseout="tooltip.clear(event);" >' . clean_text($ban->ban_text) . '</td>';
echo '<td style="overflow: hidden;white-space: nowrap;" onmouseover="return tooltip.ajax_delayed(event, \'get_ban_info.php\', ' . $ban->ban_id . ');" onmouseout="tooltip.clear(event);">' . clean_text(txt_shorter($ban->ban_comment, 50)) . '</td>';
echo '<td>' . $ban->ban_date . '</td>';
echo '<td>' . $ban->ban_expire . '</td>';
echo '<td>';
if ($current_user->user_level == "god") {
echo '<a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&op=edit&id=' . $ban->ban_id . '" title="' . _('Editar') . '"><img src="' . $globals['base_static'] . 'img/common/sneak-edit-notice01.png" alt="' . 'Editar' . '" /></a>';
echo ' / ';
echo '<a href="' . $globals['base_url'] . 'admin/bans.php?admin=' . $ban_type . '&del_ban=' . $ban->ban_id . '&key=' . $key . '" title="' . _('Eliminar') . '"><img src="' . $globals['base_static'] . 'img/common/sneak-reject01.png" alt="' . 'Eliminar' . '" /></a>';
}
echo '</td>';
echo '</tr>';
}
}
}
echo '</table>';
if (!empty($_REQUEST["op"])) {
echo "</form>\n";
}
do_pages($rows, $page_size, false);
}
示例13: unset
$this->_vars = $_templatelite_tpl_vars;
unset($_templatelite_tpl_vars);
?>
<?php
if ($this->_vars['pagename'] == "admin_users" || $this->_vars['pagename'] == "admin_comments" || $this->_vars['pagename'] == "admin_links" || $this->_vars['pagename'] == "admin_user_validate") {
?>
<fieldset>
<br />
<?php
global $db, $main_smarty, $rows, $offset, $URLMethod;
$oldURLMethod = $URLMethod;
$URLMethod = 1;
$pagesize = get_misc_data('pagesize');
do_pages($rows, $pagesize ? $pagesize : 30, $the_page);
$URLMethod = $oldURLMethod;
?>
</fieldset>
<?php
}
?>
<?php
echo tpl_function_checkActionsTpl(array('location' => "tpl_pligg_admin_legend_after"), $this);
?>
</div>
<?php
if ($this->_vars['pagename'] != "admin_modules") {
示例14: do_pages
?>
</table>
<br/>
<p align="right"><input type="submit" name="submit" value="Change Status" class="log2" /></p>
<input type="hidden" name="user" value="<?php
echo $this->_vars['user'];
?>
">
</form>
<center><a href="javascript:mark_all_publish()">Mark all for Published</a> <a href="javascript:mark_all_queued()">Mark all for Queued</a> <a href="javascript:mark_all_discard()">Mark all for Discarded</a> <a href="javascript:uncheck_all()">Uncheck All</a></center>
<br/>
<?php
global $db, $main_smarty, $rows, $offset;
do_pages($rows, 25, $the_page);
?>
<br/>
</fieldset>
<?php
echo '
<SCRIPT>
function mark_all_publish() {
for (var i=0; i< document.bulk_moderate.length; i++) {
if (document.bulk_moderate[i].value == "publish") {
document.bulk_moderate[i].checked = true;
}
}
示例15: count
// get the data to be displayed
$rows = $db->get_var("SELECT count(*) as count {$from_where} {$order_by}");
$comments = $db->get_results("{$select} {$from_where} {$order_by} LIMIT {$offset},{$top_users_size}");
//$comment = new Comment;
//$user = new User;
$link = new Link();
if ($comments) {
foreach ($comments as $dbcomment) {
// $comment->id = $dbcomment->comment_id;
// $comment->read();
$live_item['comment_content'] = $dbcomment->comment_content;
// $user->id = $comment->author;
// $user->read();
$live_item['comment_author'] = $dbcomment->user_login;
$live_item['comment_date'] = txt_time_diff(strtotime($dbcomment->comment_date));
$link->id = $dbcomment->link_id;
$cached_links[$dbcomment->link_id] = $dbcomment;
$link->read();
$live_item['comment_link_title'] = $link->title;
$live_item['comment_link_url'] = $link->get_internal_url();
$live_items[] = $live_item;
}
$main_smarty->assign('live_items', $live_items);
}
// pagination
$main_smarty->assign('live_pagination', do_pages($rows, $top_users_size, "comments", true));
// sidebar
$main_smarty = do_sidebar($main_smarty);
// show the template
$main_smarty->assign('tpl_center', $the_template . '/live_comments_center');
$main_smarty->display($the_template . '/pligg.tpl');