Ask Agaric (unsolicited edition) - how to change Drupal core output with a theme
Hi Neil,
I haven't themed forums in this way but here's the general approach:
You want to look in forum.module (and possibly other files such as include/*.inc files-- core isn't entirely modular (yet) to try to find the function that outputs the time. It _should_ be named function theme_something_something. (Where it is actually called to produce output it will be in the form theme('something_something') -- this is how Drupal allows you to override theme functions rather than modify core.
You don't modify forum.module, you will want to copy that function, paste it in a template.php file for your theme, and rename it mythemename_ or phptemplate_something_something, and modify it here.
I'm not saying it won't get more complicated than this ( for instance, you don't want to retheme something like theme_item_list because that will change the display all over your web site, so you need to look for a more specific theme_ function that calls theme_item_list ) but that's the Drupal way there.
benjamin, Agaric Design Collective, http://AgaricDesign.com/
On Nov 5, 2007 7:07 PM, Neil wrote:
I have a lot of work to do on node-forum.tpl.php and comment.tpl.php in an
attempt to get a nice fresh look to my forums.
I have a few specific questions, but don't want to swamp everyone so will
just begin with what is hopefully quite a simple one:
on the forum listing page (where you actually have the threads listed out),
both the Created and Last Reply columns have the date in "Time Ago" format.
How can I alter this to be an actual date? I presume I would need to go into
the forum.module file, is that correct?
Thanks in advanceNeil
[ Drupal support list | http://lists.drupal.org/ ]
Comments
function
function theme_forum_topic_list is the theme you're looking for.
Copy it into template.php and name it phptemplate_forum_topic_list and you'll be able to override it.
I imagine the part you want to change is here:
array('data' => _forum_format(isset($topic->last_reply) ?
benjamin, Agaric Design Collective, http://AgaricDesign.com/
On Nov 6, 2007 9:44 AM, Neil wrote:
Post new comment