S_USER_LOGGED_IN check fails with 500 error

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

S_USER_LOGGED_IN check fails with 500 error

Post 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
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: S_USER_LOGGED_IN check fails with 500 error

Post by david63 »

What do your server error logs say about the 500 error?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53412
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: S_USER_LOGGED_IN check fails with 500 error

Post by Brf »

theZelot wrote: Thu Apr 26, 2018 6:52 pm

Code: Select all

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

Code: Select all

                                <!-- END IF -->
                      
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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.
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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?
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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 ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

Re: S_USER_LOGGED_IN check fails with 500 error

Post by theZelot »

That was it. I should learn to read the complete post before I comment ... :)
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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?
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
theZelot
Registered User
Posts: 8
Joined: Thu Apr 26, 2018 6:35 pm

Re: S_USER_LOGGED_IN check fails with 500 error

Post 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
Post Reply

Return to “phpBB Custom Coding”