Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
This displays post time as "13:07 17/11/2008". Of course, post matching with clocks will not work as well, though, unless you include $post['clock'] somewhere.
I appended the function in /themes/deco/template.php
but I got following error
Fatal error: Call to undefined function get_last_posts() in /sites/all/modules/tribune/tribune.page.inc on line 62
Hmm, are you sure you haven't touched anything other than your theme's template.php file? Because in no way could this cause this problem... maybe you should try to download the latest version and replace all the files in your modules/tribune folder.
I double checked also with tribune 1.8, now I don't get any error, but nothing changes with the time printed in front of each message (no date printing in front of time)
how do I add year/month/day to hour/minute/second related to the post-time in tribune?
the previous hack is not working anymore with 2.x-dev version.
any help is apprecciated
Comments
Comment #1
SeeSchloss commentedOkay so I've changed most of the code to use theme functions now, so you could just implement in your theme a function like this for example :
This displays post time as "13:07 17/11/2008". Of course, post matching with clocks will not work as well, though, unless you include
$post['clock']somewhere.Please tell me if it worked :)
Comment #2
Anonymous (not verified) commentedsorry, I feel so stupid, but I don't know where tu put
and this
$post['clock']
Comment #3
SeeSchloss commentedWhat theme are you using?
There should be a file called
template.phpin your theme's directory (if it doesn't exist, I think you should just create it), append this code to it:... there are howtos and documentation about overriding theme functions in Drupal.org handbooks, but I can't look for them now.
This
template.phpfile should be located in<site root>/themes/<theme name>/template.php, I thinkComment #4
Anonymous (not verified) commentedI appended the function in /themes/deco/template.php
but I got following error
Fatal error: Call to undefined function get_last_posts() in /sites/all/modules/tribune/tribune.page.inc on line 62
any idea? thanks a lot for your help
Comment #5
SeeSchloss commentedHmm, are you sure you haven't touched anything other than your theme's
template.phpfile? Because in no way could this cause this problem... maybe you should try to download the latest version and replace all the files in your modules/tribune folder.Comment #6
Anonymous (not verified) commentedI double checked also with tribune 1.8, now I don't get any error, but nothing changes with the time printed in front of each message (no date printing in front of time)
Comment #7
Anonymous (not verified) commentedI solved the problem (on tribune 1.8) hacking the tribune.mudule file at line #816
function theme_post_time($post) {
$timestamp = tribune_date_to_timestamp(tribune_date_to_localdate($post['post_time'])); //gio inserito riga - new line added
$contents = "";
// $contents .= $post['clock']; // gio eliminato riga - deleted line
$contents .= date('jM H:i', $timestamp); // gio inserito riga - new line added
$contents .= "\n";
return $contents;
}
Comment #8
SeeSchloss commentedWell, I suppose it's fine then... doing it with a theme override would have prevented problems when updating the module, though
Comment #10
Anonymous (not verified) commentedhow do I add year/month/day to hour/minute/second related to the post-time in tribune?
the previous hack is not working anymore with 2.x-dev version.
any help is apprecciated
Comment #11
SeeSchloss commentedThis is all fixed in 7.x-3.x.