date/time problem

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
sputtnik
Posts: 14
Joined: Mon 13. Dec 2004, 07:33

date/time problem

Post by sputtnik »

In my article template, i'm using the sample one, i have {DATE_ARTICLE} and (TIME_ARTICLE} in there and I still get the current date/time instead of those of the article. How do I go about fixing this? thanks.

Matt
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

include/inc_conf/conf.template_default.inc.php
$template_default["date"]["language"]="EN";
and in:
include/inc_conf/conf.template_default.inc.php
// date and time formatting
$template_default["date"]["language"] = "DE"; // DE=German, IT=Italian, FR=French
$template_default["date"]["long"] = "l, j. F Y"; // (Monday, 1. October 2003)
$template_default["date"]["medium"] = "D, j. M y"; // (Mon, 1. Oct 03)
$template_default["date"]["short"] = "Y/m/d"; // (2003/12/25)
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
$template_default["time"]["long"] = "H:i:s"; // 15:25:45
$template_default["time"]["short"] = "H:i"; // 15:25
and
$template_default["news"]["date_language"] = "DA"; // DE=German, IT=Italian, FR=French, ES = Spanish, DA = Danish, NO = Norwegian
$template_default["news"]["date_format"] = "Y/m/d: "; //if empty -> no Date
http://www.studmed.dk Portal for doctors and medical students in Denmark
sputtnik
Posts: 14
Joined: Mon 13. Dec 2004, 07:33

Post by sputtnik »

I have all of those set correctly. anything else?
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

The I dont remember....

Have you used the search function on this site?
http://www.studmed.dk Portal for doctors and medical students in Denmark
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

If you see

content.func.inc.php

you have:
$content["all"] = str_replace('{DATE_ARTICLE}', international_date_format($template_default["date"]["language"], $template_default["date"]["article"], $content["article_date"]), $content["all"]);
So it should be using:
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
$content["all"] = str_replace('{TIME_ARTICLE}', date($template_default["time"]["short"] , $content["article_date"]), $content["all"] );
Should use the same :D

so try to change:
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
http://www.studmed.dk Portal for doctors and medical students in Denmark
sputtnik
Posts: 14
Joined: Mon 13. Dec 2004, 07:33

Post by sputtnik »

when i make that first change only,
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)

i get an error:
Parse error: parse error, unexpected '=' in /home/anteyet/public_html/aenergy/include/inc_front/content.func.inc.php on line 357"

so that doesn't seem to work thanks for all the help by the way
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

what do you change it to?
http://www.studmed.dk Portal for doctors and medical students in Denmark
sputtnik
Posts: 14
Joined: Mon 13. Dec 2004, 07:33

Post by sputtnik »

i changed the line:
$template_default["date"]["article"], $content["article_date"]), $content["all"]);
to
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
right?
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

NO NO NO

If you want to change time format you need to change:
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
you need to change "Y/m/d"

to eg:
$template_default["date"]["article"] = "d/m/Y"; // (2003/12/25)
where:
d/m/Y gives you: day/month/year
like: 24/12/2004

For other times variables see: http://dk.php.net/manual/da/function.date.php
http://www.studmed.dk Portal for doctors and medical students in Denmark
sputtnik
Posts: 14
Joined: Mon 13. Dec 2004, 07:33

Post by sputtnik »

oh , i know that....but on the article it just shows the current time, as opposed to the time the article was created. i'm sorry
Post Reply