Help altering code to dropdown

hi all i am not a php coder and dont pretend to know what im doing. but i realy need some help with altering the following code into some sort of dropdown menue

[code] // Show the start of the tab section.
echo ’



';
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '">' , $txt[103] , '</a>
			</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
			</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
			
			// Show the [arcade] button.
			echo ($current_action == 'arcade' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
		<td valign="top" class="maintab_' , $current_action == 'arcade' ? 'active_back' : 'back' , '">
			<a href="', $scripturl, '?action=arcade">' , $txt['arcade'] , '</a>
		</td>' , $current_action == 'arcade' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
	echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
			</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
	echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
			</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
	echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
			</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
	echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
			</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [bookmarks] button
if ($context['user']['is_logged'])
	echo ($current_action == 'bookmarks' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'bookmarks' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=bookmarks">' , $txt['bookmarks'] , '</a>
			</td>' , $current_action == 'bookmarks' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
	echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
			</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
			
			// FlashChat!
global $modSettings;
if ($context['user']['is_logged'])
	echo ($current_action == 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=chat"', (!empty($modSettings['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($modSettings['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]' : ''), '</a>
			</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// the [member] list button
if ($context['allow_memberlist'])
	echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
			</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
			
// the [contact] button
if ($context['allow_view_contact'])
	echo ($current_action == 'contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'contact' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=contact">' , $txt['smfcontact_contact']  , '</a>
			</td>' , $current_action == 'contact' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// the [treasury] button
if ($context['allow_view_treasury'])
	echo ($current_action == 'treasury' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_', $current_action == 'treasury' ? 'active_back' : 'back', '">
				<a href="', $scripturl, '?action=treasury">', $txt['treasury_menu'], '</a>
			</td>', $current_action == 'treasury' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

	
// the [links] button
if ($context['allow_view_smflinks'])
	echo ($current_action == 'links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'links' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=links">' , $txt['smflinks_menu']  , '</a>
			</td>' , $current_action == 'links' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

	
// the [SMF Gallery] button
if ($context['allow_smfgallery_view'])
	echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu']  , '</a>
			</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

	

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
	echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
			</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
	echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
			</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
	echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
			<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
				<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
			</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';[/code]

thanks for any help

 

Dropdowns are HTML elements, and have generally very little to do with PHP. What exactly are you trying to achieve?

Sponsor our Newsletter | Privacy Policy | Terms of Service