• Welcome to Simple Machines Community Forum. Please login or sign up.

White Screen when not logged in - SMF 2.0.17

Started by Payou, June 26, 2020, 12:11:34 PM

Previous topic - Next topic

Payou

Hello!

I am actually making a forum using SMF 2.0.17. The forum was looking good but this morning I realized that the forum is completely blank (even if I inspect the page) when the user is not logged in. I dont know where I can find the MySQL and PHP version I use.

You can still go manually on the forum using ?action=login to log on. Once you're on any account, the forum goes back to normal, no blank page whatsoever.
I checked my log_errors on my db but it only returns this error
Quote2: Use of undefined constant Site - assumed 'Site' (this will throw an Error in a future version of PHP)
[...]/BoardIndex.template.php (body_above sub template - eval?) - Line 288
But I checked my line 288 and it's blank, there's nothing on this line. There are on 287 and 289, but not 288.

The problem is that when you're not logged in, the page is completely white, so I can't have members registering. I tried adding some code in the header of the index_template.php to force the redirection to the login page (only to the users that are not logged in yet) :


$redirecturl = "http://lsplusforum.fr/forum/index.php?action=login";
if(empty($context['user']['is_logged']))
echo '<meta http-equiv="refresh" content="60;url=\'' . $redirecturl . '\'" />';


It does work perfectly when you are on the login page, but it doesn't work on the index.php alone, even when content is at 0.

You can try it for yourself at hxxp:lsplusforum.fr/forum/index.php [nonactive]

Sir Osis of Liver

In your database, go to smf_settings, set theme_default to 1.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Payou


Sir Osis of Liver

I'm seeing custom login page, not default Curve.  Are you using SSI for login?

You can get php and mysql versions using phpinfo (attached), but don't think that's your problem.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Sir Osis of Liver

Looks like you're running Greeny theme.  Are theme_allow, theme_default, theme_guests all set to 1?

If you can login and get to admin, set overall default theme to Curve and reset everyone.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Shambles

Did you by any chance remove some or all the files in the default (curve) theme folder?



Arantor

QuoteI tried adding some code in the header of the index_template.php to force the redirection to the login page (only to the users that are not logged in yet) :

You don't need to do that, please remove your changes; you can disable guest access from an option in the admin panel.
No good deed goes unpunished
All helpful urges should be circumvented

Payou

@Shambles No, I only use the Greeny Theme.

@Arantor I put this code to try if it could change anything, not necessarily make it permanent

@Sir Osis. I'm not on the computer right now, will try later tonight

Kindred

you use only the greeny theme...  BUT -- you NEVER can remove the files in the default theme folder (aka Curve theme) -- nor should you replace those files with your custom theme -- always use a separate directory for your custom themes -- the default theme is the fall-back if the custom theme has not defined a custom version of any individual template file.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

It's installed in /Themes/Greeny/, but some of it's been modded, and Curve may be broken.  Guests see Greeny, registration loads, but that's as far as I can get.
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Payou

@Kindred I really dont remember deleting or editing any files in the Curvy Theme. Though, someone else used to make the forum before me. But they didn't have any knowledge in ftp and stuff so I don't think it were them.

@Sir Osis I've made an account so you can test the logged side.
User : smfsupport
Pass : support2020

Yes I did add plugins to the forum, and I know how to script in php HTML so I edited some pages. But I didn't make any changes recently that would explain my problem.

Sir Osis of Liver

Everything seems to be working in Greeny when logged in.  Best guess is guests are seeing different theme.  Check if  theme_default, theme_guests are set to 1, that should reset everything to Curve.  If theme_default is already set to 1, you've broken something in theme installs, or settings are screwed up.  Have you run repair_settings?  It allows you to fix theme paths and reset all users to default Curve.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

lurkalot

Funny enough we had exact same scenario over on the tinyportal.net site about 6 days ago.  So thought I'd throw it in here just in case.  ;)

You could view the site logged in, but as guest the site was giving a white screen.   The only thing I noticed was one of the recent posts contained Turkish language and was showing strange characters Dimond's etc in the topic title.  This caused the page to choke completely for some reason, just a white page, and only as guest.  I edited the Topic title and the page loaded normally. If I pasted the original title back in it choked with a white screen again. 

Our database wasn't properly converted to utf8, which it is now.    Everything back to normal.  Never seen this happen before.

Payou

@lurkalot I tried what you said. In French we use acute accent just like in my case : Deban = Dé-bannissement.

I tried changing that 'é' to a 'e' and it resolved the problem.

lurkalot

Quote from: Payou on June 26, 2020, 02:50:45 PM
@lurkalot I tried what you said. In French we use acute accent just like in my case : Deban = Dé-bannissement.

I tried changing that 'é' to a 'e' and it resolved the problem.

Yep, that was worth mentioning then after all.  It's working for me too now.  ;)

Now all you've got to do it stop it happening again.

Payou

I will convert my database to utf8 like you said as soon as I get to my computer

Sir Osis of Liver

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

lurkalot

Quote from: Sir Osis of Liver on June 26, 2020, 09:25:18 PM
Nice catch, Mick.

Thanks, but still don't know why it would spit its dummy out on something like this.  Like I said I haven't noticed it before until last week when we had the issue.

Jesse17

My site has been running since 2011, IIRC. No problems. In May I updated one version at a time from 2.0.8 to 2.0.17. Still no problems until the last week or two where I started having this same issue. You could log in if you followed a link directly to a thread/forum/post/etc. but if you weren't logged in when you went to the landing page you got the white screen.

After reading this thread, I converted the database to UTF8 and all is well again.

izotz

Quote from: lurkalot on June 26, 2020, 02:15:34 PMFunny enough we had exact same scenario over on the tinyportal.net [nofollow] site about 6 days ago.  So thought I'd throw it in here just in case.  ;)

You could view the site logged in, but as guest the site was giving a white screen.   The only thing I noticed was one of the recent posts contained Turkish language and was showing strange characters Dimond's etc in the topic title.  This caused the page to choke completely for some reason, just a white page, and only as guest.  I edited the Topic title and the page loaded normally. If I pasted the original title back in it choked with a white screen again. 

Our database wasn't properly converted to utf8, which it is now.    Everything back to normal.  Never seen this happen before.

This was exactly the behaviour in our website for many users. I was confused because it did work for many of us, so I thought it was browser related. But somebody spotted the offending post with special characters, edited it, and it works better now. So thanks for the tip!  :)

I understand that the next step is to have a look at the database. What do you mean that it was not "properly" converted utf8? How can I check this? I thought I had converted it a few years ago, but I can't be sure what I did. I can only see that the database string columns collation is utf8_general_ci . Is this ok?

What else should I do about this?

Advertisement: