Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
date
#1
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/
Reply
#2
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 
Do you know how to make games? Do you know 3d Modeling? If so then visit
[Image: logo.png]
Reply
#3
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.
MyBB Support Team Lead
Reply
#4
sorry aboult my lack of knowledge with php but how would I write a new definition for that?
Reply
#5
bump because I still need help getting the date in the same format as my home page.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)