Announcement

Collapse
No announcement yet.

Can I remove the links to the various search results pages and just show 'previous'..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I remove the links to the various search results pages and just show 'previous'..

    Can I remove the links to the various search results pages and just show 'previous' and 'next' as it looks bad when a search brings up a large number of results?

    A search can sometimes bring about a large number of results and will display links to each page of results (depending on how many items you are showing per page, for example:




    To remove the links to each page and just leave the 'Previous' and 'Next' links, do the following:

    * browse to your site folder and locate the 'SearchScript.pl' file
    * open the file in a text editor such as notepad
    * search for:

    # enumerate the result pages

    * you should see:

    for ($nPage = 0; $nPage < $nMaxPageCount; $nPage++) # enumerate the result pages
    {
    $sPageLabel = ($nPage * $nResultsLimit + 1) . '-' . ((($nPage + 1) * $nResultsLimit) > ($#Results + 1) ? $#Results + 1 : ($nPage + 1) * $nResultsLimit);
    $sLink = $sScript . "&PN=" . $nPage;
    $sLink = sprintf($sLinkFormat, $sLink);
    if ($nPage == $nPageNumber) # the current page
    {
    $sContinue .= " " . $sPageLabel; # add the page number (no link)
    }
    else # anything other than the current page
    {
    $sContinue .= " " . $sLink . $sPageLabel . "</A>"; # add the page link
    }
    }


    * replace this with:

    #for ($nPage = 0; $nPage < $nMaxPageCount; $nPage++) # enumerate the result pages
    # {
    # $sPageLabel = ($nPage * $nResultsLimit + 1) . '-' . ((($nPage + 1) * $nResultsLimit) > ($#Results + 1) ? $#Results + 1 : ($nPage + 1) * $nResultsLimit);
    # $sLink = $sScript . "&PN=" . $nPage;
    # $sLink = sprintf($sLinkFormat, $sLink);
    # if ($nPage == $nPageNumber) # the current page
    # {
    # $sContinue .= " " . $sPageLabel; # add the page number (no link)
    # }
    # else # anything other than the current page
    # {
    # $sContinue .= " " . $sLink . $sPageLabel . "</A>"; # add the page link
    # }
    # }


    * save and close the file and update the site.
    Attached Files
Working...
X