Pastoid

The page you are looking at now is at this URL: http://pastoid.com/b0v

This paste was last updated on March 14, 2010 at 12:31 am.

Pasted Coderaw

Index: system/classes/posts.php
===================================================================
--- system/classes/posts.php	(revision 4108)
+++ system/classes/posts.php	(working copy)
@@ -65,7 +65,6 @@
 
 		// Default parameters
 		$orderby = 'pubdate DESC';
-		$limit = (int) Options::get('pagination') ? (int) Options::get('pagination') : 5;
 
 		// If $paramarray is a querystring, convert it to an array
 		$paramarray = Utils::get_params( $paramarray );
@@ -491,7 +490,7 @@
 		// Extract the remaining parameters which will be used onwards
 		// For example: page number, fetch function, limit
 		$paramarray = new SuperGlobal($paramarray);
-		$extract = $paramarray->filter_keys('page', 'limit', 'fetch_fn', 'count', 'orderby', 'groupby', 'limit', 'offset', 'nolimit', 'having');
+		$extract = $paramarray->filter_keys('page', 'fetch_fn', 'count', 'orderby', 'groupby', 'limit', 'offset', 'nolimit', 'having');
 		foreach ( $extract as $key => $value ) {
 			$$key = $value;
 		}
@@ -552,6 +551,10 @@
 				$limit .= " OFFSET $offset";
 			}
 		}
+		// Otherwise use the default limit, unless specific posts are requested
+		elseif ( !isset( $paramset['id'] ) && !isset( $paramset['slug'] ) ) {
+			$limit = (int) Options::get('pagination') ? (int) Options::get('pagination') : 5;
+		}
 
 		// Remove the LIMIT if 'nolimit' or 'month_cts' is set
 		if ( isset( $nolimit ) || isset( $paramset['month_cts'] ) ) {
 
 

Toggle wordwrap

Pasted Coderaw

                // Define the LIMIT and add the OFFSET if it exists
                if ( isset( $limit ) ) {
                        $limit = " LIMIT $limit";
                        if ( isset( $offset ) ) {
                                $limit .= " OFFSET $offset";
                        }
                }
                // Otherwise use the default limit, unless specific posts are requested
                elseif ( !isset( $paramset['id'] ) && !isset( $paramset['slug'] ) ) {
                        $limit = (int) Options::get('pagination') ? (int) Options::get('pagination') : 5;
                }
 
                // Remove the LIMIT if 'nolimit' or 'month_cts' is set
                if ( isset( $nolimit ) || isset( $paramset['month_cts'] ) ) {
                        $limit = '';
                }
 
 

Toggle wordwrap

Referring DomainHits
Unknown Referer 183
www.w3dictionary.org 11
drunkenmonkey.org 1
Is this paste spam?
<Hide