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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 105Zeile 105

$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']);





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

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

Zeile 139Zeile 139
	if($errors)
{
switch($mybb->input['viewableby'])

	if($errors)
{
switch($mybb->input['viewableby'])

		{

		{

			case 'all':
$mybb->input['viewableby'] = -1;

			case 'all':
$mybb->input['viewableby'] = -1;

				break;

				break;

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

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

				break;

				break;

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

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

				break;

				break;

		}

switch($mybb->input['editableby'])

		}

switch($mybb->input['editableby'])

Zeile 165Zeile 165
		}

$page->output_inline_error($errors);

		}

$page->output_inline_error($errors);

	}

	}

	else
{
$mybb->input['fieldtype'] = 'textbox';

	else
{
$mybb->input['fieldtype'] = 'textbox';

Zeile 174Zeile 174
		$mybb->input['editable'] = 1;
$mybb->input['hidden'] = 0;
$mybb->input['postbit'] = 0;

		$mybb->input['editable'] = 1;
$mybb->input['hidden'] = 0;
$mybb->input['postbit'] = 0;

	}


	}


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

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

	{

	{

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

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

	}


	}


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

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

	{

	{

		$mybb->input['editableby'] = '';
}


		$mybb->input['editableby'] = '';
}


	$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>

	$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_numeric_field('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_numeric_field('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_numeric_field('postnum', $mybb->input['postnum'], array('id' => 'postnum')), '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')), '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>";

	<script type=\"text/javascript\">
checkAction('viewableby');
</script>";

Zeile 423Zeile 423
				"allowimgcode" => (int)$mybb->input['allowimgcode'],
"allowvideocode" => (int)$mybb->input['allowvideocode']
);

				"allowimgcode" => (int)$mybb->input['allowimgcode'],
"allowvideocode" => (int)$mybb->input['allowvideocode']
);

 

$plugins->run_hooks("admin_config_profile_fields_edit_commit");


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

$cache->update_profilefields();


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

$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 462Zeile 462
				break;
case 'custom':
$mybb->input['viewableby'] = implode(',', (array)$mybb->input['select']['viewableby']);

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

				break;

				break;

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

switch($mybb->input['editableby'])

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

switch($mybb->input['editableby'])

		{

		{

			case 'all':
$mybb->input['editableby'] = -1;
break;

			case 'all':
$mybb->input['editableby'] = -1;
break;

Zeile 484Zeile 484
		$page->output_inline_error($errors);
}
else

		$page->output_inline_error($errors);
}
else

	{

	{

		$type = explode("\n", $profile_field['type'], "2");

$mybb->input = $profile_field;

		$type = explode("\n", $profile_field['type'], "2");

$mybb->input = $profile_field;

Zeile 500Zeile 500
	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 = 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');

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')), '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')), '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')), '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')), '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 527Zeile 527

$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' => '');

	{
$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"';

	if($mybb->input['viewableby'] == -1)
{
$group_checked['all'] = 'checked="checked"';

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