Support Forums

search result count

This is a discussion on search result count within the Templates, HTML, CSS, and Design Help forums, part of the General category; I think this maybe quite complicated... but let me ask. On a page I am putting hyperlinks which are actually ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 12-13-2009, 02:32 AM   #1
Customer
 
Join Date: Jun 2008
Location: Maldives
Posts: 134
Rep Power: 16
business is on a distinguished road
Default search result count

I think this maybe quite complicated... but let me ask.
On a page I am putting hyperlinks which are actually search queries (eg.
Code:
<a href="searchresults.php?type=13&opt12=Nokia&sortfield=dateadded&sortorder=desc">Nokia Phones</a>
my question is, next to the hyperlink, can we show the number of listings that would be found in this search.

I know that when we browse categories, we have the listing count for each category shown. this is a similar concept... but the count is required for search queries... before executing the search.
__________________
v 4.2.0 Developer - Default Template
business is offline   Reply With Quote
Old 12-13-2009, 09:33 AM   #2
Customer
 
Join Date: Sep 2006
Location: USA
Posts: 156
Rep Power: 24
BigOrange will become famous soon enough
Default

You can add {$numrows} in showlistings.tpl. to show the number listings found in all search or category listings.
__________________
v4.1.9 Designer - Default template (modified)

"I have never forgotten anything... if I have I can't remember what it was."
BigOrange is offline   Reply With Quote
Old 12-14-2009, 07:11 AM   #3
Customer
 
Join Date: Jun 2008
Location: Maldives
Posts: 134
Rep Power: 16
business is on a distinguished road
Default

that is available after the search is executed.
I am looking for a way of counting the search results before customer actually press the link for the search.
__________________
v 4.2.0 Developer - Default Template
business is offline   Reply With Quote
Old 12-14-2009, 07:26 AM   #4
Customer
 
Join Date: Sep 2006
Location: USA
Posts: 156
Rep Power: 24
BigOrange will become famous soon enough
Default

That would be equivalent to wanting to get an answer before the question has been asked.
__________________
v4.1.9 Designer - Default template (modified)

"I have never forgotten anything... if I have I can't remember what it was."
BigOrange is offline   Reply With Quote
Old 12-14-2009, 02:10 PM   #5
Customer
 
Join Date: Jun 2008
Location: Maldives
Posts: 134
Rep Power: 16
business is on a distinguished road
Default

well... you get to see the number of listings in a category before your view that category ... while browsing categories...
__________________
v 4.2.0 Developer - Default Template
business is offline   Reply With Quote
Old 12-14-2009, 04:43 PM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,356
Rep Power: 85
seymourjames is a jewel in the rough
Default

it is indeed possible to do. I would attempt to write a plugin for it that does the search to count the results and place this beside the link without displaying the listings themselves. However, as Larry has often pointed out on the forum, you will incur the overhead to do all this counting with the database queries if you put it in the layout on your site. With lots of listings it will really slow your site down.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 12-15-2009, 03:18 AM   #7
Customer
 
Join Date: Jun 2008
Location: Maldives
Posts: 134
Rep Power: 16
business is on a distinguished road
Default

my plan is to include them on certain pages.
for when a user views the hard disk category, or views a hard disk, I am including a file with the following codes. ( I categorize hard disks by type (internal, external, laptop) and by size/capacity). Opt18 is type, and opt19 is capacity. Type=44 is Hard Disk category. It is against the hyperlinks that I want to show the listing count. Of course, if the overheads outweighs the benefits, it may not be worth doing it.


Code:
<div id="sidebar">
<h1>Hard Drives</h1>
<div class="left-box-incategorysearch">
<div class="categorylist">
<b>Type</b><br>
{if $smarty.get.opt18==""}<b>All</b>{else}
<a href="searchresults.php?type=44&sortfield=dateadded&sortorder=desc">All</a>
{/if}<br>
{if $smarty.get.opt18=="External Hard Drives"}External Hard Drives{else}
<a href="searchresults.php?type=44&opt18=External+Hard+Drives&Submit=Search&sortfield=dateadded&sortorder=desc">External Hard Drives</a>
{/if}<br>
{if $smarty.get.opt18=="Internal Hard Drives"}Internal Hard Drives{else}
<a href="searchresults.php?type=44&opt18=Internal+Hard+Drives&Submit=Search&sortfield=dateadded&sortorder=desc">Internal Hard Drives</a>
{/if}<br>
{if $smarty.get.opt18=="Laptop Hard Drives"}Laptop Hard Drives{else}
<a href="searchresults.php?type=44&opt18=Laptop+Hard+Drives&Submit=Search&sortfield=dateadded&sortorder=desc">Laptop Hard Drives</a>
{/if}<br><br>
{*Capacity for All Types of Hard*}
{if $smarty.get.opt18==""}
<b>Capacity</b><br>
{if $smarty.get.opt19==""}All{else}
<a href="searchresults.php?type=44&Submit=Search">All</a>
{/if}<br>
{if $smarty.get.opt19=="100 GB and Less"}100 GB & Less{else}
<a href="searchresults.php?type=44&opt19=100+GB+and+Less&Submit=Search">100 GB & Less</a>
{/if}<br>
{if $smarty.get.opt19=="101 GB to 200 GB"}101 GB to 200 GB{else}
<a href="searchresults.php?type=44&opt19=101+GB+to+200+GB&Submit=Search">101 GB to 200 GB</a>
{/if}<br>
{if $smarty.get.opt19=="201 GB to 300 GB"}201 GB to 300 GB{else}
<a href="searchresults.php?type=44&opt19=201+GB+to+300+GB&Submit=Search">201 GB to 300 GB</a>
{/if}<br>
{if $smarty.get.opt19=="301 GB to 500 GB"}301 GB to 500 GB{else}
<a href="searchresults.php?type=44&opt19=301+GB+to+500+GB&Submit=Search">301 GB to 500 GB</a>
{/if}<br>
{if $smarty.get.opt19=="501 GB to 999 GB"}501 GB to 999 GB{else}
<a href="searchresults.php?type=44&opt19=501+GB+to+999+GB&Submit=Search">501 GB to 999 GB</a>
{/if}<br>
{if $smarty.get.opt19=="1 TB and More"}1 TB and More{else}
<a href="searchresults.php?type=44&opt19=1+TB+and+More&Submit=Search">1 TB and More</a>
{/if}<br><br>
{/if}
{* Capacity for External Hard*}
{if $smarty.get.opt18=="External Hard Drives"}
<b>Capacity</b><br>
{if $smarty.get.opt19==""}All{else}
<a href="searchresults.php?type=44&opt18=External+Hard+Drives=&Submit=Search">All</a>
{/if}<br>
{if $smarty.get.opt19=="100 GB and Less"}100 GB & Less{else}
<a href="searchresults.php?type=44&opt19=100+GB+and+Less&opt18=External+Hard+Drives&Submit=Search">100 GB & Less</a>
{/if}<br>
{if $smarty.get.opt19=="101 GB to 200 GB"}101 GB to 200 GB{else}
<a href="searchresults.php?type=44&opt19=101+GB+to+200+GB&opt18=External+Hard+Drives&Submit=Search">101 GB to 200 GB</a>
{/if}<br>
{if $smarty.get.opt19=="201 GB to 300 GB"}201 GB to 300 GB{else}
<a href="searchresults.php?type=44&opt19=201+GB+to+300+GB&opt18=External+Hard+Drives&Submit=Search">201 GB to 300 GB</a>
{/if}<br>
{if $smarty.get.opt19=="301 GB to 500 GB"}301 GB to 500 GB{else}
<a href="searchresults.php?type=44&opt19=301+GB+to+500+GB&opt18=External+Hard+Drives&Submit=Search">301 GB to 500 GB</a>
{/if}<br>
{if $smarty.get.opt19=="501 GB to 999 GB"}501 GB to 999 GB{else}
<a href="searchresults.php?type=44&opt19=501+GB+to+999+GB&opt18=External+Hard+Drives&Submit=Search">501 GB to 999 GB</a>
{/if}<br>
{if $smarty.get.opt19=="1 TB and More"}1 TB and More{else}
<a href="searchresults.php?type=44&opt19=1+TB+and+More&opt18=External+Hard+Drives&Submit=Search">1 TB and More</a>
{/if}<br><br>
{/if}
{* Capacity for Internal Hard*}
{if $smarty.get.opt18=="Internal Hard Drives"}
<b>Capacity</b><br>
{if $smarty.get.opt19==""}All{else}
<a href="searchresults.php?type=44&opt18=Internal+Hard+Drives&Submit=Search">All</a>
{/if}<br>
{if $smarty.get.opt19=="100 GB and Less"}100 GB & Less{else}
<a href="searchresults.php?type=44&opt19=100+GB+and+Less&opt18=Internal+Hard+Drives&Submit=Search">100 GB & Less</a>
{/if}<br>
{if $smarty.get.opt19=="101 GB to 200 GB"}101 GB to 200 GB{else}
<a href="searchresults.php?type=44&opt19=101+GB+to+200+GB&opt18=Internal+Hard+Drives&Submit=Search">101 GB to 200 GB</a>
{/if}<br>
{if $smarty.get.opt19=="201 GB to 300 GB"}201 GB to 300 GB{else}
<a href="searchresults.php?type=44&opt19=201+GB+to+300+GB&opt18=Internal+Hard+Drives&Submit=Search">201 GB to 300 GB</a>
{/if}<br>
{if $smarty.get.opt19=="301 GB to 500 GB"}301 GB to 500 GB{else}
<a href="searchresults.php?type=44&opt19=301+GB+to+500+GB&opt18=Internal+Hard+Drives&Submit=Search">301 GB to 500 GB</a>
{/if}<br>
{if $smarty.get.opt19=="501 GB to 999 GB"}501 GB to 999 GB{else}
<a href="searchresults.php?type=44&opt19=501+GB+to+999+GB&opt18=Internal+Hard+Drives&Submit=Search">501 GB to 999 GB</a>
{/if}<br>
{if $smarty.get.opt19=="1 TB and More"}1 TB and More{else}
<a href="searchresults.php?type=44&opt19=1+TB+and+More&opt18=Internal+Hard+Drives&Submit=Search">1 TB and More</a>
{/if}<br><br>
{/if}
{*Laptop Hard*}
{if $smarty.get.opt18=="Laptop Hard Drives"}
<b>Capacity</b><br>
{if $smarty.get.opt19==""}All{else}
<a href="searchresults.php?type=44&opt18=Laptop+Hard+Drives&Submit=Search">All</a>
{/if}<br>
{if $smarty.get.opt19=="100 GB and Less"}100 GB & Less{else}
<a href="searchresults.php?type=44&opt19=100+GB+and+Less&opt18=Laptop+Hard+Drives&Submit=Search">100 GB & Less</a>
{/if}<br>
{if $smarty.get.opt19=="101 GB to 200 GB"}101 GB to 200 GB{else}
<a href="searchresults.php?type=44&opt19=101+GB+to+200+GB&opt18=Laptop+Hard+Drives&Submit=Search">101 GB to 200 GB</a>
{/if}<br>
{if $smarty.get.opt19=="201 GB to 300 GB"}201 GB to 300 GB{else}
<a href="searchresults.php?type=44&opt19=201+GB+to+300+GB&opt18=Laptop+Hard+Drives&Submit=Search">201 GB to 300 GB</a>
{/if}<br>
{if $smarty.get.opt19=="301 GB to 500 GB"}301 GB to 500 GB{else}
<a href="searchresults.php?type=44&opt19=301+GB+to+500+GB&opt18=Laptop+Hard+Drives&Submit=Search">301 GB to 500 GB</a>
{/if}<br>
{if $smarty.get.opt19=="501 GB to 999 GB"}501 GB to 999 GB{else}
<a href="searchresults.php?type=44&opt19=501+GB+to+999+GB&opt18=Laptop+Hard+Drives&Submit=Search">501 GB to 999 GB</a>
{/if}<br>
{if $smarty.get.opt19=="1 TB and More"}1 TB and More{else}
<a href="searchresults.php?type=44&opt19=1+TB+and+More&opt18=Laptop+Hard+Drives&Submit=Search">1 TB and More</a>
{/if}<br>
<br>
{/if}
</div>
</div>
</div>
__________________
v 4.2.0 Developer - Default Template
business is offline   Reply With Quote
Old 12-15-2009, 05:49 AM   #8
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,356
Rep Power: 85
seymourjames is a jewel in the rough
Default

Well you can only try. What you can do is write a plugin to display the numrows for a search which you prime the function with each time you use it.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
when search it shows 1 result is found?!? ivkototo Technical Support 4 11-13-2009 10:48 AM


All times are GMT -4. The time now is 10:44 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0