| View previous topic :: View next topic |
| Author |
Message |
scottchapman
Joined: 25 Jan 2007 Posts: 90
|
Posted: Mon Apr 21, 2008 12:59 am Post subject: Can't get to _cal_months array |
|
|
I have tried the following code, and the array _cal_months is always empty:
require_once(@constant("_CAL_BASE_PATH_") ."include/classes/class.calendar.php");
global $_cal_months;
print "May is " . $_cal_months[5] . "\n";
This just prints:
May is
That's it...
What am I doing wrong? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Mon Apr 21, 2008 5:30 pm Post subject: |
|
|
Hi Scott,
A lot of things happen when the calendar class is instantiated. Including include()'ing the language file that contains the $_cal_months array. Please also do this:
require_once(_CAL_BASE_PATH_."include/languages/en_US.php");
Let me know if this doesn't fix it. |
|
| Back to top |
|
 |
scottchapman
Joined: 25 Jan 2007 Posts: 90
|
Posted: Mon Apr 21, 2008 6:50 pm Post subject: |
|
|
Thanks. I am pretty sure that will work.
I am not sure why my example doesn't work. I tried including exactly the same set of files other scripts did that are able to sucessfully use the _cal_months array. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Mon Apr 21, 2008 7:26 pm Post subject: |
|
|
Hi Scott,
Other scripts probably either have the language file included in it or have $cal = new calendar() before it. |
|
| Back to top |
|
 |
|