Author Topic: Help Creating Menu (Not Buttons)  (Read 1949 times)

Offline NinjaNT

Help Creating Menu (Not Buttons)
« on: July 14, 2008, 09:11:39 am »
Okay, so I've gotten everything installed and went to modify the menu.  Simply changing the code won't figuring its based on text.  So I tried using the code from default, doesn't work its based on a link.  So now I need help; here's the original code from the default theme:

Code: [Select]
//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END SMFShop code

Now here's a basic idea of how the menu is built in the theme I'm using

Code: [Select]
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>
<li class="mainnavDivider"><!-- /--></li>';

I tried installing it this way:
Code: [Select]
//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ?
<li><a href="', $scripturl, '?action=shop">' , $txt['Shop'] , '</a></li>
<li class="mainnavDivider"><!-- /--></li>';

But it gives me this warning

Quote
Template Parse Error!
There was a problem loading the /Themes/Aa_New_Damage_v2/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

PHP Error Message

Parse error: syntax error, unexpected ',' in ..../Themes/Aa_New_Damage_v2/index.template.php on line 680


Please help me :(

Offline Toups

Re: Help Creating Menu (Not Buttons)
« Reply #1 on: July 21, 2008, 03:27:45 am »
not that experienced with php but to me.. for that error looks like you missed a ' in your code you added after the echo:

Yours:
Code: [Select]
//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ?
<li><a href="', $scripturl, '?action=shop">' , $txt['Shop'] , '</a></li>
<li class="mainnavDivider"><!-- /--></li>';

With the non-missing:
Code: [Select]
//Begin SMFShop code
//loadLanguage("shop");
echo ' ($current_action == 'shop' || $context['browser']['is_ie4']) ?
<li><a href="', $scripturl, '?action=shop">' , $txt['Shop'] , '</a></li>
<li class="mainnavDivider"><!-- /--></li>';

try that :)