1 (edited by 2009-10-24 13:09:36)

Topic: [HACK] The Date Template

Name: The Date Template
Author: shubs
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Split the date data into seperate tags.
Open shows.inc.php and find 2 times

$output = str_replace("{date}", date($config_timestamp_active, $news_arr[0]), $output);

add below both

$output = str_replace("{year}", date("Y", $news_arr[0]), $output);
$output = str_replace("{month}", date("n", $news_arr[0]), $output);
$output = str_replace("{day}", date("d", $news_arr[0]), $output);
$output = str_replace("{hours}", date("H:i", $news_arr[0]), $output);

And use the new tags in your template(s)

of course if you want to change the way a specific data is outputed you'll have to do it yourself

date("d", $news_arr[0])

the bold token defines the output of the date function.
The different tokens (parameters) can be found here

Posts: 2

Pages 1

You must login or register to post a reply

CutePHP Forums → Hacks & Tricks / FAQ → [HACK] The Date Template