MyBB Community Forums

Full Version: Parse Error on Line 20
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I just upgraded my forum version 1.6.4 and started getting the bellow error:

Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/content/92/8207792/html/forum/index.php on line 20


My forum Link: http://mcxcommoditytrading.com/forum/index.php

Please help.

Also easy on technical stuff as I am a new bee.
Here are few lines from my index.php file to check more:


<?php
/**
* MyBB 1.6
* Copyright 2010 MyBB Group, All Rights Reserved
*
* Website: http://mybb.com
* License: http://mybb.com/about/license
*
* $Id: index.php 5480 2011-07-04 21:29:44Z huji $
*/

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'index.php');

$templatelist = "index,index_whosonline,index_welcomemembertext,index_welcomeguest,index_whosonline_memberbit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost,index_modcolumn,forumbit_moderators,forumbit_subforums,index_welcomeguesttext";
$templatelist .= ",index_birthdays_birthday,index_birthdays,index_pms,index_loginform,index_logoutlink,index_stats,forumbit_depth3,forumbit_depth3_statusicon,index_boardstats";

require_once "./global.php";
require_once"analyticstracking.php"
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_forumlist.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

$plugins->run_hooks("index_start");

// Load global language phrases
$lang->load("index");

$logoutlink = $loginform = '';
if($mybb->user['uid'] != 0)
{
eval("\$logoutlink = \"".$templates->get("index_logoutlink")."\";");
}
else
{
//Checks to make sure the user can login; they haven't had too many tries at logging in.
//Function call is not fatal
if(login_attempt_check(false) !== false)
{
eval("\$loginform = \"".$templates->get("index_loginform")."\";");
}
}
$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{
// Get the online users.
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY u.username ASC, s.time DESC
");
(2012-02-29, 08:27 PM)saurabh Wrote: [ -> ]Hi,

I just upgraded my forum version 1.6.4 and started getting the bellow error:

Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/content/92/8207792/html/forum/index.php on line 20


My forum Link: http://mcxcommoditytrading.com/forum/index.php

Please help.

Also easy on technical stuff as I am a new bee.
Here are few lines from my index.php file to check more:


<?php
/**
* MyBB 1.6
* Copyright 2010 MyBB Group, All Rights Reserved
*
* Website: http://mybb.com
* License: http://mybb.com/about/license
*
* $Id: index.php 5480 2011-07-04 21:29:44Z huji $
*/

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'index.php');

$templatelist = "index,index_whosonline,index_welcomemembertext,index_welcomeguest,index_whosonline_memberbit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost,index_modcolumn,forumbit_moderators,forumbit_subforums,index_welcomeguesttext";
$templatelist .= ",index_birthdays_birthday,index_birthdays,index_pms,index_loginform,index_logoutlink,index_stats,forumbit_depth3,forumbit_depth3_statusicon,index_boardstats";

require_once "./global.php";
require_once"analyticstracking.php"
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_forumlist.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

$plugins->run_hooks("index_start");

// Load global language phrases
$lang->load("index");

$logoutlink = $loginform = '';
if($mybb->user['uid'] != 0)
{
eval("\$logoutlink = \"".$templates->get("index_logoutlink")."\";");
}
else
{
//Checks to make sure the user can login; they haven't had too many tries at logging in.
//Function call is not fatal
if(login_attempt_check(false) !== false)
{
eval("\$loginform = \"".$templates->get("index_loginform")."\";");
}
}
$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{
// Get the online users.
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY u.username ASC, s.time DESC
");

line 20 = require_once MYBB_ROOT."inc/functions_post.php";
your line 20 = require_once"analyticstracking.php"
remove it and see if that fixes it
(2012-02-29, 08:53 PM)JimR Wrote: [ -> ]
(2012-02-29, 08:27 PM)saurabh Wrote: [ -> ]Hi,

I just upgraded my forum version 1.6.4 and started getting the bellow error:

Parse error: syntax error, unexpected T_REQUIRE_ONCE in /home/content/92/8207792/html/forum/index.php on line 20


My forum Link: http://mcxcommoditytrading.com/forum/index.php

Please help.

Also easy on technical stuff as I am a new bee.
Here are few lines from my index.php file to check more:


<?php
/**
* MyBB 1.6
* Copyright 2010 MyBB Group, All Rights Reserved
*
* Website: http://mybb.com
* License: http://mybb.com/about/license
*
* $Id: index.php 5480 2011-07-04 21:29:44Z huji $
*/

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'index.php');

$templatelist = "index,index_whosonline,index_welcomemembertext,index_welcomeguest,index_whosonline_memberbit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost,index_modcolumn,forumbit_moderators,forumbit_subforums,index_welcomeguesttext";
$templatelist .= ",index_birthdays_birthday,index_birthdays,index_pms,index_loginform,index_logoutlink,index_stats,forumbit_depth3,forumbit_depth3_statusicon,index_boardstats";

require_once "./global.php";
require_once"analyticstracking.php"
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_forumlist.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

$plugins->run_hooks("index_start");

// Load global language phrases
$lang->load("index");

$logoutlink = $loginform = '';
if($mybb->user['uid'] != 0)
{
eval("\$logoutlink = \"".$templates->get("index_logoutlink")."\";");
}
else
{
//Checks to make sure the user can login; they haven't had too many tries at logging in.
//Function call is not fatal
if(login_attempt_check(false) !== false)
{
eval("\$loginform = \"".$templates->get("index_loginform")."\";");
}
}
$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{
// Get the online users.
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$comma = '';
$query = $db->query("
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time>'$timesearch'
ORDER BY u.username ASC, s.time DESC
");

line 20 = require_once MYBB_ROOT."inc/functions_post.php";
your line 20 = require_once"analyticstracking.php"
remove it and see if that fixes it

So you are saying I should remove both these line or interchange them?
require_once"analyticstracking.php"

Replace with:
require_once MYBB_ROOT."analyticstracking.php";
(2012-02-29, 08:56 PM)cfillion Wrote: [ -> ]
require_once"analyticstracking.php"

Replace with:
require_once MYBB_ROOT."analyticstracking.php";

I did replace it but got new error:

Fatal error: require_once() [function.require]: Failed opening required '/home/content/92/8207792/html/forum/analyticstracking.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/92/8207792/html/forum/index.php on line 19

That "analyticstracking.php" file does not seem to exists and is not part of MyBB.
Remove that line like JimR said.
Remove that line completely. 'analyticstracking.php' doesn't even exist. It's not default MyBB code.
(2012-02-29, 09:01 PM)cfillion Wrote: [ -> ]That "analyticstracking.php" file does not seem to exists and is not part of MyBB.
Remove that line.

You are master.. It worked. Cheers!