Since the
WebStore application can be based of a database, it is
fairly simple to add this feature. Here is a hack that was sent in by
to do just that!
In the file web_store.cgi under the section:
########################################
# create_html_page_from_db Subroutine #
########################################
I replaced the line:
($status,$total_row_count) =
&submit_query(*database_rows);
With the following:
($status,$total_row_count) =
&submit_query(*database_rows,
$form_data{'hits_seen'});
$hits_seen = $form_data{'hits_seen'} +
$sc_db_max_rows_returned;
Then, in the file web_store_db_lib.pl,
there is a subroutine that begins with:
########################################
# subroutine: submit_query #
########################################
I replaced the following code:
sub submit_query
{
local(*database_rows) = @_;
with:
sub submit_query
{
local(*database_rows, $hits_seen) = @_;
then further down in that same subroutine, replace:
while(($line = <DATAVIRTUAL> ) &&
($row_count <
$sc_db_max_rows_returned + 1))
with:
while(($line = <DATAVIRTUAL> ) &&
($row_count <
$sc_db_max_rows_returned + $hits_seen))
Further down still in the same subroutine, replace:
if (($not_found == 0) &&
($row_count <=
$sc_db_max_rows_returned))
with:
$adjusted_line_number =
$sc_db_max_rows_returned +
$hits_seen;
if (($not_found == 0) &&
($row_count <=
$adjusted_line_number) &&
$row_count >= $hits_seen)
The last file that I modified was
web_store_html_lib.pl in the section:
########################################
# product_page_footer Subroutine #
########################################
I replaced the following routine:
if ($db_status ne "")
{
if ($db_status =~
/max.*row.*exceed.*/i)
{
$warn_message = qq!
<CENTER>
<BLOCKQUOTE>
Your query returned $total_rows_
returned. This is more than
the maximum we allow
($sc_db_max_rows_returned).
You will need to restrict your
query further. </BLOCKQUOTE>
</CENTER><P>!;
}
}
with:
if ($total_rows_returned >=
$hits_seen)
{
$warn_message = qq!
<CENTER>
<INPUT TYPE = "hidden"
NAME = "hits_seen"
VALUE= "$hits_seen">
<INPUT TYPE = "submit"
NAME = "search_request_button"
VALUE = "See the next
$sc_db_max_rows_returned
hits">
</CENTER>:<P>!;
}