From: <var...@us...> - 2010-07-15 15:56:29
|
Revision: 7614 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7614&view=rev Author: vargenau Date: 2010-07-15 15:56:21 +0000 (Thu, 15 Jul 2010) Log Message: ----------- Fix paging Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB.php trunk/pgsrc/AllPages trunk/pgsrc/AllPagesCreatedByMe trunk/pgsrc/AllPagesLastEditedByMe trunk/pgsrc/AllPagesOwnedByMe trunk/pgsrc/AllUserPages trunk/pgsrc/MyRatings trunk/pgsrc/RateIt trunk/pgsrc/UserRatings trunk/themes/gforge/pgsrc/ExternalPages Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/lib/PageList.php 2010-07-15 15:56:21 UTC (rev 7614) @@ -861,7 +861,9 @@ $this->addPage($page); } } - if ($i and empty($this->_options['count'])) + if (! is_array($page_iter->_options) || ! array_key_exists('limit_by_db', $page_iter->_options) || ! $page_iter->_options['limit_by_db']) + $this->_options['slice'] = 1; + if ($i and empty($this->_options['count'])) $this->_options['count'] = $i; } @@ -1491,7 +1493,7 @@ count($this->_columns), $this->_options['limit']); if ($tokens and !empty($this->_options['slice'])) - $this->_pages = array_slice($this->_pages, $tokens['OFFSET'], $tokens['COUNT']); + $this->_pages = array_slice($this->_pages, $tokens['OFFSET'], $tokens['SIZE']); } foreach ($this->_pages as $pagenum => $page) { $one_row = $this->_renderPageRow($page, $i++); Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/lib/WikiDB/backend/PearDB.php 2010-07-15 15:56:21 UTC (rev 7614) @@ -661,14 +661,16 @@ . $orderby; } } - if ($limit) { + if ($limit && $orderby) { // extract from,count from limit list($from,$count) = $this->limit($limit); $result = $dbh->limitQuery($sql, $from, $count); + $options = array('limit_by_db' => 1); } else { $result = $dbh->query($sql); + $options = array('limit_by_db' => 0); } - return new WikiDB_backend_PearDB_iter($this, $result); + return new WikiDB_backend_PearDB_iter($this, $result, $options); } /** Modified: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2010-07-15 15:56:21 UTC (rev 7614) @@ -361,14 +361,16 @@ . $orderby; } } - if ($limit) { + if ($limit && $orderby) { // extract from,count from limit list($from,$count) = $this->limit($limit); $result = $dbh->limitQuery($sql, $from, $count); + $options = array('limit_by_db' => 1); } else { $result = $dbh->query($sql); + $options = array('limit_by_db' => 0); } - return new WikiDB_backend_PearDB_iter($this, $result); + return new WikiDB_backend_PearDB_iter($this, $result, $options); } function most_popular($limit=20, $sortby='-hits') { Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/lib/WikiDB.php 2010-07-15 15:56:21 UTC (rev 7614) @@ -280,6 +280,7 @@ return new WikiDB_PageIterator($this, $result, array('include_empty' => $include_empty, 'exclude' => $exclude, + 'limit_by_db' => $result->_options['limit_by_db'], 'limit' => $result->limit())); } Modified: trunk/pgsrc/AllPages =================================================================== --- trunk/pgsrc/AllPages 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/AllPages 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -11,7 +11,7 @@ Here is the list of **all pages** on this Wiki, including any [[OrphanedPages|orphaned pages]] which are otherwise inaccessible. [[AllUserPages|Show only user pages]]. -<<AllPages info||=mtime,author,hits limit||=1000 sortby||=pagename>> +<<AllPages info||=mtime,author,hits sortby||=pagename>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/AllPagesCreatedByMe =================================================================== --- trunk/pgsrc/AllPagesCreatedByMe 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/AllPagesCreatedByMe 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ The list of pages which were created by you. (If you are authenticated only) -<<AllPages creator=[] info||=mtime,author,hits limit||=1000 sortby||=pagename>> +<<AllPages creator=[] info||=mtime,author,hits sortby||=pagename>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/AllPagesLastEditedByMe =================================================================== --- trunk/pgsrc/AllPagesLastEditedByMe 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/AllPagesLastEditedByMe 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ The list of pages for which you were the last author. (If you are authenticated only) -<<AllPages author=[] info||=mtime,author,hits limit||=1000 sortby||=pagename>> +<<AllPages author=[] info||=mtime,author,hits sortby||=pagename>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/AllPagesOwnedByMe =================================================================== --- trunk/pgsrc/AllPagesOwnedByMe 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/AllPagesOwnedByMe 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ The list of pages which you own. (If you are authenticated only) -<<AllPages owner=[] info||=mtime,author,hits limit||=1000 sortby||=pagename>> +<<AllPages owner=[] info||=mtime,author,hits sortby||=pagename>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/AllUserPages =================================================================== --- trunk/pgsrc/AllUserPages 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/AllUserPages 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ Here is the list of **all user pages** on this Wiki (pages that were not created at initialisation of the wiki). [[AllPages|Show all pages]]. -<<AllPages userpages=1 info||=mtime,author,hits limit||=1000 sortby||=pagename>> +<<AllPages userpages=1 info||=mtime,author,hits sortby||=pagename>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/MyRatings =================================================================== --- trunk/pgsrc/MyRatings 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/MyRatings 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Fri, 2 Jul 2010 13:54:01 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -8,7 +8,7 @@ charset=UTF-8 Content-Transfer-Encoding: binary -<<UserRatings info=ratingvalue limit||=1000 >> +<<UserRatings info=ratingvalue>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/RateIt =================================================================== --- trunk/pgsrc/RateIt 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/RateIt 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Fri, 2 Jul 2010 13:54:01 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,7 +10,7 @@ <<RateIt show=ratings>> -<<AllPages info=rating sortby||=-rating limit||=1000>> +<<AllPages info=rating sortby||=-rating>> ---- [[CategoryActionPage]] Modified: trunk/pgsrc/UserRatings =================================================================== --- trunk/pgsrc/UserRatings 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/pgsrc/UserRatings 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Fri, 2 Jul 2010 13:54:01 +0000 +Date: Tue, 13 Jul 2010 17:31:16 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -8,7 +8,7 @@ charset=UTF-8 Content-Transfer-Encoding: binary -<<UserRatings limit||=1000 >> +<<UserRatings>> ---- [[CategoryActionPage]] Modified: trunk/themes/gforge/pgsrc/ExternalPages =================================================================== --- trunk/themes/gforge/pgsrc/ExternalPages 2010-07-15 15:18:53 UTC (rev 7613) +++ trunk/themes/gforge/pgsrc/ExternalPages 2010-07-15 15:56:21 UTC (rev 7614) @@ -1,4 +1,4 @@ -Date: Thu, 15 Apr 2010 16:33:18 +0000 +Date: Tue, 13 Jul 2010 17:28:03 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -8,7 +8,7 @@ charset=UTF-8 Content-Transfer-Encoding: binary -<<AllPages info=external,author sortby=-external limit=10000>> +<<AllPages info=external,author sortby=-external>> ---- [[CategoryActionPage]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |