XF 1.5 Force a specific style on unregistered users?

wcbryant

Active member
I've been searching around and have found talk about limiting access to style changes through conditionals, but I wonder if there's a way to force a given style on a single usergroup (without changing the default).

Essentially I want to show skin ads (and thus a fixed with design) to unregistered users, but don't want my registered folk to lose the default full width style options.

I'm probably overlooking something simple in my third day of upgrades, changes, and code -- so if someone can suggest an efficient way to accomplish this I would appreciate it.
 
The users want (and I want for them) the full-width "liquid" design (not fixed width), which is fine since I'm not going to subject then to the background/skin/takeover (in the sense that the background and ad spots are all coordinated for a single campaign; say EA's Madden) ads.

In order to run skin ads (again, for unregs only) my ad provider requires 1000px fixed width, awfully small.

So I need to be able to force the fixed style on the unregistered group, and allow everyone else to have my liquid style as default (along with its color change siblings as options).
 
Last edited:
You can set the default fixed width style with ads as the default and run a query to update the style ID for all members, changing from the default to the fluid style.
Or just let them select it themselves the next time they log in.
 
You can set the default fixed width style with ads as the default and run a query to update the style ID for all members, changing from the default to the fluid style.
Or just let them select it themselves the next time they log in.

Hey, Brogan -- thanks. I agree that may be the way I ultimately have to do it. My concern is that new registrants would need to manually change (unless I figured out a cronjob to do it once a day), and the goal is to be able to say that if one is registered they won't be subject to the fixed width layout and background ads.

Feels like there should be a way to tell the system "if usergroup == (whatever unregistered is) then style = X", but if it's not out there it's not out there.

As an aside, thanks for your Feb/15 conditional update that speaks to EXTRA.css, you saved me a lot of time and frustration last night when I had to make some changes in there relative to my ad responsiveness through iframes.
 
Unfortunately there's no way of automatically switching newly registered members to the non default style.

You could create a notice advising them to do so, or even with a new user conversation.

Other than that it would have to be a query, either periodically manually or automatically via a small code snippet/cron.
 
Thanks, Brogan.

A cron sounds like the best bet. As with any forum my users represent a broad spectrum of comfort and familiarity with even simple user settings.

Can anyone out there suggest what this query would look like? And it's likely to be a server side cronjob and not one of the simple scheduled tasks in XF, correct?
 
Hey there,

to make the most of our forums we´ve hooked up with a premium partner that wants to advertise with us, using wallpaper ads. Because we only show ads to unregistered users, we´ve sorted that out via conditionals - but a bigger problem is, that the space to the right is to small. To solve that we could primarly do one out of 2 options:
  1. making the forum more narrow in total, so the required space is gathered that way ( a no-go for readability and user experience) or
  2. shifting the forum to the left for the unregistered usergroup only (and as soon someone registers, so they´ld see the default centered fluid/fixed forum style).
So obviously, it´s the 2nd point which makes more sense. And this is where we got stunned. No default options for assigning styles to specific usergroups in the best forum software available? When my fellow admin told me that on the phone last week, first I´d laughed and answered he should stop making fun with me. But whoops.., he wasn´t. I´ve read the forums up and down (and I´m talking about every single xenforo-related one, I know of), searched for addons and code snippets but it seems there is absolutly nothing out there, that could help us out of that mist.

What has irritated me even more was, that this request to Kier & Mike has become rated with "Lack of interest", as this - unlike the very most custom styling issues - can´t be solved by usergroup conditionals. Am I going so wrong that this affects a whole bunch of forum owners, that this has become rejected for consideration to integrate into development?

I guess the most of us are coming from vBulletin and may be it´s not just me, who can´t remember fellow vb-forum owners not making use of the style per usergroup settings. Would really love to see, that this would be re-considered or someone could come up with an Addon as this option seems to be highly requested as a quick search shows. So, if anyone is having that code on his drives and is thinking about the price tag - role two dices and name it and you will hear a loud & friendly "Shut up and take my money" ;)
 
Top Bottom