Hi there, totally confused and hoping someone can help. I have an existing article template which suddenly developed this error when viewing the article: Parse error: syntax error, unexpected $end in /home/classicr/public_html/components/com_cobalt/views/record/tmpl/default_record_library.php on line 324
My confusion is because I was previously using the template without errors, and to the best of my knowledge nothing was changed. I certainly don't recall making changes at all - the site is under construction and I have been working on other things.
Anyway. I've tried everything I can think of, and run the code through a couple of online php checkers (I'm an utter novice). I did discover that there was an "unclosed" <?php tag, so closed it with ?> but it still returns an error. I've added the code in question here (the last line is the one indicated as incorrect) but will attach the whole file as well.
Basically, if I remove the ?> it then tells me the same thing and indicates the last } as being the problem. If I add the ?> it then indicates that this is the problem. I've done a count on the { and } and there are an equal number in the document, and I don't understand how I can have an opening <?php without the closing one?
Pretty please, can someone assist? I'm not doubt as dumb as I feel right now, but hours later I'm still at a loss and would really appreciate some help.
Many thanks,
Jude
Code is below:
<?php
function group_start($data, $label, $name)
{
static $start = false;
switch ($data->tmpl_params['record']->get('tmpl_params.item_grouping_type', 0))
{
//tab
case 1:
if(!$start)
{
echo '<div class="tab-content" id="tabs-box">';
$start = TRUE;
}
echo '<div class="tab-pane" id="'.$name.'">';
break;
//slider
case 2:
if(!$start)
{
echo '<div class="accordion" id="accordion2">';
$start = TRUE;
}
echo '<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#'.$name.'">
'.$label.'
</a>
</div>
<div id="'.$name.'" class="accordion-body collapse">
<div class="accordion-inner">';
break;
// fieldset
case 3:
echo "<legend>{$label}</legend>";
break;
}
}
function group_end($data)
{
switch ($data->tmpl_params['record']->get('tmpl_params.item_grouping_type', 0))
{
case 1:
echo '</div>';
break;
case 2:
echo '</div></div></div>';
break;
}
}
function total_end($data)
{
switch ($data->tmpl_params['record']->get('tmpl_params.item_grouping_type', 0))
{
//tab
case 1:
echo '</div>';
break;
case 2:
echo '</div>';
break;
}
}
?>
Okay, it won't let me add the whole txt file? Not sure what I should do now...