Added support for query strings to the Pagination class, automatically detected or explicitly declared.
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 10af3fd..2b8d3e4 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -50,6 +50,7 @@
 	var $prev_tag_close		= '';

 	var $num_tag_open		= ' ';

 	var $num_tag_close		= '';

+	var $page_query_string	= FALSE;

 

 	/**

 	 * Constructor

@@ -152,8 +153,16 @@
 		$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;

 		$end   = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;

 

-		// Add a trailing slash to the base URL if needed

-		$this->base_url = rtrim($this->base_url, '/') .'/';

+		// Is pagination being used over GET or POST?  If get, add a per_page query

+		// string. If post, add a trailing slash to the base URL if needed

+		if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)

+		{

+			$this->base_url = rtrim($this->base_url).AMP.'per_page=';

+		}

+		else

+		{

+			$this->base_url = rtrim($this->base_url, '/') .'/';

+		}

 

   		// And here we go...

 		$output = '';