Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Documentation and How To's:
Sort By City
DoocesWild



Joined: 28 Jan 2007
Posts: 26
Location: Eugene, OR

Posted: 02/02/07 20:17 
Hello,
I have barely even installed JR and am still learning things (still haven't really understood the difference between accounts and quotas and such) but was wondering if it's possible to have something on your main index page that you can click dropdown menu and have a few cities in the dropdown and have artists sorted by city? Thanks!

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/02/07 23:57 
You will want to take a look at the search query created in the side.tpl file on the artist theme pages. If you click on a band's location, jamroom will search for all artists in that city. You could model that search query and then use a jr_function like the jr_html_select function found here:

http://www.jamroom.net/Jamroom3_jr_html_select

to generate your dropdown list. Hope that makes sense!

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
DoocesWild



Joined: 28 Jan 2007
Posts: 26
Location: Eugene, OR

Posted: 02/07/07 00:38 

smith.kyle:
You will want to take a look at the search query created in the side.tpl file on the artist theme pages. If you click on a band's location, jamroom will search for all artists in that city. You could model that search query and then use a jr_function like the jr_html_select function found here:

http://www.jamroom.net/Jamroom3_jr_html_select

to generate your dropdown list. Hope that makes sense!

Kyle


It makes sense... sorta. I need like an ultra-beginner's guide to all of jamroom Smile

Anyway, can I use my locations.txt file as all of my options, and use

http://example.com/search.php?mode=retrieve&search_area=band_location&pagebreak=10&search_string=City%2C+State

I have all locations as "City, State". The above url is what I get when I go into a band's page and click the Location. I'd like a dropdown list of every single location in my list. Then when you click it, it just takes you to the searchpage of location: city, state.

I wish I could just do this myself, but I will be able to figure it all out soon enough!

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/07/07 00:47 
Check out this page in the docs:

http://www.jamroom.net/Jamroom3_Jamroom_Search_Engine

Basically what you will want to do is create a form with hidden fields, especially:

<input type="hidden" name="search_area" value="band_location">

And then just make your dropdown from the location.txt file, and make sure that the name for that is "search_string"

There's some examples on the page to show you some other things you can do that can hopefully help!


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
DoocesWild



Joined: 28 Jan 2007
Posts: 26
Location: Eugene, OR

Posted: 02/07/07 08:23 

smith.kyle:


And then just make your dropdown from the location.txt file, and make sure that the name for that is "search_string"


I'm almost there! How do I make my dropdown from a txt file? Or do you mean copy all the entries?

Then a new question, which I can have put into place after I figure a few things out: can I only have displayed cities where registered users actually live? I just want to know if it's possible, and if it's very difficult. But for now, Just figuring out how to make a search from txt is fine Smile

Back to top
DoocesWild



Joined: 28 Jan 2007
Posts: 26
Location: Eugene, OR

Posted: 02/07/07 10:07 

DoocesWild:

smith.kyle:


And then just make your dropdown from the location.txt file, and make sure that the name for that is "search_string"


I'm almost there! How do I make my dropdown from a txt file? Or do you mean copy all the entries?

Then a new question, which I can have put into place after I figure a few things out: can I only have displayed cities where registered users actually live? I just want to know if it's possible, and if it's very difficult. But for now, Just figuring out how to make a search from txt is fine Smile


Ok I got the options to be my txt file.

Back to top
DoocesWild



Joined: 28 Jan 2007
Posts: 26
Location: Eugene, OR

Posted: 02/07/07 10:55 
In case anyone has this issue in the future and happens to browse by this post, this is what I did.


Code

<form method="post" action="search.php" enctype="multipart/form-data">
<span class="small-txt-1">Select Your City:</span>
<input type="hidden" name="search_area" value="band_location">
{jr_html_select name="search_string" options="location.txt"}
<input type="hidden" name="mode" value="retrieve">
<input class="button"  type="submit" value="Go">
</form>

I know it's simple but I'm sure someone will run across the need for it in the future

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/07/07 11:07 
Glad to hear you got it!


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Sonny Bama



Joined: 23 Jul 2005
Posts: 939

Posted: 02/27/07 17:16 
Im trying to add a search by city as well, but I want it to be text input, so they just type in a city and perhaps a zip code and it will search all user/artists, but as far as I can tell, band_location does not serahc for cities, but only states,countries.
is there a way I can achieve this? ofcourse I would need to add city/zipcode to the signup form, and find a way for it become searchable.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 02/27/07 22:38 
If you change the possible locations for people to select from as being a text input, instead of a dropdown menu, then they can type in their city, and then people can search for cities.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Sonny Bama



Joined: 23 Jul 2005
Posts: 939

Posted: 02/27/07 22:52 
got it, that worked! Thanks!

Back to top
Sonny Bama



Joined: 23 Jul 2005
Posts: 939

Posted: 03/09/07 14:41 
ok.. on signup, I added to my signup template the folowing..

city:
state:
zip:

I added 3 new rows to my JR database user table like so.

user_city
user_state
user_zip

I did the same for band_info in the data base except its

band_city
band_state
band_zip

I added this to my signup.php



$_post['user_city'] = trim($_post['user_city']);

$_post['user_state] = trim($_post['user_state']);

$_post['user_zip'] = trim($_post['user_zip']);


it sends it to the rows in the jamroom_user table fine, now..should and how do I send it to band_city,band_state,band_zip and also, how o I edit my search.php to allow these new ables to be searchable?

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 03/09/07 14:46 
You probably don't want to do it that way. Add the custom fields into your Custom Form Fields in the jamroom config, and then pass those to the signup template and follow the examples it already has. That way you don't lose support functionality because the php files are customized.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Sonny Bama



Joined: 23 Jul 2005
Posts: 939

Posted: 03/09/07 15:41 
ok.. did what you said, it shows up in the database as it should after sign up.. but now how I make it searchable?

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 03/09/07 15:57 
You know...I'm not totally sure, I thought I saw this mentioned somewhere, but couldn't find the thread. I think if you set the search_area to the name of the custom field, it will work. We might need Brian on this though.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Documentation and How To's

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.