Author Topic: Error when loading template  (Read 1941 times)

Offline cbn

Error when loading template
« on: January 02, 2007, 07:04:22 pm »
I got the error below after install the SMF Shop:
Quote
Parse error: parse error, expecting `','' or `';'' in .../Themes/default/index.template.php on line 566

557:             <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
558:                <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
559:             </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
560:
561:    // The [calendar]!
562:    if ($context['allow_calendar'])
563:       echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
564:             <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '"> //Begin SMFShop 2.0 (Build 8) MOD code
565:    //loadLanguage("shop");

566:    echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '

567:          <td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
568:             <a href="', $scripturl, '?action=shop">Shop</a>
569:          </td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
570:    //END SMFShop MOD code

Please Help
 Thanks


Offline Daniel15

Re: Error when loading template
« Reply #1 on: January 02, 2007, 08:17:45 pm »
The section from lines 561 - 570 (the calendar and SMFShop) should look like:
Code: [Select]
// 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>' : '';

//Begin SMFShop 2.0 (Build 8) MOD 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 MOD code

Replace your current code with that, and it should work.

Offline cbn

Re: Error when loading template
« Reply #2 on: January 02, 2007, 08:45:32 pm »
After I replace the code, I got another error message:

Quote
Template Parse Error!
There was a problem loading the /Themes/default/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.


calendar]!
563: if ($context['allow_calendar'])
564: echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
565: <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
566: <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
567: </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
568:
569: //Begin SMFShop 2.0 (Build 8) MOD co

Would you mind to help again? Thanks