Support Forums

Adding a city class to the database

This is a discussion on Adding a city class to the database within the Customizations forums, part of the Developer Forums category; Hi, I would like to manually add a city class to the database. I am not sure if most people ...


Go Back   68 Classifieds Forums > Developer Forums > Customizations

Reply
 
Thread Tools Display Modes
Old 08-09-2010, 07:34 PM   #1
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 203
Rep Power: 9
EnergyFreak is on a distinguished road
Default Adding a city class to the database

Hi,

I would like to manually add a city class to the database. I am not sure if most people that had selectable cities from their sign up forms is how they did it, but I think this might a good way to do it without using a whole bunch of html. I basically need the mysql queries needed to insert cities into my class_cities including all the varchars or ints it requires for it to function correctly. I am still looking at guides on how to accomplish this. I am also studying our current database to see f I can just copy the state class and modify it.
EnergyFreak is offline   Reply With Quote
Old 08-09-2010, 08:06 PM   #2
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 203
Rep Power: 9
EnergyFreak is on a distinguished road
Default

I am starting to think that I would need the developpers version to add cities as a drop down instead of a text input... Because the states has the command showStates which I am guessing it goes and gets the states somewhere. I have tried to do the same for cities but it fetches nothing, even if I have created a class called cities and manually added some cities in the class. Can anyone confirm that this is possible?
EnergyFreak is offline   Reply With Quote
Old 08-09-2010, 08:16 PM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,005
Rep Power: 74
seymourjames is a jewel in the rough
Default

You might be able to just define a dropdown with fixed options (the list of cities). I am guessing you have a fixed list of cities which you would like people to register against.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds Version 5 Themes and Version 4 Templates
seymourjames is offline   Reply With Quote
Old 08-09-2010, 08:21 PM   #4
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 203
Rep Power: 9
EnergyFreak is on a distinguished road
Default

You mean like replacing this:

<label for="city">{if $req_city=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}{$smarty.const.LANG_USER_CITY}{$smarty.const.LA NG_COLON}</label>
<input {if $req_city=="Y"}class="required"{/if} name="city" type="text" id="city" value="{$city}" size="{$smarty.const.FIELD_SIZE}" />

with this:

<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
EnergyFreak is offline   Reply With Quote
Old 08-09-2010, 08:25 PM   #5
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,120
Rep Power: 63
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

That would be how you make a drop down list, but I don't know about the names of those cities. I've never heard of any of those cities.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-09-2010, 08:34 PM   #6
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 203
Rep Power: 9
EnergyFreak is on a distinguished road
Default

Quote:
Originally Posted by Mike-N-Tosh
That would be how you make a drop down list, but I don't know about the names of those cities. I've never heard of any of those cities.
That is because they are awesome cars

This is what I have so far and it is giving me a blank page:

<label for="city">{if $req_city=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}{$smarty.const.LANG_USER_CITY}{$smarty.const.LA NG_COLON}</label>
<select name="city" id="city" {if $req_city=="Y"}class="required"{/if}>
<option value="none"{if $city=="none"} selected="SELECTED"{/if}>{$smarty.const.LANG_STATE_NONE}</option>
<option value="Montreal" selected="SELECTED">Montreal</option>
{/section}
</select>
EnergyFreak is offline   Reply With Quote
Old 08-09-2010, 09:29 PM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,005
Rep Power: 74
seymourjames is a jewel in the rough
Default

Yes pretty much like like that. You probably just have an error in the logic or you are missing a closing brace.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds Version 5 Themes and Version 4 Templates
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
{New_Listings} Smarty Plugin - adding city and state LittleRascal Customizations 4 11-15-2009 04:54 PM
database error when adding user yusufm Technical Support 5 06-18-2009 08:53 PM


All times are GMT -4. The time now is 03:05 AM.


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