本文整理汇总了PHP中pager::getLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP pager::getLinks方法的具体用法?PHP pager::getLinks怎么用?PHP pager::getLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pager
的用法示例。
在下文中一共展示了pager::getLinks方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($page, $nb_per_page, $enclose_block = '')
{
if ($this->rs->isEmpty()) {
echo '<p><strong>' . __('No page') . '</strong></p>';
} else {
$pager = new pager($page, $this->rs_count, $nb_per_page, 10);
$pager->html_prev = $this->html_prev;
$pager->html_next = $this->html_next;
$pager->var_page = 'page';
$html_block = '<table class="clear"><tr>' . '<th colspan="2">' . __('Title') . '</th>' . '<th>' . __('Date') . '</th>' . '<th>' . __('Author') . '</th>' . '<th>' . __('Comments') . '</th>' . '<th>' . __('Trackbacks') . '</th>' . '<th>' . __('Status') . '</th>' . '</tr>%s</table>';
if ($enclose_block) {
$html_block = sprintf($enclose_block, $html_block);
}
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
$blocks = explode('%s', $html_block);
echo $blocks[0];
while ($this->rs->fetch()) {
echo $this->postLine();
}
echo $blocks[1];
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
}
}
示例2: blogLine
echo '<h2>' . __('List of blogs') . '</h2>';
if (!$core->error->flag()) {
if ($core->auth->isSuperAdmin()) {
echo '<p><strong><a href="blog.php">' . __('Create a new blog') . '</a></strong></p>';
}
if (!$show_filters) {
echo '<p><a id="filter-control" class="form-control" href="#">' . __('Filters') . '</a></p>';
}
echo '<form action="blogs.php" method="get" id="filters-form">' . '<fieldset class="two-cols"><legend>' . __('Filters') . '</legend>' . '<div class="col">' . '<p><label>' . __('Order by:') . ' ' . form::combo('sortby', $sortby_combo, html::escapeHTML($sortby)) . '</label> ' . '<label>' . __('Sort:') . ' ' . form::combo('order', $order_combo, html::escapeHTML($order)) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Search:') . ' ' . form::field('q', 20, 255, html::escapeHTML($q)) . '</label></p>' . '<p><label class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('Blogs per page') . '</label> ' . '<input type="submit" value="' . __('filter') . '" /></p>' . '</div>' . '<br class="clear" />' . '</fieldset>' . '</form>';
# Show blogs
if ($nb_blog == 0) {
echo '<p><strong>' . __('No blog') . '</strong></p>';
} else {
$pager = new pager($page, $nb_blog, $nb_per_page, 10);
$pager->var_page = 'page';
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
echo '<table class="clear"><tr>' . '<th>' . __('Blog name') . '</th>' . '<th class="nowrap">' . __('Last update') . '</th>' . '<th class="nowrap">' . __('Entries') . '</th>' . '<th class="nowrap">' . __('Blog ID') . '</th>' . '<th> </th>' . '<th class="nowrap">' . __('Status') . '</th>' . '</tr>';
while ($rs->fetch()) {
echo blogLine($rs);
}
echo '</table>';
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
}
}
dcPage::close();
function blogLine(&$rs)
{
global $core;
$blog_id = html::escapeHTML($rs->blog_id);
$edit_link = '';
if ($GLOBALS['core']->auth->isSuperAdmin()) {
示例3: display
public function display($page, $nb_per_page, $enclose_block = '')
{
if ($this->rs->isEmpty()) {
echo '<p><strong>' . __('No user') . '</strong></p>';
} else {
$pager = new pager($page, $this->rs_count, $nb_per_page, 10);
$pager->html_prev = $this->html_prev;
$pager->html_next = $this->html_next;
$pager->var_page = 'page';
$html_block = '<table class="clear"><tr>' . '<th colspan="2">' . __('Username') . '</th>' . '<th>' . __('First Name') . '</th>' . '<th>' . __('Last Name') . '</th>' . '<th>' . __('Display name') . '</th>' . '<th class="nowrap">' . __('Entries') . '</th>' . '</tr>%s</table>';
if ($enclose_block) {
$html_block = sprintf($enclose_block, $html_block);
}
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
$blocks = explode('%s', $html_block);
echo $blocks[0];
while ($this->rs->fetch()) {
echo $this->userLine();
}
echo $blocks[1];
echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
}
}
示例4: sprintf
if (!$dir) {
call_user_func($close_f);
exit;
}
if ($post_id) {
echo '<p><strong>' . sprintf(__('Choose a file to attach to entry %s by clicking on %s.'), '<a href="' . $core->getPostAdminURL($post_type, $post_id) . '">' . html::escapeHTML($post_title) . '</a>', '<img src="images/plus.png" alt="' . __('Attach this file to entry') . '" />') . '</strong></p>';
}
if ($popup) {
echo '<p><strong>' . sprintf(__('Choose a file to insert into entry by clicking on %s.'), '<img src="images/plus.png" alt="' . __('Attach this file to entry') . '" />') . '</strong></p>';
}
$items = array_values(array_merge($dir['dirs'], $dir['files']));
if (count($items) == 0) {
echo '<p><strong>' . __('No file.') . '</strong></p>';
} else {
$pager = new pager($page, count($items), $nb_per_page, 10);
echo '<form action="media.php" method="get">' . '<p><label class="classic">' . __('Sort files:') . ' ' . form::combo('file_sort', $sort_combo, $file_sort) . '</label>' . form::hidden(array('popup'), $popup) . form::hidden(array('post_id'), $post_id) . '<input type="submit" value="' . __('ok') . '" /></p>' . '</form>' . '<div class="media-list">' . '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
for ($i = $pager->index_start, $j = 0; $i <= $pager->index_end; $i++, $j++) {
echo mediaItemLine($items[$i], $j);
}
echo '<p class="clear">' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>' . '</div>';
}
if ($core_media_writable) {
echo '<div class="two-cols">';
echo '<div class="col"><h3 id="add-file">' . __('Add files') . '</h3>' . '<form id="media-upload" class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), DC_MAX_UPLOAD_SIZE) . $core->formNonce() . '</div>' . '<fieldset id="add-file-f">' . '<p><label>' . __('Choose a file:') . ' (' . sprintf(__('Maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . '<input type="file" name="upfile" size="20" />' . '</label></p>' . '<p><label>' . __('Title:') . form::field(array('upfiletitle'), 35, 255) . '</label></p>' . '<p><label class="classic">' . form::checkbox(array('upfilepriv'), 1) . ' ' . __('Private') . '</label></p>' . '<p><input type="submit" value="' . __('send') . '" />' . form::hidden(array('d'), $d) . '</p>' . '</fieldset>' . '</form>' . '<p class="form-note">' . __('Please take care to publish media that you own and that are not protected by copyright.') . '</p>' . '</div>';
echo '<div class="col"><h3 id="new-dir">' . __('New directory') . '</h3>' . '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset id="new-dir-f">' . $core->formNonce() . '<p><label>' . __('Directory Name:') . form::field(array('newdir'), 35, 255) . '</label></p>' . '<p><input type="submit" value="' . __('save') . '" />' . form::hidden(array('d'), html::escapeHTML($d)) . '</p>' . '</fieldset>' . '</form></div>';
echo '</div>';
}
# Empty remove form (for javascript actions)
echo '<form id="media-remove-hide" action="' . html::escapeURL($page_url) . '" method="post"><div class="clear">' . form::hidden('rmyes', 1) . form::hidden('d', html::escapeHTML($d)) . form::hidden('remove', '') . $core->formNonce() . '</div></form>';
# Get zip directory
if ($core->auth->check('media_admin', $core->blog->id)) {