SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 23, 2012, 11:57:23 am

Login with username, password and session length
Members
Total Members: 10069
Latest: tetsujrock
Stats
Total Posts: 28682
Total Topics: 4975
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 53
Total: 53
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: date format  (Read 4301 times)
vkot
SMF Classifieds Customer
Full Member
*****
Offline Offline

Posts: 123


View Profile
« on: July 02, 2008, 05:19:35 am »

The date format should be customizable. In Europe we use the day before the month, so now I have to change by hand every "m/d/Y" to "d/m/y" in every date() function in classifieds.template.php. Also, I change "h:i a" to "H:i" because we don't use "am/pm" in Greece.
The type of format should be in a variable or constant, somewhere.

Also, how can I change the display of time left in the listings index? It shows something like: 107d 4h 21m. I want to change the letters d, h, m.
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #1 on: July 02, 2008, 07:28:49 am »

Good idea.


Second part is found in the Sources/Classifieds.php
Search for countdown
Logged
vkot
SMF Classifieds Customer
Full Member
*****
Offline Offline

Posts: 123


View Profile
« Reply #2 on: October 23, 2008, 06:07:24 am »

Continuing my thought, after seeing this post: http://www.smfhacks.com/index.php/topic,2958.0.html ...

The problem is that anyone who wants to change the date format has to do these changes everytime Classifieds.template.php is updated (new version), and there are a lot of them changes! (date("m/d/Y appears many times in the script)

One simple thing would be to put the date and time formats in constant variables, at the top of the script.

Logged
RCMF
Newbie
*
Offline Offline

Posts: 5


View Profile
« Reply #3 on: October 26, 2008, 02:51:02 am »

thanks, a simple search and replace changed it in second.

Gerry
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #4 on: November 15, 2008, 02:10:36 pm »

Added to 1.2.13 of classifieds to allow more customization of the date format.
Logged
vkot
SMF Classifieds Customer
Full Member
*****
Offline Offline

Posts: 123


View Profile
« Reply #5 on: November 17, 2008, 03:01:27 am »

You have to change the admin listing form too (index.php?action=classifieds;sa=adminlisting) because the date format is hardcoded to m/d/Y. For example:

Code:
<input type="text" name="month1" size="2" value="1" />/<input type="text" name="day1" size="2" value="1" />/<input type="text" name="year1" size="4" value="2007" />
- <input type="text" name="month2" size="2" value="',date("m"),'" />/<input type="text" name="day2" size="2" value="',date("d"),'" />/<input type="text" name="year2" size="4" value="',date("Y"),'" />

Also, the letters 'h', 'm', 's' should be in the language file...

Code:
  if ($days_left > 0)
  {
  echo $days_left . 'd ' . $hours_left  . 'h ' . $minutes_left . 'm';
  }
  else
  {
  if ($hours_left > 0)
  echo $hours_left  . 'h ' . $minutes_left . 'm';
  else
  {
 
  if ($minutes_left > 0)
  echo $minutes_left . 'm ' . $seconds_left . 's';
  else
  {
  if ($seconds_left > 0)
  echo  $seconds_left . 's';
 
  }
  }
  }
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9676


View Profile
« Reply #6 on: February 15, 2010, 03:18:42 pm »

Not sure how I want to handle the admin area to change the listings.
Did do the second part
!Date characters for h d m s for countdown timer moved to language file
Logged
vkot
SMF Classifieds Customer
Full Member
*****
Offline Offline

Posts: 123


View Profile
« Reply #7 on: October 26, 2011, 04:17:40 am »

You have to change the admin listing form too (index.php?action=classifieds;sa=adminlisting) because the date format is hardcoded to m/d/Y.

There is already a "date format" setting in smfclassifieds settings, so, it can be used for the admin listing form too.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]

[May 17, 2012, 12:38:16 pm]

[May 15, 2012, 09:32:27 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.243 seconds with 19 queries.