Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Page Background disappears with Forum
Avatar
Marcos Figueroa
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:05 pm

Hey @Scott,

I was having the same problem as you.  Using S2Member and Simple:Press caused my background to disappear when NOT logged in.  After login, everything displayed fine.

Here is the FIX!  (tried and verified - http://www.keepourforestopen.org/forum/ )

 

Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

then add:

<?php
add_filter ("ws_plugin__s2member_login_header_styles", "__return_false");
?>

 

That's it!

 

This will disable the CSS that S2Member applies to the login page (that loads in the header).  The side effect is that if you have a styled login (at /wp-login.php) it will revert to the standard WP login.

Since I've got S2M Pro, I just use the login widget on a page, so this doesn't bother me.

Cheers,

Marcos

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:26 pm

ah, so a greedy filter on the login... catching the login form that we have inline...

nice job figuring it out!

just to clarify, you could put that code into your wp theme functions.php or your sp theme functions.php...

and if you only want to do it on the forum page, you might try something like:

add_filter ('ws_plugin__s2member_login_header_styles', 'my_skip_login');
function my_skip_login($data) {
    if (sp_is_forumpage()) return false;
    return $data; 
}
Avatar
Marcos Figueroa
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:48 pm

I'm totally not an experienced user, but waded through tons of forum posts to extract that info (thought I'd share the result!)... whew!

 

@ Mr. Papa...do those files get over written if there is an update to the theme?  I thought the reason to put it in the must use plugins folder was to keep it from getting updated?  I'm learning here...

 

Also, I tried the code above and it did correct the background issue on the forum page and I did get the styled login, but it's missing the logo (better of the 2-rather no logo than wp logo).

Any idea how to get that back?

keepourforestopen.org (click Log Me In) and it fowards you to the login - since your credentials were wrong...so you can see what I mean.

Thanks so much!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:52 pm

which files? 

the wp theme could get overriden if it can be upgraded from within the wp admin...

if you do as we recommend and make your own sp theme from one of ours (http://codex.simple-press.com/.....g-a-theme/), then it will not get overwritten...

Since its really a sp driven change, I would probably put it there...  and actually, you might be able to put just the code you had in the sp theme functions.php since it wont be loaded on non forum pages anyways...

Avatar
Marcos Figueroa
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 10:08 pm

I will be making my own sp theme.

I removed the other code from s2-hacks.php

Then, I put your code in the "Default Theme's" spFunctions.php

 

I get the same results.  It does fix the background issue.  Forum page loads flawlessly.  However, it's still affecting the wordpress login page (@ http://keepourforestopen.org/w.....-login.php )

It should have a logo above the "login box" but it's now blank.

Any Ideas?

Thanks so much!

(PS - I have another issue concerning the login button in the forum - close to figuring it out but could use some help...Should I create a new topic?)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 11:24 pm

oh yeah, lol, meant to answer that too...

so I guessed at the arguments to the filter... is there really only one argument? I would need to see if there are more arguments for the ws_plugin__s2member_login_header_styles...  I just returned the passed in value... something might need to be done with it..

but cannot tell without seeing the code that applies the filter...

Avatar
Marcos Figueroa
Member
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2012 - 12:56 am

There are 5 instances where that phrase is found in the file /login-customizations.inc.php

/**/
 $a[] = '<style type="text/css">'; /* Open style tag, then give Filters a chance below. */
 $i = apply_filters("ws_plugin__s2member_login_header_styles_important", " !important", get_defined_vars());
 $a = apply_filters("ws_plugin__s2member_login_header_styles_array_after_open", $a, get_defined_vars());
 /**/

 

/**/
 $a = apply_filters("ws_plugin__s2member_login_header_styles_array_before_close", $a, get_defined_vars());
 $a[] = '</style>'; /* Now close style tag. There are other Filters below. */
 /**/

 

/**/
 $a = apply_filters("ws_plugin__s2member_login_header_styles_array", $a, get_defined_vars());
 $s .= "\n".implode("\n", $a)."\n\n"; /* Now put all array elements together. */
 /**/
 echo apply_filters("ws_plugin__s2member_login_header_styles", $s, get_defined_vars());
 /**/
 do_action("ws_plugin__s2member_after_login_header_styles", get_defined_vars());
 /**/

 

I hope this will help figure it out!  Thanks so much!  🙂

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2012 - 10:12 pm

so what do you have in the sp functions.php file?  exactly as in post #4?  and you removed the hacks file?

Avatar
Marcos Figueroa
Member
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2012 - 11:28 pm

I added this to my spFunctions.php

# remove S2Members login CSS from forum
add_filter ('ws_plugin__s2member_login_header_styles', 'my_skip_login');
function my_skip_login($data) {
 if (sp_is_forumpage()) return false;
 return $data; 
}

and yes, I removed all code from s2-hacks.php

 

Thank You!laugh

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 18, 2012 - 8:16 pm

well, there is only one line in your list that applies and that is the second from the end...

but a little confused as to what might be going on....  its actually passing two vars and we are only accepting one, but that should be fine...  if the 'IF' statement evaluates false, it should return the passed in value which should have no effect...

so what happens if you remove the entire IF statement and just let it return the original data?

if that is still wrong, then try commenting out the add_filter() line in my code and see what happens...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626