please someone help ! this project was supposed to be online 2 weeks ago and its all about drupal issues and such ive already lost all hope :(
in a template for the front page [redirected by template.php by exploding URI using clean urls] i need to use the date_iso2array function to sort news items so that only the two newest will be displayed on the front page [news item is a cck node that uses date as its publish date]. date_iso2array is included in date.inc but i am getting a-
Fatal error: Call to undefined function: date_iso2array() in {template file + line number}
though i have the date module enabled and actively using it with cck.
can be seen here > http://www.perfect-renovation.com
i tried to-
include 'modules/date/date.inc';
right before it and it seems to work until i try to publish/unpublish one of the existing news items [cck items using date as their publish date] and then i get a-
Fatal error: Cannot redeclare date_load_library() (previously declared in /var/www/html/modules/date/date.inc:96) in /var/www/html/modules/date/date.inc on line 95
anyone ? please ?
Comments
Comment #1
karens commentedYou need to include the file when using it outside of CCK, so you were right about that, but change include to include_once. It looks like there are places where it is included too many times.
Comment #2
baec commentedyep karens thx so much for the quick reply. that did the trick :) excellent job on this module [!!].
ive closed this support issue though someone might want to look into this multiple include behaviour.
Comment #3
karens commentedThe multiple include behavior is not a bug. It's because when you use cck, cck is including the file, too, which it must. That's why you need to make it include_once.
Comment #4
baec commentedah ok thx wasnt aware of that one