Gossamer Forum
Quote Reply
SearchLogger question
Hi,

isn't the SearchLogger plugin supposed to display a page toolbar (i.e. page 1 2 3 >>) when there are more search terms than 25?
The code looks like it should, but for some reason I get only 25 logged items displayed - no possibility to look at the following pages...

Any ideas?

thanx
Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: SearchLogger question In reply to
Seems that I found a solution for my problem.
When I change the line #40 in SearchLogger.pm from
Code:
my $hits = $sth->rows;
to
Code:
my $hits = $db->total;
the toolbar (i.e. page 1 2 3 >>) is displayed correctly.
My version returns the total of the SearchLog table records, the original would return the results of a query (which for some reason always seems to be 25, don't know why...).

Andreas

--------------------------------------------
http://www.archaeologie-online.de
Quote Reply
Re: SearchLogger question In reply to
This looks like a logic bug.

$db->total

Returns the number of links (records) in a table.

$db->rows()

Returns the number of "hits" from the last query to the database.

So, if you were displaying 25 at a time, $db->rows would always return 25 (or less)

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum