Jump to content

Parse Error - Syntax error


Recommended Posts

Hi, i am new to the forum and PHP.

 

I am currently running a SMF forum, i had a fair amount of third party modifications installed and friday i installed another one, it had a few errors when installing which i queried the author and he said to manual edit after installing which i was happy to do. As soon as i did i got  this message :

 

- Parse error: syntax error, unexpected T_VARIABLE in /xxxx/xxxx/SMF/www/index.php on line 1

 

Someone kindly went through it for me and i uploaded the edited one and i am now getting this :

 

- Parse error: syntax error, unexpected '}' in /xxxx/xxxx/SMF/www/index.php on line 332

 

Would anyone be able to help me fix the problem? Here is all i found on line 332 :

 

-      'credits' => array('Who.php', 'Credits'),

 

Many Thanks

 

Matt

Link to comment
Share on other sites

we probably need to see more code say about line 315-340 ?

 

What happens is the php parser doesnt bring up an error until it thinks there is somethign wrong which might not always be exactly where the error is... but your probably missing an opening { way earlier in the code or have an extra } around 332 somewhere...

Link to comment
Share on other sites

I am using a basic text editor on my mac called smultron.

 

Here is part some code - line 300-342

 

// -> end change PortaMx
	}

	// Topic is empty, and action is empty.... MessageIndex!
	elseif (empty($topic))
	{
		require_once($sourcedir . '/MessageIndex.php');
		return 'MessageIndex';
	}

	// Board is not empty... topic is not empty... action is empty.. Display!
	else
	{
		require_once($sourcedir . '/Display.php');
		return 'Display';
	}
}

// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
$actionArray = array(
	'activate' => array('Register.php', 'Activate'),
	'admin' => array('Admin.php', 'AdminMain'),
	'articles' => array('Articles2.php', 'ArticlesMain'),
	'announce' => array('Post.php', 'AnnounceTopic'),
	'announcements' => array('Announcements.php', 'AnnouncementsMain'),
	'arcade' => array('Arcade.php','Arcade'),
	'attachapprove' => array('ManageAttachments.php', 'ApproveAttach'),
	'buddy' => array('Subs-Members.php', 'BuddyListToggle'),
	'calendar' => array('Calendar.php', 'CalendarMain'),
	'clock' => array('Calendar.php', 'clock'),
	'collapse' => array('BoardIndex.php', 'CollapseCategory'),
	'coppa' => array('Register.php', 'CoppaForm'),
	'credits' => array('Who.php', 'Credits'),
	'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
	'display' => array('Display.php', 'Display'),
	'dlattach' => array('Display.php', 'Download'),
	'editpoll' => array('Poll.php', 'EditPoll'),
	'editpoll2' => array('Poll.php', 'EditPoll2'),
	'emailuser' => array('SendTopic.php', 'EmailUser'),
	'findmember' => array('Subs-Auth.php', 'JSMembers'),
	//-> start add PortaMx
	'forum' => array('BoardIndex.php', 'BoardIndex'),
	//-> end add PortaMx

 

At the minute all i get is an error message i am unable to access the forum at all.

 

Many Thanks

Matt

Link to comment
Share on other sites

I am using SMF 2.0 RC1 and it was YAGAM i was trying to install.

 

I replaced with this -

'announce' => array('Post.php', 'AnnounceTopic'),

'announcements' => array('Announcements.php', 'AnnouncementsMain'),

 

Then i had an error message saying that there - syntax error, unexpected T_VARIABLE in /home/matthew09/SMF/www/index.php on line 1

 

Then someone edited the file and it gave me the current unexpected } error

 

Matt

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.