Change Search Results

Does anyone know how to INCREASE the number of Search Results per page?


Im not talking about the drop down menu where the user can change themselves,

What i am speaking of is, how to change the DEFAULT number. Because right now it only displays MAX 10 people after the search. I would like to make it show like 20 members after the search.

ie: After they hit Search, the amount of results that first appear.

Quote · 26 Apr 2010

Try to search over search classes.

inc\classes\BxDolSearch.php   as example

here are

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

try set 20 as example. Hope it will help.

also you can check

templates\base\scripts\BxBaseSearchProfile.php

'paginate' => array('perPage' => 10, 'page' => 1, 'totalNum' => 10, 'totalPages' => 1),

Quote · 26 Apr 2010

Hello,

I changed code per BOTH of your instructions below.

That did NOT change the results on "People Search" nor "Search Home".

That did, however change the results for "Keyword Search" ONLY.

How can we change the results for "People Search" and "Search Home" ?

Quote · 26 Apr 2010

Hello,
I am trying to change the number of results shown in search results.

On BxDolSearch.php i have changed:

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'] = 20;

And on, BxBaseSearchProfile.php i have changed:

'paginate' => array('perPage' => 20, 'page' => 1, 'totalNum' => 20, 'totalPages' => 1),

But, neither of those changed the search results. It only changed "keyword" search results.

Do you know which code i would modify so that i can increase the number of search results per page?

Thank You!

Quote · 28 Apr 2010

You can do one of the following. Edit the BxBaseProfileView.php in one of the following directories: base/scripts file OR edit the tmpl_uni/scripts file (if it exists! Otherwise you will have to copy it from the base/scripts directory) OR edit it in the tmpl_whateverTemplateYouAreUsingDirectory (if you are using a template and if the file exists. Again if it does not you will have to copy it). Assuming you were to edit the base/scripts/BxBaseProfileView.php then open up the file and change the following:

Edit: templates/base/scripts/BxBaseProfileView.php

Around about line 887

Change from this:

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

To this:

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

Around about line 892

Change from this:

$iResultsPerPage = 10;

To this:

$iResultsPerPage = 20;

Go into the administration panel and clear the cache.

Check the results for proof of concept.

Then I would advise you to revert the changes to base and apply them to your template directories (tmpl_uni or tmpl_whatever)

Quote · 28 Apr 2010

Thank you!! that worked!

Quote · 29 Apr 2010

Wait...are you saying now i should REMOVE this change from:  templates/base/scripts/BxBaseProfileView ?

And then ONLY apply this change to:

templates/tmpl_uni/scripts/ BxTemplProfileView ?

templates/tmpl_uni1/scripts/ (there is no such file with that name here)

Why?

Quote · 29 Apr 2010

Yes. Remove the change and copy the script from base to the equivalent directory in tmpl_whateverthenameis. It is the proper way of making amendments. I am assuming that upon subsequent dolphin upgrades that boonex will over write the base directory with their own updated files and so you will lose your amendments.

Quote · 29 Apr 2010

Hi,

I am somewhat confused.

templates/base/scripts/BxBaseProfileView.php

does not have the same code on the page as:

templates/tmpl_uni/scripts/BxTemplProfileView.php

So, what do i need to do?

BxTemplProfileView.php only has this much code....

<?php

require_once( BX_DIRECTORY_PATH_BASE . 'scripts/BxBaseProfileView.php' );

class BxTemplProfileView extends BxBaseProfileView {
function BxTemplProfileView(&$oPr, &$aSite, &$aDir) {
BxBaseProfileView::BxBaseProfileView($oPr, $aSite, $aDir);
}
}

But, BxBaseProfileView.php has a whole page of code.

Please advise.

Thank You

Quote · 30 Apr 2010

Hi,
Regarding making changes to items in /base folder...

You say that if i only make the change in /base that i will lose it next time i upgrade?

You said to...

"Remove the change and copy the script from base to the equivalent directory in tmpl_whateverthenameis..."

So, do i actually copy and paste the ACTUAL FILE:

templates/base/scripts/BxBaseProfileView.php

into the templates/tmpl_uni/scripts/ folder?

So, now the tmpl_uni/scripts folder will now have a BxBaseProfileView.php file?

Thank You!

Quote · 30 Apr 2010
 
 
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.