Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Search Help (http://forum.bytesforall.com/showthread.php?t=3647)

joestyer Sep 29, 2009 01:08 PM

Search Help
 
Hi
I just affiliated with a co-branded store and they asked me to an additional thing to my search box.

Add an option on your site search for searching the store.
To add a store-search option to your search widget, simply pass the search terms through a url formatted like the following (example search: “poker game”):
HTML Code:

http://your.store.url/home.asp?platform=0&sString=poker+game&cmdSearch.x=0&cmdSearch.y=0
Or, if you use google search you can simply create an option for searching the store subdomain.


Hi hope the above makes sense to someone because I do not have a clue on this one. If it is not possible to do with the embeded search plugin just let me know. I am at an absolute loss on this one.
My site is www.blackberrysites.com
my store is a subdomain http://store.blackberrysites.com

Thank you
Joe Styer

joestyer Sep 30, 2009 10:30 PM

Search Box Help
 
Hi
I just affiliated with a co-branded store and they asked me to an additional thing to my search box.

Add an option on your site search for searching the store.
To add a store-search option to your search widget, simply pass the search terms through a url formatted like the following (example search: “poker game”):

HTML Code:

http://your.store.url/home.asp?platform=0&sString=poker+game&cmdSearch.x=0&cmdSearch.y=0
Or, if you use Google search you can simply create an option for searching the store sub-domain.


Hi hope the above makes sense to someone because I do not have a clue on this one. If it is not possible to do with the embedded search plug-in just let me know. I am at an absolute loss on this one.
My site is www.blackberrysites.com
my store is a sub-domain http://store.blackberrysites.com

Thank you
Joe Styer

flaneur Oct 13, 2009 08:47 AM

Hi Joe. I may be able to help you on this one. Using form code in a text widget, I placed a custom search box on my blog.

It allows visitors to enter a search term, then searches Twitter traffic for those terms within a 15-mile radius of Bloomington, Indiana.

First, I had to get the url format of the search engine results. (It looks like you have this already in your post.)

Next, I added this form in a text widget to my blog:

Code:

<form name="form" target="_new" method="get" action="http://lafleurphoto.com/btweets.php">
<b>Search Bloomington Twitter traffic:</b><br />
<input name="btweets" type="text" /> <input type="submit" name="submit" value="Go" />
</form>

The last step was to create the PHP file that outputs the search in a new window, and save it in my directory as btweets.php:

Code:

<?php

if (isset($_GET['btweets']))
{
$search = $_GET['btweets'];

echo "<meta http-equiv=\"Refresh\" content=\"0; url=http://search.twitter.com/search?q=" . $search . "+near%3A%22Bloomington%2C+Indiana%22+within%3A15mi\">";
}
else
{
echo "You need to enter a search term";
}

?>

You can see it in action at the bottom of http://lafleurphoto.com/?p=118 . I'm certain this would work for your needs once you change the url in the PHP file. Note that you are passing 'btweets' from the form to the PHP function, so if you want to change it to another word, you have to change it throughout the PHP file as well. Hope this helps!


Michael LaFleur
www.lafleurphoto.com


All times are GMT -6. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.