date - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36) +---- Forum: Forum Software Help (https://www.supportforums.net/forumdisplay.php?fid=49) +---- Thread: date (/showthread.php?tid=1813) |
date - R3c0nna1ssanc3 - 10-19-2009 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'); ?> </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 here are the two things I trying to match. http://www.datapodcomputer.com/ http://www.datapodcomputer.com/forum/ RE: date - Grizzly - 10-19-2009 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 PHP Code: $lastposttime RE: date - MattR - 10-20-2009 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. RE: date - R3c0nna1ssanc3 - 10-20-2009 sorry aboult my lack of knowledge with php but how would I write a new definition for that? RE: date - R3c0nna1ssanc3 - 10-20-2009 bump because I still need help getting the date in the same format as my home page. |