Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 251
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 101
Total: 101

Author Topic: date format  (Read 13340 times)

0 Members and 1 Guest are viewing this topic.

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
date format
« 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.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: date format
« Reply #1 on: July 02, 2008, 07:28:49 am »
Good idea.


Second part is found in the Sources/Classifieds.php
Search for countdown
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: date format
« 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.


Offline RCMF

  • Member
  • *
  • Posts: 5
    • View Profile
Re: date format
« Reply #3 on: October 26, 2008, 02:51:02 am »
thanks, a simple search and replace changed it in second.

Gerry

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: date format
« 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.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: date format
« 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: [Select]
<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: [Select]
  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';
 
  }
  }
  }

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: date format
« 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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: date format
« 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.

 

Related Topics

  Subject / Started by Replies Last post
7 Replies
5688 Views
Last post January 24, 2007, 08:58:17 pm
by mlinvin
Date format

Started by RCMF Support

6 Replies
7068 Views
Last post August 06, 2012, 04:28:30 am
by tank_fv101
20 Replies
12922 Views
Last post April 10, 2013, 10:02:19 pm
by SMFHacks
3 Replies
3089 Views
Last post June 26, 2015, 10:30:59 am
by SMFHacks
2 Replies
696 Views
Last post March 04, 2022, 04:20:54 pm
by Shades

+- Recent Topics

Please Help! by SMFHacks
Today at 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal