unexpected 'endif' (T_ENDIF)

Status
Not open for further replies.

thegrosv

New Member
Messages
4
Reaction score
0
Points
1
Im using siteground-j16-32 template which installed ok , but with the following

Parse error: syntax error, unexpected 'endif' (T_ENDIF) in /home/thegrosv/public_html/templates/siteground-j16-32/templates.php on line 12
I believe the solution is to open tags in php .ini
Anyone have any ideas how to solve
regards and thank you
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

This appears to be an error in the template you downloaded. Please check the code in the file it specifies, since there seems to be quite a few syntax errors there. You might need to contact the template's author about this.

Thank you,
 

thegrosv

New Member
Messages
4
Reaction score
0
Points
1
There is no error in the template , apparently I have to amend php.ini file , but obviously I cant get access to this,
but thank you for your reply , must be something to do with free hosting ????
as follows
Parse error: syntax error, unexpected 'endif' (T_ENDIF) in /home/thegrosv/public_html/templates/siteground-j16-32/templates.php on line 12,

but just incase any php experts are in , this is the offending page

<?if( $sg == 'banner' ):?>
<?php if (JRequest::getVar('view') == 'frontpage'):?>
<!-- SIDE BEGIN --><!-- SIDE END -->
<?php endif?>
<?else:?>
<?php echo $app->getCfg('sitename'); ?>, Powered by <a href="http://joomla.org/" class="sgfooter" target="_blank">Joomla!</a>
$menus = $app->getMenu();
$sgfrontpage = /*SGFRONTPAGE BEGIN*/1/*SGFRONTPAGE END*/;
if ($menu->getActive() == $menu->getDefault() || $sgfrontpage):?>
<!-- FOOTER BEGIN --><a href="http://www.siteground.com/smf-hosting.htm" target="_blank">SMF hosting by SiteGround</a><!-- FOOTER END -->
?php <?endif;?>
<?endif;?>
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
PHP:
<?php endif?>
<?else:?>
If you ask me, this does look a little sudden. If it were to do with the php.ini file then I would imagine it would be to do with short tags.
Personally, I haven't seen that type of format of PHP before (which I've quoted), like 'else' is using a colon instead of a curly bracket (like Python) and 'endif' doesn't have any curly brackets. Perhaps something else was also thrown in before that so that it's actually something else.
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
I took a look at the code. It looks like there is PHP code after the "Powered by" line that doesn't even start with <?php or <?.

Therefore, the "if" statement is not being evaluated as PHP, and so it cannot be closed with "endif".
 

thegrosv

New Member
Messages
4
Reaction score
0
Points
1
Thank you both , I have reinstalled template and have menu and login block back but now I have

Strict Standards: Non-static method JSite::getMenu() should not be called statically, assuming $this from incompatible context in /home/thegrosv/public_html/templates/siteground-j16-32/templates.php on line 7

<?if( $sg == 'banner' ):?>
<?php if (JRequest::getVar('view') == 'frontpage'):?>
<!-- SIDE BEGIN --><!-- SIDE END -->
<?php endif?>
<?else:?>
<?php echo $app->getCfg('sitename'); ?>, Powered by <a href="http://joomla.org/" class="sgfooter" target="_blank">Joomla!</a>
<?php $menu = &JSite::getMenu();
$sgfrontpage = /*SGFRONTPAGE BEGIN*/1/*SGFRONTPAGE END*/;
if ($menu->getActive() == $menu->getDefault() || $sgfrontpage):?>
<!-- FOOTER BEGIN --><a href="http://www.siteground.com/smf-hosting.htm" target="_blank">SMF hosting by SiteGround</a><!-- FOOTER END -->
<?php endif ?>
<?endif;?>
 

thegrosv

New Member
Messages
4
Reaction score
0
Points
1
caftpx10 , you are a star changed configuration .php as mentioned in that topic ....gone
thanks a lot
apprieciated
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Welcome to hell... it is another way to declare a code block
It's actually a very clean way to conditionally include HTML blocks; it beats the heck out of conditional includes or echoing heredoc. Using it for anything other than conditional HTML is a felony in most jurisdictions (in the little world I live in inside my head, la-la-la...). It's honestly good for what it's honestly good for; using it to make PHP look more like Pascal is very, very bad practice.
 
Status
Not open for further replies.
Top