You are here:  » Number of results in search external

Support Forum



Number of results in search external

Submitted by kiddaclo on Sat, 2010-04-24 20:20 in

Hi David,

Is there a way to pass a value to searchExternal for how many results it displays?

I'm a php newbie as you know I have tried this but probably way off the mark:

Calling code:

<?php
  $common_baseHREF 
"http://www.example.com/pricetapestry/";
  
$common_path "/path/to/pricetapestry/";
  
$mylimit "6";
  
$_GET["q"] = "Search Terms";
  require(
$common_path."searchExternal.php");
?>

Then in SearchExternal.php around line 274 I changed from:
$sql .= " LIMIT ".$config_resultsPerPage;

To:
$sql .= " LIMIT ".$mylimit;

But no joy!

Submitted by support on Sun, 2010-04-25 15:35

Hi,

I can't see any obvious reason why that shouldn't work - and would have been pretty much what I would suggest! An alternative method, if you replace the original code, would be to override $config_resultsPerPage after config.php included. To do this, around line 38 you'll find:

    require_once($common_path."config.php");

..REPLACE that with:

    require_once($common_path."config.php");
    $config_resultsPerPage = 6;

Hope this helps!

Cheers,
David.

Submitted by kiddaclo on Mon, 2010-04-26 16:55

Hi David,

Not sure how but I have my original code working, I started a fresh with the same code! I think I must have missed out the space before LIMIT originally in SearchExternal.php and that stopped it working that's all I can think of.

A warning to others don't try your hand at php whilst drinking red wine!

Cheers,
Chris.