How to change the number per page in search?

Any idea how to change the number per page in people search (search.php)? Now the default is 10 (5, 10, 15, 25, etc)


I would like to change the default setting to 24 (8,16,24, 32, etc)  Is this possible?  I can't seem to find it anywhere.

Quote · 8 Jan 2010

Hi Patrick,

Try changing defaults in:

 inc/classes/BxDolSearch.php

Dave...

Quote · 8 Jan 2010

Hey thanks for pointing me to that file!  I did look inside and found this

/////////////////////////////////////////////////////////////////////

function setPaginate () {

$this->aCurrent['paginate']['perPage'] = (int)$_GET['per_page'] != 0 ? (int)$_GET['per_page'] : $this->aCurrent['paginate']['perPage'];

if (!$this->aCurrent['paginate']['perPage'])

----> $this->aCurrent['paginate']['perPage'] = 10;

$this->aCurrent['paginate']['page'] = isset($this->aCurrent['paginate']['forcePage']) ? (int)$this->aCurrent['paginate']['forcePage'] : (int)$_GET['page'];

if ($this->aCurrent['paginate']['page'] < 1)

$this->aCurrent['paginate']['page'] = 1;

}

/////////////////////////////////////////////////////////////////////


I changed that red line to this

$this->aCurrent['paginate']['perPage'] = 16;

I don't see a change yet. :/ Is there something else I need to do? I'm not sure what i'm doing.

Quote · 8 Jan 2010

Try clearing you cache manually (/cache and /public_cache) now that you changed/edit the file (except for the .htaccess file.)

Chris

Nothing to see here
Quote · 8 Jan 2010

I haven't tried it myself it was just a suggestion, I thought you might change near the top:

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 10);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL', 3);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL_MIN', 3);

define('BX_DOL_PAGINATE_PER_PAGE_DEFAULT', 10);

define('BX_DOL_PAGINATE_RANGE', 3);

To:

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 8);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL', 3);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL_MIN', 3);

define('BX_DOL_PAGINATE_PER_PAGE_DEFAULT', 16);

define('BX_DOL_PAGINATE_RANGE', 3);

You might also need to make some edits on

Templates/base/scripts/BxBaseSearchResult.php

Then you might also need to reset your template cache.

All untested but let me know how you get on.

Dave...

Quote · 8 Jan 2010

hey Zarcon! I just did that.  No luck.  :/  hmm

Quote · 8 Jan 2010

I haven't tried it myself it was just a suggestion, I thought you might change near the top:

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 10);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL', 3);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL_MIN', 3);

define('BX_DOL_PAGINATE_PER_PAGE_DEFAULT', 10);

define('BX_DOL_PAGINATE_RANGE', 3);

To:

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 8);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL', 3);

define('BX_DOL_PAGINATE_PER_PAGE_INTERVAL_MIN', 3);

define('BX_DOL_PAGINATE_PER_PAGE_DEFAULT', 16);

define('BX_DOL_PAGINATE_RANGE', 3);

You might also need to make some edits on

Templates/base/scripts/BxBaseSearchResult.php

Then you might also need to reset your template cache.

All untested but let me know how you get on.

Dave...

Where is that exactly?  I can't find it in inc/classes/BxDolSearch.php.

Quote · 8 Jan 2010

Sorry

inc/classes/BxDolPaginate.php

is probably what I meant.

:)

Dave..

Quote · 8 Jan 2010

I still haven't solved this yet. :-/  I still need help with this.  :(

Quote · 13 Feb 2010

I'm looking for this exact same thing, and was just going to post when I saw this.   Great minds think alike, eh Patrick?  Has anyone else tried it yet?    I'll poke around also, but if anyone comes up with a solution please post.

Quote · 14 Feb 2010

haha yeah caltrade, i know.... i can't stand this anymore... i want to show 2 or 3 full rows.

Quote · 14 Feb 2010

I know - 10 is way too few.  I don't think people doing a search really even see that next page arrow.  The change that lancanshire recommended didn't work?

Quote · 14 Feb 2010

I've always wondered why the default was 10, and not 8 or 16.  You may as well fill up all that blank space.  Wouldn't it be nice to have a real admin section where you could change stuff like this?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 14 Feb 2010

I tried lancashiredates's suggestion.. no luck.  :-/

Quote · 14 Feb 2010

Let's see if we can get Boonex / Alex to respond on this.   I have a feeling this is just a simple tweek somewhere.   HL is right - this should be a setting in admin.  Is there a trac for that?

Quote · 15 Feb 2010

Well since you've spent so much time on your site and given so much I'm sure they will jump right on this for you. 

 

 Maybe someone would give a thought to looking in the inc/js/browse_member.js file.  Nah... It would never reference anything at all to do with browsing members and such.

Quote · 15 Feb 2010

You are not just mocking me now Mydatery, you are also mocking the others who are looking for a solution on this.

Quote · 15 Feb 2010

Actually, seems as though the function that controls this, is in templates/base/scripts/BxBaseProfileView.php


$iCountProfiles = (int)(db_value($sQueryCnt));

$sResults = $sTopFilter = '';
if ($iCountProfiles) {
//collect pagination
$iCurrentPage    = isset( $_GET['page']         ) ? (int)$_GET['page']         : 1;
$iResultsPerPage = isset( $_GET['res_per_page'] ) ? (int)$_GET['res_per_page'] : 10;

if( $iCurrentPage < 1 )
$iCurrentPage = 1;
if( $iResultsPerPage < 1 )
$iResultsPerPage = 10;

$iTotalPages = ceil( $iCountProfiles / $iResultsPerPage );

if( $iTotalPages > 1 ) {
if( $iCurrentPage > $iTotalPages )
$iCurrentPage = $iTotalPages;

$sLimitFrom = ( $iCurrentPage - 1 ) * $iResultsPerPage;
$sQuery .= " LIMIT {$sLimitFrom}, {$iResultsPerPage}";

list($sPagination, $sTopFilter) = $this->genSearchPagination($iCountProfiles, $iCurrentPage, $iResultsPerPage, $aFilterSortSettings);
} else {
$sPagination = '';
}


There is more to it somewhere though.  I haven't found where that list gets incremented by 5.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 15 Feb 2010

 

You are not just mocking me now Mydatery, you are also mocking the others who are looking for a solution on this.

 Check this:      /templates/base/scripts/BxBaseProfileView.php

 

$iResultsPerPage = isset( $_GET['res_per_page'] ) ? (int)$_GET['res_per_page'] : 10;

   if( $iCurrentPage < 1 )
    $iCurrentPage = 1;
   if( $iResultsPerPage < 1 )
    $iResultsPerPage = 10;

 

 

Quote · 15 Feb 2010

Editing the /templates/base/scripts/BxBaseProfileView.php worked! Thanks :)

Quote · 20 Feb 2010

wow simple solution.  jeez thanks man

Quote · 20 Feb 2010

So now the search part is finally fixed but what about My Friends block in My Account page.  It still shows 10 friends... is there a different file to fix that?

Quote · 20 Feb 2010

Easy fix, improved my site quite a bit.  Thank you HL and rhimpr for tracking this down, and Patrick for broaching the issue.

Quote · 21 Feb 2010

So now the search part is finally fixed but what about My Friends block in My Account page.  It still shows 10 friends... is there a different file to fix that?

member.php
function getBlockCode_Friends() {
$iLimit = 10;

$sAllFriends    = 'viewFriends.php?iUser=' . $this->iMember;
$sOutputHtml    = null;

Quote · 21 Feb 2010

So now the search part is finally fixed but what about My Friends block in My Account page.  It still shows 10 friends... is there a different file to fix that?

member.php
function getBlockCode_Friends() {
$iLimit = 10;

$sAllFriends    = 'viewFriends.php?iUser=' . $this->iMember;
$sOutputHtml    = null;

Awesome!  Thanks for that!

Quote · 21 Feb 2010

DEANO! WE NEED A TOOLS UPDATE HERE! All of these should be adjustable by the admin

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 21 May 2010

I had a similar problem in Dol7, but I had problems finding the answer and this topic was very close to what I needed. In Dol7 the pages were incrementing by 5 which did not make sense to me because the default on the page was 8, then to increase the number per page it was 2, 7, 12, 17, 22, 27. If you change the lines in  /inc/classes/BxDolPaginate.php from

 

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 5);

to

define('BX_DOL_PAGINATE_PER_PAGE_STEP', 4);

 

You will get 4, 8, 12, 17, 22, 27. I hope this helps!

 
Quote · 21 Nov 2012

How to do this on Dolphin7.3.3  ??? 

 

 

So now the search part is finally fixed but what about My Friends block in My Account page.  It still shows 10 friends... is there a different file to fix that?

member.php
function getBlockCode_Friends() {
$iLimit = 10;

$sAllFriends    = 'viewFriends.php?iUser=' . $this->iMember;
$sOutputHtml    = null;

 

Quote · 15 Feb 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.