\', $scripturl, $rowData[\'id_field\'], $rowData[\'field_name\'], $rowData[\'field_desc\']);
'),
'style' => 'width: 62%;',
),
'sort' => array(
'default' => 'field_name',
'reverse' => 'field_name DESC',
),
),
'field_type' => array(
'header' => array(
'value' => $txt['custom_profile_fieldtype'],
),
'data' => array(
'function' => create_function('$rowData', '
global $txt;
$textKey = sprintf(\'custom_profile_type_%1$s\', $rowData[\'field_type\']);
return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
'),
'style' => 'width: 15%;',
),
'sort' => array(
'default' => 'field_type',
'reverse' => 'field_type DESC',
),
),
'active' => array(
'header' => array(
'value' => $txt['custom_profile_active'],
),
'data' => array(
'function' => create_function('$rowData', '
global $txt;
return $rowData[\'active\'] ? $txt[\'yes\'] : $txt[\'no\'];
'),
'style' => 'width: 8%;',
),
'sort' => array(
'default' => 'active DESC',
'reverse' => 'active',
),
),
'placement' => array(
'header' => array(
'value' => $txt['custom_profile_placement'],
),
'data' => array(
'function' => create_function('$rowData', '
global $txt;
return $txt[\'custom_profile_placement_\' . (empty($rowData[\'placement\']) ? \'standard\' : ($rowData[\'placement\'] == 1 ? \'withicons\' : \'abovesignature\'))];
'),
'style' => 'width: 8%;',
),
'sort' => array(
'default' => 'placement DESC',
'reverse' => 'placement',
),
),
'show_on_registration' => array(
'data' => array(
'sprintf' => array(
'format' => '' . $txt['modify'] . '',
'params' => array(
'id_field' => false,
),
),
'style' => 'width: 15%;',
),
),
),
'form' => array(
'href' => $scripturl . '?action=admin;area=featuresettings;sa=profileedit',
'name' => 'customProfileFields',
),
'additional_rows' => array(
array(
'position' => 'below_table_data',
'value' => '',
),
),
);
createList($listOptions);
// There are two different ways we could get to this point. To keep it simple, they both do
// the same basic thing.
if (isset($_SESSION['adm-save']))
{
$context['saved_successful'] = true;
unset ($_SESSION['adm-save']);
}
}
/**
* Callback for createList().
*
* @param $start
* @param $items_per_page
* @param $sort
* @param $standardFields
*/
function list_getProfileFields($start, $items_per_page, $sort, $standardFields)
{
global $txt, $modSettings, $smcFunc;
$list = array();
if ($standardFields)
{
$standard_fields = array('website', 'personal_text', 'posts', 'warning_status');
$fields_no_registration = array('posts', 'warning_status');
$disabled_fields = isset($modSettings['disabled_profile_fields']) ? explode(',', $modSettings['disabled_profile_fields']) : array();
$registration_fields = isset($modSettings['registration_fields']) ? explode(',', $modSettings['registration_fields']) : array();
foreach ($standard_fields as $field)
$list[] = array(
'id' => $field,
'label' => isset($txt['standard_profile_field_' . $field]) ? $txt['standard_profile_field_' . $field] : (isset($txt[$field]) ? $txt[$field] : $field),
'disabled' => in_array($field, $disabled_fields),
'on_register' => in_array($field, $registration_fields) && !in_array($field, $fields_no_registration),
'can_show_register' => !in_array($field, $fields_no_registration),
);
}
else
{
// Load all the fields.
$request = $smcFunc['db_query']('', '
SELECT id_field, col_name, field_name, field_desc, field_type, field_order, active, placement
FROM {db_prefix}custom_fields
ORDER BY {raw:sort}
LIMIT {int:start}, {int:items_per_page}',
array(
'sort' => $sort,
'start' => $start,
'items_per_page' => $items_per_page,
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
$list[] = $row;
$smcFunc['db_free_result']($request);
}
return $list;
}
/**
* Callback for createList().
*/
function list_getProfileFieldSize()
{
global $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}custom_fields',
array(
)
);
list ($numProfileFields) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
return $numProfileFields;
}
/**
* Edit some profile fields?
*/
function EditCustomProfiles()
{
global $txt, $scripturl, $context, $sc, $smcFunc;
// Sort out the context!
$context['fid'] = isset($_GET['fid']) ? (int) $_GET['fid'] : 0;
$context[$context['admin_menu_name']]['current_subsection'] = 'profile';
$context['page_title'] = $context['fid'] ? $txt['custom_edit_title'] : $txt['custom_add_title'];
$context['sub_template'] = 'edit_profile_field';
// Load the profile language for section names.
loadLanguage('Profile');
// There's really only a few places we can go...
$move_to = array('up', 'down');
// We need this for both moving and saving so put it right here.
$order_count = custFieldsMaxOrder();
if ($context['fid'])
{
$request = $smcFunc['db_query']('', '
SELECT
id_field, col_name, field_name, field_desc, field_type, field_order, field_length, field_options,
show_reg, show_display, show_mlist, show_profile, private, active, default_value, can_search,
bbc, mask, enclose, placement
FROM {db_prefix}custom_fields
WHERE id_field = {int:current_field}',
array(
'current_field' => $context['fid'],
)
);
$context['field'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if ($row['field_type'] == 'textarea')
@list ($rows, $cols) = @explode(',', $row['default_value']);
else
{
$rows = 3;
$cols = 30;
}
$context['field'] = array(
'name' => $row['field_name'],
'desc' => $row['field_desc'],
'colname' => $row['col_name'],
'profile_area' => $row['show_profile'],
'reg' => $row['show_reg'],
'display' => $row['show_display'],
'mlist' => $row['show_mlist'],
'type' => $row['field_type'],
'order' => $row['field_order'],
'max_length' => $row['field_length'],
'rows' => $rows,
'cols' => $cols,
'bbc' => $row['bbc'] ? true : false,
'default_check' => $row['field_type'] == 'check' && $row['default_value'] ? true : false,
'default_select' => $row['field_type'] == 'select' || $row['field_type'] == 'radio' ? $row['default_value'] : '',
'options' => strlen($row['field_options']) > 1 ? explode(',', $row['field_options']) : array('', '', ''),
'active' => $row['active'],
'private' => $row['private'],
'can_search' => $row['can_search'],
'mask' => $row['mask'],
'regex' => substr($row['mask'], 0, 5) == 'regex' ? substr($row['mask'], 5) : '',
'enclose' => $row['enclose'],
'placement' => $row['placement'],
);
}
$smcFunc['db_free_result']($request);
}
// Setup the default values as needed.
if (empty($context['field']))
$context['field'] = array(
'name' => '',
'colname' => '???',
'desc' => '',
'profile_area' => 'forumprofile',
'reg' => false,
'display' => false,
'mlist' => false,
'type' => 'text',
'order' => 0,
'max_length' => 255,
'rows' => 4,
'cols' => 30,
'bbc' => false,
'default_check' => false,
'default_select' => '',
'options' => array('', '', ''),
'active' => true,
'private' => false,
'can_search' => false,
'mask' => 'nohtml',
'regex' => '',
'enclose' => '',
'placement' => 0,
);
// Are we moving it?
if (isset($_GET['move']) && in_array($smcFunc['htmlspecialchars']($_GET['move']), $move_to))
{
// Down is the new up.
$new_order = ($_GET['move'] == 'up' ? ($context['field']['order'] - 1) : ($context['field']['order'] + 1));
// Is this a valid position?
if ($new_order <= 0 || $new_order > $order_count)
redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler
// All good, proceed.
$smcFunc['db_query']('','
UPDATE {db_prefix}custom_fields
SET field_order = {int:old_order}
WHERE field_order = {int:new_order}',
array(
'new_order' => $new_order,
'old_order' => $context['field']['order'],
)
);
$smcFunc['db_query']('','
UPDATE {db_prefix}custom_fields
SET field_order = {int:new_order}
WHERE id_field = {int:id_field}',
array(
'new_order' => $new_order,
'id_field' => $context['fid'],
)
);
redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo perhaps a nice confirmation message, dunno.
}
// Are we saving?
if (isset($_POST['save']))
{
checkSession();
validateToken('admin-ecp');
// Everyone needs a name - even the (bracket) unknown...
if (trim($_POST['field_name']) == '')
redirectexit($scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $_GET['fid'] . ';msg=need_name');
// Regex you say? Do a very basic test to see if the pattern is valid
if (!empty($_POST['regex']) && @preg_match($_POST['regex'], 'dummy') === false)
redirectexit($scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $_GET['fid'] . ';msg=regex_error');
$_POST['field_name'] = $smcFunc['htmlspecialchars']($_POST['field_name']);
$_POST['field_desc'] = $smcFunc['htmlspecialchars']($_POST['field_desc']);
// Checkboxes...
$show_reg = isset($_POST['reg']) ? (int) $_POST['reg'] : 0;
$show_display = isset($_POST['display']) ? 1 : 0;
$show_mlist = isset($_POST['mlist']) ? 1 : 0;
$bbc = isset($_POST['bbc']) ? 1 : 0;
$show_profile = $_POST['profile_area'];
$active = isset($_POST['active']) ? 1 : 0;
$private = isset($_POST['private']) ? (int) $_POST['private'] : 0;
$can_search = isset($_POST['can_search']) ? 1 : 0;
// Some masking stuff...
$mask = isset($_POST['mask']) ? $_POST['mask'] : '';
if ($mask == 'regex' && isset($_POST['regex']))
$mask .= $_POST['regex'];
$field_length = isset($_POST['max_length']) ? (int) $_POST['max_length'] : 255;
$enclose = isset($_POST['enclose']) ? $_POST['enclose'] : '';
$placement = isset($_POST['placement']) ? (int) $_POST['placement'] : 0;
// Select options?
$field_options = '';
$newOptions = array();
$default = isset($_POST['default_check']) && $_POST['field_type'] == 'check' ? 1 : '';
if (!empty($_POST['select_option']) && ($_POST['field_type'] == 'select' || $_POST['field_type'] == 'radio'))
{
foreach ($_POST['select_option'] as $k => $v)
{
// Clean, clean, clean...
$v = $smcFunc['htmlspecialchars']($v);
$v = strtr($v, array(',' => ''));
// Nada, zip, etc...
if (trim($v) == '')
continue;
// Otherwise, save it boy.
$field_options .= $v . ',';
// This is just for working out what happened with old options...
$newOptions[$k] = $v;
// Is it default?
if (isset($_POST['default_select']) && $_POST['default_select'] == $k)
$default = $v;
}
$field_options = substr($field_options, 0, -1);
}
// Text area has default has dimensions
if ($_POST['field_type'] == 'textarea')
$default = (int) $_POST['rows'] . ',' . (int) $_POST['cols'];
// Come up with the unique name?
if (empty($context['fid']))
{
$colname = $smcFunc['substr'](strtr($_POST['field_name'], array(' ' => '')), 0, 6);
preg_match('~([\w\d_-]+)~', $colname, $matches);
// If there is nothing to the name, then let's start out own - for foreign languages etc.
if (isset($matches[1]))
$colname = $initial_colname = 'cust_' . strtolower($matches[1]);
else
$colname = $initial_colname = 'cust_' . mt_rand(1, 9999);
// Make sure this is unique.
$current_fields = array();
$request = $smcFunc['db_query']('', '
SELECT id_field, col_name
FROM {db_prefix}custom_fields');
while ($row = $smcFunc['db_fetch_assoc']($request))
$current_fields[$row['id_field']] = $row['col_name'];
$smcFunc['db_free_result']($request);
$unique = false;
for ($i = 0; !$unique && $i < 9; $i ++)
{
if (!in_array($colname, $current_fields))
$unique = true;
else
$colname = $initial_colname . $i;
}
// Still not a unique column name? Leave it up to the user, then.
if (!$unique)
fatal_lang_error('custom_option_not_unique');
}
// Work out what to do with the user data otherwise...
else
{
// Anything going to check or select is pointless keeping - as is anything coming from check!
if (($_POST['field_type'] == 'check' && $context['field']['type'] != 'check')
|| (($_POST['field_type'] == 'select' || $_POST['field_type'] == 'radio') && $context['field']['type'] != 'select' && $context['field']['type'] != 'radio')
|| ($context['field']['type'] == 'check' && $_POST['field_type'] != 'check'))
{
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}themes
WHERE variable = {string:current_column}
AND id_member > {int:no_member}',
array(
'no_member' => 0,
'current_column' => $context['field']['colname'],
)
);
}
// Otherwise - if the select is edited may need to adjust!
elseif ($_POST['field_type'] == 'select' || $_POST['field_type'] == 'radio')
{
$optionChanges = array();
$takenKeys = array();
// Work out what's changed!
foreach ($context['field']['options'] as $k => $option)
{
if (trim($option) == '')
continue;
// Still exists?
if (in_array($option, $newOptions))
{
$takenKeys[] = $k;
continue;
}
}
// Finally - have we renamed it - or is it really gone?
foreach ($optionChanges as $k => $option)
{
// Just been renamed?
if (!in_array($k, $takenKeys) && !empty($newOptions[$k]))
$smcFunc['db_query']('', '
UPDATE {db_prefix}themes
SET value = {string:new_value}
WHERE variable = {string:current_column}
AND value = {string:old_value}
AND id_member > {int:no_member}',
array(
'no_member' => 0,
'new_value' => $newOptions[$k],
'current_column' => $context['field']['colname'],
'old_value' => $option,
)
);
}
}
// @todo Maybe we should adjust based on new text length limits?
}
// Do the insertion/updates.
if ($context['fid'])
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}custom_fields
SET
field_name = {string:field_name}, field_desc = {string:field_desc},
field_type = {string:field_type}, field_length = {int:field_length},
field_options = {string:field_options}, show_reg = {int:show_reg},
show_display = {int:show_display}, show_mlist = {int:show_mlist}, show_profile = {string:show_profile},
private = {int:private}, active = {int:active}, default_value = {string:default_value},
can_search = {int:can_search}, bbc = {int:bbc}, mask = {string:mask},
enclose = {string:enclose}, placement = {int:placement}
WHERE id_field = {int:current_field}',
array(
'field_length' => $field_length,
'show_reg' => $show_reg,
'show_display' => $show_display,
'show_mlist' => $show_mlist,
'private' => $private,
'active' => $active,
'can_search' => $can_search,
'bbc' => $bbc,
'current_field' => $context['fid'],
'field_name' => $_POST['field_name'],
'field_desc' => $_POST['field_desc'],
'field_type' => $_POST['field_type'],
'field_options' => $field_options,
'show_profile' => $show_profile,
'default_value' => $default,
'mask' => $mask,
'enclose' => $enclose,
'placement' => $placement,
)
);
// Just clean up any old selects - these are a pain!
if (($_POST['field_type'] == 'select' || $_POST['field_type'] == 'radio') && !empty($newOptions))
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}themes
WHERE variable = {string:current_column}
AND value NOT IN ({array_string:new_option_values})
AND id_member > {int:no_member}',
array(
'no_member' => 0,
'new_option_values' => $newOptions,
'current_column' => $context['field']['colname'],
)
);
}
else
{
// Gotta figure it out the order.
$new_order = $order_count > 1 ? ($order_count + 1) : 1;
$smcFunc['db_insert']('',
'{db_prefix}custom_fields',
array(
'col_name' => 'string', 'field_name' => 'string', 'field_desc' => 'string',
'field_type' => 'string', 'field_length' => 'string', 'field_options' => 'string', 'field_order' => 'int',
'show_reg' => 'int', 'show_display' => 'int', 'show_mlist' => 'int', 'show_profile' => 'string',
'private' => 'int', 'active' => 'int', 'default_value' => 'string', 'can_search' => 'int',
'bbc' => 'int', 'mask' => 'string', 'enclose' => 'string', 'placement' => 'int',
),
array(
$colname, $_POST['field_name'], $_POST['field_desc'],
$_POST['field_type'], $field_length, $field_options, $new_order,
$show_reg, $show_display, $show_mlist, $show_profile,
$private, $active, $default, $can_search,
$bbc, $mask, $enclose, $placement,
),
array('id_field')
);
}
}
// Deleting?
elseif (isset($_POST['delete']) && $context['field']['colname'])
{
checkSession();
validateToken('admin-ecp');
// Delete the user data first.
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}themes
WHERE variable = {string:current_column}
AND id_member > {int:no_member}',
array(
'no_member' => 0,
'current_column' => $context['field']['colname'],
)
);
// Finally - the field itself is gone!
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}custom_fields
WHERE id_field = {int:current_field}',
array(
'current_field' => $context['fid'],
)
);
// Re-arrange the order.
$smcFunc['db_query']('','
UPDATE {db_prefix}custom_fields
SET field_order = field_order - 1
WHERE field_order > {int:current_order}',
array(
'current_order' => $context['field']['order'],
)
);
}
// Rebuild display cache etc.
if (isset($_POST['delete']) || isset($_POST['save']))
{
checkSession();
$request = $smcFunc['db_query']('', '
SELECT col_name, field_name, field_type, field_order, bbc, enclose, placement, show_mlist
FROM {db_prefix}custom_fields
WHERE show_display = {int:is_displayed}
AND active = {int:active}
AND private != {int:not_owner_only}
AND private != {int:not_admin_only}
ORDER BY field_order',
array(
'is_displayed' => 1,
'active' => 1,
'not_owner_only' => 2,
'not_admin_only' => 3,
)
);
$fields = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$fields[] = array(
'colname' => strtr($row['col_name'], array('|' => '', ';' => '')),
'title' => strtr($row['field_name'], array('|' => '', ';' => '')),
'type' => $row['field_type'],
'order' => $row['field_order'],
'bbc' => $row['bbc'] ? '1' : '0',
'placement' => !empty($row['placement']) ? $row['placement'] : '0',
'enclose' => !empty($row['enclose']) ? $row['enclose'] : '',
'mlist' => $row['show_mlist'],
);
}
$smcFunc['db_free_result']($request);
updateSettings(array('displayFields' => serialize($fields)));
$_SESSION['adm-save'] = true;
redirectexit('action=admin;area=featuresettings;sa=profile');
}
createToken('admin-ecp');
}
function custFieldsMaxOrder()
{
global $smcFunc;
// Gotta know the order limit
$result = $smcFunc['db_query']('', '
SELECT MAX(field_order)
FROM {db_prefix}custom_fields',
array()
);
list ($order_count) = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);
return (int) $order_count;
}
/**
* Allow to edit the settings on the pruning screen.
* @param $return_config
*/
function ModifyLogSettings($return_config = false)
{
global $txt, $scripturl, $sourcedir, $context, $sc, $modSettings;
// Make sure we understand what's going on.
loadLanguage('ManageSettings');
$context['page_title'] = $txt['log_settings'];
$config_vars = array(
array('check', 'modlog_enabled', 'help' => 'modlog'),
array('check', 'adminlog_enabled', 'help' => 'adminlog'),
array('check', 'userlog_enabled', 'help' => 'userlog'),
// The error log is a wonderful thing.
array('title', 'errlog'),
array('desc', 'error_log_desc'),
array('check', 'enableErrorLogging'),
array('check', 'enableErrorQueryLogging'),
array('check', 'log_ban_hits'),
// Even do the pruning?
array('title', 'pruning_title'),
array('desc', 'pruning_desc'),
// The array indexes are there so we can remove/change them before saving.
'pruningOptions' => array('check', 'pruningOptions'),
'',
// Various logs that could be pruned.
array('int', 'pruneErrorLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Error log.
array('int', 'pruneModLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Moderation log.
array('int', 'pruneBanLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Ban hit log.
array('int', 'pruneReportLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Report to moderator log.
array('int', 'pruneScheduledTaskLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Log of the scheduled tasks and how long they ran.
array('int', 'pruneSpiderHitLog', 'postinput' => $txt['days_word'], 'subtext' => $txt['zero_to_disable']), // Log of the scheduled tasks and how long they ran.
// If you add any additional logs make sure to add them after this point. Additionally, make sure you add them to the weekly scheduled task.
// Mod Developers: Do NOT use the pruningOptions master variable for this as SMF Core may overwrite your setting in the future!
);
// We want to be toggling some of these for a nice user experience. If you want to add yours to the list of those magically hidden when the 'pruning' option is off, add to this.
$prune_toggle = array('pruneErrorLog', 'pruneModLog', 'pruneBanLog', 'pruneReportLog', 'pruneScheduledTaskLog', 'pruneSpiderHitLog');
call_integration_hook('integrate_prune_settings', array(&$config_vars, &$prune_toggle, false));
$prune_toggle_dt = array();
foreach ($prune_toggle as $item)
$prune_toggle_dt[] = 'setting_' . $item;
if ($return_config)
return $config_vars;
addInlineJavascript('
function togglePruned()
{
var newval = $("#pruningOptions").prop("checked");
$("#' . implode(', #', $prune_toggle) . '").closest("dd").toggle(newval);
$("#' . implode(', #', $prune_toggle_dt) . '").closest("dt").toggle(newval);
};
togglePruned();
$("#pruningOptions").click(function() { togglePruned(); });', true);
// We'll need this in a bit.
require_once($sourcedir . '/ManageServer.php');
// Saving?
if (isset($_GET['save']))
{
checkSession();
// Because of the excitement attached to combining pruning log items, we need to duplicate everything here.
$savevar = array(
array('check', 'modlog_enabled'),
array('check', 'adminlog_enabled'),
array('check', 'userlog_enabled'),
array('check', 'enableErrorLogging'),
array('check', 'enableErrorQueryLogging'),
array('check', 'log_ban_hits'),
array('text', 'pruningOptions')
);
call_integration_hook('integrate_prune_settings', array(&$savevar, &$prune_toggle, true));
if (!empty($_POST['pruningOptions']))
{
$vals = array();
foreach ($config_vars as $index => $dummy)
{
if (!is_array($dummy) || $index == 'pruningOptions')
continue;
$vals[] = empty($_POST[$dummy[1]]) || $_POST[$dummy[1]] < 0 ? 0 : (int) $_POST[$dummy[1]];
}
$_POST['pruningOptions'] = implode(',', $vals);
}
else
$_POST['pruningOptions'] = '';
saveDBSettings($savevar);
$_SESSION['adm-save'] = true;
redirectexit('action=admin;area=logs;sa=settings');
}
$context['post_url'] = $scripturl . '?action=admin;area=logs;save;sa=settings';
$context['settings_title'] = $txt['log_settings'];
$context['sub_template'] = 'show_settings';
// Get the actual values
if (!empty($modSettings['pruningOptions']))
@list ($modSettings['pruneErrorLog'], $modSettings['pruneModLog'], $modSettings['pruneBanLog'], $modSettings['pruneReportLog'], $modSettings['pruneScheduledTaskLog'], $modSettings['pruneSpiderHitLog']) = explode(',', $modSettings['pruningOptions']);
else
$modSettings['pruneErrorLog'] = $modSettings['pruneModLog'] = $modSettings['pruneBanLog'] = $modSettings['pruneReportLog'] = $modSettings['pruneScheduledTaskLog'] = $modSettings['pruneSpiderHitLog'] = 0;
prepareDBSettingContext($config_vars);
}
/**
* If you have a general mod setting to add stick it here.
*
* @param $return_config
*/
function ModifyGeneralModSettings($return_config = false)
{
global $txt, $scripturl, $context, $sc;
$config_vars = array(
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
);
// Make it even easier to add new settings.
call_integration_hook('integrate_general_mod_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=general';
$context['settings_title'] = $txt['mods_cat_modifications_misc'];
// No removing this line you, dirty unwashed mod authors. :p
if (empty($config_vars))
{
$context['settings_save_dont_show'] = true;
$context['settings_message'] = '
' . $txt['modification_no_misc_settings'] . '
';
return prepareDBSettingContext($config_vars);
}
// Saving?
if (isset($_GET['save']))
{
checkSession();
$save_vars = $config_vars;
call_integration_hook('integrate_save_general_mod_settings', array(&$save_vars));
// This line is to help mod authors do a search/add after if you want to add something here. Keyword: FOOT TAPPING SUCKS!
saveDBSettings($save_vars);
// This line is to remind mod authors that it's nice to let the users know when something has been saved.
$_SESSION['adm-save'] = true;
// This line is to help mod authors do a search/add after if you want to add something here. Keyword: I LOVE TEA!
redirectexit('action=admin;area=modsettings;sa=general');
}
// This line is to help mod authors do a search/add after if you want to add something here. Keyword: RED INK IS FOR TEACHERS AND THOSE WHO LIKE PAIN!
prepareDBSettingContext($config_vars);
}
?>