Support Forums

state abbreviation

This is a discussion on state abbreviation within the Templates, HTML, CSS, and Design Help forums, part of the General category; In the showlistings.tpl i'm wondering if this: Code: {if $sDisState == "Y"} <td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.state}</td> {/if} can be altered to ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 01-08-2009, 10:40 AM   #1
Member
 
Join Date: Dec 2008
Posts: 55
Rep Power: 8
island1 is on a distinguished road
Default state abbreviation

In the showlistings.tpl i'm wondering if this:

Code:
 {if $sDisState == "Y"}
	     <td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.state}</td>
	     {/if}
can be altered to reflect the State Abbreviation insted of the full state name.

I know the data is already stored, just don't know the "name".

Thanks.
__________________
v4.0.9 Designer
island1 is offline   Reply With Quote
Old 01-08-2009, 11:26 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,175
Rep Power: 127
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Not sure I understand wht you are asking.

Are you saying you want to display the whole state name and not the abbreviation?

Since you have the designer edition you cant do anything at the code level so whats probably easiest would be for you to log into your sites admin, goto settings and "edit states", then edit each state and in the abbreviation field just put in the states full name.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-08-2009, 11:27 AM   #3
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,906
Rep Power: 56
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Yes, the database table has both the full name and the abbreviation. The abbreviation field is called "abbrev" which is in the {$PREFIX}_state table.

The bigger question would be is the abbrev field available to the template?
It seems that the listings are from the users table which does not store the abbreviation only the full name. So to be able to do what you want you would have to modify several things in order have that available and display in that template. None of which can be done with the Designer version as Larry states.

-Mike
__________________
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)] 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

Last edited by Mike-N-Tosh; 01-08-2009 at 11:30 AM.
Mike-N-Tosh is offline   Reply With Quote
Old 09-30-2009, 02:19 AM   #4
Member
 
Join Date: Apr 2009
Posts: 61
Rep Power: 6
JP2 Designs is on a distinguished road
Default

Quote:
Originally Posted by Mike-N-Tosh
So to be able to do what you want you would have to modify several things in order have that available and display in that template.
Hi,
so what do I need to modify for me to be able to do this?

Thanks
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own
JP2 Designs is offline   Reply With Quote
Old 10-04-2009, 10:41 PM   #5
Member
 
Join Date: Apr 2009
Posts: 61
Rep Power: 6
JP2 Designs is on a distinguished road
Default

Can anyone help me hear?
What I am after is the states to be abbreviated instead of the full state. I can change the settings in the admin area but it will only change the state for new listings, i want all new and current to be changed.
http://www.tradinghub.com.au/categor...a8daf535366f19

In other forum topics I have seen you need to add the abbrev table in the sql or something. Any help on what fies i edit etc?

Thanks
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own

Last edited by JP2 Designs; 10-04-2009 at 10:48 PM.
JP2 Designs is offline   Reply With Quote
Old 10-05-2009, 10:35 AM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,621
Rep Power: 64
seymourjames is a jewel in the rough
Default

You will probably need to edit your database using a tool like phpadmin. However, unless you are proficient, I would not advise you try to do this. The only other way which is safe is to start editing your listings manually using the 68C admin control panel. I believe this is possible and may only be practical if you have a modest number of listings.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Old 10-05-2009, 09:34 PM   #7
Member
 
Join Date: Apr 2009
Posts: 61
Rep Power: 6
JP2 Designs is on a distinguished road
Default

Yeah not really an option as we have over 700 items already (in just 3 months)...

In looking at past threads, there once was a bit of talk about State Abbreviations and Mike made a comment about editing a few files, I tried this but it did not work. Would this work and what would I need to do?

Adding Provinces and States by country
__________________
Jermayn Parker
v4.1.3 Developer
using deapsea as a template for hack m y own
JP2 Designs is offline   Reply With Quote
Old 10-05-2009, 11:15 PM   #8
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,449
Rep Power: 129
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Honestly if this is a must I would either do it one of three ways.

1. Create a custom smarty plugin that pulls out the abbreviation by the state name.
2. Create an include file with an array or state names and abbreviations. Then do some sort of replacement on that. This method would prevent multiple calls to the db.
3. Manually alter the registration and edit pages to use the code then do a manual search and replace in the db.

None of those options would be very simple but should point you in the right direction.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 10-06-2009, 08:53 AM   #9
curmudgeon
 
Join Date: Mar 2006
Posts: 5,175
Rep Power: 127
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by Eric Barnes
Honestly if this is a must I would either do it one of three ways.

1. Create a custom smarty plugin that pulls out the abbreviation by the state name.
2. Create an include file with an array or state names and abbreviations. Then do some sort of replacement on that. This method would prevent multiple calls to the db.
3. Manually alter the registration and edit pages to use the code then do a manual search and replace in the db.

None of those options would be very simple but should point you in the right direction.
And this is the exact reason VERY careful planning and preparation is needed before taking a site live. Its a lot easier to set your site up right the first time than it is to have to redo things AND mess with a load of data as well.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 10-06-2009, 10:43 AM   #10
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,621
Rep Power: 64
seymourjames is a jewel in the rough
Default

It happens to to of us Larry - need a Zen Cart genius at the moment that can make it speak French properly. LOL
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter on state wesse249 Technical Support 5 04-07-2008 10:19 AM


All times are GMT -4. The time now is 09:17 AM.


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