Support Forum

Page Background disappears with Forum

26 Answers

New Answer

MP Mr Papa
Mr Papa
Member

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…

MF Marcos Figueroa
Marcos Figueroa
Member

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)."nn"; /* 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!  🙂

MP Mr Papa
Mr Papa
Member

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

MF Marcos Figueroa
Marcos Figueroa
Member

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

MP Mr Papa
Mr Papa
Member

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…

MF Marcos Figueroa
Marcos Figueroa
Member

Okay,  if I remove the entire IF statement the page background disappears again on the forum and the the logo on the login page is still blank…

…trying next instruction…

 

Actually, both give the exact same result… page background disappears and logo on login disappears.

MP Mr Papa
Mr Papa
Member

so confused…  what did you have working??  either of those should be the same…

MF Marcos Figueroa
Marcos Figueroa
Member

Ummm… working….

Well, the original “problem” was the lack of a background on the forum page when not logged in.  Both my code and your code fixes that.

Side effects:

My code:  strips all styling (from S2Member) from a styled login (at /wp-login.php), reverting it back to the wordpress style and logo…. 

Your code: only removes my logo from that login… leaving the other styling in place… (wider fields and minimal styling)

 

At the very least…Your code offers the best of the 2.  Since I want a “white label” setup.  I’d rather no logo than the wordpress one.  🙂

 

However, I’d rather it all work.  I just wish I knew enough about php…   I’m learning though…one hiccup at a time!!  haha!

 

Thanks for all your help!

MP Mr Papa
Mr Papa
Member

thats where I am confused…

with nothing, you get the wp login page correct, but background on sp pages messed up… correct?

with just your code in hacks, you get wp login page looking like wp and sp pages looking right…  correct?

with my code:

add_filter (‘ws_plugin__s2member_login_header_styles’, ‘my_skip_login’);
function my_skip_login($data) {
    if (sp_is_forumpage()) return false;
    return $data;
}

you get sp page right, but the login page is not right…  missing logo…  correct?

but I dont understand why if you comment out the ‘IF’ statement or comment out the add_filter, it doesnt display as if you had done nothing…   doing either really is same as doing nothing… ie wp login correct but sp pages missing logo…

MF Marcos Figueroa
Marcos Figueroa
Member

OK…  I’ve got S2Member setup to “theme” my login page.  Slight adjustments to the width of the box and my custom logo.

WITH NO CODE CHANGES

My “themed” login shows correctly and there is NO background on forum page WHEN NOT LOGGED IN.  After logging in… it shows the background fine.

 

WITH MY CODE EDITS – s2-hacks.php

My “themed” login is REMOVED (showing WP login).  The background works correctly on forum page.

 

WITH YOUR CODE EDITS – spFunctions.php

My “themed” login shows w/o logo at all (so no WP login-yea!).  The background works correctly on forum page.

 

# 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; 
}

 

THIS CODE – spFunctions.php

My “themed” login shows w/o logo at all (so no WP login-yea!).  there is NO background on forum page WHEN NOT LOGGED IN.

 

# 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; 
}

 

THIS CODE – spFunctions.php – SAME RESULT

My “themed” login shows w/o logo at all (so no WP login-yea!).  there is NO background on forum page WHEN NOT LOGGED IN.

——–

Okay, weird… that got me thinking…  I commented out everything and my logo still doesn’t show on the login page…  looking at several other things…  will get back at you.

MF Marcos Figueroa
Marcos Figueroa
Member

embarassed  OH…MY…GOSH!!

I’m so embarrassed!  Your code works great!

Somehow, I must have deleted the logo image that S2Member was looking for to theme my login.  It all just happened at the same time and I didn’t catch it…  I’m so sorry.

—-

Oh, yea…I remember…I did delete the old logo file and uploaded a new one that was “crisper and clearer” and didn’t change S2Member to look for the new file.

 

Wow, I’m so sorry for the rabbit trail!

 THANK YOU!  THANK YOU!  THANK YOU!  For All your help!! 

 

(got this figured out just in time for my next “issue”!)  -please don’t run from me…. laugh

MP Mr Papa
Mr Papa
Member

well good!  that makes me feel better and not confused! ;)

no worries – all been there and done that…