root/branches/release-36/php/lib/function.mtnextlink.php @ 2103

Revision 2103, 0.5 kB (checked in by fumiakiy, 19 months ago)

Implemented PHP version of pager related tags. Dynamically published archives can now be pagination-enabled by adding these tags and specify "auto" to limit and offset.

  • Property svn:keywords set to Id Date Author Revision
Line 
1<?php
2# Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd.
3# This program is distributed under the terms of the
4# GNU General Public License, version 2.
5#
6# $Id$
7
8function smarty_function_mtnextlink($args, &$ctx) {
9
10    $limit = $ctx->stash('__pager_limit');
11    $offset = $ctx->stash('__pager_offset');
12    $offset += $limit;
13
14    if ( strpos($link, '?') ) {
15        $link .= '&';
16    }
17    else {
18        $link .= '?';
19    }
20
21    $link .= "limit=$limit";
22    if ( $offset )
23        $link .= "&offset=$offset";
24    return $link;
25}
26?>
27
Note: See TracBrowser for help on using the browser.