Support Forums

Full Version: date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay I am almost done matching my templates for joomla and mybb, but right now I am stuck on one thing getting the same date. Here is the script in the html file from joomla.

Code:
<?php if($this->params->get('dateDisplay')) : ?><div id="date"><?php echo date('l dS \of F Y'); ?>&nbsp;&nbsp;&nbsp;&nbsp;</div><?php endif; ?>

If I put it directly into the header file for mybb I get this error.

Code:
Fatal error: Using $this when not in object context in /home/content/41/4149141/html/forum/global.php(438) : eval()'d code on line 12
Let me know if you can help.

here are the two things I trying to match.

http://www.datapodcomputer.com/

http://www.datapodcomputer.com/forum/
Well, to call the current date and time in MyBB, you would use:
PHP Code:
{$lang->welcome_current_time

And to set which timezone you would like the forum to run off, you go into your Admin CP > Configuration > Date and Time Format.

For last post date you would use
PHP Code:
$lastpostdate 
and for the last post time you would use
PHP Code:
$lastposttime 
The reason it doesn't work is because you can't use normal PHP in templates, only variables that have been pre-defined in whatever file evals the template.
sorry aboult my lack of knowledge with php but how would I write a new definition for that?
bump because I still need help getting the date in the same format as my home page.