Change the way the news looks and how to change date format

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
JohnDubya
Posts: 9
Joined: Sat Jul 08, 2006 12:14 am

Change the way the news looks and how to change date format

Post by JohnDubya »

How can you format how the news on the front page looks? I can't find a .tpl file that has that information.

Also, how can I change the date/time format that shows up to describe when an article or news piece was written? I don't want 24 hr. time.

Thanks in advance!
JDub

Find useful information online for a ton of different topics!
http://www.johnnyzone.com
Thorsten
Posts: 15742
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Change the way the news looks and how to change date for

Post by Thorsten »

Hi,
JohnDubya wrote:How can you format how the news on the front page looks? I can't find a .tpl file that has that information.
you can change that in the style.css file.
JohnDubya wrote:Also, how can I change the date/time format that shows up to describe when an article or news piece was written? I don't want 24 hr. time.
hm, which format do you want?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
JohnDubya
Posts: 9
Joined: Sat Jul 08, 2006 12:14 am

Post by JohnDubya »

I checked in the style.css file, but I couldn't find formatting options in there.

I would like to have the time listed in 12 hr. time (8am shows as 8:00 am and 6pm shows as 6:00 pm instead of 18:00).

Thanks for your help!
JDub

Find useful information online for a ton of different topics!
http://www.johnnyzone.com
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
JohnDubya wrote:I checked in the style.css file, but I couldn't find formatting options in there.
I'm not a CSS expert but I'm not sure that there are CSS attributes for doing L10N.
JohnDubya wrote:I would like to have the time listed in 12 hr. time (8am shows as 8:00 am and 6pm shows as 6:00 pm instead of 18:00).
You need to hack the makeDate function: please locate, open and backup the file [PATH_TO_PMFINSTALL]/inc/functions.php, locate the makeDate function and replace this line:

Code: Select all

...
    return date("Y-m-d H:i", $timestamp);
...
with this one below:

Code: Select all

...
    return date("Y-m-d g:ia", $timestamp);
...
See PHP date format string for futhers details.
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Thorsten
Posts: 15742
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

a news entry looks like the following:

Code: Select all

<h3><a name="news_1">phpMyFAQ 1.6.0 beta Released!</a></h3><div class="block">The first beta release of phpMyFAQ adds some new features.
</div><div class="date">2006-03-05 07:19</div>
Just take the CSS classes and set the attributes in style.css.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply