RSS 2.0
Browse posts:
Unanswered |
Mark all read
| Author | Message | ||
|---|---|---|---|
|
Monkeybrain Nucleus PhD Joined: 15 Dec 2005 Posts: 525 Location: Kristiansand, Norway |
How can I display the monthname from a given number, lets say 02, and get the output to be according to the blog locale setting? I'm currently using this:
It gives me the correct name of the month, but I would like to get back the correct value for the selected locale setting. Must be getting tired, I better go sleep on it Edit: Ok... this should maby be in another part of the forum, please move if so _________________ Is your question not solved yet? Search our FAQ, read the Documentation, or browse the list of available plugins. |
||
|
|
|||
|
ftruscot Nucleus Guru ![]() Joined: 22 Feb 2006 Posts: 7449 Location: Massachusetts |
Monkeybrain, sorry I missed this when you posted it. If I understand, you are getting the correct month name, but in the language of the server. You want it to get it according to the locale specified in the skin or template used by nucleus? If you still need help, let me know a little more about where you're using this. _________________ Is your question not solved yet? Search our FAQ, read the Documentation, or browse the list of available plugins. Check out my plugins |
||
|
|
|||
|
ftruscot Nucleus Guru ![]() Joined: 22 Feb 2006 Posts: 7449 Location: Massachusetts |
There's a PHP function called setlocale() that you should use. The issue is that locale is not stored in db as part of the blog object, so you can't pull it from there. One option, if this is a plugin, is to use a blogOption to set the locale per blog, then get that blogOption to use in setlocale() like this:
_________________ Is your question not solved yet? Search our FAQ, read the Documentation, or browse the list of available plugins. Check out my plugins |
||
|
|
|||
|
Monkeybrain Nucleus PhD Joined: 15 Dec 2005 Posts: 525 Location: Kristiansand, Norway |
Thanks Frank! I was going to use this in a plugin, yes, but I kinda figured out a way of achieving what I wanted by using setlocale() and using the server locale value. Guess it won't be of much use as most servers are configured using EN locale, even on my norwegian hosts server, so I guess I'l have to add an option like you mentioned. Thank you for the hint _________________ Is your question not solved yet? Search our FAQ, read the Documentation, or browse the list of available plugins. |
||
|
|
|||
|
|
|||
|
All times are GMT + 1 Hour
You cannot post new topics in this forum |
|||