Vergleich admin/modules/config/profile_fields.php - 1.8.0 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 84Zeile 84
			$new_profile_field = array(
"name" => $db->escape_string($mybb->input['name']),
"description" => $db->escape_string($mybb->input['description']),

			$new_profile_field = array(
"name" => $db->escape_string($mybb->input['name']),
"description" => $db->escape_string($mybb->input['description']),

				"disporder" => (int)$mybb->input['disporder'],

				"disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT),

				"type" => $db->escape_string($thing),
"regex" => $db->escape_string($mybb->input['regex']),

				"type" => $db->escape_string($thing),
"regex" => $db->escape_string($mybb->input['regex']),

				"length" => (int)$mybb->input['length'],
"maxlength" => (int)$mybb->input['maxlength'],
"required" => $db->escape_string($mybb->input['required']),
"registration" => $db->escape_string($mybb->input['registration']),
"profile" => $db->escape_string($mybb->input['profile']),

				"length" => $mybb->get_input('length', MyBB::INPUT_INT),
"maxlength" => $mybb->get_input('maxlength', MyBB::INPUT_INT),
"required" => $mybb->get_input('required', MyBB::INPUT_INT),
"registration" => $mybb->get_input('registration', MyBB::INPUT_INT),
"profile" => $mybb->get_input('profile', MyBB::INPUT_INT),

				"viewableby" => $db->escape_string($mybb->input['viewableby']),
"editableby" => $db->escape_string($mybb->input['editableby']),

				"viewableby" => $db->escape_string($mybb->input['viewableby']),
"editableby" => $db->escape_string($mybb->input['editableby']),

				"postbit" => $db->escape_string($mybb->input['postbit']),
"postnum" => (int)$mybb->input['postnum'],
"allowhtml" => (int)$mybb->input['allowhtml'],
"allowmycode" => (int)$mybb->input['allowmycode'],
"allowsmilies" => (int)$mybb->input['allowsmilies'],
"allowimgcode" => (int)$mybb->input['allowimgcode'],
"allowvideocode" => (int)$mybb->input['allowvideocode']

				"postbit" => $mybb->get_input('postbit', MyBB::INPUT_INT),
"postnum" => $mybb->get_input('postnum', MyBB::INPUT_INT),
"allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT),
"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
"allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT),
"allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT)

			);

$fid = $db->insert_query("profilefields", $new_profile_field);

			);

$fid = $db->insert_query("profilefields", $new_profile_field);


$cache->update_profilefields();

 

$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid{$fid} TEXT");


$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid{$fid} TEXT");





			$plugins->run_hooks("admin_config_profile_fields_add_commit");

			$plugins->run_hooks("admin_config_profile_fields_add_commit");

 

$cache->update_profilefields();


// Log admin action
log_admin_action($fid, $mybb->input['name']);


// Log admin action
log_admin_action($fid, $mybb->input['name']);

Zeile 187Zeile 187
	}

$form_container = new FormContainer($lang->add_new_profile_field);

	}

$form_container = new FormContainer($lang->add_new_profile_field);

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
$select_list = array(
"text" => $lang->text,
"textarea" => $lang->textarea,
"select" => $lang->select,
"multiselect" => $lang->multiselect,
"radio" => $lang->radio,
"checkbox" => $lang->checkbox
);
$form_container->output_row($lang->field_type." <em>*</em>", $lang->field_type_desc, $form->generate_select_box('fieldtype', $select_list, $mybb->input['fieldtype'], array('id' => 'fieldtype')), 'fieldtype');
$form_container->output_row($lang->field_regex, $lang->field_regex_desc, $form->generate_text_box('regex', $mybb->input['regex'], array('id' => 'regex')), 'regex', array(), array('id' => 'row_regex'));
$form_container->output_row($lang->maximum_length, $lang->maximum_length_desc, $form->generate_text_box('maxlength', $mybb->input['maxlength'], array('id' => 'maxlength')), 'maxlength', array(), array('id' => 'row_maxlength'));
$form_container->output_row($lang->field_length, $lang->field_length_desc, $form->generate_text_box('length', $mybb->input['length'], array('id' => 'length')), 'length', array(), array('id' => 'row_fieldlength'));
$form_container->output_row($lang->selectable_options, $lang->selectable_options_desc, $form->generate_text_area('options', $mybb->input['options'], array('id' => 'options')), 'options', array(), array('id' => 'row_options'));
$form_container->output_row($lang->min_posts_enabled, $lang->min_posts_enabled_desc, $form->generate_text_box('postnum', $mybb->input['postnum'], array('id' => 'postnum')), 'postnum');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
$form_container->output_row($lang->required." <em>*</em>", $lang->required_desc, $form->generate_yes_no_radio('required', $mybb->input['required']));
$form_container->output_row($lang->show_on_registration." <em>*</em>", $lang->show_on_registration_desc, $form->generate_yes_no_radio('registration', $mybb->input['registration']));
$form_container->output_row($lang->display_on_profile." <em>*</em>", $lang->display_on_profile_desc, $form->generate_yes_no_radio('profile', $mybb->input['profile']));
$form_container->output_row($lang->display_on_postbit." <em>*</em>", $lang->display_on_postbit_desc, $form->generate_yes_no_radio('postbit', $mybb->input['postbit']));

$selected_values = '';
if($mybb->input['viewableby'] != '' && $mybb->input['viewableby'] != -1)
{
$selected_values = explode(',', (string)$mybb->input['viewableby']);

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['viewableby'] == -1)
{
$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['viewableby'] != '')
{
$group_checked['custom'] = 'checked="checked"';
}
else
{
$group_checked['none'] = 'checked="checked"';
}

print_selection_javascript();

$select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"all\" {$group_checked['all']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_groups}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"custom\" {$group_checked['custom']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_groups}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"viewableby_forums_groups_custom\" class=\"viewableby_forums_groups\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->groups_colon}</small></td>
<td>".$form->generate_group_select('select[viewableby][]', $selected_values, array('id' => 'viewableby', 'multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"none\" {$group_checked['none']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('viewableby');
</script>";
$form_container->output_row($lang->viewableby, $lang->viewableby_desc, $select_code, '', array(), array('id' => 'row_viewableby'));

$selected_values = '';
if($mybb->input['editableby'] != '' && $mybb->input['editableby'] != -1)
{
$selected_values = explode(',', (string)$mybb->input['editableby']);

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['editableby'] == -1)
{
$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['editableby'] != '')
{
$group_checked['custom'] = 'checked="checked"';
}
else
{
$group_checked['none'] = 'checked="checked"';
}

print_selection_javascript();

$select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"all\" {$group_checked['all']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_groups}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"custom\" {$group_checked['custom']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_groups}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"editableby_forums_groups_custom\" class=\"editableby_forums_groups\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->groups_colon}</small></td>
<td>".$form->generate_group_select('select[editableby][]', $selected_values, array('id' => 'editableby', 'multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"none\" {$group_checked['none']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('editableby');
</script>";
$form_container->output_row($lang->editableby, $lang->editableby_desc, $select_code, '', array(), array('id' => 'row_editableby'));

$parser_options = array(
$form->generate_check_box('allowhtml', 1, $lang->parse_allowhtml, array('checked' => $mybb->input['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->parse_allowmycode, array('checked' => $mybb->input['allowmycode'], 'id' => 'allowmycode')),
$form->generate_check_box('allowsmilies', 1, $lang->parse_allowsmilies, array('checked' => $mybb->input['allowsmilies'], 'id' => 'allowsmilies')),
$form->generate_check_box('allowimgcode', 1, $lang->parse_allowimgcode, array('checked' => $mybb->input['allowimgcode'], 'id' => 'allowimgcode')),
$form->generate_check_box('allowvideocode', 1, $lang->parse_allowvideocode, array('checked' => $mybb->input['allowvideocode'], 'id' => 'allowvideocode'))
);
$form_container->output_row($lang->parser_options, '', implode('<br />', $parser_options), '', array(), array('id' => 'row_parser_options'));
$form_container->end();

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
$select_list = array(
"text" => $lang->text,
"textarea" => $lang->textarea,
"select" => $lang->select,
"multiselect" => $lang->multiselect,
"radio" => $lang->radio,
"checkbox" => $lang->checkbox
);
$form_container->output_row($lang->field_type." <em>*</em>", $lang->field_type_desc, $form->generate_select_box('fieldtype', $select_list, $mybb->input['fieldtype'], array('id' => 'fieldtype')), 'fieldtype');
$form_container->output_row($lang->field_regex, $lang->field_regex_desc, $form->generate_text_box('regex', $mybb->input['regex'], array('id' => 'regex')), 'regex', array(), array('id' => 'row_regex'));
$form_container->output_row($lang->maximum_length, $lang->maximum_length_desc, $form->generate_numeric_field('maxlength', $mybb->input['maxlength'], array('id' => 'maxlength', 'min' => 0)), 'maxlength', array(), array('id' => 'row_maxlength'));
$form_container->output_row($lang->field_length, $lang->field_length_desc, $form->generate_numeric_field('length', $mybb->input['length'], array('id' => 'length', 'min' => 0)), 'length', array(), array('id' => 'row_fieldlength'));
$form_container->output_row($lang->selectable_options, $lang->selectable_options_desc, $form->generate_text_area('options', $mybb->input['options'], array('id' => 'options')), 'options', array(), array('id' => 'row_options'));
$form_container->output_row($lang->min_posts_enabled, $lang->min_posts_enabled_desc, $form->generate_numeric_field('postnum', $mybb->input['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
$form_container->output_row($lang->required." <em>*</em>", $lang->required_desc, $form->generate_yes_no_radio('required', $mybb->input['required']));
$form_container->output_row($lang->show_on_registration." <em>*</em>", $lang->show_on_registration_desc, $form->generate_yes_no_radio('registration', $mybb->input['registration']));
$form_container->output_row($lang->display_on_profile." <em>*</em>", $lang->display_on_profile_desc, $form->generate_yes_no_radio('profile', $mybb->input['profile']));
$form_container->output_row($lang->display_on_postbit." <em>*</em>", $lang->display_on_postbit_desc, $form->generate_yes_no_radio('postbit', $mybb->input['postbit']));

$selected_values = '';
if($mybb->input['viewableby'] != '' && $mybb->input['viewableby'] != -1)
{
$selected_values = explode(',', $mybb->get_input('viewableby'));

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['viewableby'] == -1)
{
$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['viewableby'] != '')
{
$group_checked['custom'] = 'checked="checked"';
}
else
{
$group_checked['none'] = 'checked="checked"';
}

print_selection_javascript();

$select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"all\" {$group_checked['all']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_groups}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"custom\" {$group_checked['custom']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_groups}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"viewableby_forums_groups_custom\" class=\"viewableby_forums_groups\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->groups_colon}</small></td>
<td>".$form->generate_group_select('select[viewableby][]', $selected_values, array('id' => 'viewableby', 'multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"viewableby\" value=\"none\" {$group_checked['none']} class=\"viewableby_forums_groups_check\" onclick=\"checkAction('viewableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('viewableby');
</script>";
$form_container->output_row($lang->viewableby, $lang->viewableby_desc, $select_code, '', array(), array('id' => 'row_viewableby'));

$selected_values = '';
if($mybb->input['editableby'] != '' && $mybb->input['editableby'] != -1)
{
$selected_values = explode(',', $mybb->get_input('editableby'));

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['editableby'] == -1)
{
$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['editableby'] != '')
{
$group_checked['custom'] = 'checked="checked"';
}
else
{
$group_checked['none'] = 'checked="checked"';
}

print_selection_javascript();

$select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"all\" {$group_checked['all']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_groups}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"custom\" {$group_checked['custom']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_groups}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"editableby_forums_groups_custom\" class=\"editableby_forums_groups\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->groups_colon}</small></td>
<td>".$form->generate_group_select('select[editableby][]', $selected_values, array('id' => 'editableby', 'multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"editableby\" value=\"none\" {$group_checked['none']} class=\"editableby_forums_groups_check\" onclick=\"checkAction('editableby');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>
</dl>
<script type=\"text/javascript\">
checkAction('editableby');
</script>";
$form_container->output_row($lang->editableby, $lang->editableby_desc, $select_code, '', array(), array('id' => 'row_editableby'));

$parser_options = array(
$form->generate_check_box('allowhtml', 1, $lang->parse_allowhtml, array('checked' => $mybb->input['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->parse_allowmycode, array('checked' => $mybb->input['allowmycode'], 'id' => 'allowmycode')),
$form->generate_check_box('allowsmilies', 1, $lang->parse_allowsmilies, array('checked' => $mybb->input['allowsmilies'], 'id' => 'allowsmilies')),
$form->generate_check_box('allowimgcode', 1, $lang->parse_allowimgcode, array('checked' => $mybb->input['allowimgcode'], 'id' => 'allowimgcode')),
$form->generate_check_box('allowvideocode', 1, $lang->parse_allowvideocode, array('checked' => $mybb->input['allowvideocode'], 'id' => 'allowvideocode'))
);
$form_container->output_row($lang->parser_options, '', implode('<br />', $parser_options), '', array(), array('id' => 'row_parser_options'));
$form_container->end();


$buttons[] = $form->generate_submit_button($lang->save_profile_field);

$form->output_submit_wrapper($buttons);
$form->end();



$buttons[] = $form->generate_submit_button($lang->save_profile_field);

$form->output_submit_wrapper($buttons);
$form->end();


	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>

	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1821"></script>

	<script type="text/javascript">

	<script type="text/javascript">

		$(document).ready(function() {
var maxlength_peeker = new Peeker($("#fieldtype"), $("#row_maxlength, #row_regex, #row_parser_options"), /text|textarea/, false);
var fieldlength_peeker = new Peeker($("#fieldtype"), $("#row_fieldlength"), /select|multiselect/, false);
var options_peeker = new Peeker($("#fieldtype"), $("#row_options"), /select|radio|checkbox/, false);

		$(function() {
new Peeker($("#fieldtype"), $("#row_maxlength, #row_regex, #row_parser_options"), /text|textarea/, false);
new Peeker($("#fieldtype"), $("#row_fieldlength"), /select|multiselect/, false);
new Peeker($("#fieldtype"), $("#row_options"), /select|radio|checkbox/, false);

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

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

Zeile 336Zeile 336

if($mybb->input['action'] == "edit")
{


if($mybb->input['action'] == "edit")
{

	$query = $db->simple_select("profilefields", "*", "fid = '".$mybb->get_input('fid', 1)."'");

	$query = $db->simple_select("profilefields", "*", "fid = '".$mybb->get_input('fid', MyBB::INPUT_INT)."'");

	$profile_field = $db->fetch_array($query);

if(!$profile_field['fid'])

	$profile_field = $db->fetch_array($query);

if(!$profile_field['fid'])

Zeile 405Zeile 405
			$updated_profile_field = array(
"name" => $db->escape_string($mybb->input['name']),
"description" => $db->escape_string($mybb->input['description']),

			$updated_profile_field = array(
"name" => $db->escape_string($mybb->input['name']),
"description" => $db->escape_string($mybb->input['description']),

				"disporder" => (int)$mybb->input['disporder'],

				"disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT),

				"type" => $db->escape_string($type),
"regex" => $db->escape_string($mybb->input['regex']),

				"type" => $db->escape_string($type),
"regex" => $db->escape_string($mybb->input['regex']),

				"length" => (int)$mybb->input['length'],
"maxlength" => (int)$mybb->input['maxlength'],
"required" => $db->escape_string($mybb->input['required']),
"registration" => $db->escape_string($mybb->input['registration']),
"profile" => $db->escape_string($mybb->input['profile']),

				"length" => $mybb->get_input('length', MyBB::INPUT_INT),
"maxlength" => $mybb->get_input('maxlength', MyBB::INPUT_INT),
"required" => $mybb->get_input('required', MyBB::INPUT_INT),
"registration" => $mybb->get_input('registration', MyBB::INPUT_INT),
"profile" => $mybb->get_input('profile', MyBB::INPUT_INT),

				"viewableby" => $db->escape_string($mybb->input['viewableby']),
"editableby" => $db->escape_string($mybb->input['editableby']),

				"viewableby" => $db->escape_string($mybb->input['viewableby']),
"editableby" => $db->escape_string($mybb->input['editableby']),

				"postbit" => $db->escape_string($mybb->input['postbit']),
"postnum" => (int)$mybb->input['postnum'],
"allowhtml" => (int)$mybb->input['allowhtml'],
"allowmycode" => (int)$mybb->input['allowmycode'],
"allowsmilies" => (int)$mybb->input['allowsmilies'],
"allowimgcode" => (int)$mybb->input['allowimgcode'],
"allowvideocode" => (int)$mybb->input['allowvideocode']

				"postbit" => $mybb->get_input('postbit', MyBB::INPUT_INT),
"postnum" => $mybb->get_input('postnum', MyBB::INPUT_INT),
"allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT),
"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT),
"allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT),
"allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT)

			);


			);


			$db->update_query("profilefields", $updated_profile_field, "fid = '".$mybb->get_input('fid', 1)."'");




			$plugins->run_hooks("admin_config_profile_fields_edit_commit");

$db->update_query("profilefields", $updated_profile_field, "fid='{$profile_field['fid']}'");


			$cache->update_profilefields();

			$cache->update_profilefields();


$plugins->run_hooks("admin_config_profile_fields_edit_commit");






			// Log admin action
log_admin_action($profile_field['fid'], $mybb->input['name']);


			// Log admin action
log_admin_action($profile_field['fid'], $mybb->input['name']);


Zeile 443Zeile 443

$sub_tabs['edit_profile_field'] = array(
'title' => $lang->edit_profile_field,


$sub_tabs['edit_profile_field'] = array(
'title' => $lang->edit_profile_field,

		'link' => "index.php?module=config-profile_fields&amp;action=edit&amp;fid=".$mybb->get_input('fid', 1),

		'link' => "index.php?module=config-profile_fields&amp;action=edit&amp;fid={$profile_field['fid']}",

		'description' => $lang->edit_profile_field_desc
);


		'description' => $lang->edit_profile_field_desc
);


Zeile 465Zeile 465
				break;
default:
$mybb->input['viewableby'] = '';

				break;
default:
$mybb->input['viewableby'] = '';

				break;
}

				break;
}


switch($mybb->input['editableby'])
{
case 'all':
$mybb->input['editableby'] = -1;


switch($mybb->input['editableby'])
{
case 'all':
$mybb->input['editableby'] = -1;

				break;

				break;

			case 'custom':
$mybb->input['editableby'] = implode(',', (array)$mybb->input['select']['editableby']);

			case 'custom':
$mybb->input['editableby'] = implode(',', (array)$mybb->input['select']['editableby']);

				break;

				break;

			default:
$mybb->input['editableby'] = '';
break;

			default:
$mybb->input['editableby'] = '';
break;

		}


		}


		$page->output_inline_error($errors);
}
else
{
$type = explode("\n", $profile_field['type'], "2");

		$page->output_inline_error($errors);
}
else
{
$type = explode("\n", $profile_field['type'], "2");





		$mybb->input = $profile_field;
$mybb->input['fieldtype'] = $type[0];
$mybb->input['options'] = $type[1];
}

if(empty($mybb->input['viewableby']))

		$mybb->input = $profile_field;
$mybb->input['fieldtype'] = $type[0];
$mybb->input['options'] = $type[1];
}

if(empty($mybb->input['viewableby']))

	{

	{

		$mybb->input['viewableby'] = '';

		$mybb->input['viewableby'] = '';

	}


	}


	if(empty($mybb->input['editableby']))
{
$mybb->input['editableby'] = '';

	if(empty($mybb->input['editableby']))
{
$mybb->input['editableby'] = '';

	}


	}


	$form_container = new FormContainer($lang->edit_profile_field);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');

	$form_container = new FormContainer($lang->edit_profile_field);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');

Zeile 515Zeile 515
	);
$form_container->output_row($lang->field_type." <em>*</em>", $lang->field_type_desc, $form->generate_select_box('fieldtype', $select_list, $mybb->input['fieldtype'], array('id' => 'fieldtype')), 'fieldtype');
$form_container->output_row($lang->field_regex, $lang->field_regex_desc, $form->generate_text_box('regex', $mybb->input['regex'], array('id' => 'regex')), 'regex', array(), array('id' => 'row_regex'));

	);
$form_container->output_row($lang->field_type." <em>*</em>", $lang->field_type_desc, $form->generate_select_box('fieldtype', $select_list, $mybb->input['fieldtype'], array('id' => 'fieldtype')), 'fieldtype');
$form_container->output_row($lang->field_regex, $lang->field_regex_desc, $form->generate_text_box('regex', $mybb->input['regex'], array('id' => 'regex')), 'regex', array(), array('id' => 'row_regex'));

	$form_container->output_row($lang->maximum_length, $lang->maximum_length_desc, $form->generate_text_box('maxlength', $mybb->input['maxlength'], array('id' => 'maxlength')), 'maxlength', array(), array('id' => 'row_maxlength'));
$form_container->output_row($lang->field_length, $lang->field_length_desc, $form->generate_text_box('length', $mybb->input['length'], array('id' => 'length')), 'length', array(), array('id' => 'row_fieldlength'));

	$form_container->output_row($lang->maximum_length, $lang->maximum_length_desc, $form->generate_numeric_field('maxlength', $mybb->input['maxlength'], array('id' => 'maxlength', 'min' => 0)), 'maxlength', array(), array('id' => 'row_maxlength'));
$form_container->output_row($lang->field_length, $lang->field_length_desc, $form->generate_numeric_field('length', $mybb->input['length'], array('id' => 'length', 'min' => 0)), 'length', array(), array('id' => 'row_fieldlength'));

	$form_container->output_row($lang->selectable_options, $lang->selectable_options_desc, $form->generate_text_area('options', $mybb->input['options'], array('id' => 'options')), 'options', array(), array('id' => 'row_options'));

	$form_container->output_row($lang->selectable_options, $lang->selectable_options_desc, $form->generate_text_area('options', $mybb->input['options'], array('id' => 'options')), 'options', array(), array('id' => 'row_options'));

	$form_container->output_row($lang->min_posts_enabled, $lang->min_posts_enabled_desc, $form->generate_text_box('postnum', $mybb->input['postnum'], array('id' => 'postnum')), 'postnum');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');

	$form_container->output_row($lang->min_posts_enabled, $lang->min_posts_enabled_desc, $form->generate_numeric_field('postnum', $mybb->input['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');

	$form_container->output_row($lang->required." <em>*</em>", $lang->required_desc, $form->generate_yes_no_radio('required', $mybb->input['required']));
$form_container->output_row($lang->show_on_registration." <em>*</em>", $lang->show_on_registration_desc, $form->generate_yes_no_radio('registration', $mybb->input['registration']));
$form_container->output_row($lang->display_on_profile." <em>*</em>", $lang->display_on_profile_desc, $form->generate_yes_no_radio('profile', $mybb->input['profile']));

	$form_container->output_row($lang->required." <em>*</em>", $lang->required_desc, $form->generate_yes_no_radio('required', $mybb->input['required']));
$form_container->output_row($lang->show_on_registration." <em>*</em>", $lang->show_on_registration_desc, $form->generate_yes_no_radio('registration', $mybb->input['registration']));
$form_container->output_row($lang->display_on_profile." <em>*</em>", $lang->display_on_profile_desc, $form->generate_yes_no_radio('profile', $mybb->input['profile']));

Zeile 528Zeile 528
	$selected_values = '';
if($mybb->input['viewableby'] != '' && $mybb->input['viewableby'] != -1)
{

	$selected_values = '';
if($mybb->input['viewableby'] != '' && $mybb->input['viewableby'] != -1)
{

		$selected_values = explode(',', (string)$mybb->input['viewableby']);

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['viewableby'] == -1)
{

		$selected_values = explode(',', $mybb->get_input('viewableby'));

foreach($selected_values as &$value)
{
$value = (int)$value;
}
unset($value);
}

$group_checked = array('all' => '', 'custom' => '', 'none' => '');
if($mybb->input['viewableby'] == -1)
{

		$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['viewableby'] != '')

		$group_checked['all'] = 'checked="checked"';
}
elseif($mybb->input['viewableby'] != '')

Zeile 575Zeile 575
	$selected_values = '';
if($mybb->input['editableby'] != '' && $mybb->input['editableby'] != -1)
{

	$selected_values = '';
if($mybb->input['editableby'] != '' && $mybb->input['editableby'] != -1)
{

		$selected_values = explode(',', (string)$mybb->input['editableby']);

		$selected_values = explode(',', $mybb->get_input('editableby'));


foreach($selected_values as &$value)
{


foreach($selected_values as &$value)
{

Zeile 634Zeile 634
	$form->output_submit_wrapper($buttons);
$form->end();


	$form->output_submit_wrapper($buttons);
$form->end();


	echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>

	echo '<script type="text/javascript" src="./jscripts/peeker.js?ver=1821"></script>

	<script type="text/javascript">

	<script type="text/javascript">

		$(document).ready(function() {
var maxlength_peeker = new Peeker($("#fieldtype"), $("#row_maxlength, #row_regex, #row_parser_options"), /text|textarea/);
var fieldlength_peeker = new Peeker($("#fieldtype"), $("#row_fieldlength"), /select|multiselect/);
var options_peeker = new Peeker($("#fieldtype"), $("#row_options"), /select|radio|checkbox/);

		$(function() {
new Peeker($("#fieldtype"), $("#row_maxlength, #row_regex, #row_parser_options"), /text|textarea/);
new Peeker($("#fieldtype"), $("#row_fieldlength"), /select|multiselect/);
new Peeker($("#fieldtype"), $("#row_options"), /select|radio|checkbox/);

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

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

Zeile 652Zeile 652

if($mybb->input['action'] == "delete")
{


if($mybb->input['action'] == "delete")
{

	$query = $db->simple_select("profilefields", "*", "fid='".$mybb->get_input('fid', 1)."'");

	$query = $db->simple_select("profilefields", "*", "fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'");

	$profile_field = $db->fetch_array($query);

// Does the profile field not exist?

	$profile_field = $db->fetch_array($query);

// Does the profile field not exist?

Zeile 675Zeile 675
		// Delete the profile field
$db->delete_query("profilefields", "fid='{$profile_field['fid']}'");
$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields DROP fid{$profile_field['fid']}");

		// Delete the profile field
$db->delete_query("profilefields", "fid='{$profile_field['fid']}'");
$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields DROP fid{$profile_field['fid']}");


$cache->update_profilefields();

 

$plugins->run_hooks("admin_config_profile_fields_delete_commit");


$plugins->run_hooks("admin_config_profile_fields_delete_commit");

 

$cache->update_profilefields();


// Log admin action
log_admin_action($profile_field['fid'], $profile_field['name']);


// Log admin action
log_admin_action($profile_field['fid'], $profile_field['name']);