|
Joined: Apr 2002
Posts: 474
Enthusiast
|
Enthusiast
Joined: Apr 2002
Posts: 474 |
currently if I have a forum w/ custom style sheet the only ones who see it as intended are those who have their preferences set to showing default.
I would like to reverse this behavior if a forum has a custom style sheet then this should take precedence regardless to what the user has set in their profile.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Untested, but in the applicable scripts (postlist.php, showflat.php, showthreaded.php, newpost.php, newreply.php) look for the block of code similar to this: (it may not be exact in all scripts) <br />// -------------------------------------------------<br />// Here we need to figure out what stylesheet to use<br /> if (!$mystyle) { $mystyle = "usedefault"; }<br /> if ($mystyle == "usedefault") {<br /> $mystyle = $fstyle;<br /> if ($mystyle == "usedefault") {<br /> $mystyle = $theme['stylesheet'];<br /> }<br /> }<br />// fstyle will now be a global variable to use in send_header<br /> $fstyle = $mystyle;<br /> Above it, add this: $mystyle = $fstyle; And I *think* that'll do it. 
|
|
|
|
Joined: Apr 2002
Posts: 474
Enthusiast
|
Enthusiast
Joined: Apr 2002
Posts: 474 |
Thanks Josh that did the trick... I hadn't looked but this would be the same for 6.5?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Yes, that should be the same. 
|
|
|
|
Joined: Apr 2002
Posts: 474
Enthusiast
|
Enthusiast
Joined: Apr 2002
Posts: 474 |
maybe that didn't work so well...
Now users settings are ignored in forms that use the Default setting..
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Try instead adding this:
if ($fstyle != "usedefault") { $$mystyle = $fstyle; }
See if that does the trick.
|
|
|
|
Joined: Apr 2002
Posts: 474
Enthusiast
|
Enthusiast
Joined: Apr 2002
Posts: 474 |
Did you mean $mystyle = $fstyle;
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
Why not move all the styles but that one to a parent folder and then they cant choose another. Then use an sql command to reset everyone to the forum default.
|
|
|
|
Joined: Jun 2002
Posts: 38
User
|
User
Joined: Jun 2002
Posts: 38 |
If I delete all the other stylesheets... will that work?
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
well, that would make it so they cant choose another. but you would have to use the sql command to set everyone to default. otherwise they would have a white board with some text all over it  the sql command is here somewhere to set everyone to the default stylesheet.. Ill take a look for it..
|
|
|
|
Joined: Jun 2003
Posts: 1,025
Junior Member
|
Junior Member
Joined: Jun 2003
Posts: 1,025 |
UPDATE w3t_Users SET U_styleSheet = 'default'
Assumes that your table prefix is w3t. If its not, adjust accordingly.
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
Im going to have to commit the generic sql command to memory. Its basicaly the same you just have to know the actual name of the stuff you are tring to change,....
thanks slayer60
|
|
|
|
Joined: Jun 2002
Posts: 38
User
|
User
Joined: Jun 2002
Posts: 38 |
|
|
|
|
Joined: Jun 2003
Posts: 1,025
Junior Member
|
Junior Member
Joined: Jun 2003
Posts: 1,025 |
No problem, it was just lying around the MySQL forum, all I did was dust it off.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|