Author Topic: Error after install  (Read 10387 times)

Offline Hyperguy

Error after install
« on: November 05, 2006, 09:50:32 am »
After upgrading to SMFShop, I keep on getting this error:

Parse error: syntax error, unexpected $end in /home2/hyperguy/public_html/forum/index.php on line 207

I upgraded from SMFShop 2.1 to 2.2, and then to SMFShop 2.3.

Please help.

Offline Daniel15

Re: Error after install
« Reply #1 on: November 05, 2006, 10:18:12 am »
Hi,
 Please post the contents of your Index.php file here.

Offline Hyperguy

Re: Error after install
« Reply #2 on: November 05, 2006, 11:43:42 am »
Here you are:

Code: [Select]
<?php
/******************************************************************************
* index.php                                                                   *
*******************************************************************************
* SMF: Simple Machines Forum                                                  *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                *
* =========================================================================== *
* Software Version:           SMF 1.1 RC2                                     *
* Software by:                Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by:     Lewis Media (http://www.lewismedia.com)         *
* Support, News, Updates at:  http://www.simplemachines.org                   *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it     *
* under the terms of the provided license as published by Lewis Media.        *
*                                                                             *
* This program is distributed in the hope that it is and will be useful,      *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of            *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        *
*                                                                             *
* See the "license.txt" file for details of the Simple Machines license.      *
* The latest version can always be found at http://www.simplemachines.org.    *
******************************************************************************/

/* This, as you have probably guessed, is the crux on which SMF functions.
Everything should start here, so all the setup and security is done
properly.  The most interesting part of this file is the action array in
the smf_main() function.  It is formatted as so:

'action-in-url' => array('Source-File.php', 'FunctionToCall'),

Then, you can access the FunctionToCall() function from Source-File.php
with the URL index.php?action=action-in-url.  Relatively simple, no?
*/

$forum_version 'SMF 1.1 RC2';

// Get everything started up...
define('SMF'1);
@
set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start microtime();

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// And important includes.
require_once($sourcedir '/QueryString.php');
require_once(
$sourcedir '/Subs.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Load.php');
require_once(
$sourcedir '/Security.php');
// TinyPortal include
require_once($sourcedir '/TPortal.php');

// Using an old version of PHP?
if (@version_compare(PHP_VERSION'4.2.3') != 1)
require_once(
$sourcedir '/Subs-Compat.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) && $maintenance == 2)
db_fatal_error();

// Connect to the MySQL database.
if (empty($db_persist))
$db_connection = @mysql_connect($db_server$db_user$db_passwd);
else
$db_connection = @mysql_pconnect($db_server$db_user$db_passwd);

// Show an error if the connection couldn't be made.
if (!$db_connection || !@mysql_select_db($db_name$db_connection))
db_fatal_error();

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();
$context = array();

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset(
$_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (
strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}

if (!
defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' '')));

// Some cellphones can't handle output compression...
$modSettings['enableCompressedOutput'] = '0';
// !!! Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');
}

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0)
{
// If zlib is being used, turn off output compression.
if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION'4.2.0') == -1)
$modSettings['enableCompressedOutput'] = '0';
else
ob_start('ob_gzhandler');
}
// This makes it so headers can be sent!
if (empty($modSettings['enableCompressedOutput']))
ob_start();

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// What function shall we execute? (done like this for memory's sake.)
call_user_func(smf_main());

// Call obExit specially; we're coming from the main area ;).
obExit(nullnulltrue);

// The main controlling function.
function smf_main()
{
global 
$modSettings$settings$user_info$board$topic$maintenance$sourcedir;

// Special case: session keep-alive.
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
die;

// Load the user's cookie (or set as guest) and load their settings.
loadUserSettings();

// Load the current board's information.
loadBoard();

// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme();

// Check if the user should be disallowed access.
is_not_banned();

// Load the current user's permissions.
loadPermissions();

// Do some logging if this is not an attachment/avatar or the setting of an option.
if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('dlattach''jsoption')))
{
// Log this user as online.
writeLog();

// Track forum statistics and hits...?
if (!empty($modSettings['hitStats']))
trackStats(array('hits' => '+'));
}

// TinyPortal
TPortal_init();

// Is the forum in maintenance mode? (doesn't apply to administrators.)
if (!empty($maintenance) && !allowedTo('admin_forum'))
{
// You can only login.... otherwise, you're getting the "maintenance mode" display.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login2')
{
require_once(
$sourcedir '/LogInOut.php');
return 
'Login2';
}
// Don't even try it, sonny.
else
{
require_once(
$sourcedir '/Subs-Auth.php');
return 
'InMaintenance';
}
}
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login''login2''register''register2''reminder''activate''help''.xml'))))
{
require_once(
$sourcedir '/Subs-Auth.php');
return 
'KickGuest';
}
elseif (empty(
$_REQUEST['action']))
{
// Action and board are both empty... maybe the portal page?
if (empty($board) && empty($topic) && $settings['TPortal_front_type']!='boardindex')
{
require_once(
$sourcedir '/TPortal.php');
return 
'TPortal';
}
if (empty(
$board) && empty($topic) && $settings['TPortal_front_type']=='boardindex' && (isset($_GET['cat']) || isset($_GET['page'])))
{
require_once(
$sourcedir '/TPortal.php');
return 
'TPortal';
}
}

Offline Hyperguy

Re: Error after install
« Reply #3 on: November 06, 2006, 09:31:25 pm »
Any idea what it could be?

Also, is there anyway to uninstall the mod through FTP?  I don't think I'll be able to access anything on the forum until index.php's fixed.

Offline Daniel15

Re: Error after install
« Reply #4 on: November 07, 2006, 09:53:49 am »
Sorry, I can't see any SMFShop segments in that code, so I'm not sure what's causing the problem.
If you have an index.php~ file (with a ~ on the end), replace your index.php file with it. The index.php~ file is a backup of index.php before your most recent MOD was installed

Offline Hyperguy

Re: Error after install
« Reply #5 on: November 08, 2006, 01:03:22 pm »
Thanks for your help.

I didn't manage to find the root of the problem, so I backed up my database and reinstalled the forum.

I suspect some files didn't upload completely.