News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Fatal Error - Features and Options

Started by CrazyRed98, August 08, 2009, 09:54:09 PM

Previous topic - Next topic

CrazyRed98

Well for some reason my features and options isn't working. It keeps showing this error.

Fatal error: Function name must be a string in /home/corntv/public_html/computertv/forum/Sources/ModSettings.php on line 174

and when I go look at it this is what I see. Its the whole section surrounding it.

require_once($sourcedir . '/ManageServer.php');


// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

// Actually call the saving function.
[b]This is Line:174[/b]$subActions[$_REQUEST['sa']]();
}

function ModifyBasicSettings()
{
and this happens on anything I try to save in features and options. I can like look at the things, but when I click save, even when I didn't modify anything I still get this error.

P.S.  I added the  "This is line:174" in the code so you guys would know.  :)

JBlaze

Jason Clemons
Former Team Member 2009 - 2012


Arantor

What's the URL in the address bar when you're trying to save?

CrazyRed98

Quote from: Arantor on August 09, 2009, 08:53:14 PM
What's the URL in the address bar when you're trying to save?
what do you mean?

Arantor

When I'm replying to this page, for example, my browser says the page is 'http://www.simplemachines.org/community/index.php?topic=329774.msg2204114;topicseen#new'

When you're trying to save, what page does your browser tell you that you are on.

CrazyRed98

it says
http://com.puter.tv/forum/index.php?action=featuresettings2;save;sa=basic [nofollow]
but thats when I try to do it in the normal options like "Maximum allowed characters in signatures", but when I do it in a different tab like karma and I try to enable it, it says   http://com.puter.tv/forum/index.php?action=featuresettings2;save;sa=karma [nofollow]

Arantor

So, for which of those, if either, is it working, and which is it failing on?

CrazyRed98

its like I said the whole tab of Features and Options  is not working. It won't save anything anymore, and its the same error no matter what I try saving.

SlammedDime

You're missing a block of code.

function ModifyFeatureSettings2() should be the following:

// This function basically just redirects to the right save function.
function ModifyFeatureSettings2()
{
global $context, $txt, $scripturl, $modSettings, $sourcedir;

isAllowedTo('admin_forum');
loadLanguage('ModSettings');

// Quick session check...
checkSession();

require_once($sourcedir . '/ManageServer.php');

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
);

// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

// Actually call the saving function.
$subActions[$_REQUEST['sa']]();
}


Yours is missing the $subActions array.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

CrazyRed98

Quote from: CrazyRed98 on August 10, 2009, 05:22:47 PM
its like I said the whole tab of Features and Options  is not working. It won't save anything anymore, and its the same error no matter what I try saving.
Thanks got it to work

Advertisement: