Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
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.

Sponsored Links
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)


Code
<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
Offline
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
Offline
Joined: Apr 2002
Posts: 474
maybe that didn't work so well...

Now users settings are ignored in forms that use the Default setting..

Sponsored Links
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
Offline
Joined: Apr 2002
Posts: 474
Did you mean $mystyle = $fstyle;

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
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
Offline
Joined: Jun 2002
Posts: 38
If I delete all the other stylesheets... will that work?

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
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..

Sponsored Links
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
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
Offline
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
Offline
Joined: Jun 2002
Posts: 38
Thanks!

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
No problem, it was just lying around the MySQL forum, all I did was dust it off.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)