MyBB Community Forums

Full Version: Global.php unexpected end.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Having a very strange error. I was modifying this file, then reinstalled the original global.php file from the source. I don't even understand why it's occuring.

So this error is being caused by the default global.php file

Error:
Parse error: syntax error, unexpected $end in /home/susite/public_html/global.php on line 526

Some code around Line 526... (Lines 504 to 527)
// Are we showing version numbers in the footer?
if($mybb->settings['showvernum'] == 1)
{
	$mybbversion = ' '.$mybb->version;
}
else
{
	$mybbversion = '';
}

// Check to see if we have any tasks to run
$task_cache = $cache->read("tasks");
if(!$task_cache['nextrun'])
{
	$task_cache['nextrun'] = TIME_NOW;
}
if($task_cache['nextrun'] <= TIME_NOW)
{
	$task_image = "<img src=\"{$mybb->settings['bburl']}/task.php\" border=\"0\" width=\"1\" height=\"1\" alt=\"\" />";
}
else
{
	$task_image = '';
}

This can be solved by either removing $task_image = ''; totally or even removing the whole else { } .
But I don't wan't to do that as it might conflict with something in the future. else { $task_image = ''; } is included in global.php from your install, so it's nothing I've added. Why is this causing an error?
missing the beginning and ending braces for the if block

// Check to see if we have any tasks to run
if($mybb->settings['taskscron'] != 1)
{
	$task_cache = $cache->read("tasks");
	if(!$task_cache['nextrun'])
	{
		$task_cache['nextrun'] = TIME_NOW;
	}
	if($task_cache['nextrun'] <= TIME_NOW)
	{
		$task_image = "<img src=\"{$mybb->settings['bburl']}/task.php\" border=\"0\" width=\"1\" height=\"1\" alt=\"\" />";
	}
	else
	{
		$task_image = '';
	}
}
Nooo... I believe the syntax is correct. and adding a } to end of things doesn't solve anything.

I have got the default global.php codes from here: http://crossreference.mybboard.de/nav.ht...ource.html

Help!
^ I guess you have not seen the above quoted code on your php editor..
anyway, lets wait for an expert to respond and fix the problem
If you're getting this then the file just isn't complete or there's an error in it, if you upload a copy from a fresh download it won't happen.
I have deleted the entire contents of global.php - then copied all 680 lines from that PHPX thing. This has shifted the error to line 588, same unexpected $end
And what is wrong with downloading MyBB from here and using the file from in there?? If you're getting this, there is just something wrong with the code in the file. PM me FTP login details if you want me to have a look at it.
My apologies, I had a MyBB_1603.zip which I tried using the code from. That didn't work but I have no idea how long that had been sitting there. I downloaded MyBB1603 again... it worked.

That CrossReference site must be wrong, and somehow the zip archive went a bit crazy.

Problem Solved
My apologies, please delete thread.