site search tool question?

Discussion in 'Products & Tools' started by cgo85, May 20, 2005.

  1. #1
    does anyone know how to show more than 10 results per page with the dp site search tool?

    what should i change in this code:

    if ($urls['end'] - $urls['start'] < 9) $urls['results'] = $urls['end'];

    if ($urls['results'] > 10) {

    if ($start < 40) {
    $x = 0;
    } else {
    $x = round (max (0, min ($start - 40, $urls['results'] - 96) / 10));
    }
    for ($i = $x; $i < $x + 10; $i++) {
    if ($i != round ($start / 10)) {
    echo '<A HREF="search.php?q=' . urlencode($q) . '&start=' . ($i * 10) . '">' . ($i + 1) . "</A>&nbsp;&nbsp;";
    } else {
    echo ($i + 1) . "&nbsp;&nbsp;";
    }
    if (max (10, ($i + 1) * 10) >= $urls['results']) break;
    }

    echo '<BR>';

    thanks
     
    cgo85, May 20, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Unfortunately it's not possible because the Google API has a limitation of 10 results per query.
     
    digitalpoint, May 20, 2005 IP
  3. bottomsup6

    bottomsup6 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm just curious because i have the same error and i was curious as to what your statement of "Unfortunately it's not possible because the Google API has a limitation of 10 results per query" means? Does that mean that i can't use your search tool? or do i have some thing incorrect?:confused:
     
    bottomsup6, Sep 14, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Correct, if you need to show more than 10 results per query, you would not be able to use it.
     
    digitalpoint, Sep 14, 2005 IP