View Full Version : Results found line.
webtrade
07-25-2007, 04:58 AM
What code would I use to display anywhere I choose on my site, the line "# results found." that appears at the top of search results. I would like to be able to display the total number of items current in the search engine anywhere.
This line I want to post anywhere without the rest of the search results:
5628 results found.
The 5628 can be any number. Somehow I would use this ** in the code.
If you are implying that you wish to perform a "**" search automatically whenever someone visits certain pages of your site, and then retrieve the line "x results found" from the search results only for this purpose, then I should point out that this is very inefficient and unwise. A "**" (which is a search for all possible words in the dictionary) is a slow and exhaustive search. To perform such a search on other pages of your site would not be very practical.
But with whatever method you go with, you will need to write some server-side scripting of your own, so I will presume that you are comfortable with PHP or ASP scripting.
One easy way to do this would be to retrieve the "NumPages" value from the settings.php or settings.asp file.
webtrade
07-26-2007, 03:03 AM
I tried to simplify my question as much as I could. What I want to do is exactly as I stated. I'm not suggesting anything. I just want to be able to display that ONE LINE anywhere on my website. I just want to state how many entries are in the ___.
Yes, and the answer is the same. You will need to write some PHP or ASP scripting on your pages to retrieve the NumPages value from the settings.php or settings.asp file.
For example, something like the following in PHP:
<?php
include("settings.php");
print("$NumPages pages available to search from.<br>");
?>
Now, the path to the settings file will vary depending on where you put this code. And you would need to be careful if you are putting this in other scripts.
vBulletin® v3.7.0, Copyright ©2000-2010, Jelsoft Enterprises Ltd.