View Full Version : Search The Internet v1.0 (Major Engines)
tHE DSS
08-09-2002, 10:00 PM
Search The Internet Hack - (Copyright 2002+), tHE DSS
V1.0 (10th August 2002)
Additional code (enhanced by tHE DSS) used from Freddie's Quick Stats Hack at https://vborg.vbsupport.ru/showthread.php?s=&threadid=37193
As with anything of this nature, I will not be held responsible for any damage that may be caused during installation of this hack, or in the future during usage of this hack. Although steps have been taken to ensure a smooth installation, and smooth usage, you install and use this hack entirely at your own risk.
// #######################
// #######################
This hack gives your visitors an excellent quick and easy way of finding information on the Internet, without having to leave your site.
5 search engines are included at the moment (google, yahoo, alta vista, excite & lycos). A search "bar" is present on every page on your forum site, in the footer by default - your visitors simply type in a search, select the engine to search on (from a drop down box), and that's that.
A new window will open up, with the seach results displayed.
It gets even better, because this hack can optionally keep search logs on who is searching what from where, and when. A great help for webmasters interested in their visitors wants and needs.
Webmasters can quickly track down information from the search logs via the vB AdminCP. In-fact, webmasters can control the logs completely, from the AdminCP.
It gets better yet, as this hack is so easy to install.
// #######################
// #######################
I will no doubt be adding features to this hack as and when I get a spare half hour - the "upgrades" will simply entail uploading a replacement file (no vB scripts will need replacing).
Cheers.
tHE DSS
08-10-2002, 01:20 PM
Screenshot from the main screen in AdminCP
tHE DSS
08-10-2002, 01:24 PM
A screen shot from viewing criteria logs...
tHE DSS
08-10-2002, 01:25 PM
A screenshot from the main forums area :
Juanito
08-10-2002, 01:31 PM
Cool, was talking about installing a search box to our website yesterday!
Thanks, I'm gone try it ou tright away ;)
DemiNeo0101
08-10-2002, 02:08 PM
very nice :)
hypedave
08-10-2002, 02:13 PM
wow im bout to run and install this now!!!! Great add-on to keep the members active
tHE DSS
08-10-2002, 02:14 PM
Cheers guys... keep the vibe alive. ;)
DestyNova
08-10-2002, 02:26 PM
Out of curiousity, will it add some more queries?
Sean123
08-10-2002, 02:51 PM
Great job ... It was VERY easy to install and I think it will be a great addon to my forums . .thanks
Lionel
08-10-2002, 02:52 PM
I just installed. I have 2 questions:
1-what is the purpose of the second template search_the_internet_window ?
2-How do I get rid of the java error from a search result? Whether google's , yahoo etc... the search engine website always comes up with a java error.
VietSoil
08-10-2002, 03:03 PM
Nice hack. Could be useful to my forum. Thanks.
tHE DSS
08-10-2002, 03:19 PM
Cheers for the input. :)
DestyNova, no, not really - 1 template will be pulled in to each page (for the search bar, which won't give any performance loss), but apart from that, no. If you opt to use the logs, then 1 query will be added (only if somone searches), but it's very small... again, you won't notice a loss in performance.
Lionel, the purpose of the 'search_the_internet_window', is to keep the results of any search "clean". It's the new window that pops up to display your search results.
And, which JavaScript error are you getting? Is it the one telling you that you cannot be auto. re-directed, because you have no javscript support (or have it disabled), or does the search engine page with the results come up, but you have JavaScript errors?
If it's the latter of those two, the JavaScript errors will be from the search engine site itself.
Again, cheers everyone for the input. :)
... ps : oops.. I forgot to say earlier... if the "error" is the one saying you cannot be re-directed because of no JavaScript support, then don't worry, that's normal... the script takes this into account, and outputs a URL for you to click on, which will take you to the search results.
Lionel... i've used this add-on/hack at your site, and i'm not getting any errors.
What browser are you using?
hypedave
08-10-2002, 03:28 PM
Works like a charm hasnt installed for a complete hour yet, and my users are already using it like mad
http://www.ochroma.net/forums
my users are wanting to know if there is a way to add www.ditto.com search engines, it some search engine that lets you search for avatars I believe.
tHE DSS
08-10-2002, 03:34 PM
Yep, search engines can be added easily, i'll go through a little tutorial here in a moment, using your www.ditto.com as an example.
Watch this space.
DestyNova
08-10-2002, 03:37 PM
tHE DSS
thanks for answer my QQ, I m going to install this one :thumbup: good job ;)
tHE DSS
08-10-2002, 04:13 PM
Adding more search engines to this hack is really quick and easy. Just follow this guide.
First thing to do, is get the URL and parameters that the new search engine needs/takes.
Using hypedave's suggestion for Ditto.com as an example, I went to http://www.ditto.com, and did a search for footballs... this gave me the results, and from the address bar, I took the URL of :
http://ditto.com/search_results.asp?ss=footballs&viewstyle=compact
Look for your search string in the URL to get the search string parameter for that search engine.
Here, I looked in the URL for footballs. I see ss=footballs, so, the search string parameter for Ditto.com, is ss=
You may need to re-arrange the URL to work with this hack, as the search string parameter in this hack, needs to be the very last parameter in the URL. So, i've just moved this one, so the URL now looks like this (I did this in Notepad) :
http://www.ditto.com/search_results.asp?viewstyle=compact&ss=
... the search string parameter (ss=), is now the last parameter.
There is another parameter for Ditto.com, for viewstyle... I chose the "compact" for this example. You can see that in the URL.
Now, open up the 'websearch.php' script, and find the following :
switch ($engine) {
case "google" :
doSearch("http://www.google.com/search?q=");
break;
case "yahoo" :
doSearch("http://search.yahoo.com/bin/search?p=");
break;
case "altaVista" :
doSearch("http://www.altavista.com/sites/search/web?pg=q&kl=XX&q=");
break;
case "excite" :
doSearch("http://srch.excite.com/d/search/p/excite/?c=web&qcat=web&s=");
break;
case "lycos" :
doSearch("http://search.lycos.com/default.asp?query=");
break;
default :
outputStatus(-1);
}
... after the last engine (lycos here), add this :
case "ditto" :
doSearch("http://www.ditto.com/search_results.asp?viewstyle=compact&ss=");
break;
... do ensure that you insert that underneath the 'break;' statement of the previous case statement, or you will have problems.
Save the 'websearch.php' file.
Now, you need to edit the 'search_the_internet' template.
In this template, find this :
<select name="engine">
<option value="google" selected>Search -> Google
<option value="yahoo">Search -> Yahoo
<option value="altaVista">Search -> Alta Vista
<option value="excite">Search -> Excite
<option value="lycos">Search -> Lycos
</select>
... after the last engine option (lycos here), add this :
<option value="ditto">Search -> Ditto
Save the template, and it works from that point.
==========
==========
The only other thing to do, is if you are keeping search logs.
In this case, the statistics script won't recognise your new engine (ditto.com here).... it's not a problem whilst searching for logs, but the main stats page, where you get a count by engine, counts will show up as (Unknown Engine :)... so, if you want it to actually tell you it's Ditto.Com, open up your 'stistats.php' file, and find the following :
$engineName_array = array('google','yahoo','altaVista','excite','lycos ');
$engineCount_array = array(0,0,0,0,0);
.. then basically, add the search engine name, and set it's count to 0, by adding a new element to each array. For the above, we'll replace the above, with this :
$engineName_array = array('google','yahoo','altaVista','excite','lycos ', 'ditto');
$engineCount_array = array(0,0,0,0,0,0);
... we've added 'ditto' to the engine name array, and set it's default count to 0, by adding a 0 to the engine count array. The script tallies up the counts as it reads them, at run-time... they should always be 0 in the script.
That's it... that's all you got to do.
Just make sure that when adding engines, you keep the engine's 'key value' consistent through-out each change... here, the keyword is simply 'ditto'... like in :
$engineName_array = array('google','yahoo','altaVista','excite','lycos ', 'ditto');
option value="ditto">Search -> Ditto
case "ditto" :
doSearch("http://www.ditto.com/search_results.asp?viewstyle=compact&ss=");
break;
I find that the most damndest part, is getting the search engines needed parameters... as somtimes, the only effective way of doing it, is viewing their page source, and looking at their HTML FORM keys.
Doing it the URL way though, should be fine for most of the time.
Happy searching.
DestyNova
08-10-2002, 04:50 PM
wow, great can you update your hack?
tHE DSS
08-10-2002, 04:58 PM
Hiya, DestyNova.
I would update the hack, but i'm not sure that the majority of people would like Ditto.com as part of the default installation.
If I was to be told otherwise, then yeah, i'd certainly update it.
If it is the Ditto.com engine that you would like, but feel that you might not be able to follow the above guide fully, then PM me an email address, and i'll send you an edited copy, with the Ditto.com added.
Schorsch
08-10-2002, 05:33 PM
works great :) thank you very much "tHE DSS" !!
NTLDR
08-10-2002, 07:19 PM
Great hack tHE DSS, I'll be installing this onto my forum soon :)
Destee
08-10-2002, 08:44 PM
Thanks tHE DSS!
Installed easily with no problems!
Destee
hypedave
08-10-2002, 09:29 PM
Hey DSS thanks, that update wasnt so painless to add, only took me bout 2min, and now I can get a clue as to what kind of avatars my members like, keep up the good work
Erwin
08-10-2002, 09:52 PM
This is a wonderful hack, which I will install when I have time! Good work!
MrLister
08-10-2002, 10:08 PM
Great job! Very useful
tHE DSS
08-10-2002, 10:22 PM
Cheers everyone... i'm so glad to of helped so many. :)
freeshares1
08-10-2002, 10:35 PM
I guess i must be doing something wrong, I have followed the instructions but the search bar does not show up, My board is heavily hacked would this make a difference??
www.gamblingforums.net/vbportal/forums/index.php
thanks in advance for any help you could offer
tHE DSS
08-10-2002, 10:44 PM
Hiya, freeshares1.
I've just been to your forums, and can see the search bar.... in-fact, I can see two of them.
One looks ok (the 2nd), but the one above that, doesn't seem to quite fit.
A screenshot is in this post, of what I see at your forums.
Do you have several template sets installed? If so, you'll want to add the $search_the_internet bit into each template... basically follow that instruction from the 'install.txt' for each template.
Obviously, just follow the step that tells you where to put the $search_the_internet variable.
freeshares1
08-10-2002, 10:54 PM
Thanks, I have now sorted out the 2 and only have one. However it is only visable to guest. I have Pm'ed you a test account for you to see.
tHE DSS
08-10-2002, 11:08 PM
Right, I see what you mean.
First though, whilst logging out, your forum tried to re-direct me to a 'newhome.html' page, or somthing... but it doesnt exist (error 404).
Anyway, back to the hack :
Do you have more than 1 template set?
You get your forums with 'Default', but did you add anymore, and if so, do you use them?
If so, you'll need to add the search_the_internet template to each set that you want the search bar to display on, and add the $search_the_internet variable to the $footer template of each template set.
If the above is happening, then Guests see one template, whilst members can see others.
Check that out first before we start diving into your vB scripts.
If doing the above gives no joy, then it could be because of the many previous hacks you have installed.
Maybe, the bit in the 'global.php' script where you need to place the parsing of the search_the_internet template is being caught inside a $userinfo[usergroup] decision, wherby it only "happens" if the "$userinfo[usergroup] == 0"... which is Guest.
freeshares1
08-10-2002, 11:13 PM
Thanks, I only have 1 template set so i will have a look at global (tomorrow as it's really late now) I will also upload my global.php
tHE DSS
08-10-2002, 11:32 PM
I think vB may not like you attaching licensed scripts. :) Best to get rid of it... it's ok, i've seen it and found the problem.
I was right about the "if Guest" thing.
Here is what I see :
if ($bbuserinfo['userid']==0) {
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
...
...
...
So, replace this :
if ($bbuserinfo['userid']==0) {
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
eval("\$vbpopup .= \"".gettemplate('vbpopup')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");
} else {
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");
}
... with this :
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
if ($bbuserinfo['userid']==0) {
eval("\$vbpopup .= \"".gettemplate('vbpopup')."\";");
}
eval("\$footer .= \"".gettemplate('footer')."\";");
I've cleaned up that chunk of code for you at the same time - there was no need for the "decisions" to be arranged like that... my changes will make my hack/add-on work for all usergroups, and will give better peformance of your 'global.php'... not much mind.. but it's better.
Backup your 'global.php' file first, before you do the above... just in case.
ryancooper
08-11-2002, 02:48 AM
Great Hack Thansk!~
Schorsch
08-11-2002, 03:30 AM
Hi,
one question, how can I do it that it's only viewable for registered and logged in Members ?
thanks,
Schorsch
Aaron RV
08-11-2002, 05:58 AM
:disappointed:
step 1 = ok
step 2 = ok
step 3 = ok
step 4 = ok
step 5 = ok
After in my search_bar:
Database error in vBulletin 2.2.6:
Invalid SQL: INSERT INTO zz_sti_log (logid,userid,username,searchstring,searchengine,i paddress,timedate) VALUES ('NULL','4','****','****','yahoo','ip... | no proxy detected','1029048553')
mysql error: Table '******_net.zz_sti_log' doesn't exist
mysql error number: 1146
:dead:
tHE DSS
08-11-2002, 10:39 AM
Schorsch, i'll reply to you in the next post.... i'll just do Aaron RV first, because that error could leave him "open".
Aaron RV, do you want to keep the optional search logs?
If so, from STEP 05, you skip STEP 05.5, and go onto STEP 06, where you create the table logs.
What you haven't done, is put the 'createSTI_table.php' script into your 'admin/' directory, and run the script, and clicked 'YES! Create The Table'.
Go from STEP 5, then SKIP STEP 05.5, and follow from STEP 06. You should be ok from there.
If you DO NOT want to keep the optional search logs, then you need to DO STEP 05.5... wherby you "comment out" the line the 'install.txt' tells you to.
The line(s) you are looking for, are in the 'websearch.php' script, and look like this :
// comment out the following line, if you do not wish to keep search logs.
$DB_site->query("INSERT INTO
So, if you are NOT wanting to keep the optional search logs, where you see the above lines in the 'websearch.php' script, put TWO forward slashes ( // ), like this :
// comment out the following line, if you do not wish to keep search logs.
// $DB_site->query("INSERT INTO
The line here, $DB_site->query("INSERT INTO, is truncated here, to save space... but you'll find that line ok in the script.
tHE DSS
08-11-2002, 10:52 AM
Schorsch, to make it so that only Registered & Logged In members can see the search bar, find these lines in your 'global.php' script :
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
... and replace with :
if ($bbuserinfo[userid] != 0) {
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
}
That will do it.
But, letting Guests use the search bar aswell, may actually help you, if you are keeping search logs. Because, you can track down what Guests are searching for on their way out of your site..... then maybe you can adjust your site to appeal more. ;)
Schorsch
08-11-2002, 05:42 PM
Hi tHE DSS,
that doesn't work, guests still can see the search bar.
what can I do ?
cu
Schorsch
tHE DSS
08-11-2002, 05:57 PM
Sorry, Schorsch, please accept my apologies.... I made a slight typo.
I've now edited my post where I showed you how to make it for non-guests only... if you now replace the stated code with the now stated replacement code, it will work.
Again, sorry dude.
Schorsch
08-11-2002, 06:04 PM
jep, works now :) thank you very much, great hack !!!
best regards,
Schorsch
tzlvazrael
08-11-2002, 09:00 PM
Stoopid question...
Anyway to get this to show up in the header rather than the footer???
I tried putting the $search_the_internet in the header template, right after <!-- /content area table --> but it did not show up in the header...
Thanks
tHE DSS
08-11-2002, 09:37 PM
In your 'header' template, you need to look for this :
<!-- content table -->
The :
<!-- /content area table -->
... which you speak of, should be in your footer, so you don't want the '$search_the_internet' in your footer, if you want it in your header.
So, find this line in your 'header' template : <!-- content table -->
... and then above that, place : $search_the_internet
You are going to need to also change where your 'global.php' script "calls in" the 'search_the_internet' template.
Open up your 'global.php', and find the bit from this hack that you've place in it, as displayed below :
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
... CUT that out, and place it above this :
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
Then save your 'global.php' file, and that will do it.
As long as you do have the $search_the_internet variable inside your 'header' template, this will work to get the search bar in your header, rather than your footer.
tzlvazrael
08-11-2002, 09:44 PM
Works like a charm...
Thanks a million.....
mauisun
08-11-2002, 10:00 PM
I added this hack, added 6 new search sites to it and everything worked perfectly. thanks alot for a great hack! :)
...mauisun
tHE DSS
08-11-2002, 11:02 PM
All more than welcome. :Wink:
Smoothie
08-12-2002, 01:18 AM
tHE DSS-
Hi! I want this show on my main page, not the forums. Anyway to get this to work? I had it in the footer of my forums, but I have sinced moved it to my main page. It obviously won't work there, I get a websearch.php not found.
Smoothie
08-12-2002, 01:23 AM
never mind. :)
tHE DSS
08-12-2002, 06:04 AM
Just an issue with file paths..... but, you sussed it already. :cool:
Smoothie
08-12-2002, 06:28 AM
Yes, I moved it to the front page, right side. Looks good. Great job, appreciate it. :)
Very Nice tHE DSS
It makes a great addition to the welcome panel. ;)
Thanks
Big M
08-12-2002, 09:58 AM
Nice hack, easy to install, works well.
Thanx for your time & effort.:)
tHE DSS
08-12-2002, 03:55 PM
Excellent. :)
I've looked at all the sites that I can find a URL for, to see this working at your places..... i'm impressed with everyone... thanks all for installing. :)
blackice912
08-12-2002, 10:49 PM
* blackice912 likes and will use :)
morrow
08-13-2002, 07:35 PM
This is a really nice hack. I just installed it and everything seems to be working great.
Check it out:
http://www.njflyfishing.com
tHE DSS
08-14-2002, 12:14 AM
All doing me proud. Thanks for installing. ;)
Attrox
08-15-2002, 08:42 PM
Oh wow, I've been looking for this for quite awhile now. Nice job. :)
joebow
08-16-2002, 05:29 AM
Cool hack! Easy to install .... Nice Job!
memobug
08-18-2002, 07:47 AM
Great idea! This looks really useful. I am thinking of a little bit different use.
Shouldn't the default really be to search the forum itself? Anyway, I am thinking of using this also to search my own photopost database of pictures, and my links database, but I will probably make the default a simple search of the forum.
Some notes:
1) I found each template (both search_the_internet and search_the_internet_window) have what appears to be a few instances of the same minor html bug: Each has a few, I believe three instances of valign="center". and the actual options for the valign tag are "bottom" "middle" or "top", so it probably should be "middle?"
2) If you do decide as I did to make the default search option a search of your forum, you may find this useful:
add this case option to websearch.php with the others:
case "myforum" :
doSearch("http://www.yourforum.com/search.php?action=simplesearch&sortby=lastpost&sortorder=descending&forumchoice=-1&searchdate=-1&query=");
break;
Then, open the search_the_internet template and replace the
<option value="google" selected>Search--> Google
bit with the following:
<option value="myforum" selected>Search -> Your Forum Name Here
<option value="google" selected>Search -> Google
That will make a simple keyword search of your forum the default search
3) Then, if you'd like to change the layout a bit to what I found to be a little more straightforward presentation, you can get rid of all that Search -> This engine stuff in the pulldown and insert the word Search as a text label for the box. You can see it in the footer at http://forum.bonsaitalk.com but it looks like
Search for: [ input box ] Search in: [ pulldown box ] [(go button)]
I think that's cleaner anyway, plus moving the submit button (which I relabled Go! to a position right next to the pulldowns.
4) Somewhere I have some Javascript for a pulldown that doesn't require a GO! button. That might be even better since this is a Jscript menu anyway. I'll look around.
5) Here's another one you'll definitely want to add, especially if you are Amazon Affiliate:
add to the case statement in websearch.php, replacing the "tag=" part with your own affiliate ID, or use mine, heck I don't care!
case "amazon" :
doSearch("http://www.amazon.com/exec/obidos/external-search?mode=blended&tag=wwwbonsailinn-20&keyword=");
break;
default :
and modify your search_the_internet template accordingly:
<option value="amazon" >Search--> Amazon
Fun Hack!
Regards,
Matt
tHE DSS
08-18-2002, 10:32 AM
For sure. ;)
I like what you've done.
I didn't have the "search forum" in there, or as default, because there are already options for that. I simply wanted a "search the internet" add-on.
I'll certainly consider your suggestions for the next version, though, each to their own tastes.
Nicely done though.
memobug
08-18-2002, 05:55 PM
A mod for online.php to clean things up a bit. This will decode websearch a bit
1. in online.php find:
case 'gallery':
$userinfo[where] = "Viewing Picture <a href='gallery.php?s=$session[sessionhash]'>Gallery</a>";
break;
case 'spider':
$userinfo[where] = "Search Engine Spider";
break;
Add after that:
// mec 081802 start print websearch
case 'websearch':
$userinfo[where] = "<a href=\"$userinfo[location]\" TITLE=$userinfo[location]>Using Websearch Function</a>";
break;
2. Next find case 'attachment.php':
if (strstr($token1,'postid')) {
$blowup = explode('=', $token1);
$postid = intval($blowup[1]);
$postids .= ",$postid";
} else if (strstr($token2,'postid')) {
$blowup = explode('=', $token2);
$postid = intval($blowup[1]);
$postids .= ",$postid";
}
and insert BEFORE it: case 'websearch.php':
$userinfo[activity] = 'websearch';
break;
You can of course, omit the comment, change the date or use your own initials. This is just a technique I use to find mods later.
3) Test it out. When a user uses this search function, you should see something like
Using Websearch Function (with the Function hotlinked to the search, and if you hover on it you will be able to see the search url, of course you could read that out of the "explorer bar" at the bottom of the browser, anyway)
Regards,
Matt
memobug
08-18-2002, 06:32 PM
If you have a site you'd like to include that has no built-in search engine to reference, you can still include it by using one of the features of the Google site that allows it to search within a domain.
1. Add this to the websearch.php case statement. Please note the space after the ".com " That's important!
case "newsite" :
doSearch("http://www.google.com/search?q=site:thatdomain.com ");
break;a) replace thatdomain.com with the domain to be searched; no "http://www" required!
b) replace newsite with a shorthand name for the site if you'd like.
2. Add this to your template along with the other options
<option value="newsite">Site Title
a) replace newsite with the name you used in 1.b) above
b) replace Site Title with the name you'd like to appear for this search.
3. Test it out
You will get a Google screen with a listing for the site of interest
Regards,
Matt
tHE DSS
08-18-2002, 07:21 PM
That's very cool. Cheers man.
I was supposed to include the bit in the install.txt file about putting the "Searching The Internet"..... stuff, so that is ouput in Who's Online, but some-how forgot. :cry: I felt like a right t**t afterwards.... well, when I realised.
I'm trying to fastrak a vB installation, working alongside, and with a 2nd database for the normal website area, so time is pretty short for extra vB type work, so, in the meantime, it's recommended you implement that above from memobug.
:)
memobug
08-19-2002, 03:29 AM
After getting this form working well in the footer, I tried moving it to the header template, but couldn't get anything to display.
I thought it might be a conflict with the form having the same name in the footer, so I stubbed out the footer and tried again, but still no display.
I had the word TEST displaying where I wanted it, then I changed out TEST for $search_the_internet, expecting to see the form, but no dice. I then tried putting it in its own table row. Still no form
Any ideas?
Regards,
Matt
tHE DSS
08-19-2002, 04:05 PM
To get this to display in your header, you'll need to replace the location of the "calling of the template" in your 'global.php' script.
This bit :
// parse tHE DSS, Search The Internet template (global)
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
... should be place ABOVE this (in the 'global.php') :
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
It should work then.
2 X Viverridae
08-20-2002, 10:27 AM
Very slick hack, thanks a bunch!
Installation was easy, and your responses in this thread were both quick and helpful.
I have made it so the default search is my own forum, it's darn handy having it all right in one spot, with the option of users going to the advanced search if they wish.
1 question though - how would I make it so that when searching within my site, have it NOT launch in a new window, but use the existing one?
tHE DSS
08-20-2002, 04:06 PM
Hiya,
Inside the "search_the_internet" template, exists the HTML form... the opening FORM tag has as one of it's parameters "target="_blank", this is what causes the searches to open up in a new page.
The reason being, people may be posting a thread, a reply, doing a PM, or simply just want/need to stay in the same screen, but they need to search somthing at the same time.
If you just wanted it to load into the same browser window, just for your forums search, then you'd need to take out the "target="_blank" paremeter from the FORM tag, and then inside the 'websearch.php' script, we'd need to add some JavaScript to pop-up a new window, if the search wasn't for your forum.
I don't like adding JavaScript pop-ups, as they can be un-reliable. But that would be the solution.
The main consideration would be, visitors needing to stay in the same screen, and do a search at the same time... you'd overwrite what they were doing.
It's upto yourself though. ;)
2 X Viverridae
08-20-2002, 09:21 PM
Hmm - good point - I have a nasty habit of thinking about how *I* would do things, and generally I hate new windows... :D
However, putting myself in the position of the average end user, I can see how a fresh window would be a good idea. I'll leave it as is for now, thanks.
dreamhost
08-23-2002, 06:20 PM
i love this one, been using it for a while now http://www.annointed.net/forums/index.php
Grunt
08-25-2002, 01:20 AM
Another satisfied customer here...thanks!
Destee
09-22-2002, 09:12 PM
A note to thank Memobug for his additions to this hack. I've added them! :)
tHE DSS ... one question ... after making Memobug's additions, I edited stistats.php so the new engines could be logged (outside of 'unknown') and they are showing up because I moved them to the front in stistats.php ... 'myforum','network','amazon','google','yahoo','alt aVista','excite','lycos' ... but 'altaVista', 'excite', and 'lycos' are being logged as 'unknown' (even though they are listed, showing 0).
I reloaded my original stistats.php and altaVista, excite and lycos are showing up again. It seems that the logs are only wanting to count the first 5 engines and defaulting to zero and unknown for any beyond that point<?>.
Any reason why, if I've done everything as I should?
No rush because it's just the logs (and they are logging / unknown) and everything else is working perfectly.
Great hack, thanks a bunch.
Destee
tHE DSS
09-22-2002, 09:42 PM
Locate this bit, in the 'stistats.php' script :
$engineName_array = array('google','yahoo','altaVista','excite','lycos ', 'ditto');
$engineCount_array = array(0,0,0,0,0,0);
$unknownCount = 0;
$engine_count=$DB_site->query("SELECT searchengine FROM zz_sti_log");
if (!$num_rows = $DB_site->num_rows($engine_count) <=0) {
while ($row = $DB_site->fetch_array($engine_count, MYSQL_ASSOC)) {
switch ($row[searchengine]) {
case $engineName_array[0] :
$engineCount_array[0]++;
break;
case $engineName_array[1] :
$engineCount_array[1]++;
break;
case $engineName_array[2] :
$engineCount_array[2]++;
break;
case $engineName_array[3] :
$engineCount_array[3]++;
break;
case $engineName_array[4] :
$engineCount_array[4]++;
break;
case $engineName_array[5] :
$engineCount_array[5]++;
break;
default : $unknownCount++;
}
}
}
Be sure that you have added the engines, and the default count to these two arrays :
$engineName_array = array('google','yahoo','altaVista','excite','lycos ', 'ditto');
$engineCount_array = array(0,0,0,0,0,0);
.. the default count should always be 0. The script will give false results otherwise.
And then, be sure you've added each engine to the case statement :
case $engineName_array[5] :
$engineCount_array[5]++;
break;
Each engine needs it's own "clause".
Destee
09-22-2002, 11:12 PM
tHE DSS ... thank you, that did it! :)
Another question if you don't mind ... is there an easy way to include / log the keyword searches done from the forum's main search page?
Also, I noticed that when doing a search of myforum from your hack, Who's Online sometimes lists it as "Searching Forums" with no link and sometimes it says "Using Websearch Function" with a link to search results. My concern is permissions and if Moderators and/or Admins do a search, will those results be available to others that don't normally have access to all forums.
Thanks again.
Destee
tHE DSS
09-22-2002, 11:29 PM
Glad you sorted it. :)
Regarding logging searches from your forums (using the vB supplied search functions), i'd say that some vB scripts would need a little hacking.
I'll look into that.
With regards to searching and Who's Online, I can't say i'm too sure. I think those modifications were made by memobug, and to be truthful, I haven't really studied it.
May be worth trying it out, by logging in as yourself, doing a search, and then taking the URL from the Who's Online link (right click the link, select Properties, and copy the URL).. log out, and then paste the URL into the address bar, and see what comes up.
Destee
09-22-2002, 11:51 PM
Thanks Again tHE DSS! :)
I've played with it some more and now am only able to get it to show the "Searching Forums" text (not linked). Hmmmm ... I would have swore I saw it linked earlier ... I'll keep watching it and maybe Memobug will post and put my mind at ease.
In regard to logging searches from the main search page, certainly at your convenience, as you've already given much!
:heart:
Destee
Dark Shogun
09-29-2002, 03:43 AM
Does anyone know how I can make it so this will also allow people to search the forum?
Dark Shogun
-=dm=-
09-29-2002, 07:30 PM
*install* :D:D:D
working fine on 2.2.4
I have a litle question, is it possible to change the colors of the search field?
see screen shot:
tHE DSS
10-06-2002, 10:50 AM
dm, try adding 'class="bginput"' to the INPUT tag in your 'search_the_internet' template.
Go into that template, and change this :
<input type="text" name="searchString" size="25" maxlength="255" value="">
... to this :
<input type="text" class="bginput" name="searchString" size="25" maxlength="255" value="">
... that should keep the colours consistent.
Dark Shogun, I think a few here have done what you are asking - I feel really really bad about not sticking around right now to expalain, but i'm way behind on a site upgrade. Have a look around this support thread, and see if somone has explained it.
kreftt
10-23-2002, 02:22 AM
great.
no problems at all and 2 minutes of installation.
working fine on 2.2.8.
thanx a bunch
Visionray
12-03-2002, 09:22 AM
great hack!
Slave
12-26-2002, 02:02 PM
Great hack :)
Just installed it on my 2.2.9 forum and works great ..
One thing though .. some users want it .. and some don't ..
So could someone please show me how to make it so people can pick if they want it or not via their control panel?
That would be cool .. :) .. cheers :)
attic
01-21-2003, 09:07 AM
Hey
Great hack!
I only want to replace the search buttons for imagebuttons to match my buttonset. Is this possible?
Thanks in advance,
hp
speednow007
01-21-2003, 02:50 PM
very nice!
Floris
02-02-2003, 07:23 PM
Originally posted by attic
Hey
Great hack!
I only want to replace the search buttons for imagebuttons to match my buttonset. Is this possible?
Thanks in advance,
hp
Yeah, you can do that since it is just plain html :) update the submit button to use a src image instead of default. see www.w3.org for howto html 4.
WoodiE
02-23-2003, 05:56 PM
I've installed it on 2.2.8 and it works PERFECTLY!
I love it, though one of my members brought up a really good suggestion. Instead of searching major search engines..is there away to search other sites?
For example instead of having google, yahoo, exite and so on listed. I would have like Circuit City, Best Buy, so on and so on. So a member could input say "Kenwood home theater" and select Best Buy...it would then search all of best buy for "Kenwood Home Theater".
Is this possible?
-WoodiE
tHE DSS
02-23-2003, 06:12 PM
Originally posted by WoodiE
I've installed it on 2.2.8 and it works PERFECTLY!
I love it, though one of my members brought up a really good suggestion. Instead of searching major search engines..is there away to search other sites?
For example instead of having google, yahoo, exite and so on listed. I would have like Circuit City, Best Buy, so on and so on. So a member could input say "Kenwood home theater" and select Best Buy...it would then search all of best buy for "Kenwood Home Theater".
Is this possible?
-WoodiE
Hiya, WoodiE.
I've not usually got much time lately to support this hack - but I do have a spare 5-10 minutes at the moment - you caught me at a good time.
Is the Best Buy website http://www.bestbuy.com ?
If so, i've been over there and did a search so that I could extract the URL properties for their search routine.
It seem that all you need is this :
http://www.bestbuy.com/search/sr01.asp?SV=
Read my post on this page :
https://vborg.vbsupport.ru/showthread.php?s=&threadid=42125&perpage=15&display=&pagenumber=2
... it will guide you on adding other search engines - you can use the Best Buy search engine to search their site.
WoodiE
02-24-2003, 01:56 AM
tHE DSS,
Man I can not thank you enough... I've modified it to fit my members needs, and they love it!
Thanks again!
-WoodiE
MuSuL
03-28-2003, 04:27 AM
For the love of me....I can't get a search engine to work with it. Can anyone give me a hand. I've been at it for hours.
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=Search&DB=PubMed
I'm trying to search the pubmed database via my site.
tHE DSS
03-28-2003, 04:39 PM
Hello. Thank you for installing.
The URL you will need is this :
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=search&term=
... the script will append the search query onto the end of that, and it works.
Cheers.
MuSuL
03-29-2003, 04:15 AM
Yesterday at 06:39 PM tHE DSS said this in Post #88 (https://vborg.vbsupport.ru/showthread.php?postid=374588#post374588)
Hello. Thank you for installing.
The URL you will need is this :
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=search&term=
... the script will append the search query onto the end of that, and it works.
Cheers.
Thank you...I'll give it a shot. BTW, is there somewhere I can click to increment the number of installs. I see it in the hacks section but I can't find it in this thead. Does it do it automatically?
MuSuL
03-29-2003, 04:21 AM
THANKS!!!! Worked like a charm. I couldn't find the variable name for the text in the box. You did though....thank you so much :D
MuSuL
03-29-2003, 05:14 AM
Oh....I just saw the install button. My apologies for not doing this. I will do it from now on :)
chipheodeptrai
04-01-2003, 04:58 AM
OK done...very cool hack
many thanks
PurpleCow
04-01-2003, 08:50 AM
Hey :
I just installed this hack...and noticed that the page(s) loads quite slow after the installation.
What i actually see is that after the installation of this hack....the page does load quite normally but the IE bar syill keeps reading and kind of browser freezes for a moment.
Anyone see this phenomenon happening at ur end ??
I suspect its because of adding the search functionality in the footer folder.......may be if its in another folder...the same problem may not arise !?
Thanks for the feedback !
Cheers
tHE DSS
04-01-2003, 01:16 PM
HostBubble, i've never had that happen, and i've been running this hack, well, since I wrote it, which is before I released it here.
I don't see why there is any reason this particular hack will cause the above mentioned problem.
Is it still happening?
PurpleCow
04-03-2003, 04:30 AM
DSS :
sorry, its fine now. I don't have that problem anymore.
I guess, its my connection being slow, which is taking time to load.
Sorry for that false statement above.
Cheers
AnaFreak
04-06-2003, 06:52 PM
Very Easy Hack, "clicks intall"
jbear6
04-06-2003, 09:30 PM
Thanks for an excellent hack tHE DSS, our members absolutely love it. Ours is primarily setup to search the MSU and OSU websites for animal health information on diseases, and treatments. I have been trying to add the online Merck Manual with no success. Are there some web sites that are impossible to search "outside" their webpage search system? This is the website I am trying to add to the list of search choices:
http://www.merckvetmanual.com/mvm/index.jsp
No matter what I try, I can't get it to search this website.
Thanks
Jbear6
tHE DSS
04-06-2003, 10:54 PM
Hiya, jbear6. Thank you for installing.
Well, i've been at this for about 20 minutes, and Jesus, this one is tough!
One thing has hasn't helped is that websites Java Servlet approach! It's rather slow and prone to being very un-helpful when trying to "hack" it. :D
I can't seem to manage to get the output fully. But I have managed the following :
http://www.merckvetmanual.com/mvm/servlet/CVMSearch?searchType=0&searchSubType=-1&startIndex=0&numResults=10&hilightTerm=null&queryText=
... put that as your search URL, and it should work. But, the whole website design won't show, only the results.
If that will do, then bless you.
jbear6
04-07-2003, 12:38 AM
That will do, and thank you so very much :)
It works like a champ!
Jbear6
gmarik
04-22-2003, 05:10 AM
So it should work on 2.3.0 as well?
If so, it is a great submission, looking forward for more soon to be...?!
tHE DSS
04-22-2003, 07:28 AM
It should work until vB3 is released.
heynurse
04-23-2003, 10:35 PM
tHE DSS,
Awesome hack! I have already added a MEDLine plus search to my hack, but I'd love to have the following site added, and for the life of me, I cant figure out the correct search string, can anyone else help me figure this one out?
http://www.merck.com/pubs/mmanual/sections.htm
Any help would be appreciated! Thanks
tHE DSS
04-23-2003, 10:53 PM
Hiya.
Quick and dirty, you can use :
http://webseek.merck.com/query.html?qp=%2Burl%3Ahttp%3A%2F%2Fwww.merck.com% 2Fpubs%2Fmmanual+-url%3Ahttp%3A%2F%2Fwww.merck.com%2Fpubs%2Fmmanual_ home&searchbutton.x=16&searchbutton.y=8&qt=
... all of that is already URL encoded... but it should work in the PHP strings.
ps... right click that link, and take the full URL from the "properties" pop up menu.
heynurse
04-24-2003, 05:26 AM
tHE DSS,
you rock, my users love this hack!!!! Thanks a ton for your help with the search string!
heynurse
05-01-2003, 06:38 PM
Does anyone know if it is possible to have this search tool bar on NON-vbulletin pages? I'd love to add this search tool bar in the footer of every page of our site. Any ideas? Thanks
Again, this is a great hack!!!!
Crazy Pete
05-04-2003, 05:44 AM
This hack is really excellent, and I installed it. The only thing that's odd is the table for the "Search The Internet" bar is slightly wider than the rest of my tables on the page. I'm sure it's just something stupid that I'm overlooking, but can anyone tell me how to get them to match up? Thanks.
Crazy Pete
05-05-2003, 07:59 PM
Nevermind, I got it. I Just changed the tablewidth parameter from{contenttablewidth} to 80% and it looks better now.
Alien
05-18-2003, 09:37 PM
I take it there wouldn't be a problem if I just wanted to stick this into the already available search template instead of at the footer of every page? I'd really rather not put it on every page, just as an add-on into the search area built into vB.
Thanks. :)
tHE DSS
05-18-2003, 09:44 PM
No, it shouldn't cause a problem.
Just put the :
eval("\$search_the_internet = \"".gettemplate('search_the_internet')."\";");
... that usually goes in the "global.php" script into the script that will be showing the search bar.
There is no point in having the database do extra work on pages that are not using the search bar.
Even though the resource saving is very slight... may aswell do it.
Alien
05-19-2003, 12:24 AM
Thanks for the quick reply! I'll give it a try and let you know how I make out!
-Jason
Alien
05-19-2003, 02:07 AM
Just a heads up.. If anyone chooses to make this part of the search.php as I had requested above, make sure you also add:
,search_the_internet
...to the $templatesused section at the top of search.php
This will reduce one query. :)
Alien
05-19-2003, 07:06 PM
Works AWESOME, I've been enjoying adding searches to the site such as eBay, Price Grabber, etc. 8 so far!
Would you have any idea how to add CompUSA, Fatwallet.com forum search (not the top one that searches google), and imdb.com search? Can't get those to work.
Thanks!
-Jason
atomic fireball
07-31-2003, 09:24 AM
AWESOME HACK!
Just wanted to say thanks for producing such an excellent hack. We've placed this on our forums in the header in a quick search box that includes our forum, internet search engines and some retailers as well.
Here's the look of the search box from our fourms after a little tweaking:
http://www.thedigitalreview.com/forum/
Great hack, thanks again!!
PurpleCow
07-31-2003, 01:37 PM
I have already installed this hack and did a bit of customisation, its a very nice one.
Okay, i guess, it is possible to add another new search engine to search along with the already available 5/6 engines.
But, bot sure, how to go about adding the new engine to the list.
I would also like the stats to appear for the newly added engine in my admin section, just like i can see stats for other already included engines also.
tHE DSS - could you help me with the changes, i have to do to include a new search engine and in what fines, i'll have to do the necessary changes ??
Thank you very much
Cheers
Also a Suggestion :
Currently the search results ( SERPs - Search Engine Result Pages ) are the actual pages from the respective search engines. Is it possible to make the search results appear on our custom forum pages itself instead of on their(SE's) own SERPs ??
Thank you
tHE DSS
07-31-2003, 07:27 PM
Glad you're liking the hack.
HostBubble, on the 2nd or 3rd page of this thread there is an instruction set on adding new search engines, it also covers the admin part.
With regards to the last bit, SERPS, I didn't quite follow what you're saying. :banana:
PurpleCow
08-01-2003, 04:58 AM
tHE DSS - Thank you.
The suggestions part is something like this :
Currently, when a search is performed on any avilable Search engines on this hack...let say, i search on Google (In this hack ) for widgets, the search results are displayed as if we did a search on google itself.
What i suggested was, isn't it possible to make the search results appear on our custom pages ??
Thanks
klaattu
10-06-2003, 03:27 AM
"clicks" install
THANKS GREAT HACK !!!!
Only one minor problem my text color is black and also the header table is black so the Shaerch the internet title dioes not show up !!!
Can you change the color of the text so it shows on style slike mine?
take a Look:
www.auto-mania.com.mx
thanks again
klaattu
10-06-2003, 03:38 AM
Ok I already fixed it, doh I was looking at another template!!
By the way If someone wants it in Spanish E mail me and Ill send you the translated templates..
Thanks again
GREAT hack! :)
klaattu
10-07-2003, 03:31 AM
HELP here is a real problem I have, the hacks works perfectly and it searches ok but I get this legend at the very top of the Vbulletin pages:
Warning: Cannot modify header information - headers already sent by (output started at /home/automani/public_html/foro/upload/global.php:377) in /home/automani/public_html/foro/upload/admin/functions.php on line 1707
My guess is that when I edit the file (global.php) with the web editor (in my browser) it somehow changes something and makes the error.
The problem is that I am Using a Mac G5 and if I copy and paste the php text into an editor it somehow changes the file and when I upload it it doesnt work...
Any sugestiosn, maybe someone can e mail me the global.php hacked file and Ill upload it, or maybe its the Vbanner control that is not incompatible...help because I really want to use this great Hack...
tHE DSS
10-07-2003, 03:28 PM
Hiya, klaattu.
I went over to your site the other day to see it working on your particular setup, and it all seemed fine.
What has happend since?
Do you have a backup of the files you edited, from before you hacked them?
If so, replace them for the hacked ones and try again.
If not, reverse the install process... but, keep a backup of what you currently have in case the reversal goes wrong.
If you've added any hacks or whatever since installing this Search The Internet hack, the problem more than likely lies with the latter hack(s) you installed.
It could be fixed if there is in-compatability, but the global.php file will need looking at by either myself or the author of the latter hack(s).
klaattu
10-07-2003, 03:34 PM
Thanks for the prompt response.!
Yeah it works (the search hack) perfectly but Iget the
Warning: Cannot modify header information - headers already sent by (output started at /home/automani/public_html/foro/upload/global.php:377) in /home/automani/public_html/foro/upload/admin/functions.php on line 1707
on top of the forum when I change the global file. I have backups soo I reloaded the original global file (no hacks to this file have been done previously sothe only things That I am considering are:
My mac is moving the code sigtly so I get an error with the text parsing
The Vbanners (that make changes to headers anf footers) hack interferes with it in some way.....
Ill try to put the search statement in another window or part to see if its related to the vbanners hack doing something at the footer, ill let you know...In the mean time any sugestions?
atomic fireball
05-30-2004, 03:57 PM
Any chance we could see this hack updated for vB3?
I love this hack, and after upgrading to vB3, I'm jonsin' to get this hack back up and running. Any info/help with getting this working with vB3 would be appreciated, thanks.
atomic fireball
06-03-2004, 09:56 PM
vB3 version? Anyone? :)
Gio~Logist
11-10-2004, 01:07 AM
nice hack, i might use it for every search engine, expecpt google, cuz if u get google adsense then they pay u when people use the engine ;]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.