Vergleich admin/modules/user/users.php - 1.4.4 - 1.4.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: users.php 4272 2008-11-16 23:25:10Z belloman $

 * $Id: users.php 4657 2009-12-24 20:31:25Z RyanGordon $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 159Zeile 159
	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

	// We've selected a new avatar for this user!
if($mybb->input['avatar'])
{

 
		$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']),
"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",

		if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']))
{
$dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']);
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']),
"avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",



 
				"avatartype" => "gallery"
);


				"avatartype" => "gallery"
);


Zeile 245Zeile 246
	// Get a listing of avatars/directories within this gallery
$sub_galleries = $avatars = array();
$files = @scandir($real_path);

	// Get a listing of avatars/directories within this gallery
$sub_galleries = $avatars = array();
$files = @scandir($real_path);

	
if(is_array($files))
{

	
if(is_array($files))
{

		foreach($files as $file)
{
if($file == "." || $file == ".." || $file == ".svn") continue;

		foreach($files as $file)
{
if($file == "." || $file == ".." || $file == ".svn") continue;

Zeile 266Zeile 267
						$has = 1;
break;
}

						$has = 1;
break;
}

				}

				}

				@closedir($dh);
if($has == 1)
{

				@closedir($dh);
if($has == 1)
{

Zeile 277Zeile 278
				}
}
else if(preg_match("#\.(jpg|jpeg|gif|bmp|png)$#i", $file))

				}
}
else if(preg_match("#\.(jpg|jpeg|gif|bmp|png)$#i", $file))

			{

			{

				$friendly_name = preg_replace("#\.(jpg|jpeg|gif|bmp|png)$#i", "", $friendly_name);

// Fetch dimensions

				$friendly_name = preg_replace("#\.(jpg|jpeg|gif|bmp|png)$#i", "", $friendly_name);

// Fetch dimensions

Zeile 365Zeile 366
	else
{
$db->delete_query("awaitingactivation", "uid='{$user['uid']}'");

	else
{
$db->delete_query("awaitingactivation", "uid='{$user['uid']}'");

	}


	}


	// Move out of awaiting activation if they're in it.
if($user['usergroup'] == 5)
{

	// Move out of awaiting activation if they're in it.
if($user['usergroup'] == 5)
{

Zeile 381Zeile 382
	log_admin_action($user['uid'], $user['username']);

if($mybb->input['from'] == "home")

	log_admin_action($user['uid'], $user['username']);

if($mybb->input['from'] == "home")

	{

	{

		if($user['coppauser'])
{
$message = $lang->success_coppa_activated;

		if($user['coppauser'])
{
$message = $lang->success_coppa_activated;

		}

		}

		else
{
$message = $lang->success_activated;

		else
{
$message = $lang->success_activated;

Zeile 396Zeile 397
	else
{
if($user['coppauser'])

	else
{
if($user['coppauser'])

		{

		{

			flash_message($lang->success_coppa_activated, 'success');
}
else

			flash_message($lang->success_coppa_activated, 'success');
}
else

Zeile 432Zeile 433
		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

			foreach($mybb->input['additionalgroups'] as $gid)

			foreach($mybb->input['additionalgroups'] as $key => $gid)

			{
if($gid == $mybb->input['usergroup'])
{

			{
if($gid == $mybb->input['usergroup'])
{

					unset($mybb->input['additionalgroups'][$gid]);

					unset($mybb->input['additionalgroups'][$key]);

				}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);

				}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);

Zeile 568Zeile 569
		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

		// Determine the usergroup stuff
if(is_array($mybb->input['additionalgroups']))
{

			foreach($mybb->input['additionalgroups'] as $gid)

			foreach($mybb->input['additionalgroups'] as $key => $gid)

			{
if($gid == $mybb->input['usergroup'])
{

			{
if($gid == $mybb->input['usergroup'])
{

					unset($mybb->input['additionalgroups'][$gid]);

					unset($mybb->input['additionalgroups'][$key]);

				}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);

				}
}
$additionalgroups = implode(",", $mybb->input['additionalgroups']);

Zeile 924Zeile 925
	}
else
{

	}
else
{

		$percent_posts = round($memprofile['postnum']*100/$posts, 2);;

		$percent_posts = round($user['postnum']*100/$posts, 2);

	}

$user_permissions = user_permissions($user['uid']);

	}

$user_permissions = user_permissions($user['uid']);

Zeile 960Zeile 961
		$age = '';
}


		$age = '';
}


	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"{$user['avatar']}\" style=\"margin-top: {$avatar_top}px\" width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('rowspan' => 6, 'width' => 1));

	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"".htmlspecialchars_uni($user['avatar'])."\" style=\"margin-top: {$avatar_top}px\" width=\"{$scaled_dimensions['width']}\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('rowspan' => 6, 'width' => 1));

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

	$table->construct_cell("<strong>{$lang->email_address}:</strong> <a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>");
$table->construct_cell("<strong>{$lang->last_active}:</strong> {$last_active}");
$table->construct_row();

Zeile 1045Zeile 1046
		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");

		$form->generate_check_box("remember", 1, $lang->remember_login_details, array("checked" => $mybb->input['remember']))
);
$form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");








	
if($mybb->input['pmnotice'] > 1)
{
$mybb->input['pmnotice'] = 1;
}


	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

	$messaging_options = array(
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
$form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])),

Zeile 1193Zeile 1199
	$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	$table = new Table;
$table->construct_header($lang->current_avatar, array('colspan' => 2));


	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"{$user['avatar']}\" width=\"{$scaled_dimensions['width']}\" style=\"margin-top: {$avatar_top}px\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('width' => 1));

	$table->construct_cell("<div style=\"width: 126px; height: 126px;\" class=\"user_avatar\"><img src=\"".htmlspecialchars_uni($user['avatar'])."\" width=\"{$scaled_dimensions['width']}\" style=\"margin-top: {$avatar_top}px\" height=\"{$scaled_dimensions['height']}\" alt=\"\" /></div>", array('width' => 1));


if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{


if($user['avatartype'] == "upload" || stristr($user['avatar'], $mybb->settings['avataruploadpath']))
{

Zeile 1305Zeile 1311
		$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");
$db->delete_query("users", "uid='{$user['uid']}'");

		$db->delete_query("banned", "uid='{$user['uid']}'");
$db->delete_query("threadratings", "uid='{$user['uid']}'");
$db->delete_query("users", "uid='{$user['uid']}'");

 
		$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");


// Update forum stats
update_stats(array('numusers' => '-1'));


// Update forum stats
update_stats(array('numusers' => '-1'));

Zeile 1355Zeile 1363
	
$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['conditions']['referrer'] = $mybb->input['uid'];

	
$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['conditions']['referrer'] = $mybb->input['uid'];





	echo build_users_view($admin_view);

$page->output_footer();

	echo build_users_view($admin_view);

$page->output_footer();

Zeile 1445Zeile 1453
}

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

}

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

{

{

	$plugins->run_hooks("admin_user_users_merge");

if($mybb->request_method == "post")

	$plugins->run_hooks("admin_user_users_merge");

if($mybb->request_method == "post")

Zeile 1453Zeile 1461
		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['source_username']))."'");
$source_user = $db->fetch_array($query);
if(!$source_user['uid'])

		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['source_username']))."'");
$source_user = $db->fetch_array($query);
if(!$source_user['uid'])

		{

		{

			$errors[] = $lang->error_invalid_user_source;

			$errors[] = $lang->error_invalid_user_source;

		}


		}


		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['destination_username']))."'");
$destination_user = $db->fetch_array($query);
if(!$destination_user['uid'])

		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['destination_username']))."'");
$destination_user = $db->fetch_array($query);
if(!$destination_user['uid'])

		{

		{

			$errors[] = $lang->error_invalid_user_destination;
}


			$errors[] = $lang->error_invalid_user_destination;
}


Zeile 1474Zeile 1482
			// Begin to merge the accounts
$uid_update = array(
"uid" => $destination_user['uid']

			// Begin to merge the accounts
$uid_update = array(
"uid" => $destination_user['uid']

			);

			);

			$query = $db->simple_select("adminoptions", "uid", "uid='{$destination_user['uid']}'");
$existing_admin_options = $db->fetch_field($query, "uid");

			$query = $db->simple_select("adminoptions", "uid", "uid='{$destination_user['uid']}'");
$existing_admin_options = $db->fetch_field($query, "uid");





			// Only carry over admin options/permissions if we don't already have them
if(!$existing_admin_options)

			// Only carry over admin options/permissions if we don't already have them
if(!$existing_admin_options)

			{

			{

				$db->update_query("adminoptions", $uid_update, "uid='{$source_user['uid']}'");

				$db->update_query("adminoptions", $uid_update, "uid='{$source_user['uid']}'");

			}


			}


			$db->update_query("adminlog", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("announcements", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("events", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("adminlog", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("announcements", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("events", $uid_update, "uid='{$source_user['uid']}'");

Zeile 1493Zeile 1501
			$db->update_query("pollvotes", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("pollvotes", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("reputation", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reputation", array('adduid' => $destination_user['uid']), "adduid='{$source_user['uid']}'");

 
			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->delete_query("sessions", "uid='{$source_user['uid']}'");

			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->delete_query("sessions", "uid='{$source_user['uid']}'");

 
			
// Merging Reputation
$query = $db->simple_select("reputation", "rid, uid", "adduid = '{$source_user['uid']}' OR adduid = '{$uid_update['uid']}'", array("order_by" => "dateline", "order_dir" => "DESC"));
while($result = $db->fetch_array($query))
{
// Let's try and remove old one if it's the same uid
if($result['uid'] == $last['uid'])
{
$db->delete_query("reputation", "rid = '".$result['rid']."'");
$db->update_query("reputation", array("adduid" => $uid_update['uid']), "rid = '".$last['rid']."'");
}
$last = array(
"rid" => $result['rid'],
"uid" => $result['uid']
);
}

// Calculate new reputation
$query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'");
$total_reputation = $db->fetch_field($query, "total_rep");

// No reputation?
if(!$total_reputation)
{
$total_reputation = '0';
}





 
			$db->update_query("users", array('reputation' => $total_reputation), "uid='{$destination_user['uid']}'");


			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

			// Additional updates for non-uid fields
$last_poster = array(
"lastposteruid" => $destination_user['uid'],

Zeile 1523Zeile 1557
			// Delete the old user
$db->delete_query("users", "uid='{$source_user['uid']}'");
$db->delete_query("banned", "uid='{$source_user['uid']}'");

			// Delete the old user
$db->delete_query("users", "uid='{$source_user['uid']}'");
$db->delete_query("banned", "uid='{$source_user['uid']}'");

 
			
// Get a list of forums where post count doesn't apply
$fids = array();
$query = $db->simple_select("forums", "fid", "usepostcounts=0");
while($fid = $db->fetch_field($query, "fid"))
{
$fids[] = $fid;
}

$fids_not_in = '';
if(!empty($fids))
{
$fids_not_in = "AND fid NOT IN(".implode(',', $fids).")";
}

			
// Update user post count

			
// Update user post count

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."'");

			$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");

			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']
);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");

			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']
);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");

 
			
// Use the earliest registration date
if($destination_user['regdate'] > $source_user['regdate'])
{
$db->update_query("users", array('regdate' => $source_user['regdate']), "uid='{$destination_user['uid']}'");
}


update_stats(array('numusers' => '-1'));



update_stats(array('numusers' => '-1'));


Zeile 1588Zeile 1642
	if($mybb->request_method == "post" || $mybb->input['results'] == 1)
{
// Build view options from incoming search options

	if($mybb->request_method == "post" || $mybb->input['results'] == 1)
{
// Build view options from incoming search options

		if($mybb->input['vid'])
{
$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);
}

		if($mybb->input['vid'])
{
$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);
}

		}

if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])

		}

if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])

Zeile 1793Zeile 1847
	// If we have any error messages, show them
if($errors)
{

	// If we have any error messages, show them
if($errors)
{

 
		echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n";

		$page->output_inline_error($errors);
}


		$page->output_inline_error($errors);
}


Zeile 1860Zeile 1915
	if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&amp;", "&", $view['url']))
{
update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));

	if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&amp;", "&", $view['url']))
{
update_admin_session('last_users_url', str_replace("&amp;", "&", $view['url']));

 
	}

// Do we not have any views?
if(empty($view))
{
return false;

	}

$table = new Table;

	}

$table = new Table;

Zeile 1884Zeile 1945
				$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

				$field_options['class'] = "align_".$view_field['align'];
}
$table->construct_header($view_field['title'], $field_options);

		}
}



		}
}



	$search_sql = '1=1';

// Build the search SQL for users

	$search_sql = '1=1';

// Build the search SQL for users

Zeile 1949Zeile 2010
			else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);

			else
{
$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);

				$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);

 
				if(!is_array($ip_range))
{
$ip_sql = "long{$search_field}='{$ip_range}'";

				if(!is_array($ip_range))
{
$ip_sql = "long{$search_field}='{$ip_range}'";

Zeile 1975Zeile 2035
		else
{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);

		else
{
$ip_range = fetch_longipv4_range($view['conditions']['postip']);

			$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);

 
			if(!is_array($ip_range))

			if(!is_array($ip_range))

			{

			{

				$ip_sql = "longipaddress='{$ip_range}'";

				$ip_sql = "longipaddress='{$ip_range}'";

			}

			}

			else
{
$ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}
}

			else
{
$ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
}
}

		$search_sql .= " AND EXISTS (SELECT uid FROM ".TABLE_PREFIX."posts WHERE {$ip_sql} AND uid=u.uid)";








		$ip_uids = array(0);
$query = $db->simple_select("posts", "uid", $ip_sql);
while($uid = $db->fetch_field($query, "uid"))
{
$ip_uids[] = $uid;
}
$search_sql .= " AND u.uid IN(".implode(',', $ip_uids).")";
unset($ip_uids);

	}

// Usergroup based searching

	}

// Usergroup based searching

Zeile 2020Zeile 2086

// Extra SQL?
if($view['extra_sql'])


// Extra SQL?
if($view['extra_sql'])

	{

	{

		$search_sql .= $view['extra_sql'];
}


		$search_sql .= $view['extra_sql'];
}


Zeile 2066Zeile 2132
		
switch($view['sortby'])
{

		
switch($view['sortby'])
{

			case "numposts":
$view['sortby'] = "postnum";
break;

 
			case "regdate":
case "lastactive":
case "postnum":
case "reputation":

			case "regdate":
case "lastactive":
case "postnum":
case "reputation":

 
				$view['sortby'] = $db->escape_string($view['sortby']);
break;
case "numposts":
$view['sortby'] = "postnum";
break;

			case "warninglevel":

			case "warninglevel":

 
				$view['sortby'] = "warningpoints";

				break;
default:
$view['sortby'] = "username";

				break;
default:
$view['sortby'] = "username";

Zeile 2170Zeile 2239
			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

			{
$user['avatar'] = "styles/{$page->style}/images/default_avatar.gif";
}

			$user['view']['avatar'] = "<img src=\"{$user['avatar']}\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";

			$user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";


if($view['view_type'] == "card")
{


if($view['view_type'] == "card")
{

Zeile 2504Zeile 2573
				foreach($select_options as $val)
{
$val = trim($val);

				foreach($select_options as $val)
{
$val = trim($val);

					$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $values[$field_name] ? true : false)))."<br />";

					$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $selected_options[$val] ? true : false)))."<br />";

				}
break;
case "textarea":

				}
break;
case "textarea":