Vergleich admin/modules/config/settings.php - 1.8.6 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 441Zeile 441
	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1804"></script>
<script type="text/javascript">
$(document).ready(function() {

	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1804"></script>
<script type="text/javascript">
$(document).ready(function() {

			var peeker = new Peeker($("#type"), $("#row_extra"), /select|radio|checkbox|php/, false);

			new Peeker($("#type"), $("#row_extra"), /^(select|radio|checkbox|php)$/, false);

		});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");

		});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");

Zeile 659Zeile 659
	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1804"></script>
<script type="text/javascript">
$(document).ready(function() {

	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1804"></script>
<script type="text/javascript">
$(document).ready(function() {

			var peeker = new Peeker($("#type"), $("#row_extra"), /select|radio|checkbox|php/, false);

			new Peeker($("#type"), $("#row_extra"), /^(select|radio|checkbox|php)$/, false);

		});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");

		});
// Add a star to the extra row since the "extra" is required if the box is shown
add_star("row_extra");

Zeile 893Zeile 893
				'email',
'email2',
'imagestring',

				'email',
'email2',
'imagestring',

 
				'imagehash',
'answer',
'question_id',

				'allownotices',
'hideemail',
'receivepms',

				'allownotices',
'hideemail',
'receivepms',

Zeile 905Zeile 908
				'language',
'step',
'action',

				'language',
'step',
'action',

 
				'agree',
'regtime',
'regcheck1',
'regcheck2',

				'regsubmit'
);


				'regsubmit'
);


Zeile 918Zeile 925
			}
}


			}
}


		// Get settings which optionscode is a forum/group select

		// Get settings which optionscode is a forum/group select, checkbox or numeric

		// We cannot rely on user input to decide this

		// We cannot rely on user input to decide this

		$forum_group_select = array();
$query = $db->simple_select('settings', 'name', 'optionscode IN (\'forumselect\', \'groupselect\')');
while($name = $db->fetch_field($query, 'name'))


		$checkbox_settings = $forum_group_select = array();
$query = $db->simple_select('settings', 'name, optionscode', "optionscode IN('forumselect', 'groupselect', 'numeric') OR optionscode LIKE 'checkbox%'");

while($multisetting = $db->fetch_array($query))

		{

		{

			$forum_group_select[] = $name;





















			if(substr($multisetting['optionscode'], 0, 8) == 'checkbox')
{
$checkbox_settings[] = $multisetting['name'];

// All checkboxes deselected = no $mybb->input['upsetting'] for them, we need to initialize it manually then, but only on pages where the setting is shown
if(empty($mybb->input['upsetting'][$multisetting['name']]) && isset($mybb->input["isvisible_{$multisetting['name']}"]))
{
$mybb->input['upsetting'][$multisetting['name']] = array();
}
}
elseif($multisetting['optionscode'] == 'numeric')
{
if(isset($mybb->input['upsetting'][$multisetting['name']]))
{
$mybb->input['upsetting'][$multisetting['name']] = (int)$mybb->input['upsetting'][$multisetting['name']];
}
}
else
{
$forum_group_select[] = $multisetting['name'];
}

		}

if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)
{

		}

if(is_array($mybb->input['upsetting']))
{
foreach($mybb->input['upsetting'] as $name => $value)
{

				if(!empty($forum_group_select) && in_array($name, $forum_group_select))

				if($forum_group_select && in_array($name, $forum_group_select))

				{
if($value == 'all')
{

				{
if($value == 'all')
{

Zeile 940Zeile 968
					elseif($value == 'custom')
{
if(isset($mybb->input['select'][$name]) && is_array($mybb->input['select'][$name]))

					elseif($value == 'custom')
{
if(isset($mybb->input['select'][$name]) && is_array($mybb->input['select'][$name]))

						{

						{

							foreach($mybb->input['select'][$name] as &$val)
{
$val = (int)$val;
}
unset($val);

							foreach($mybb->input['select'][$name] as &$val)
{
$val = (int)$val;
}
unset($val);


$value = implode(',', (array)$mybb->input['select'][$name]);
}


$value = implode(',', $mybb->input['select'][$name]);
}

						else
{
$value = '';
}
}
else

						else
{
$value = '';
}
}
else

					{

					{

						$value = '';
}
}

						$value = '';
}
}


$value = $db->escape_string($value);
$db->update_query("settings", array('value' => $value), "name='".$db->escape_string($name)."'");









				elseif($checkbox_settings && in_array($name, $checkbox_settings))
{
$value = '';

if(is_array($mybb->input['upsetting'][$name]))
{
$value = implode(',', $mybb->input['upsetting'][$name]);
}
}

$db->update_query("settings", array('value' => $db->escape_string($value)), "name='".$db->escape_string($name)."'");

			}
}


			}
}


Zeile 985Zeile 1021
			{
$updated_task = array(
"enabled" => 0

			{
$updated_task = array(
"enabled" => 0

				);
}

				);
}

			else
{
$updated_task = array(

			else
{
$updated_task = array(

Zeile 994Zeile 1030
				);
}
$db->update_query("tasks", $updated_task, "file='threadviews'");

				);
}
$db->update_query("tasks", $updated_task, "file='threadviews'");

		}

		}


// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out
if($mybb->input['upsetting']['cookieprefix'] && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['cookieprefix'])


// Have we changed our cookie prefix? If so, update our adminsid so we're not logged out
if($mybb->input['upsetting']['cookieprefix'] && $mybb->input['upsetting']['cookieprefix'] != $mybb->settings['cookieprefix'])

Zeile 1008Zeile 1044
		if($mybb->input['upsetting']['captchaimage'] == 2 && !$mybb->input['upsetting']['captchaprivatekey'] && !$mybb->input['upsetting']['captchapublickey'])
{
$db->update_query("settings", array("value" => 1), "name = 'captchaimage'");

		if($mybb->input['upsetting']['captchaimage'] == 2 && !$mybb->input['upsetting']['captchaprivatekey'] && !$mybb->input['upsetting']['captchapublickey'])
{
$db->update_query("settings", array("value" => 1), "name = 'captchaimage'");

		}

		}


rebuild_settings();



rebuild_settings();


Zeile 1022Zeile 1058

// Log admin action
log_admin_action();


// Log admin action
log_admin_action();





		flash_message($lang->success_settings_updated, 'success');
admin_redirect("index.php?module=config-settings");
}

		flash_message($lang->success_settings_updated, 'success');
admin_redirect("index.php?module=config-settings");
}

Zeile 1042Zeile 1078
			WHERE s.name LIKE '%{$search}%' OR s.title LIKE '%{$search}%' OR s.description LIKE '%{$search}%' OR g.name LIKE '%{$search}%' OR g.title LIKE '%{$search}%' OR g.description LIKE '%{$search}%'
ORDER BY s.disporder
");

			WHERE s.name LIKE '%{$search}%' OR s.title LIKE '%{$search}%' OR s.description LIKE '%{$search}%' OR g.name LIKE '%{$search}%' OR g.title LIKE '%{$search}%' OR g.description LIKE '%{$search}%'
ORDER BY s.disporder
");

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))
{

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}

if(!$db->num_rows($query))
{

			if(isset($mybb->input['ajax_search']))
{
echo json_encode(array("errors" => array($lang->error_no_settings_found)));

			if(isset($mybb->input['ajax_search']))
{
echo json_encode(array("errors" => array($lang->error_no_settings_found)));

Zeile 1068Zeile 1104
		while($group = $db->fetch_array($query))
{
$cache_groups[$group['gid']] = $group;

		while($group = $db->fetch_array($query))
{
$cache_groups[$group['gid']] = $group;

		}

		}


// Page header only if not AJAX
if(!isset($mybb->input['ajax_search']))
{
$page->add_breadcrumb_item($lang->settings_search);
$page->output_header($lang->board_settings." - {$lang->settings_search}");


// Page header only if not AJAX
if(!isset($mybb->input['ajax_search']))
{
$page->add_breadcrumb_item($lang->settings_search);
$page->output_header($lang->board_settings." - {$lang->settings_search}");

		}

		}


$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");



$form = new Form("index.php?module=config-settings&amp;action=change", "post", "change");


Zeile 1096Zeile 1132

// Cache settings
$query = $db->simple_select("settings", "*", "gid='".$mybb->get_input('gid', MyBB::INPUT_INT)."'", array('order_by' => 'disporder'));


// Cache settings
$query = $db->simple_select("settings", "*", "gid='".$mybb->get_input('gid', MyBB::INPUT_INT)."'", array('order_by' => 'disporder'));

		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}


		while($setting = $db->fetch_array($query))
{
$cache_settings[$setting['gid']][$setting['sid']] = $setting;
}


		if(!$db->num_rows($query))
{
flash_message($lang->error_no_settings_found, 'error');

		if(!$db->num_rows($query))
{
flash_message($lang->error_no_settings_found, 'error');

Zeile 1215Zeile 1251
				closedir($dir);
ksort($folders);
$setting_code = $form->generate_select_box($element_name, $folders, $setting['value'], array('id' => $element_id));

				closedir($dir);
ksort($folders);
$setting_code = $form->generate_select_box($element_name, $folders, $setting['value'], array('id' => $element_id));

			}

			}

			else if($type[0] == "language")
{
$languages = $lang->get_languages();

			else if($type[0] == "language")
{
$languages = $lang->get_languages();

Zeile 1343Zeile 1379
			}
else
{

			}
else
{

				for($i=0; $i < count($type); $i++)








				$typecount = count($type);

if($type[0] == 'checkbox')
{
$multivalue = explode(',', $setting['value']);
}

for($i = 0; $i < $typecount; $i++)

				{
$optionsexp = explode("=", $type[$i]);
if(!isset($optionsexp[1]))

				{
$optionsexp = explode("=", $type[$i]);
if(!isset($optionsexp[1]))

Zeile 1361Zeile 1404
						$option_list[$optionsexp[0]] = htmlspecialchars_uni($optionsexp[1]);
}
else if($type[0] == "radio")

						$option_list[$optionsexp[0]] = htmlspecialchars_uni($optionsexp[1]);
}
else if($type[0] == "radio")

					{

					{

						if($setting['value'] == $optionsexp[0])
{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

						if($setting['value'] == $optionsexp[0])
{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

						}
else

						}
else

						{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));
}
}
else if($type[0] == "checkbox")
{

						{
$option_list[$i] = $form->generate_radio_button($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));
}
}
else if($type[0] == "checkbox")
{

						if($setting['value'] == $optionsexp[0])

						if(in_array($optionsexp[0], $multivalue))

						{

						{

							$option_list[$i] = $form->generate_check_box($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

							$option_list[$i] = $form->generate_check_box("{$element_name}[]", $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, "checked" => 1, 'class' => $element_id));

						}
else
{

						}
else
{

							$option_list[$i] = $form->generate_check_box($element_name, $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));

							$option_list[$i] = $form->generate_check_box("{$element_name}[]", $optionsexp[0], htmlspecialchars_uni($optionsexp[1]), array('id' => $element_id.'_'.$i, 'class' => $element_id));

						}
}
}

						}
}
}

 
				

				if($type[0] == "select")

				if($type[0] == "select")

				{

				{

					$setting_code = $form->generate_select_box($element_name, $option_list, $setting['value'], array('id' => $element_id));
}
else
{
$setting_code = implode("<br />", $option_list);

					$setting_code = $form->generate_select_box($element_name, $option_list, $setting['value'], array('id' => $element_id));
}
else
{
$setting_code = implode("<br />", $option_list);

 
					
if($type[0] == 'checkbox')
{
$setting_code .= $form->generate_hidden_field("isvisible_{$setting['name']}", 1);
}

				}
$option_list = array();
}

				}
$option_list = array();
}

 
			

			// Do we have a custom language variable for this title or description?
$title_lang = "setting_".$setting['name'];
$desc_lang = $title_lang."_desc";

			// Do we have a custom language variable for this title or description?
$title_lang = "setting_".$setting['name'];
$desc_lang = $title_lang."_desc";

Zeile 1628Zeile 1678
		'new Peeker($("#setting_mail_handler"), $("#row_setting_smtp_host, #row_setting_smtp_port, #row_setting_smtp_user, #row_setting_smtp_pass, #row_setting_secure_smtp"), "smtp", false)',
'new Peeker($("#setting_mail_handler"), $("#row_setting_mail_parameters"), "mail", false)',
'new Peeker($("#setting_captchaimage"), $("#row_setting_captchapublickey, #row_setting_captchaprivatekey"), /(2|4)/, false)',

		'new Peeker($("#setting_mail_handler"), $("#row_setting_smtp_host, #row_setting_smtp_port, #row_setting_smtp_user, #row_setting_smtp_pass, #row_setting_secure_smtp"), "smtp", false)',
'new Peeker($("#setting_mail_handler"), $("#row_setting_mail_parameters"), "mail", false)',
'new Peeker($("#setting_captchaimage"), $("#row_setting_captchapublickey, #row_setting_captchaprivatekey"), /(2|4)/, false)',

		'new Peeker($("#setting_captchaimage"), $("#row_setting_ayahpublisherkey, #row_setting_ayahscoringkey"), 3, false)',

 
		'new Peeker($(".setting_contact"), $("#row_setting_contact_guests, #row_setting_contact_badwords, #row_setting_contact_maxsubjectlength, #row_setting_contact_minmessagelength, #row_setting_contact_maxmessagelength"), 1, true)',
'new Peeker($(".setting_enablepruning"), $("#row_setting_enableprunebyposts, #row_setting_pruneunactived, #row_setting_prunethreads"), 1, true)',
'new Peeker($(".setting_enableprunebyposts"), $("#row_setting_prunepostcount, #row_setting_dayspruneregistered, #row_setting_prunepostcountall"), 1, true)',

		'new Peeker($(".setting_contact"), $("#row_setting_contact_guests, #row_setting_contact_badwords, #row_setting_contact_maxsubjectlength, #row_setting_contact_minmessagelength, #row_setting_contact_maxmessagelength"), 1, true)',
'new Peeker($(".setting_enablepruning"), $("#row_setting_enableprunebyposts, #row_setting_pruneunactived, #row_setting_prunethreads"), 1, true)',
'new Peeker($(".setting_enableprunebyposts"), $("#row_setting_prunepostcount, #row_setting_dayspruneregistered, #row_setting_prunepostcountall"), 1, true)',