TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 354
  • Total: 354

ModSettings error after moving to TP 0.9.8

Started by itweb, March 23, 2007, 02:33:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

itweb

I am pretty sure it worked just fine with 0.9.7 and I didn't mess with anything besides upgrading to 0.9.8

When going to Features and Options, error pops up (and why is it regarding chat? :o):

Fatal error: Cannot redeclare modifychatsettings() (previously declared in .../Sources/ModSettings.php:348) in .../Sources/ModSettings.php on line 379

ModSettings looks like this:

function ModifyChatSettings(){
global $txt, $scripturl, $context, $settings, $sc;

// Integrated Chat 2.7 Settings
$config_vars = array(
array('text', 'chatLanguage'),
array('text', 'chatRoomName'),
array('text', 'chatAppend'),
array('text', 'chatWidth'),
array('text', 'chatHeight'),
array('text', 'chatPassword'),
array('text', 'chatUpdateInterval'),
array('check', 'chatRoomsTab'),
array('check', 'chatAds'),
array('check', 'chatShowUsers'),
array('check', 'chatShowTop'),

);

// Saving?
if (isset($_GET['save'])){
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=chat');
}

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=chat';
$context['settings_title'] = &$txt['chatTitle'];

prepareDBSettingContext($config_vars);
}


function ModifyChatSettings(){
global $txt, $scripturl, $context, $settings, $sc;

// Integrated Chat 2.7 Settings
$config_vars = array(
array('text', 'chatLanguage'),
array('text', 'chatRoomName'),
array('text', 'chatAppend'),
array('text', 'chatWidth'),
array('text', 'chatHeight'),
array('text', 'chatPassword'),
array('text', 'chatUpdateInterval'),
array('check', 'chatRoomsTab'),
array('check', 'chatAds'),
array('check', 'chatShowUsers'),
array('check', 'chatShowTop'),

);

// Saving?
if (isset($_GET['save'])){
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=chat');
}

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=chat';
$context['settings_title'] = &$txt['chatTitle'];

prepareDBSettingContext($config_vars);
}


Is it me or is it same code twice?

Also,

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',

'chat' => 'ModifyChatSettings',

'chat' => 'ModifyChatSettings',
'profile' => 'ModifyProfileSettings',
);


Chat action is repeated twice here.

'chat' => array(
'title' => $txt['chatTitle'],
'href' => $scripturl . '?action=featuresettings;sa=chat;sesc=' . $context['session_id'],
),

'chat' => array(
'title' => $txt['chatTitle'],
'href' => $scripturl . '?action=featuresettings;sa=chat;sesc=' . $context['session_id'],
),

... and here

Any advice?

itweb

... And as I thought, removing the doubled code fixed the thing :uglystupid2:

Nokonium

As a general rule, any 'Cannot redeclare' error is duplicated code, most likely from installing twice and/or the uninstall not working.

This website is proudly hosted on Crocweb Cloud Website Hosting.