Page 1 of 1

S_USER_LOGGED_IN check fails with 500 error

Posted: Thu Apr 26, 2018 6:52 pm
by theZelot
I have been tasked with updating our phpBB with custom headers and footers.
I am VERY rusty on my php. So be gentle in your response.

I have what I thought was a simple solution to a problem. I know there are other ways to solve this but this is how I chose to solve it...

We have users logging into our main site and when they go to the forums the phpBB takes over I am required to make the login match my main site's look and feel ( thus the reason I am doing it this way )

I have a custom header that runs in overallheader.html page. when served up without this code it runs fine... when I add it if fails with a 500 error. I Would normally just run it through a try catch to see what the error is but i can't find any inline examples of doing it sooooo here I am.

I'm running a fresh install of phpBB 3.2.2

here is the code and HTML in the overall_header template

Code: Select all

                            <div class="log">
                                <!-- IF S_USER_LOGGED_IN -->
                                <a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem"><span class="fa fa-sign-in"></span>/a>
                                <!-- ELSE -->
                                <a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem"><span class="fa fa-sign-out"></span>/a>
                                <!-- END IF-->
                            </div>
If I simply put a mustache output of the variable { S_USER_LOGGED_IN } I get Nothing when not logged in and 1 when they are.

Any help at this point would be great.

-z

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Thu Apr 26, 2018 8:40 pm
by david63
What do your server error logs say about the 500 error?

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Thu Apr 26, 2018 11:03 pm
by Brf
theZelot wrote:
Thu Apr 26, 2018 6:52 pm

Code: Select all

                                <!-- END IF-->
                      
That should be

Code: Select all

                                <!-- END IF -->
                      

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 12:38 pm
by theZelot
The server is maintained by a third party and I don't have access to the logs. He said as soon as he has free time he'll get them for me. In the meantime have you ever seen this type of error? I'm fairly certain it will be a type mismatch at the end. Or a nulled object. It is odd that when I place a mustache around the output it works without error. But when it is evaluated by the the phpbb function it fails.

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 12:44 pm
by theZelot
Brf wrote:
Thu Apr 26, 2018 11:03 pm
theZelot wrote:
Thu Apr 26, 2018 6:52 pm

Code: Select all

                                <!-- END IF-->
                      
That should be

Code: Select all

                                <!-- END IF -->
                      
Thanks for the input but it didn't help. Same error. I don't think the problem is syntax. Got any other ideas until I can get the server logs?

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 1:09 pm
by canonknipser
Your <!-- END IF--> should be <!-- ENDIF --> (one word, no space between end and if)

See: https://area51.phpbb.com/docs/32x/codin ... #templates or nearly every template file in prosilver ;)

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 1:58 pm
by theZelot
That was it. I should learn to read the complete post before I comment ... :)

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 2:18 pm
by theZelot
canonknipser wrote:
Mon Apr 30, 2018 1:09 pm
Your <!-- END IF--> should be <!-- ENDIF --> (one word, no space between end and if)

See: https://area51.phpbb.com/docs/32x/codin ... #templates or nearly every template file in prosilver ;)
That was it. Totally a noob mistake. Is there a complete list of syntax for the template in PHPbb. I just need a reference. The bb's are a we bit too verbose in places. Or is that a complete list?

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Mon Apr 30, 2018 4:38 pm
by canonknipser
Afaik it's a complete list (with explanations and examples), but I would suggest to switch to Twig syntax (which is done by phpBB internal routines anyway). You can use the Twig converter to convert existing template files to twig syntax

Re: S_USER_LOGGED_IN check fails with 500 error

Posted: Thu May 03, 2018 5:32 pm
by theZelot
canonknipser wrote:
Mon Apr 30, 2018 4:38 pm
Afaik it's a complete list (with explanations and examples), but I would suggest to switch to Twig syntax (which is done by phpBB internal routines anyway). You can use the Twig converter to convert existing template files to twig syntax
That is great information and thank you for the help. You're the best.

-z