[ic] timed-build breaks more list - help needed
Aaron Rubin
ronnie at karatedepot.com
Mon Jan 26 12:21:28 EST 2004
Instead of usings IC's next page link to a results page with
mv_first_match=# of results returned already.
Haven't tried it, though...
--
Aaron Rubin
http://www.KarateDepot.com
1-877-216-2669 x12
-----Original Message-----
From: interchange-users-bounces at icdevgroup.org
[mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of DB
Sent: Monday, January 26, 2004 8:37 AM
To: interchange-users at icdevgroup.org
Subject: [ic] timed-build breaks more list - help needed
I'm running 4.8.8 using a modified foundation and MySQL. I have about
150,000 items in the catalog. Instead of the stock category list along
the left side of the page, I have links to custom pages which contain
searches.
When customers click these links, the search is performed as expected.
But because the database is getting large, these searches are slowing
things down. Since the same search is performed each time these links
are clicked, the timed-build tag should really help reduce the server
load.
On one of these custom pages, I put [timed-build auto=1 force=1
minutes=0] at the top of the page and [/timed-build] at the bottom. As
expected the page loaded much faster.. almost instantly. The only
problem is that the more list no longer functions. When I click "Next"
or any other link from the more list, I just get the first page again.
There is a big performance incentive for me to fix this so any hints are
welcomed. I tried moving the [timed-biuld] tage to various places on the
custom page but unless I wrapped almost the entire page, things broke
(raw ITL tags were shown on the page). Below is an example of one of
these custom pages' CONTENT section. If I wrap this whole section with
[timed-build...], I get the speedup but a broken more list.
------ begin code -----
<H2 align="center">Parts for Commercial turf & Golf course</H2> <H3
align="center">These are just our featured products.<br>Use our
[page parts]<B>Parts Finder</B>[/page] to search the complete
database.</H3>
<!-- Parts for Commercial turf & Golf course -->
[if scratch did_order]
[include file="templates/components/cart_display"]
[/if]
[set did_order][/set]
[search-region more=1
search="
co=yes
st=text
ml=15
tf=category
sf=title
se=452
nu=1
op=>=
sf=title
se=535
nu=1
op=<=
"]
[set munge_quantity]
[calc]
$Scratch->{did_order} = 1;
@q = split /\0/, $CGI->{mv_order_quantity};
for (@q) {
next unless length $_;
$_ = "=$_";
}
@parms = grep /^mv_oi\d+/ && $CGI->{$_}, keys %{$CGI};
# If we have parms, means an individual buy. If we don't
# we want to strip empty items
unless (@parms) {
@i = split "\0", $CGI->{mv_order_item};
for(my $i = 0; $i < @i; $i++) {
next if length($q[$i]);
$i[$i] = '';
}
@i = grep length($_), @i;
@q = grep length($_), @q;
$CGI_array->{mv_order_quantity} = \@q;
$CGI->{mv_order_quantity} = join "\0", @q;
$CGI_array->{mv_order_item} = \@i;
$CGI->{mv_order_item} = join "\0", @i;
return;
}
my $item = $parms[0];
$item =~ /(\d+)/ or return;
my $idx = $1;
$idx--;
$CGI->{mv_order_item} = $CGI->{$item};
$CGI->{mv_order_quantity} = "$q[$idx]";
return;
[/calc]
[bounce href="[history-scan exclude=nothing]"]
[/set]
[tmp cross_sale][value-extended name=mv_searchspec index=0][/tmp]
[on-match]
<FORM ACTION="[area nothing]" METHOD=POST>
<input type=hidden name=mv_session_id value="[data session id]"> <INPUT
TYPE=hidden NAME="mv_action" VALUE="refresh"> <INPUT TYPE=hidden
NAME="mv_separate_items" VALUE="0"> <INPUT TYPE=hidden NAME="mv_click"
VALUE="munge_quantity">
Parts for Commercial turf & Golf course
[/on-match]
[more-list]
<BLOCKQUOTE>
Showing [matches] of [match-count] matching items
<BR>
</BLOCKQUOTE>
[/more-list]
<table width="95%" border="0" cellspacing="0" cellpadding="3"> <tr
class="contentbar2">
<td><b>Part#</b></td>
<td align="center" width="55"><b> </b></td>
<td align="center" width="40%"><b>Description</b></td>
<td align="center"><b>Price</b></td>
<td align="center"><b>Qty</b></td>
<td align="center"><b>Buy</b></td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
[search-list]
[item-change 1][condition][item-field category][/condition]
<tr class="contentbar1">
<td colspan="6"> [either][value banner_text][or][item-field
category][/either]</td>
</tr>
[/item-change 1]
<tr valign="top">
<td align="left" valign="middle">
<INPUT TYPE=hidden NAME="mv_order_item" VALUE="[item-code]"> <a
href="[area [item-code]]">[item-code]</a> </td>
<td align="center" width="55" valign="middle">
<INPUT TYPE=hidden NAME="mv_order_item" VALUE="[item-code]">
[if-item-field thumb] <a href="[area [item-code]]"> <IMG
SRC="thumb/[item-field thumb]" ALT="image" border=0> </a>
[/if-item-field]
</td>
<td align="center" valign="middle" width="40%"> <b>[item-field
comment]</b><br>[item-field description]</td>
<td align="center" valign="middle">[item-price]</td>
<td align="center" valign="middle"><input type=hidden
name="mv_oi[item-increment]" value=""><input type=text
name=mv_order_quantity size=2 value="1"></td>
<td align="center" valign="middle">
[if session browser =~ /mac/]
<input type=submit value="[L]Buy now[/L]"
onClick="this.form.mv_oi[item-increment].value='[item-code]'" border=0>
[else]
<input type=image
src="__THEME_IMG_DIR__buynow.gif"
onClick="this.form.mv_oi[item-increment].value='[item-code]'" border=0>
[comment] [order [item-code]]Order Now[/order][/comment]
[/else]
[/if]
</td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
</p>
</td>
</tr>
<tr><td align="center" colspan="6">
[/search-list]
[no-match]
Sorry, no matches for [value mv_searchspec].
[/no-match]
[more-list]
<BLOCKQUOTE>
Showing [matches] of [match-count] matching items.<BR>
Click below to see more...
<BR>[more]<BR>
</BLOCKQUOTE>
[/more-list]
[/search-region]
</FORM>
<H3 align="center">These are just our featured products.<br>Use our
[page parts]<B>Parts Finder</B>[/page] to search the complete
database.</H3>
</td>
</tr>
</td>
</tr>
</table>
------ end code -----
_______________________________________________
interchange-users mailing list
interchange-users at icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
More information about the interchange-users
mailing list