当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::get_limit方法代码示例

本文整理汇总了PHP中Paginator::get_limit方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::get_limit方法的具体用法?PHP Paginator::get_limit怎么用?PHP Paginator::get_limit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::get_limit方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $this->view->js_link[] = $this->make_link('js', SITE_ASSETS, 'pages/sidebar_search.js');
     $this->view->js_link[] = $this->make_link('js', SITE_ASSETS, 'pages/common.js');
     // alapbeállítások lekérdezése
     $this->view->settings = $this->munkak_model->get_settings();
     // 3 legfrissebb munka
     $this->view->latest_jobs = $this->munkak_model->jobs_query(3);
     $this->view->title = 'Munka diákoknak | Multijob Iskolaszövetkezet.';
     $this->view->description = 'Munka diákoknak a Multijob Iskolaszövetkezetnél. Diákmunka az ország több területén.';
     $this->view->keywords = 'diákmunka, alkalmi munka, multijob';
     // paginator
     include LIBS . '/pagine_class.php';
     // paginátor objektum létrehozása (paraméter neve, limit)
     $pagine = new Paginator('oldal', 9);
     // adatok lekérdezése limittel
     $this->view->jobs_data = $this->munkak_model->jobs_filter_query($pagine->get_limit(), $pagine->get_offset());
     // szűrési feltételeknek megfelelő összes rekord száma
     $filter_count = $this->munkak_model->jobs_filter_count_query();
     $pagine->set_total($filter_count);
     // lapozó linkek
     $this->view->pagine_links = $pagine->page_links($this->registry->uri_path);
     //$this->view->debug(true);
     $this->view->render('munkak/tpl_munkak');
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:25,代码来源:munkak.php

示例2: cat

 public function cat($slug)
 {
     $pages = new Paginator('10', 'page');
     $pages->set_total(count($this->_model->getcatposttotal($slug)));
     $data['posts'] = $this->_model->getcatposts($slug, $pages->get_limit());
     $data['page_links'] = $pages->page_links();
     $data['cats'] = $this->_model->getcats();
     $data['title'] = $data['posts'][0]->catTitle;
     View::rendertemplate('header', $data);
     View::render('blog/cats', $data);
     View::rendertemplate('footer', $data);
 }
开发者ID:fabioassuncao,项目名称:build-a-blog,代码行数:12,代码来源:blog.php

示例3: Paginator

        <table>
        <tr>
		<th>ID</th>
                <th>Pseudo</th>
		<th>PID</th>
                <th>Email</th>
		<th style="text-align: center;">Inscription</th>
                <th style="text-align: center;">Action</th>
        </tr>
        <?php 
try {
    $pages = new Paginator('10', 'p');
    $stmt = $db->query('SELECT memberID FROM blog_members');
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->query('SELECT memberID,username,pid,email,memberDate FROM blog_members ORDER BY memberID DESC ' . $pages->get_limit());
    while ($row = $stmt->fetch()) {
        echo '<tr>';
        echo '<td>' . $row['memberID'] . '</td>';
        echo '<td style="width: 20%;">' . $row['username'] . '</td>';
        echo '<td style="font-size: 10px;">' . $row['pid'] . '</td>';
        echo '<td style="font-size: 11px;">' . $row['email'] . '</td>';
        sscanf($row['memberDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
        echo '<td style="font-size: 10px; text-align: center;">' . $jour . '-' . $mois . '-' . $annee . '</td>';
        ?>

                                <td style="text-align: center;">
                                        <a style="text-decoration: none;" href="edit-user.php?id=<?php 
        echo $row['memberID'];
        ?>
"><input type="button" class="button" value="Edit." /></a>
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:users.php

示例4: Paginator

		</div>
<h1 id="blogheader">The Jungle Times Blog <small>Posts in "<?php 
echo $row['catTitle'];
?>
"</small></h1>
		<div id="main" class="row">
			<div id="posts" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="row">
            <?php 
try {
    $pages = new Paginator('12', 'p');
    $stmt = $db->prepare('SELECT blog_posts.postID FROM blog_posts, blog_cat_cats WHERE blog_posts.postID = blog_cat_cats.postID AND blog_cat_cats.catID = :catID');
    $stmt->execute(array(':catID' => $row['catID']));
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->prepare('SELECT blog_posts.postID, blog_posts.postTitle, blog_posts.postAuthor, blog_posts.postSlug, blog_posts.postImage, blog_posts.postDescription, blog_posts.postDate FROM blog_posts, blog_cat_cats WHERE blog_posts.postID = blog_cat_cats.postID AND blog_cat_cats.catID = :catID ORDER BY postID DESC ' . $pages->get_limit());
    $stmt->execute(array(':catID' => $row['catID']));
    $adCount = 3;
    while ($row = $stmt->fetch()) {
        echo '<div class="postsOuter col-lg-3 col-md-6 col-sm-6 col-xs-12">';
        echo '<div class="posts">';
        echo '<h2><a href="' . $row['postSlug'] . '">' . $row['postTitle'] . '</a></h2>';
        echo '<h4>By <strong>' . $row['postAuthor'] . '</strong> | ' . date('F d, Y', strtotime($row['postDate'])) . ' <br/>';
        $stmt2 = $db->prepare('SELECT catTitle, catSlug	FROM blog_cats, blog_cat_cats WHERE blog_cats.catID = blog_cat_cats.catID AND blog_cat_cats.postID = :postID');
        $stmt2->execute(array(':postID' => $row['postID']));
        $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
        $links = array();
        if (!empty($catRow)) {
            echo 'Tags: ';
        } else {
            echo '&nbsp;';
开发者ID:jacobvarner,项目名称:aujungletimes-php,代码行数:31,代码来源:catpost.php

示例5: htmlentities

<br /><br />

		                        <?php 
try {
    //collect month and year data
    $month = htmlentities($_GET['month']);
    $year = htmlentities($_GET['year']);
    //set from and to dates
    $from = date('Y-m-01 00:00:00', strtotime("{$year}-{$month}"));
    $to = date('Y-m-31 23:59:59', strtotime("{$year}-{$month}"));
    $pages = new Paginator('10', 'p');
    $stmt = $db->prepare('SELECT postID FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to');
    $stmt->execute(array(':from' => $from, ':to' => $to));
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->prepare('SELECT postID, postTitle, postSlug, postDesc, postDate FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to ORDER BY postID DESC ' . $pages->get_limit());
    $stmt->execute(array(':from' => $from, ':to' => $to));
    while ($row = $stmt->fetch()) {
        echo '<br /><div><fieldset>';
        echo '<span style="font-weight: bold; font-size: 12pt;"><a style="text-decoration: none;" href="' . $row['postSlug'] . '">' . $row['postTitle'] . '</a></span>';
        echo '<br />Posté le ' . date('j M Y', strtotime($row['postDate'])) . ', dans ';
        $stmt2 = $db->prepare('SELECT catTitle, catSlug FROM blog_cats, blog_post_cats WHERE blog_cats.catID = blog_post_cats.catID AND blog_post_cats.postID = :postID');
        $stmt2->execute(array(':postID' => $row['postID']));
        $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
        $links = array();
        foreach ($catRow as $cat) {
            $links[] = "<a href='c-" . $cat['catSlug'] . "'>" . $cat['catTitle'] . "</a>";
        }
        echo implode(", ", $links);
        echo '</div></fieldset>';
    }
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:archives.php

示例6: while

    $stmt = $db->prepare('SELECT blog_posts_seo.postID FROM blog_posts_seo, blog_post_cats WHERE blog_posts_seo.postID = blog_post_cats.postID AND blog_post_cats.catID = :catID');
    $stmt->execute(array(':catID' => $row['catID']));
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->prepare('
					SELECT 
						blog_posts_seo.postID, blog_posts_seo.postTitle, blog_posts_seo.postSlug, blog_posts_seo.postDesc, blog_posts_seo.postDate 
					FROM 
						blog_posts_seo,
						blog_post_cats
					WHERE
						 blog_posts_seo.postID = blog_post_cats.postID
						 AND blog_post_cats.catID = :catID
					ORDER BY 
						postID DESC
					' . $pages->get_limit());
    $stmt->execute(array(':catID' => $row['catID']));
    while ($row = $stmt->fetch()) {
        echo '<div>';
        echo '<h1><a href="' . $row['postSlug'] . '">' . $row['postTitle'] . '</a></h1>';
        echo '<p>Posted on ' . date('jS M Y H:i:s', strtotime($row['postDate'])) . ' in ';
        $stmt2 = $db->prepare('SELECT catTitle, catSlug	FROM blog_cats, blog_post_cats WHERE blog_cats.catID = blog_post_cats.catID AND blog_post_cats.postID = :postID');
        $stmt2->execute(array(':postID' => $row['postID']));
        $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
        $links = array();
        foreach ($catRow as $cat) {
            $links[] = "<a href='c-" . $cat['catSlug'] . "'>" . $cat['catTitle'] . "</a>";
        }
        echo implode(", ", $links);
        echo '</p>';
        echo '<p>' . $row['postDesc'] . '</p>';
开发者ID:planethax,项目名称:simple-blog-part-6-pagination,代码行数:31,代码来源:catpost.php

示例7: Paginator

try {
    // On affiche 15 membres par page
    $pages = new Paginator('10', 'p');
    $stmt = $db->query('SELECT memberID FROM blog_members');
    $pages->set_total($stmt->rowCount());
    if (isset($_GET['tri'])) {
        $tri = htmlentities($_GET['tri']);
    } else {
        $tri = 'memberID';
    }
    if (isset($_GET['ordre'])) {
        $ordre = htmlentities($_GET['ordre']);
    } else {
        $ordre = 'DESC';
    }
    $stmt = $db->query('SELECT * FROM blog_members,xbt_users WHERE blog_members.memberID=xbt_users.uid AND blog_members.username != "visiteur" ORDER BY ' . $tri . ' ' . $ordre . ' ' . $pages->get_limit());
    while ($row = $stmt->fetch()) {
        // On affiche des couleurs de row alternées
        //$tablerow = ++$i % 2 ? 'tableRow1':'tableRow2';
        //$x++;
        //$tablerow = ($x%2 == 0)? 'tableRow1': 'tableRow2';
        //echo '<tr class="'.$tablerow.'">';
        echo '<tr>';
        if (!empty($row['avatar'])) {
            echo '<td style="font-weight: bold; font-size: 14px;"><img src="' . SITEURL . '/images/avatars/' . $row['avatar'] . '" alt="' . $row['username'] . '" style="float: left; margin-right: 5px; width: 30px; height: 30px;" /><a href="admin/profil.php?membre=' . $row['username'] . '">' . $row['username'] . '</a></td>';
        } else {
            echo '<td style="font-weight: bold; font-size: 14px;"><img src="' . SITEURL . '/images/avatars/avatar.png" alt="' . $row['username'] . '" style="float: left; margin-right: 5px; width: 30px; height: 30px;" /><a href="admin/profil.php?membre=' . $row['username'] . '">' . $row['username'] . '</a></td>';
        }
        sscanf($row['memberDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
        echo '<td style="font-size: 12px;">' . $jour . '-' . $mois . '-' . $annee . ' à ' . $heure . ':' . $minute . ':' . $seconde . '</td>';
        echo '<td style="text-align: center;">' . makesize($row['uploaded']) . '</td>';
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:membres.php

示例8: Paginator

    echo '<h3>Catégorie ' . $_GET['action'] . '.</h3>';
}
?>

        <table>
        <tr>
                <th>Titre</th>
                <th>Action</th>
        </tr>
        <?php 
try {
    $pages = new Paginator('10', 'p');
    $stmt = $db->query('SELECT catID FROM blog_cats');
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->query('SELECT catID, catTitle, catSlug FROM blog_cats ORDER BY catTitle ASC ' . $pages->get_limit());
    while ($row = $stmt->fetch()) {
        echo '<tr>';
        echo '<td style="width: 80%;">' . $row['catTitle'] . '</td>';
        ?>

                                <td>
                                        <a style="text-decoration: none;" href="edit-category.php?id=<?php 
        echo $row['catID'];
        ?>
"><input type="button" class="button" value="Edit."></a> |
                                        <a style="text-decoration: none;" href="javascript:delcat('<?php 
        echo $row['catID'];
        ?>
','<?php 
        echo $row['catSlug'];
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:categories.php

示例9: displayView

 function displayView($view, $id = 0)
 {
     $tpl_vars = array();
     switch ($view) {
         case 'about':
             break;
         case 'config':
             $dev_infos = $this->_getPocheVersion('dev');
             $dev = trim($dev_infos[0]);
             $check_time_dev = date('d-M-Y H:i', $dev_infos[1]);
             $prod_infos = $this->_getPocheVersion('prod');
             $prod = trim($prod_infos[0]);
             $check_time_prod = date('d-M-Y H:i', $prod_infos[1]);
             $compare_dev = version_compare(POCHE, $dev);
             $compare_prod = version_compare(POCHE, $prod);
             $themes = $this->tpl->getInstalledThemes();
             $languages = $this->language->getInstalledLanguages();
             $token = $this->user->getConfigValue('token');
             $http_auth = isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['REMOTE_USER']) ? true : false;
             $only_user = $this->store->listUsers() > 1 ? false : true;
             $tpl_vars = array('themes' => $themes, 'languages' => $languages, 'dev' => $dev, 'prod' => $prod, 'check_time_dev' => $check_time_dev, 'check_time_prod' => $check_time_prod, 'compare_dev' => $compare_dev, 'compare_prod' => $compare_prod, 'token' => $token, 'user_id' => $this->user->getId(), 'http_auth' => $http_auth, 'only_user' => $only_user);
             Tools::logm('config view');
             break;
         case 'edit-tags':
             # tags
             $entry = $this->store->retrieveOneById($id, $this->user->getId());
             if (!$entry) {
                 $this->messages->add('e', _('Article not found!'));
                 Tools::logm('error : article not found');
                 Tools::redirect();
             }
             $tags = $this->store->retrieveTagsByEntry($id);
             $tpl_vars = array('entry_id' => $id, 'tags' => $tags, 'entry' => $entry);
             break;
         case 'tags':
             $token = $this->user->getConfigValue('token');
             //if term is set - search tags for this term
             $term = Tools::checkVar('term');
             $tags = $this->store->retrieveAllTags($this->user->getId(), $term);
             if (Tools::isAjaxRequest()) {
                 $result = array();
                 foreach ($tags as $tag) {
                     $result[] = $tag['value'];
                 }
                 echo json_encode($result);
                 exit;
             }
             $tpl_vars = array('token' => $token, 'user_id' => $this->user->getId(), 'tags' => $tags);
             break;
         case 'search':
             if (isset($_GET['search'])) {
                 $search = filter_var($_GET['search'], FILTER_SANITIZE_STRING);
                 $tpl_vars['entries'] = $this->store->search($search, $this->user->getId());
                 $count = count($tpl_vars['entries']);
                 $this->pagination->set_total($count);
                 $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), $this->pagination->page_links('?view=' . $view . '?search=' . $search . '&sort=' . $_SESSION['sort'] . '&'));
                 $tpl_vars['page_links'] = $page_links;
                 $tpl_vars['nb_results'] = $count;
                 $tpl_vars['searchterm'] = $search;
             }
             break;
         case 'view':
             $entry = $this->store->retrieveOneById($id, $this->user->getId());
             if ($entry != NULL) {
                 Tools::logm('view link #' . $id);
                 $content = $entry['content'];
                 if (function_exists('tidy_parse_string')) {
                     $tidy = tidy_parse_string($content, array('indent' => true, 'show-body-only' => true), 'UTF8');
                     $tidy->cleanRepair();
                     $content = $tidy->value;
                 }
                 # flattr checking
                 $flattr = NULL;
                 if (FLATTR) {
                     $flattr = new FlattrItem();
                     $flattr->checkItem($entry['url'], $entry['id']);
                 }
                 # tags
                 $tags = $this->store->retrieveTagsByEntry($entry['id']);
                 $tpl_vars = array('entry' => $entry, 'content' => $content, 'flattr' => $flattr, 'tags' => $tags);
             } else {
                 Tools::logm('error in view call : entry is null');
             }
             break;
         default:
             # home, favorites, archive and tag views
             $tpl_vars = array('entries' => '', 'page_links' => '', 'nb_results' => '', 'listmode' => isset($_COOKIE['listmode']) ? true : false);
             //if id is given - we retrieve entries by tag: id is tag id
             if ($id) {
                 $tpl_vars['tag'] = $this->store->retrieveTag($id, $this->user->getId());
                 $tpl_vars['id'] = intval($id);
             }
             $count = $this->store->getEntriesByViewCount($view, $this->user->getId(), $id);
             if ($count > 0) {
                 $this->pagination->set_total($count);
                 $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . ($id ? '&id=' . $id : '') . '&'));
                 $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id);
                 $tpl_vars['page_links'] = $page_links;
                 $tpl_vars['nb_results'] = $count;
             }
//.........这里部分代码省略.........
开发者ID:nsbasicus,项目名称:wallabag,代码行数:101,代码来源:Poche.class.php

示例10: Paginator

        //echo $pages->page_links('?membre='.$row['username'].'&');
        echo $pages->page_links('?membre=' . $row['username'] . '&tri=' . $tri . '&ordre=' . $ordre . '&');
        echo '</div>';
        ?>

<br />


<!-- Messages internes -->
<?php 
        $pages = new Paginator('5', 'm');
        $stmt = $db->prepare('SELECT messages_id FROM blog_messages WHERE messages_id_destinataire = :destinataire');
        $stmt->execute(array(':destinataire' => $row['memberID']));
        $pages->set_total($stmt->rowCount());
        // on prépare une requete SQL cherchant le titre, la date, l'expéditeur des messages pour le membre connecté
        $stmt = $db->prepare('SELECT blog_messages.messages_titre, blog_messages.messages_date, blog_members.username as expediteur, blog_messages.messages_id as id_message FROM blog_messages, blog_members WHERE blog_messages.messages_id_destinataire = :id_destinataire AND blog_messages.messages_id_expediteur = blog_members.memberID ORDER BY blog_messages.messages_date DESC ' . $pages->get_limit());
        $stmt->execute(array(':id_destinataire' => $row['memberID']));
        ?>

<table>
	<tr>
		<td colspan="5">
			<h3 id="messages">Vos messages : 
				<a style="text-decoration: none;" href="<?php 
        echo SITEURL;
        ?>
/messages_envoyer.php"><input type="button" class="button" value="Envoyer un message à un membre" /></a>
			</h3>
		</td>
	</tr>
	<tr>
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:profil.php

示例11: Paginator

		</div>
<?php
}
*/
?>
		
		<br />
		<div><h2>Les derniers torrents</h2></div>

	<?php 
try {
    $pages = new Paginator('7', 'p');
    $stmt = $db->query('SELECT postID FROM blog_posts_seo');
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->query('SELECT postID,postTitle,postAuthor,postSlug,postDesc,postDate,postImage,postViews FROM blog_posts_seo ORDER BY postID DESC ' . $pages->get_limit());
    while ($row = $stmt->fetch()) {
        echo '<fieldset>';
        echo '<div style="margin-top: 10px;">';
        echo '<span style="font-size: 17px; font-weight: bold; padding: 5px 0 0 10px;"><a style="text-decoration: none; color: black;" href="' . stripslashes(htmlspecialchars($row['postSlug'])) . '">' . stripslashes(htmlspecialchars($row['postTitle'])) . '</a></span><br />';
        sscanf($row['postDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde);
        echo '<span style="font-size: 7pt; padding: 5px 0 0 10px;">';
        echo '<img src="images/date.png" style="vertical-align: bottom; margin-top: 5px;" alt="Date" /> ' . $jour . '-' . $mois . '-' . $annee . ' <img src="images/meta-separator.png" style="margin-left: 4px; margin-right: 4px;" alt="" /> <img src="images/author.png" style="vertical-align: bottom;" alt="Auteur" />';
        echo '<a style="text-decoration: none;" href="' . SITEURL . '/admin/profil.php?membre=' . stripslashes(htmlspecialchars($row['postAuthor'])) . '">' . stripslashes(htmlspecialchars($row['postAuthor'])) . '</a>';
        $stmt2 = $db->prepare('SELECT catTitle, catSlug FROM blog_cats, blog_post_cats WHERE blog_cats.catID = blog_post_cats.catID AND blog_post_cats.postID = :postID');
        $stmt2->execute(array(':postID' => $row['postID']));
        $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
        $links = array();
        foreach ($catRow as $cat) {
            $links[] = "<a style=\"text-decoration: none;\" href='c-" . htmlspecialchars($cat['catSlug']) . "'>" . htmlspecialchars($cat['catTitle']) . "</a>";
        }
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:index.php

示例12: displayView


//.........这里部分代码省略.........
                 $percent = floor($eachtag["entriescount"] / $maximus * 100);
                 if ($percent < 20) {
                     // assign a css class, depending on the number of entries count
                     $cssclass = 'smallesttag';
                 } elseif ($percent >= 20 and $percent < 40) {
                     $cssclass = 'smalltag';
                 } elseif ($percent >= 40 and $percent < 60) {
                     $cssclass = 'mediumtag';
                 } elseif ($percent >= 60 and $percent < 80) {
                     $cssclass = 'largetag';
                 } else {
                     $cssclass = 'largesttag';
                 }
                 $all_tags[$key]['cssclass'] = $cssclass;
             }
             $tpl_vars = array('entry_id' => $id, 'tags' => $tags, 'alltags' => $all_tags, 'entry' => $entry);
             break;
         case 'tags':
             $token = $this->user->getConfigValue('token');
             //if term is set - search tags for this term
             $term = Tools::checkVar('term');
             $tags = $this->store->retrieveAllTags($this->user->getId(), $term);
             if (Tools::isAjaxRequest()) {
                 $result = array();
                 foreach ($tags as $tag) {
                     $result[] = $tag['value'];
                 }
                 echo json_encode($result);
                 exit;
             }
             $tpl_vars = array('token' => $token, 'user_id' => $this->user->getId(), 'tags' => $tags);
             break;
         case 'search':
             if (isset($_GET['search'])) {
                 $search = filter_var($_GET['search'], FILTER_SANITIZE_STRING);
                 $tpl_vars['entries'] = $this->store->search($search, $this->user->getId());
                 $count = count($tpl_vars['entries']);
                 $this->pagination->set_total($count);
                 $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), $this->pagination->page_links('?view=' . $view . '?search=' . $search . '&sort=' . $_SESSION['sort'] . '&'));
                 $tpl_vars['page_links'] = $page_links;
                 $tpl_vars['nb_results'] = $count;
                 $tpl_vars['searchterm'] = $search;
             }
             break;
         case 'view':
             $entry = $this->store->retrieveOneById($id, $this->user->getId());
             if ($entry != NULL) {
                 Tools::logm('view link #' . $id);
                 $content = $entry['content'];
                 if (function_exists('tidy_parse_string')) {
                     $tidy = tidy_parse_string($content, array('indent' => true, 'show-body-only' => true), 'UTF8');
                     $tidy->cleanRepair();
                     $content = $tidy->value;
                 }
                 # flattr checking
                 $flattr = NULL;
                 if (FLATTR) {
                     $flattr = new FlattrItem();
                     $flattr->checkItem($entry['url'], $entry['id']);
                 }
                 # previous and next
                 $previous = FALSE;
                 $previous_id = $this->store->getPreviousArticle($id, $this->user->getId());
                 $next = FALSE;
                 $next_id = $this->store->getNextArticle($id, $this->user->getId());
                 if ($this->store->retrieveOneById($previous_id, $this->user->getId())) {
                     $previous = TRUE;
                 }
                 if ($this->store->retrieveOneById($next_id, $this->user->getId())) {
                     $next = TRUE;
                 }
                 $navigate = array('previous' => $previous, 'previousid' => $previous_id, 'next' => $next, 'nextid' => $next_id);
                 # tags
                 $tags = $this->store->retrieveTagsByEntry($entry['id']);
                 $tpl_vars = array('entry' => $entry, 'content' => $content, 'flattr' => $flattr, 'tags' => $tags, 'navigate' => $navigate);
             } else {
                 Tools::logm('error in view call : entry is null');
             }
             break;
         default:
             # home, favorites, archive and tag views
             $tpl_vars = array('entries' => '', 'page_links' => '', 'nb_results' => '', 'listmode' => isset($_COOKIE['listmode']) ? true : false, 'view' => $view);
             //if id is given - we retrieve entries by tag: id is tag id
             if ($id) {
                 $tpl_vars['tag'] = $this->store->retrieveTag($id, $this->user->getId());
                 $tpl_vars['id'] = intval($id);
             }
             $count = $this->store->getEntriesByViewCount($view, $this->user->getId(), $id);
             if ($count && $count > 0) {
                 $this->pagination->set_total($count);
                 $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . ($id ? '&id=' . $id : '') . '&'));
                 $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id);
                 $tpl_vars['page_links'] = $page_links;
                 $tpl_vars['nb_results'] = $count;
             }
             Tools::logm('display ' . $view . ' view');
             break;
     }
     return $tpl_vars;
 }
开发者ID:Kwadz,项目名称:wallabag,代码行数:101,代码来源:Poche.class.php

示例13: Paginator

				</h1>
				<h2>days until Auburn Basketball<br/><em>November 13, 2015 vs UAB</em></h2>
			</div>
		</div>
	</div>
	<div id="wrapper" class="container-fluid">
		<div id="main" class="row">
			<div id="posts-outer" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="row">
			<?php 
try {
    $pages = new Paginator('12', 'p');
    $stmt = $db->query('SELECT postID FROM blog_posts');
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->query('SELECT postID, postAuthor, postTitle, postImage, postSlug, postDescription, postDate FROM blog_posts ORDER BY postID DESC ' . $pages->get_limit());
    $adCount = 3;
    while ($row = $stmt->fetch()) {
        echo '<div class="postsOuter col-lg-3 col-md-6 col-sm-6 col-xs-12">';
        echo '<div class="posts">';
        echo '<h2><a href="' . $row['postSlug'] . '">' . $row['postTitle'] . '</a></h2>';
        echo '<h4>By <strong>' . $row['postAuthor'] . '</strong> | ' . date('F d, Y', strtotime($row['postDate'])) . ' <br/>';
        $stmt2 = $db->prepare('SELECT catTitle, catSlug	FROM blog_cats, blog_cat_cats WHERE blog_cats.catID = blog_cat_cats.catID AND blog_cat_cats.postID = :postID');
        $stmt2->execute(array(':postID' => $row['postID']));
        $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC);
        $links = array();
        if (!empty($catRow)) {
            echo 'Tags: ';
        } else {
            echo '&nbsp;';
        }
开发者ID:jacobvarner,项目名称:aujungletimes-php,代码行数:31,代码来源:index.php

示例14: Paginator

    echo '<h3>Licence ' . $_GET['action'] . '.</h3>';
}
?>

        <table>
        <tr>
                <th>Titre</th>
                <th>Action</th>
        </tr>
        <?php 
try {
    $pages = new Paginator('10', 'p');
    $stmt = $db->query('SELECT licenceID FROM blog_licences');
    //pass number of records to
    $pages->set_total($stmt->rowCount());
    $stmt = $db->query('SELECT licenceID, licenceTitle, licenceSlug FROM blog_licences ORDER BY licenceTitle ASC ' . $pages->get_limit());
    while ($row = $stmt->fetch()) {
        echo '<tr>';
        echo '<td style="width: 80%;">' . $row['licenceTitle'] . '</td>';
        ?>

                                <td>
                                        <a style="text-decoration: none;" href="edit-licence.php?id=<?php 
        echo $row['licenceID'];
        ?>
"><input type="button" class="button" value="Edit."</a> |
                                        <a style="text-decoration: none;" href="javascript:dellicence('<?php 
        echo $row['licenceID'];
        ?>
','<?php 
        echo $row['licenceSlug'];
开发者ID:sybix,项目名称:freeostorrent,代码行数:31,代码来源:licences.php


注:本文中的Paginator::get_limit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。