Support Forums

Full Version: PHP error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I used a plug in to enable PHP in a mybb forum. When I put in this code.

PHP 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; ?>

The date is working fine but I got two errors I got rid of one by taking out

PHP Code:
<?php endif; ?>

But im still left with this.

Code:
Parse error: syntax error, unexpected $end in /home/content/41/4149141/html/forum/global.php(438) : eval()'d code(7) : eval()'d code on line 1

If you would like to see the error here is the link to the forum

http://www.datapodcomputer.com/forum/
Idk what the problem is but it just might be the way your formatted it
also do you want it to display the date everytime? if so try this
PHP Code:
<?php
echo '<div id="date">';
echo 
date('l dS \of F Y');
echo 
"&nbsp;&nbsp;&nbsp;&nbsp;</div>";
?>
if you want it to use the if (which is where your error might be) use this
PHP Code:
<?php
if($this->params->get('dateDisplay')){
echo 
'<div id="date">';
echo 
date('l dS \of F Y');
echo 
"&nbsp;&nbsp;&nbsp;&nbsp;</div>";
}
?>
its not working when I input the code and hit save the entire header file
I justed youed the predefined date code from mybb and then coded it into the homepage
the error is caused by a missing parameter I guess.. did you put the timestamp??

PHP Code:
time();