News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PaypalDonations

Started by snork13, February 06, 2006, 11:36:58 PM

Previous topic - Next topic

TikkA

I also have the same problem with ./Sources/ModSettings.php     Test failed
What  file to i need to edit manually?

TikkA

Anyone? Im using Metallic-Abyss-1.1
www.gfx-genie.co.uk

snork13



<file name="$sourcedir/ModSettings.php">

<operation>
<search position="replace"><![CDATA[require_once($sourcedir . '/ManageServer.php');

$context['page_title'] = $txt['modSettings_title'];
$context['sub_template'] = 'show_settings';

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
);]]></search>
<add><![CDATA[require_once($sourcedir . '/ManageServer.php');

$context['page_title'] = $txt['modSettings_title'];
$context['sub_template'] = 'show_settings';

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
'paypal' => 'ModifypayPalSettings',
);]]></add>
</operation>

<operation>
<search position="replace"><![CDATA[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']]();
}]]></search>
<add><![CDATA[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',
'paypal' => 'ModifypayPalSettings',
);

// 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']]();
}]]></add>
</operation>

<operation>
<search position="replace"><![CDATA[
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
'is_last' => true,
),]]></search>
<add><![CDATA[
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
),
'paypal' => array(
'title' => $txt['payPalFO'],
'href' => $scripturl . '?action=featuresettings;sa=paypal;sesc=' . $context['session_id'],
'is_last' => true,
),]]></add>
</operation>

<operation>
<search position="before"><![CDATA[
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
$context['settings_title'] = $txt['smf293'];

prepareDBSettingContext($config_vars);
}
]]></search>
<add><![CDATA[
function ModifypayPalSettings()
{
global $txt, $scripturl, $context, $settings, $sc;

$config_vars = array(
// Paypal Donations - On or off?
array('check', 'payPalEnable'),
'',
// Paypal key and Reason
array('large_text', 'payPalReason','10'),
array('large_text', 'payPalKey','8'),
           
);

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

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
$context['settings_title'] = $txt['payPalFO'];

prepareDBSettingContext($config_vars);
}
]]></add>
</operation>
</file>
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

TikkA

Could you please put where this goes i think in the modification.xml? I have replaced it still have the same error.

snork13

Quote from: TikkA on July 07, 2007, 07:35:35 AM
Could you please put where this goes i think in the modification.xml? I have replaced it still have the same error.

What you need to do is follow the changes to Modsetting in your source file. make a backup of the file first.

http://docs.simplemachines.org/index.php?topic=402
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

TikkA

That makes no sense to me.
In that link, that was .mod or .xml.
You said changes in the Modsetting which is php.

snork13

Quote from: TikkA on July 07, 2007, 01:38:37 PM
That makes no sense to me.
In that link, that was .mod or .xml.
You said changes in the Modsetting which is php.

What I posted is the changes in an xml format. If you unzip the mod check out the file modification.xml.
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

TikkA

Nevermind ill leave it.

MinasC

Quote from: MinasC on July 03, 2007, 05:49:34 PM
Quote from: snork13 on July 01, 2007, 10:30:56 AM
Quote from: MinasC on July 01, 2007, 04:05:32 AM
couldn't wait for the 1.1.3-compatible update , but when i tried to install i got "test failed" in ManagePermissions.php and ModSettings.php ! any ideas why ?

thnx a lot !

sure, another mod has edited what my mod is looking for. you will need to edit those file manually.

wow , i think i'm gonna need instructions for that , couldn't possibly do it myself ! would that be possible for you ?

thnx a lot !

how do i modify manually and what do i need to modify ?
thnx a lot !

snork13

Quote from: MinasC on July 09, 2007, 06:50:12 AM
Quote from: MinasC on July 03, 2007, 05:49:34 PM
Quote from: snork13 on July 01, 2007, 10:30:56 AM
Quote from: MinasC on July 01, 2007, 04:05:32 AM
couldn't wait for the 1.1.3-compatible update , but when i tried to install i got "test failed" in ManagePermissions.php and ModSettings.php ! any ideas why ?

thnx a lot !

sure, another mod has edited what my mod is looking for. you will need to edit those file manually.

wow , i think i'm gonna need instructions for that , couldn't possibly do it myself ! would that be possible for you ?

thnx a lot !

how do i modify manually and what do i need to modify ?
thnx a lot !

http://docs.simplemachines.org/index.php?topic=402
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

MinasC


Muse

I have SMF 1.1.3, and the current, updated version of this mod.

Now, I am getting the fail on Mod.settings.php also so I went in to edit manually, and some of the code I am trying to find to add or replace just isn't there.

So I am assuming that's why the auto install is failing. It also means I can't manually install.

I uninstalled my two other mods, and it is the same error.

Suggestions?

Should I post my mod.settings.php code for help? :)

snork13

Quote from: Muse on July 17, 2007, 09:37:51 PM
I have SMF 1.1.3, and the current, updated version of this mod.

Now, I am getting the fail on Mod.settings.php also so I went in to edit manually, and some of the code I am trying to find to add or replace just isn't there.

So I am assuming that's why the auto install is failing. It also means I can't manually install.

I uninstalled my two other mods, and it is the same error.

Suggestions?

Should I post my mod.settings.php code for help? :)


sure, i can take a look for ya :)
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Muse

Thank you! :)

I'm thinking that maybe something got changed somewhere down the line that didn't get undone on an uninstall and I'm just missing it when I'm combing through it all.


Also, I reinstalled the other mods - let me know if you need me to uninstall everything again and repost :)

<?php
/**********************************************************************************
* ModSettings.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 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 Simple Machines LLC.          *
*                                                                                 *
* 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.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* This file is here to make it easier for installed mods to have settings
and options.  It uses the following functions:

void ModifyFeatureSettings()
// !!!

void ModifyFeatureSettings2()
// !!!

void ModifyBasicSettings()
// !!!

void ModifyLayoutSettings()
// !!!

void ModifyKarmaSettings()
// !!!

Adding new settings to the $modSettings array:
---------------------------------------------------------------------------
// !!!
*/

/* Adding options to one of the setting screens isn't hard.  The basic format for a checkbox is:
array('check', 'nameInModSettingsAndSQL'),

   And for a text box:
array('text', 'nameInModSettingsAndSQL')
   (NOTE: You have to add an entry for this at the bottom!)

   In these cases, it will look for $txt['nameInModSettingsAndSQL'] as the description,
   and $helptxt['nameInModSettingsAndSQL'] as the help popup description.

Here's a quick explanation of how to add a new item:

 * A text input box.  For textual values.
ie. array('text', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For numerical values.
ie. array('int', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For floating point values.
ie. array('float', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

         * A large text input box. Used for textual values spanning multiple lines.
ie. array('large_text', 'nameInModSettingsAndSQL', 'OptionalNumberOfRows',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A check box.  Either one or zero. (boolean)
ie. array('check', 'nameInModSettingsAndSQL', null, &$txt['descriptionOfTheOption'],
'OptionalReferenceToHelpAdmin'),

 * A selection box.  Used for the selection of something from a list.
ie. array('select', 'nameInModSettingsAndSQL', array('valueForSQL' => &$txt['displayedValue']),
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),
Note that just saying array('first', 'second') will put 0 in the SQL for 'first'.

 * A password input box. Used for passwords, no less!
ie. array('password', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

For each option:
type (see above), variable name, size/possible values, description, helptext.
OR make type 'rule' for an empty string for a horizontal rule.
OR make type 'heading' with a string for a titled section. */

// This function passes control through to the relevant tab.
function ModifyFeatureSettings()
{
global $context$txt$scripturl$modSettings$sourcedir;

// You need to be an admin to edit settings!
isAllowedTo('admin_forum');

// All the admin bar, to make it right.
adminIndex('edit_mods_settings');
loadLanguage('Help');
loadLanguage('ModSettings');

// Will need the utility functions from here.
require_once($sourcedir '/ManageServer.php');

$context['page_title'] = $txt['modSettings_title'];
$context['sub_template'] = 'show_settings';

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

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];

loadLanguage('CustomProfile');
// Load up all the tabs...
$context['admin_tabs'] = array(
'title' => &$txt['modSettings_title'],
'help' => 'modsettings',
'description' => $txt['smf3'],
'tabs' => array(
'basic' => array(
'title' => $txt['mods_cat_features'],
'href' => $scripturl '?action=featuresettings;sa=basic;sesc=' $context['session_id'],
),
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl '?action=featuresettings;sa=layout;sesc=' $context['session_id'],
),
'profile' => array(
'title' => $txt['cp_cpfields'],
'href' => $scripturl '?action=featuresettings;sa=profile;sesc=' $context['session_id'],
),
'MemberColorLinks' => array(
'title' => $txt['MemberColorLinkHeadline'],
'href' => $scripturl '?action=featuresettings;sa=MemberColorLinks;sesc=' $context['session_id'],
),
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl '?action=featuresettings;sa=karma;sesc=' $context['session_id'],
'is_last' => true,
),
),
);

// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']]))
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;

// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}

// 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',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',
'chat' => 'ModifyChatSettings',

'profile' => 'ModifyProfileSettings',
);

// 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']]();
}

function 
ModifyBasicSettings()
{
global $txt$scripturl$context$settings$sc$modSettings;

$config_vars = array(
// Big Options... polls, sticky, bbc....
array('select''pollMode', array(&$txt['smf34'], &$txt['smf32'], &$txt['smf33'])),
'',
// Basic stuff, user languages, titles, flash, permissions...
array('check''allow_guestAccess'),
array('check''userLanguage'),
array('check''allow_editDisplayName'),
array('check''allow_hideOnline'),
array('check''allow_hideEmail'),
array('check''guest_hideContacts'),
array('check''titlesEnable'),
array('check''enable_buddylist'),
array('text''default_personalText'),
array('int''max_signatureLength'),
'',
// Stats, compression, cookies.... server type stuff.
array('text''time_format'),
array('select''number_format', array('1234.00' => '1234.00''1,234.00' => '1,234.00''1.234,00' => '1.234,00''1 234,00' => '1 234,00''1234,00' => '1234,00')),
array('float''time_offset'),
array('int''failed_login_threshold'),
array('int''lastActive'),
array('check''trackStats'),
array('check''hitStats'),
array('check''enableErrorLogging'),
array('check''securityDisable'),
'',
// Reactive on email, and approve on delete
array('check''send_validation_onChange'),
array('check''approveAccountDeletion'),
'',
// Option-ish things... miscellaneous sorta.
array('check''allow_disableAnnounce'),
array('check''disallow_sendBody'),
array('check''modlog_enabled'),
array('check''queryless_urls'),
'',
// Width/Height image reduction.
array('int''max_image_width'),
array('int''max_image_height'),
'',
// Reporting of personal messages?
array('check''enableSinglePM'),

array('check''enableReportPM'),
);

// Saving?
if (isset($_GET['save']))
{
// Fix PM settings.
$_POST['pm_spam_settings'] = (int) $_POST['max_pm_recipients'] . ',' . (int) $_POST['pm_posts_verification'] . ',' . (int) $_POST['pm_posts_per_hour'];
$save_vars $config_vars;
$save_vars[] = array('text''pm_spam_settings');

saveDBSettings($save_vars);

writeLog();
redirectexit('action=featuresettings;sa=basic');
}

// Hack for PM spam settings.
list ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(','$modSettings['pm_spam_settings']);
$config_vars[] = array('int''max_pm_recipients');
$config_vars[] = array('int''pm_posts_verification');
$config_vars[] = array('int''pm_posts_per_hour');

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=basic';
$context['settings_title'] = $txt['mods_cat_features'];

prepareDBSettingContext($config_vars);
}

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

$config_vars = array(
// Compact pages?
array('check''compactTopicPagesEnable'),
array('int''compactTopicPagesContiguous'null$txt['smf235'] . '<div class="smalltext">' str_replace(' ''&nbsp;''"3" ' $txt['smf236'] . ': <b>1 ... 4 [5] 6 ... 9</b>') . '<br />' str_replace(' ''&nbsp;''"5" ' $txt['smf236'] . ': <b>1 ... 3 4 [5] 6 7 ... 9</b>') . '</div>'),
'',
// Stuff that just is everywhere - today, search, online, etc.
array('select''todayMod', array(&$txt['smf290'], &$txt['smf291'], &$txt['smf292'])),
array('check''topbottomEnable'),
array('check''onlineEnable'),
array('check''enableVBStyleLogin'),
'',
// Pagination stuff.
array('int''defaultMaxMembers'),
'',
// This is like debugging sorta.
array('check''timeLoadPageEnable'),
array('check''disableHostnameLookup'),
'',
// Who's online.
array('check''who_enabled'),
'',
// SimpleImageshack mod - SimpleTweaks.co.nr
array('check''SimpleImageShack_enable'),
array('check''SimpleImageShack_permis'),
array('int''SimpleImageShack_width'),
array('int''SimpleImageShack_height'),
array('text''SimpleImageShack_txtclr'),
array('int''SimpleImageShack_uplfld'),
);

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

loadUserSettings();
writeLog();
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=layout';
$context['settings_title'] = $txt['mods_cat_layout'];

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);
}



function 
ModifyProfileSettings()
{
global $sourcedir;
require_once($sourcedir '/CustomProfile.php');
CustomFieldSettings();
}

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

$config_vars = array(
// Karma - On or off?
array('select''karmaMode'explode('|'$txt['smf64'])),
'',
// Who can do it.... and who is restricted by time limits?
array('int''karmaMinPosts'),
array('float''karmaWaitTime'),
array('check''karmaTimeRestrictAdmins'),
'',
// What does it look like?  [smite]?
array('text''karmaLabel'),
array('text''karmaApplaudLabel'),
array('text''karmaSmiteLabel'),
);

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

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=karma';
$context['settings_title'] = $txt['smf293'];

prepareDBSettingContext($config_vars);
}
function 
ModifyMemberColorLinksSettings()
{
global $txt$scripturl$context$settings$sc;

$config_vars = array(
// Standard Membercolor?
array('check''MemberColorLink'),
'',
//Some Stat Settings
array('check''MemberColorLatestMember'),
array('check''MemberColorStats'),
array('check''MemberColorWhoIsOnline'),
'',
//Thread and Boardsettings
array('check''MemberColorThreadOwner'),
array('check''MemberColorThreadLastPost'),
array('check''MemberColorThreadChild'),
'',
//Birthday and Calendar 
array('check''MemberColorBoardindex'),
array('check''MemberColorBirthday'),
'',
//Some Recent Things
array('check''MemberColorRecentOwner'),
array('check''MemberColorRecentLastPost'),
'',
// PM Colors
array('check''MemberColorInbox'),
array('check''MemberColorOutbox'),
'',
//Guest Color
array('text''MemberColorGuests'),
);

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

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=MemberColorLinks';
$context['settings_title'] = $txt['MemberColorLinkHeadline'];

prepareDBSettingContext($config_vars);
}

?>

snork13

try this, backup your old file before uploading.


<?php
/**********************************************************************************
* ModSettings.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 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 Simple Machines LLC.          *
*                                                                                 *
* 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.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* This file is here to make it easier for installed mods to have settings
and options.  It uses the following functions:

void ModifyFeatureSettings()
// !!!

void ModifyFeatureSettings2()
// !!!

void ModifyBasicSettings()
// !!!

void ModifyLayoutSettings()
// !!!

void ModifyKarmaSettings()
// !!!

Adding new settings to the $modSettings array:
---------------------------------------------------------------------------
// !!!
*/

/* Adding options to one of the setting screens isn't hard.  The basic format for a checkbox is:
array('check', 'nameInModSettingsAndSQL'),

   And for a text box:
array('text', 'nameInModSettingsAndSQL')
   (NOTE: You have to add an entry for this at the bottom!)

   In these cases, it will look for $txt['nameInModSettingsAndSQL'] as the description,
   and $helptxt['nameInModSettingsAndSQL'] as the help popup description.

Here's a quick explanation of how to add a new item:

 * A text input box.  For textual values.
ie. array('text', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For numerical values.
ie. array('int', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A text input box.  For floating point values.
ie. array('float', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

         * A large text input box. Used for textual values spanning multiple lines.
ie. array('large_text', 'nameInModSettingsAndSQL', 'OptionalNumberOfRows',
&$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

 * A check box.  Either one or zero. (boolean)
ie. array('check', 'nameInModSettingsAndSQL', null, &$txt['descriptionOfTheOption'],
'OptionalReferenceToHelpAdmin'),

 * A selection box.  Used for the selection of something from a list.
ie. array('select', 'nameInModSettingsAndSQL', array('valueForSQL' => &$txt['displayedValue']),
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),
Note that just saying array('first', 'second') will put 0 in the SQL for 'first'.

 * A password input box. Used for passwords, no less!
ie. array('password', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
&$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

For each option:
type (see above), variable name, size/possible values, description, helptext.
OR make type 'rule' for an empty string for a horizontal rule.
OR make type 'heading' with a string for a titled section. */

// This function passes control through to the relevant tab.
function ModifyFeatureSettings()
{
global $context$txt$scripturl$modSettings$sourcedir;

// You need to be an admin to edit settings!
isAllowedTo('admin_forum');

// All the admin bar, to make it right.
adminIndex('edit_mods_settings');
loadLanguage('Help');
loadLanguage('ModSettings');

// Will need the utility functions from here.
require_once($sourcedir '/ManageServer.php');

$context['page_title'] = $txt['modSettings_title'];
$context['sub_template'] = 'show_settings';

$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',
'profile' => 'ModifyProfileSettings',
'paypal' => 'ModifypayPalSettings',
);

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];

loadLanguage('CustomProfile');
// Load up all the tabs...
$context['admin_tabs'] = array(
'title' => &$txt['modSettings_title'],
'help' => 'modsettings',
'description' => $txt['smf3'],
'tabs' => array(
'basic' => array(
'title' => $txt['mods_cat_features'],
'href' => $scripturl '?action=featuresettings;sa=basic;sesc=' $context['session_id'],
),
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl '?action=featuresettings;sa=layout;sesc=' $context['session_id'],
),
'profile' => array(
'title' => $txt['cp_cpfields'],
'href' => $scripturl '?action=featuresettings;sa=profile;sesc=' $context['session_id'],
),
'MemberColorLinks' => array(
'title' => $txt['MemberColorLinkHeadline'],
'href' => $scripturl '?action=featuresettings;sa=MemberColorLinks;sesc=' $context['session_id'],
),
'paypal' => array(
'title' => $txt['payPalFO'],
'href' => $scripturl '?action=featuresettings;sa=paypal;sesc=' $context['session_id'],
'is_last' => true,
),
'karma' => array(
'title' => $txt['smf293'],
'href' => $scripturl '?action=featuresettings;sa=karma;sesc=' $context['session_id'],
'is_last' => true,
),
),
);

// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']]))
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;

// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}

// 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',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'karma' => 'ModifyKarmaSettings',
'chat' => 'ModifyChatSettings',
'profile' => 'ModifyProfileSettings',
'paypal' => 'ModifypayPalSettings',
);

// 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']]();
}

function 
ModifyBasicSettings()
{
global $txt$scripturl$context$settings$sc$modSettings;

$config_vars = array(
// Big Options... polls, sticky, bbc....
array('select''pollMode', array(&$txt['smf34'], &$txt['smf32'], &$txt['smf33'])),
'',
// Basic stuff, user languages, titles, flash, permissions...
array('check''allow_guestAccess'),
array('check''userLanguage'),
array('check''allow_editDisplayName'),
array('check''allow_hideOnline'),
array('check''allow_hideEmail'),
array('check''guest_hideContacts'),
array('check''titlesEnable'),
array('check''enable_buddylist'),
array('text''default_personalText'),
array('int''max_signatureLength'),
'',
// Stats, compression, cookies.... server type stuff.
array('text''time_format'),
array('select''number_format', array('1234.00' => '1234.00''1,234.00' => '1,234.00''1.234,00' => '1.234,00''1 234,00' => '1 234,00''1234,00' => '1234,00')),
array('float''time_offset'),
array('int''failed_login_threshold'),
array('int''lastActive'),
array('check''trackStats'),
array('check''hitStats'),
array('check''enableErrorLogging'),
array('check''securityDisable'),
'',
// Reactive on email, and approve on delete
array('check''send_validation_onChange'),
array('check''approveAccountDeletion'),
'',
// Option-ish things... miscellaneous sorta.
array('check''allow_disableAnnounce'),
array('check''disallow_sendBody'),
array('check''modlog_enabled'),
array('check''queryless_urls'),
'',
// Width/Height image reduction.
array('int''max_image_width'),
array('int''max_image_height'),
'',
// Reporting of personal messages?
array('check''enableSinglePM'),

array('check''enableReportPM'),
);

// Saving?
if (isset($_GET['save']))
{
// Fix PM settings.
$_POST['pm_spam_settings'] = (int) $_POST['max_pm_recipients'] . ',' . (int) $_POST['pm_posts_verification'] . ',' . (int) $_POST['pm_posts_per_hour'];
$save_vars $config_vars;
$save_vars[] = array('text''pm_spam_settings');

saveDBSettings($save_vars);

writeLog();
redirectexit('action=featuresettings;sa=basic');
}

// Hack for PM spam settings.
list ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(','$modSettings['pm_spam_settings']);
$config_vars[] = array('int''max_pm_recipients');
$config_vars[] = array('int''pm_posts_verification');
$config_vars[] = array('int''pm_posts_per_hour');

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=basic';
$context['settings_title'] = $txt['mods_cat_features'];

prepareDBSettingContext($config_vars);
}

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

$config_vars = array(
// Compact pages?
array('check''compactTopicPagesEnable'),
array('int''compactTopicPagesContiguous'null$txt['smf235'] . '<div class="smalltext">' str_replace(' ''&nbsp;''"3" ' $txt['smf236'] . ': <b>1 ... 4 [5] 6 ... 9</b>') . '<br />' str_replace(' ''&nbsp;''"5" ' $txt['smf236'] . ': <b>1 ... 3 4 [5] 6 7 ... 9</b>') . '</div>'),
'',
// Stuff that just is everywhere - today, search, online, etc.
array('select''todayMod', array(&$txt['smf290'], &$txt['smf291'], &$txt['smf292'])),
array('check''topbottomEnable'),
array('check''onlineEnable'),
array('check''enableVBStyleLogin'),
'',
// Pagination stuff.
array('int''defaultMaxMembers'),
'',
// This is like debugging sorta.
array('check''timeLoadPageEnable'),
array('check''disableHostnameLookup'),
'',
// Who's online.
array('check''who_enabled'),
'',
// SimpleImageshack mod - SimpleTweaks.co.nr
array('check''SimpleImageShack_enable'),
array('check''SimpleImageShack_permis'),
array('int''SimpleImageShack_width'),
array('int''SimpleImageShack_height'),
array('text''SimpleImageShack_txtclr'),
array('int''SimpleImageShack_uplfld'),
);

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

loadUserSettings();
writeLog();
}

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=layout';
$context['settings_title'] = $txt['mods_cat_layout'];

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);
}



function 
ModifyProfileSettings()
{
global $sourcedir;
require_once($sourcedir '/CustomProfile.php');
CustomFieldSettings();
}

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

$config_vars = array(
// Karma - On or off?
array('select''karmaMode'explode('|'$txt['smf64'])),
'',
// Who can do it.... and who is restricted by time limits?
array('int''karmaMinPosts'),
array('float''karmaWaitTime'),
array('check''karmaTimeRestrictAdmins'),
'',
// What does it look like?  [smite]?
array('text''karmaLabel'),
array('text''karmaApplaudLabel'),
array('text''karmaSmiteLabel'),
);

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

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=karma';
$context['settings_title'] = $txt['smf293'];

prepareDBSettingContext($config_vars);
}


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

$config_vars = array(
// Paypal Donations - On or off?
array('check''payPalEnable'),
'',
// Paypal key and Reason
array('large_text''payPalReason','10'),
array('large_text''payPalKey','8'),
            
);

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

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=paypal';
$context['settings_title'] = $txt['payPalFO'];

prepareDBSettingContext($config_vars);
}

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

$config_vars = array(
// Standard Membercolor?
array('check''MemberColorLink'),
'',
//Some Stat Settings
array('check''MemberColorLatestMember'),
array('check''MemberColorStats'),
array('check''MemberColorWhoIsOnline'),
'',
//Thread and Boardsettings
array('check''MemberColorThreadOwner'),
array('check''MemberColorThreadLastPost'),
array('check''MemberColorThreadChild'),
'',
//Birthday and Calendar 
array('check''MemberColorBoardindex'),
array('check''MemberColorBirthday'),
'',
//Some Recent Things
array('check''MemberColorRecentOwner'),
array('check''MemberColorRecentLastPost'),
'',
// PM Colors
array('check''MemberColorInbox'),
array('check''MemberColorOutbox'),
'',
//Guest Color
array('text''MemberColorGuests'),
);

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

$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=MemberColorLinks';
$context['settings_title'] = $txt['MemberColorLinkHeadline'];

prepareDBSettingContext($config_vars);
}

?>


Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

tracie

Hi I am coding a friends forum

using the default template the core...version smf 1.1.3

I had to hand code 3 of the files for this modification..2 things...when I click on the modification link in the admin section I get

QuoteFatal error: Call to undefined function: modifypaypalsettings() in /home/pammie/public_html/holdenbarina/Forums/Sources/ModSettings.php on line 190

this is the line

  $subActions[$_REQUEST['sa']]();

The second thing is...a link does not appear on the main index page...can anyone help please? many thanks.

snork13

Quote from: tracie on July 19, 2007, 06:25:55 AM
Hi I am coding a friends forum

using the default template the core...version smf 1.1.3

I had to hand code 3 of the files for this modification..2 things...when I click on the modification link in the admin section I get

QuoteFatal error: Call to undefined function: modifypaypalsettings() in /home/pammie/public_html/holdenbarina/Forums/Sources/ModSettings.php on line 190

this is the line

  $subActions[$_REQUEST['sa']]();

The second thing is...a link does not appear on the main index page...can anyone help please? many thanks.

your missing the function

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

   $config_vars = array(
         // Paypal Donations - On or off?
         array('check', 'payPalEnable'),
      '',
         // Paypal key and Reason
         array('large_text', 'payPalReason','10'),
         array('large_text', 'payPalKey','8'),
           
   );

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

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
   $context['settings_title'] = $txt['payPalFO'];

   prepareDBSettingContext($config_vars);
}

for the second check the index.template file, your missing the link.

Take another look at the modification.xml file and make sure all the changes have been made.

-snork13
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

tracie

#317
Hello...I just double checked my files and I do have the coding given in  both files...

here is the ModSettings.php 

<?php
/**********************************************************************************
* ModSettings.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 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 Simple Machines LLC.          *
*                                                                                 *
* 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.        *
**********************************************************************************/
if (!defined('SMF'))
   die(
'Hacking attempt...');

/* This file is here to make it easier for installed mods to have settings
   and options.  It uses the following functions:

   void ModifyFeatureSettings()
      // !!!

   void ModifyFeatureSettings2()
      // !!!

   void ModifyBasicSettings()
      // !!!

   void ModifyLayoutSettings()
      // !!!

   void ModifyKarmaSettings()
      // !!!

   Adding new settings to the $modSettings array:
   ---------------------------------------------------------------------------
// !!!
*/

/* Adding options to one of the setting screens isn't hard.  The basic format for a checkbox is:
      array('check', 'nameInModSettingsAndSQL'),

      And for a text box:
      array('text', 'nameInModSettingsAndSQL')
      (NOTE: You have to add an entry for this at the bottom!)

      In these cases, it will look for $txt['nameInModSettingsAndSQL'] as the description,
      and $helptxt['nameInModSettingsAndSQL'] as the help popup description.

   Here's a quick explanation of how to add a new item:

    * A text input box.  For textual values.
   ie.   array('text', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A text input box.  For numerical values.
   ie.   array('int', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A text input box.  For floating point values.
   ie.   array('float', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

         * A large text input box. Used for textual values spanning multiple lines.
   ie.   array('large_text', 'nameInModSettingsAndSQL', 'OptionalNumberOfRows',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A check box.  Either one or zero. (boolean)
   ie.   array('check', 'nameInModSettingsAndSQL', null, &$txt['descriptionOfTheOption'],
         'OptionalReferenceToHelpAdmin'),

    * A selection box.  Used for the selection of something from a list.
   ie.   array('select', 'nameInModSettingsAndSQL', array('valueForSQL' => &$txt['displayedValue']),
         &$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),
   Note that just saying array('first', 'second') will put 0 in the SQL for 'first'.

    * A password input box. Used for passwords, no less!
   ie.   array('password', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

   For each option:
      type (see above), variable name, size/possible values, description, helptext.
   OR make type 'rule' for an empty string for a horizontal rule.
   OR make type 'heading' with a string for a titled section. */

// This function passes control through to the relevant tab.
function ModifyFeatureSettings()
{
   global 
$context$txt$scripturl$modSettings$sourcedir;

   
// You need to be an admin to edit settings!
   
isAllowedTo('admin_forum');

   
// All the admin bar, to make it right.
   
adminIndex('edit_mods_settings');
   
loadLanguage('Help');
   
loadLanguage('ModSettings');

   
// Will need the utility functions from here.
   
require_once($sourcedir '/ManageServer.php');

   
$context['page_title'] = $txt['modSettings_title'];
   
$context['sub_template'] = 'show_settings';

   
$subActions = array(
      
'custombbc' => 'ModifyCustomBBCodeSettings',
      
'invite' => 'ModifyInviteSettings',
      
'basic' => 'ModifyBasicSettings',
      
'layout' => 'ModifyLayoutSettings',
      
'thankyoupost' => 'ModifyThankYouPostSettings',
      
'karma' => 'ModifyKarmaSettings',
      
'paypal' => 'ModifypayPalSettings',
      
'sbox' => 'ModifySboxSettings',

      
'websiteButton' => 'ModifyWebsiteButtonSettings',

   );

   
// By default do the basic settings.
   
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   
$context['sub_action'] = $_REQUEST['sa'];

   
// Load up all the tabs...
   
$context['admin_tabs'] = array(
      
'title' => &$txt['modSettings_title'],
      
'help' => 'modsettings',
      
'description' => $txt['smf3'],
      
'tabs' => array(
         
'basic' => array(
            
'title' => $txt['mods_cat_features'],
            
'href' => $scripturl '?action=featuresettings;sa=basic;sesc=' $context['session_id'],
         ),
         
'layout' => array(
            
'title' => $txt['mods_cat_layout'],
            
'href' => $scripturl '?action=featuresettings;sa=layout;sesc=' $context['session_id'],
         ),

         
'custombbc' => array(
            
'title' => $txt['customBBCode_tabtitle'],
            
'href' => $scripturl '?action=featuresettings;sa=custombbc;sesc=' $context['session_id'],
         ),
         
'thankyoupost' => array(
            
'title' => $txt['thankyouposttitle'],
            
'href' => $scripturl '?action=featuresettings;sa=thankyoupost;sesc=' $context['session_id'],
         ),

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

         
'sbox' => array(
            
'title' => $txt['sbox_ModTitle'],
            
'href' => $scripturl '?action=featuresettings;sa=sbox;sesc=' $context['session_id'],
         ),
                        
'websiteButton' => array(
                                
'title' => $txt['websiteButton_title'],
                                
'href' => $scripturl '?action=featuresettings;sa=websiteButton;sesc=' $context['session_id'],
),
         
'paypal' => array(
            
'title' => $txt['payPalFO'],
            
'href' => $scripturl '?action=featuresettings;sa=paypal;sesc=' $context['session_id'],
            
'is_last' => true,
         ),
         
'karma' => array(
            
'title' => $txt['smf293'],
            
'href' => $scripturl '?action=featuresettings;sa=karma;sesc=' $context['session_id'],
            
'is_last' => true,


         ),
      ),
   );

   
// Select the right tab based on the sub action.
   
if (isset($context['admin_tabs']['tabs'][$context['sub_action']]))
      
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;

   
// Call the right function for this sub-acton.
   
$subActions[$_REQUEST['sa']]();
}

// 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(
      
'custombbc' => 'ModifyCustomBBCodeSettings',
      
'invite' => 'ModifyInviteSettings',
      
'basic' => 'ModifyBasicSettings',
      
'layout' => 'ModifyLayoutSettings',
      
'thankyoupost' => 'ModifyThankYouPostSettings',
      
'karma' => 'ModifyKarmaSettings',
      
'paypal' => 'ModifypayPalSettings',
      
'sbox' => 'ModifySboxSettings',

      
'websiteButton' => 'ModifyWebsiteButtonSettings',

   );

   
// 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']]();
}

function 
ModifyBasicSettings()
{
   global 
$txt$scripturl$context$settings$sc$modSettings;

   
$config_vars = array(
         
// Big Options... polls, sticky, bbc....
         
array('select''pollMode', array(&$txt['smf34'], &$txt['smf32'], &$txt['smf33'])),
      
'',
         
// Basic stuff, user languages, titles, flash, permissions...
         
array('check''allow_guestAccess'),
         array(
'check''userLanguage'),
         array(
'check''allow_editDisplayName'),
         array(
'check''allow_hideOnline'),
         array(
'check''allow_hideEmail'),
         array(
'check''guest_hideContacts'),
         array(
'check''titlesEnable'),
         array(
'check''enable_buddylist'),
         array(
'text''default_personalText'),
         array(
'int''max_signatureLength'),
      
'',
         
// Stats, compression, cookies.... server type stuff.
         
array('text''time_format'),
         array(
'select''number_format', array('1234.00' => '1234.00''1,234.00' => '1,234.00''1.234,00' => '1.234,00''1 234,00' => '1 234,00''1234,00' => '1234,00')),
         array(
'float''time_offset'),
         array(
'int''failed_login_threshold'),
         array(
'int''lastActive'),
         array(
'check''trackStats'),
         array(
'check''hitStats'),
         array(
'check''enableErrorLogging'),
         array(
'check''securityDisable'),
      
'',
         
// Reactive on email, and approve on delete
         
array('check''send_validation_onChange'),
         array(
'check''approveAccountDeletion'),
      
'',
         
// Option-ish things... miscellaneous sorta.
         
array('check''allow_disableAnnounce'),
         array(
'check''disallow_sendBody'),
         array(
'check''modlog_enabled'),
         array(
'check''queryless_urls'),
      
'',
         array(
'check''sitemap_xml'),
         array(
'int''sitemap_topic_count'),
         array(
'check''sitemap_collapsible'),
      
'',
         
// Width/Height image reduction.
         
array('int''max_image_width'),
         array(
'int''max_image_height'),
      
'',
         
// Topic Member Count Settings.
         
array('check''topiccountAllowGuests'),
         array(
'check''topiccountMemberColorLink'),
         array(
'int''topiccountMaxRepliesLimit'),
      
'',
         
// Reporting of personal messages?
         
array('check''enableReportPM'),
         array(
'int''report_board'),

      
'',
         
// Show flags
         
array('select''country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
         array(
'check''country_flag_required'),
         array(
'check''country_flag_show'),
   );

   
// Saving?
   
if (isset($_GET['save']))
   {
      
// Fix PM settings.
      
$_POST['pm_spam_settings'] = (int) $_POST['max_pm_recipients'] . ',' . (int) $_POST['pm_posts_verification'] . ',' . (int) $_POST['pm_posts_per_hour'];
      
$save_vars $config_vars;
      
$save_vars[] = array('text''pm_spam_settings');

      
saveDBSettings($save_vars);

      
writeLog();
      
redirectexit('action=featuresettings;sa=basic');
   }

   
// Hack for PM spam settings.
   
list ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(','$modSettings['pm_spam_settings']);
   
$config_vars[] = array('int''max_pm_recipients');
   
$config_vars[] = array('int''pm_posts_verification');
   
$config_vars[] = array('int''pm_posts_per_hour');

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=basic';
   
$context['settings_title'] = $txt['mods_cat_features'];

   
prepareDBSettingContext($config_vars);
}

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

   
$config_vars = array(
         
// Compact pages?
         
array('check''compactTopicPagesEnable'),
         array(
'int''compactTopicPagesContiguous'null$txt['smf235'] . '<div class="smalltext">' str_replace(' ''&nbsp;''"3" ' $txt['smf236'] . ': <b>1 ... 4 [5] 6 ... 9</b>') . '<br />' str_replace(' ''&nbsp;''"5" ' $txt['smf236'] . ': <b>1 ... 3 4 [5] 6 7 ... 9</b>') . '</div>'),
      
'',
         
// Stuff that just is everywhere - today, search, online, etc.
         
array('select''todayMod', array(&$txt['smf290'], &$txt['smf291'], &$txt['smf292'])),
         array(
'check''topbottomEnable'),
         array(
'check''onlineEnable'),
         array(
'check''enableVBStyleLogin'),
      
'',
         
// Pagination stuff.
         
array('int''defaultMaxMembers'),
      
'',
         
// This is like debugging sorta.
         
array('check''timeLoadPageEnable'),
         array(
'check''disableHostnameLookup'),
      
'',
         
// Who's online.
         
array('check''who_enabled'),
   );

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

      
loadUserSettings();
      
writeLog();
   }

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=layout';
   
$context['settings_title'] = $txt['mods_cat_layout'];

   
prepareDBSettingContext($config_vars);
}

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

   
// WebsiteButton 1.0 Settings
      
$config_vars = array(
         array(
'text''websiteButton_url'),
      );

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

        
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=websiteButton';
        
$context['settings_title'] = isset($txt['websiteButton_title']) ? $txt['websiteButton_title'] : 'Website';

   
prepareDBSettingContext($config_vars);
}
// Invite MOD
function ModifyInviteSettings()
{
   global 
$sourcedir;
   require_once(
$sourcedir '/Invite.php');
   
InviteSettings();
}


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

   
$config_vars = array(
         
// Karma - On or off?
         
array('select''karmaMode'explode('|'$txt['smf64'])),
      
'',
         
// Who can do it.... and who is restricted by time limits?
         
array('int''karmaMinPosts'),
         array(
'float''karmaWaitTime'),
         array(
'check''karmaTimeRestrictAdmins'),
      
'',
         
// What does it look like?  [smite]?
         
array('text''karmaLabel'),
         array(
'text''karmaApplaudLabel'),
         array(
'text''karmaSmiteLabel'),
   );

   
// Saving?
   
if (isset($_GET['save']))
   {
      
saveDBSettings($config_vars);
      
redirectexit('action=featuresettings;sa=karma');
   }
function 
ModifypayPalSettings()
{
   global 
$txt$scripturl$context$settings$sc;

   
$config_vars = array(
         
// Paypal Donations - On or off?
         
array('check''payPalEnable'),
      
'',
         
// Paypal key and Reason
         
array('large_text''payPalReason','10'),
         array(
'large_text''payPalKey','8'),

   );

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

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=paypal';
   
$context['settings_title'] = $txt['payPalFO'];

   
prepareDBSettingContext($config_vars);
}
   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=karma';
   
$context['settings_title'] = $txt['smf293'];

   
prepareDBSettingContext($config_vars);
}

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

   
$config_vars = array(
         
// Thank You Post, some Stanadard settings :)
         
array('check''thankYouPostOnePerPost'),
         array(
'check''thankYouPostColors'),
         array(
'check''thankYouPostDisplayPage'),
      
'',
         
// Okay only the preview settings :)
         
array('check''thankYouPostPreview'),
         array(
'int''thankYouPostPreviewHM'),
         array(
'select''thankYouPostPreviewOrder'explode('|'$txt['thankYouPostPreviewOrderSelect'])),
      
'',
         
// Okay only the Full List settings :)
         
array('select''thankYouPostFullOrder'explode('|'$txt['thankYouPostFullOrderSelect'])),
      
'',
         
//Hmm it'S compatible to my Hide Mod... and have two options xD
         
array('check''thankYouPostUnhidePost'),
         array(
'check''thankYouPostThxUnhideAll'),
         array(
'check''thankYouPostDisableUnhide'),
   );

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

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=thankyoupost';
   
$context['settings_title'] = $txt['thankyouposttitle'];

   
prepareDBSettingContext($config_vars);
}

loadLanguage('sbox');

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

  
$config_vars = array(
    
// Generic stuff
    
array('check''sbox_Visible'),
    array(
'check''sbox_ModsRule'),
    array(
'check''sbox_DoHistory'),
    
'',
    
// Guest stuff
    
array('check''sbox_GuestVisible'),
    array(
'check''sbox_GuestAllowed'),
    array(
'check''sbox_GuestBBC'),
    
'',
    
// Visual
    
array('check''sbox_SmiliesVisible'),
    array(
'check''sbox_UserLinksVisible'),
    array(
'check''sbox_AllowBBC'),
    array(
'check''sbox_NewShoutsBar'),
    array(
'int''sbox_MaxLines'),
    array(
'int''sbox_Height'),
    
'',
    
// Miscellaneous
    
array('int''sbox_RefreshTime'),
    array(
'check''sbox_BlockRefresh'),
    array(
'check''sbox_EnableSounds'),
    
'',
    
// Font stuff
    
array('select''sbox_FontFamily', array(
        
'Garamond, serif' => 'Garamond, serif',
        
'Times, serif' => 'Times, serif',
        
'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',
        
'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif',
        
'Verdana, sans-serif' => 'Verdana, sans-serif',
        
'cursive' => 'cursive',
        
'Palatino, fantasy' => 'Palatino, fantasy',
        
'Courier, monospace' => 'Courier, monospace'
      
),
    ),
    array(
'select''sbox_TextSize', array(
        
'6pt' => '6pt',
        
'7pt' => '7pt',
        
'8pt' => '8pt',
        
'9pt' => '9pt',
        
'10pt' => '10pt',
        
'11pt' => '11pt',
        
'12pt' => '12pt',
        
'13pt' => '13pt',
        
'14pt' => '14pt',
        
'15pt' => '15pt',
        
'16pt' => '16pt',
        
'xx-small' => 'xx-small',
        
'x-small' => 'x-small',
        
'small' => 'small',
        
'medium' => 'medium',
        
'large' => 'large',
        
'x-large' => 'x-large',
        
'xx-large' => 'xx-large'
      
),
    ),
    array(
'text''sbox_TextColor1'),
    array(
'text''sbox_DarkThemes'),
    array(
'text''sbox_TextColor2'),
  );

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

  
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=sbox';
  
$context['settings_title'] = $txt['sbox_ModTitle'];

  
prepareDBSettingContext($config_vars);
}


function 
ModifyCustomBBCodeSettings()
{
   global 
$sourcedir;

   require_once 
$sourcedir '/CustomBBCode.php';

   if (!empty(
$_GET['tag']))
      
EditCustomTag($_GET['tag']);
   else
      
BrowseCustomTags();
}

?>




in the index.template I have

   if ($context['current_action'] == 'usercp')
      $current_action = 'profile';
      if ($context['current_action'] == 'paypal')
      $current_action = 'paypal';
      if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';


and


// Paypal Mod
   if (($modSettings['payPalEnable']) && (allowedTo('payPal_view')))
      echo ($current_action == 'paypal' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'paypal' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=paypal">' , $txt['payPal'] , '</a>
            </td>' , $current_action == 'paypal' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

snork13

Quote from: tracie on July 19, 2007, 10:24:20 AM
Hello...I just double checked my files and I do have the coding given in  both files...

here is the ModSettings.php 

<?php
/**********************************************************************************
* ModSettings.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 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 Simple Machines LLC.          *
*                                                                                 *
* 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.        *
**********************************************************************************/
if (!defined('SMF'))
   die(
'Hacking attempt...');

/* This file is here to make it easier for installed mods to have settings
   and options.  It uses the following functions:

   void ModifyFeatureSettings()
      // !!!

   void ModifyFeatureSettings2()
      // !!!

   void ModifyBasicSettings()
      // !!!

   void ModifyLayoutSettings()
      // !!!

   void ModifyKarmaSettings()
      // !!!

   Adding new settings to the $modSettings array:
   ---------------------------------------------------------------------------
// !!!
*/

/* Adding options to one of the setting screens isn't hard.  The basic format for a checkbox is:
      array('check', 'nameInModSettingsAndSQL'),

      And for a text box:
      array('text', 'nameInModSettingsAndSQL')
      (NOTE: You have to add an entry for this at the bottom!)

      In these cases, it will look for $txt['nameInModSettingsAndSQL'] as the description,
      and $helptxt['nameInModSettingsAndSQL'] as the help popup description.

   Here's a quick explanation of how to add a new item:

    * A text input box.  For textual values.
   ie.   array('text', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A text input box.  For numerical values.
   ie.   array('int', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A text input box.  For floating point values.
   ie.   array('float', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

         * A large text input box. Used for textual values spanning multiple lines.
   ie.   array('large_text', 'nameInModSettingsAndSQL', 'OptionalNumberOfRows',
         &$txt['OptionalDescriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

    * A check box.  Either one or zero. (boolean)
   ie.   array('check', 'nameInModSettingsAndSQL', null, &$txt['descriptionOfTheOption'],
         'OptionalReferenceToHelpAdmin'),

    * A selection box.  Used for the selection of something from a list.
   ie.   array('select', 'nameInModSettingsAndSQL', array('valueForSQL' => &$txt['displayedValue']),
         &$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),
   Note that just saying array('first', 'second') will put 0 in the SQL for 'first'.

    * A password input box. Used for passwords, no less!
   ie.   array('password', 'nameInModSettingsAndSQL', 'OptionalInputBoxWidth',
         &$txt['descriptionOfTheOption'], 'OptionalReferenceToHelpAdmin'),

   For each option:
      type (see above), variable name, size/possible values, description, helptext.
   OR make type 'rule' for an empty string for a horizontal rule.
   OR make type 'heading' with a string for a titled section. */

// This function passes control through to the relevant tab.
function ModifyFeatureSettings()
{
   global 
$context$txt$scripturl$modSettings$sourcedir;

   
// You need to be an admin to edit settings!
   
isAllowedTo('admin_forum');

   
// All the admin bar, to make it right.
   
adminIndex('edit_mods_settings');
   
loadLanguage('Help');
   
loadLanguage('ModSettings');

   
// Will need the utility functions from here.
   
require_once($sourcedir '/ManageServer.php');

   
$context['page_title'] = $txt['modSettings_title'];
   
$context['sub_template'] = 'show_settings';

   
$subActions = array(
      
'custombbc' => 'ModifyCustomBBCodeSettings',
      
'invite' => 'ModifyInviteSettings',
      
'basic' => 'ModifyBasicSettings',
      
'layout' => 'ModifyLayoutSettings',
      
'thankyoupost' => 'ModifyThankYouPostSettings',
      
'karma' => 'ModifyKarmaSettings',
      
'paypal' => 'ModifypayPalSettings',
      
'sbox' => 'ModifySboxSettings',

      
'websiteButton' => 'ModifyWebsiteButtonSettings',

   );

   
// By default do the basic settings.
   
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   
$context['sub_action'] = $_REQUEST['sa'];

   
// Load up all the tabs...
   
$context['admin_tabs'] = array(
      
'title' => &$txt['modSettings_title'],
      
'help' => 'modsettings',
      
'description' => $txt['smf3'],
      
'tabs' => array(
         
'basic' => array(
            
'title' => $txt['mods_cat_features'],
            
'href' => $scripturl '?action=featuresettings;sa=basic;sesc=' $context['session_id'],
         ),
         
'layout' => array(
            
'title' => $txt['mods_cat_layout'],
            
'href' => $scripturl '?action=featuresettings;sa=layout;sesc=' $context['session_id'],
         ),

         
'custombbc' => array(
            
'title' => $txt['customBBCode_tabtitle'],
            
'href' => $scripturl '?action=featuresettings;sa=custombbc;sesc=' $context['session_id'],
         ),
         
'thankyoupost' => array(
            
'title' => $txt['thankyouposttitle'],
            
'href' => $scripturl '?action=featuresettings;sa=thankyoupost;sesc=' $context['session_id'],
         ),

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

         
'sbox' => array(
            
'title' => $txt['sbox_ModTitle'],
            
'href' => $scripturl '?action=featuresettings;sa=sbox;sesc=' $context['session_id'],
         ),
                        
'websiteButton' => array(
                                
'title' => $txt['websiteButton_title'],
                                
'href' => $scripturl '?action=featuresettings;sa=websiteButton;sesc=' $context['session_id'],
),
         
'paypal' => array(
            
'title' => $txt['payPalFO'],
            
'href' => $scripturl '?action=featuresettings;sa=paypal;sesc=' $context['session_id'],
            
'is_last' => true,
         ),
         
'karma' => array(
            
'title' => $txt['smf293'],
            
'href' => $scripturl '?action=featuresettings;sa=karma;sesc=' $context['session_id'],
            
'is_last' => true,


         ),
      ),
   );

   
// Select the right tab based on the sub action.
   
if (isset($context['admin_tabs']['tabs'][$context['sub_action']]))
      
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;

   
// Call the right function for this sub-acton.
   
$subActions[$_REQUEST['sa']]();
}

// 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(
      
'custombbc' => 'ModifyCustomBBCodeSettings',
      
'invite' => 'ModifyInviteSettings',
      
'basic' => 'ModifyBasicSettings',
      
'layout' => 'ModifyLayoutSettings',
      
'thankyoupost' => 'ModifyThankYouPostSettings',
      
'karma' => 'ModifyKarmaSettings',
      
'paypal' => 'ModifypayPalSettings',
      
'sbox' => 'ModifySboxSettings',

      
'websiteButton' => 'ModifyWebsiteButtonSettings',

   );

   
// 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']]();
}

function 
ModifyBasicSettings()
{
   global 
$txt$scripturl$context$settings$sc$modSettings;

   
$config_vars = array(
         
// Big Options... polls, sticky, bbc....
         
array('select''pollMode', array(&$txt['smf34'], &$txt['smf32'], &$txt['smf33'])),
      
'',
         
// Basic stuff, user languages, titles, flash, permissions...
         
array('check''allow_guestAccess'),
         array(
'check''userLanguage'),
         array(
'check''allow_editDisplayName'),
         array(
'check''allow_hideOnline'),
         array(
'check''allow_hideEmail'),
         array(
'check''guest_hideContacts'),
         array(
'check''titlesEnable'),
         array(
'check''enable_buddylist'),
         array(
'text''default_personalText'),
         array(
'int''max_signatureLength'),
      
'',
         
// Stats, compression, cookies.... server type stuff.
         
array('text''time_format'),
         array(
'select''number_format', array('1234.00' => '1234.00''1,234.00' => '1,234.00''1.234,00' => '1.234,00''1 234,00' => '1 234,00''1234,00' => '1234,00')),
         array(
'float''time_offset'),
         array(
'int''failed_login_threshold'),
         array(
'int''lastActive'),
         array(
'check''trackStats'),
         array(
'check''hitStats'),
         array(
'check''enableErrorLogging'),
         array(
'check''securityDisable'),
      
'',
         
// Reactive on email, and approve on delete
         
array('check''send_validation_onChange'),
         array(
'check''approveAccountDeletion'),
      
'',
         
// Option-ish things... miscellaneous sorta.
         
array('check''allow_disableAnnounce'),
         array(
'check''disallow_sendBody'),
         array(
'check''modlog_enabled'),
         array(
'check''queryless_urls'),
      
'',
         array(
'check''sitemap_xml'),
         array(
'int''sitemap_topic_count'),
         array(
'check''sitemap_collapsible'),
      
'',
         
// Width/Height image reduction.
         
array('int''max_image_width'),
         array(
'int''max_image_height'),
      
'',
         
// Topic Member Count Settings.
         
array('check''topiccountAllowGuests'),
         array(
'check''topiccountMemberColorLink'),
         array(
'int''topiccountMaxRepliesLimit'),
      
'',
         
// Reporting of personal messages?
         
array('check''enableReportPM'),
         array(
'int''report_board'),

      
'',
         
// Show flags
         
array('select''country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
         array(
'check''country_flag_required'),
         array(
'check''country_flag_show'),
   );

   
// Saving?
   
if (isset($_GET['save']))
   {
      
// Fix PM settings.
      
$_POST['pm_spam_settings'] = (int) $_POST['max_pm_recipients'] . ',' . (int) $_POST['pm_posts_verification'] . ',' . (int) $_POST['pm_posts_per_hour'];
      
$save_vars $config_vars;
      
$save_vars[] = array('text''pm_spam_settings');

      
saveDBSettings($save_vars);

      
writeLog();
      
redirectexit('action=featuresettings;sa=basic');
   }

   
// Hack for PM spam settings.
   
list ($modSettings['max_pm_recipients'], $modSettings['pm_posts_verification'], $modSettings['pm_posts_per_hour']) = explode(','$modSettings['pm_spam_settings']);
   
$config_vars[] = array('int''max_pm_recipients');
   
$config_vars[] = array('int''pm_posts_verification');
   
$config_vars[] = array('int''pm_posts_per_hour');

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=basic';
   
$context['settings_title'] = $txt['mods_cat_features'];

   
prepareDBSettingContext($config_vars);
}

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

   
$config_vars = array(
         
// Compact pages?
         
array('check''compactTopicPagesEnable'),
         array(
'int''compactTopicPagesContiguous'null$txt['smf235'] . '<div class="smalltext">' str_replace(' ''&nbsp;''"3" ' $txt['smf236'] . ': <b>1 ... 4 [5] 6 ... 9</b>') . '<br />' str_replace(' ''&nbsp;''"5" ' $txt['smf236'] . ': <b>1 ... 3 4 [5] 6 7 ... 9</b>') . '</div>'),
      
'',
         
// Stuff that just is everywhere - today, search, online, etc.
         
array('select''todayMod', array(&$txt['smf290'], &$txt['smf291'], &$txt['smf292'])),
         array(
'check''topbottomEnable'),
         array(
'check''onlineEnable'),
         array(
'check''enableVBStyleLogin'),
      
'',
         
// Pagination stuff.
         
array('int''defaultMaxMembers'),
      
'',
         
// This is like debugging sorta.
         
array('check''timeLoadPageEnable'),
         array(
'check''disableHostnameLookup'),
      
'',
         
// Who's online.
         
array('check''who_enabled'),
   );

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

      
loadUserSettings();
      
writeLog();
   }

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=layout';
   
$context['settings_title'] = $txt['mods_cat_layout'];

   
prepareDBSettingContext($config_vars);
}

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

   
// WebsiteButton 1.0 Settings
      
$config_vars = array(
         array(
'text''websiteButton_url'),
      );

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

        
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=websiteButton';
        
$context['settings_title'] = isset($txt['websiteButton_title']) ? $txt['websiteButton_title'] : 'Website';

   
prepareDBSettingContext($config_vars);
}
// Invite MOD
function ModifyInviteSettings()
{
   global 
$sourcedir;
   require_once(
$sourcedir '/Invite.php');
   
InviteSettings();
}


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

   
$config_vars = array(
         
// Karma - On or off?
         
array('select''karmaMode'explode('|'$txt['smf64'])),
      
'',
         
// Who can do it.... and who is restricted by time limits?
         
array('int''karmaMinPosts'),
         array(
'float''karmaWaitTime'),
         array(
'check''karmaTimeRestrictAdmins'),
      
'',
         
// What does it look like?  [smite]?
         
array('text''karmaLabel'),
         array(
'text''karmaApplaudLabel'),
         array(
'text''karmaSmiteLabel'),
   );

   
// Saving?
   
if (isset($_GET['save']))
   {
      
saveDBSettings($config_vars);
      
redirectexit('action=featuresettings;sa=karma');
   }
function 
ModifypayPalSettings()
{
   global 
$txt$scripturl$context$settings$sc;

   
$config_vars = array(
         
// Paypal Donations - On or off?
         
array('check''payPalEnable'),
      
'',
         
// Paypal key and Reason
         
array('large_text''payPalReason','10'),
         array(
'large_text''payPalKey','8'),

   );

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

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=paypal';
   
$context['settings_title'] = $txt['payPalFO'];

   
prepareDBSettingContext($config_vars);
}
   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=karma';
   
$context['settings_title'] = $txt['smf293'];

   
prepareDBSettingContext($config_vars);
}

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

   
$config_vars = array(
         
// Thank You Post, some Stanadard settings :)
         
array('check''thankYouPostOnePerPost'),
         array(
'check''thankYouPostColors'),
         array(
'check''thankYouPostDisplayPage'),
      
'',
         
// Okay only the preview settings :)
         
array('check''thankYouPostPreview'),
         array(
'int''thankYouPostPreviewHM'),
         array(
'select''thankYouPostPreviewOrder'explode('|'$txt['thankYouPostPreviewOrderSelect'])),
      
'',
         
// Okay only the Full List settings :)
         
array('select''thankYouPostFullOrder'explode('|'$txt['thankYouPostFullOrderSelect'])),
      
'',
         
//Hmm it'S compatible to my Hide Mod... and have two options xD
         
array('check''thankYouPostUnhidePost'),
         array(
'check''thankYouPostThxUnhideAll'),
         array(
'check''thankYouPostDisableUnhide'),
   );

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

   
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=thankyoupost';
   
$context['settings_title'] = $txt['thankyouposttitle'];

   
prepareDBSettingContext($config_vars);
}

loadLanguage('sbox');

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

  
$config_vars = array(
    
// Generic stuff
    
array('check''sbox_Visible'),
    array(
'check''sbox_ModsRule'),
    array(
'check''sbox_DoHistory'),
    
'',
    
// Guest stuff
    
array('check''sbox_GuestVisible'),
    array(
'check''sbox_GuestAllowed'),
    array(
'check''sbox_GuestBBC'),
    
'',
    
// Visual
    
array('check''sbox_SmiliesVisible'),
    array(
'check''sbox_UserLinksVisible'),
    array(
'check''sbox_AllowBBC'),
    array(
'check''sbox_NewShoutsBar'),
    array(
'int''sbox_MaxLines'),
    array(
'int''sbox_Height'),
    
'',
    
// Miscellaneous
    
array('int''sbox_RefreshTime'),
    array(
'check''sbox_BlockRefresh'),
    array(
'check''sbox_EnableSounds'),
    
'',
    
// Font stuff
    
array('select''sbox_FontFamily', array(
        
'Garamond, serif' => 'Garamond, serif',
        
'Times, serif' => 'Times, serif',
        
'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',
        
'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif',
        
'Verdana, sans-serif' => 'Verdana, sans-serif',
        
'cursive' => 'cursive',
        
'Palatino, fantasy' => 'Palatino, fantasy',
        
'Courier, monospace' => 'Courier, monospace'
      
),
    ),
    array(
'select''sbox_TextSize', array(
        
'6pt' => '6pt',
        
'7pt' => '7pt',
        
'8pt' => '8pt',
        
'9pt' => '9pt',
        
'10pt' => '10pt',
        
'11pt' => '11pt',
        
'12pt' => '12pt',
        
'13pt' => '13pt',
        
'14pt' => '14pt',
        
'15pt' => '15pt',
        
'16pt' => '16pt',
        
'xx-small' => 'xx-small',
        
'x-small' => 'x-small',
        
'small' => 'small',
        
'medium' => 'medium',
        
'large' => 'large',
        
'x-large' => 'x-large',
        
'xx-large' => 'xx-large'
      
),
    ),
    array(
'text''sbox_TextColor1'),
    array(
'text''sbox_DarkThemes'),
    array(
'text''sbox_TextColor2'),
  );

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

  
$context['post_url'] = $scripturl '?action=featuresettings2;save;sa=sbox';
  
$context['settings_title'] = $txt['sbox_ModTitle'];

  
prepareDBSettingContext($config_vars);
}


function 
ModifyCustomBBCodeSettings()
{
   global 
$sourcedir;

   require_once 
$sourcedir '/CustomBBCode.php';

   if (!empty(
$_GET['tag']))
      
EditCustomTag($_GET['tag']);
   else
      
BrowseCustomTags();
}

?>




in the index.template I have

   if ($context['current_action'] == 'usercp')
      $current_action = 'profile';
      if ($context['current_action'] == 'paypal')
      $current_action = 'paypal';
      if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';


and


// Paypal Mod
   if (($modSettings['payPalEnable']) && (allowedTo('payPal_view')))
      echo ($current_action == 'paypal' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'paypal' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=paypal">' , $txt['payPal'] , '</a>
            </td>' , $current_action == 'paypal' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


ok, check the language file as well if it's not working in index.template.

and you place the paypal function within the karma function, which is why it won't work as shown here.

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

   $config_vars = array(
         // Karma - On or off?
         array('select', 'karmaMode', explode('|', $txt['smf64'])),
      '',
         // Who can do it.... and who is restricted by time limits?
         array('int', 'karmaMinPosts'),
         array('float', 'karmaWaitTime'),
         array('check', 'karmaTimeRestrictAdmins'),
      '',
         // What does it look like?  [smite]?
         array('text', 'karmaLabel'),
         array('text', 'karmaApplaudLabel'),
         array('text', 'karmaSmiteLabel'),
   );

   // Saving?
   if (isset($_GET['save']))
   {
      saveDBSettings($config_vars);
      redirectexit('action=featuresettings;sa=karma');
   }
function ModifypayPalSettings()
{
   global $txt, $scripturl, $context, $settings, $sc;

   $config_vars = array(
         // Paypal Donations - On or off?
         array('check', 'payPalEnable'),
      '',
         // Paypal key and Reason
         array('large_text', 'payPalReason','10'),
         array('large_text', 'payPalKey','8'),

   );

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

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
   $context['settings_title'] = $txt['payPalFO'];

   prepareDBSettingContext($config_vars);
}
   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
   $context['settings_title'] = $txt['smf293'];

   prepareDBSettingContext($config_vars);
}
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

snork13

it should be

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

   $config_vars = array(
         // Karma - On or off?
         array('select', 'karmaMode', explode('|', $txt['smf64'])),
      '',
         // Who can do it.... and who is restricted by time limits?
         array('int', 'karmaMinPosts'),
         array('float', 'karmaWaitTime'),
         array('check', 'karmaTimeRestrictAdmins'),
      '',
         // What does it look like?  [smite]?
         array('text', 'karmaLabel'),
         array('text', 'karmaApplaudLabel'),
         array('text', 'karmaSmiteLabel'),
   );

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

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
   $context['settings_title'] = $txt['smf293'];

   prepareDBSettingContext($config_vars);
}

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

   $config_vars = array(
         // Paypal Donations - On or off?
         array('check', 'payPalEnable'),
      '',
         // Paypal key and Reason
         array('large_text', 'payPalReason','10'),
         array('large_text', 'payPalKey','8'),

   );

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

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
   $context['settings_title'] = $txt['payPalFO'];

   prepareDBSettingContext($config_vars);
}
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Advertisement: