Previous Thread
Next Thread
Print Thread
Rate Thread
#218240 06/08/2002 9:30 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
I run a TEST user.
I havn't used that one for ages.
In the meantime the stylesheets got renamed.

Today I logged in with the test user.
ANd got a 404 error with NEtscape: - stylesheet not found.
(IE displayed a page: without any stylesheet, but at
least without that stupid 404).

I checked: for the TEST user the name of the stylesheet set was outdated. But instead of a 404 error i would prefer that the default stylesheet would be displayed if the chosen one is not found.

I think that shoud be easy to fix?

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I been down this road before...

In your ubbt.inc.php script find this:

code:

if (!$fstyle) {
$fstyle = $user['U_StyleSheet'];
if ( (!$fstyle) || ($fstyle == "usedefault") ) {
$fstyle = $theme['stylesheet'];
}
}



and change it to this:

code:

if (!$fstyle) {
$fstyle = $user['U_StyleSheet'];
if ( (!$fstyle) || ($fstyle == "usedefault") ) {
$fstyle = $theme['stylesheet'];
}
}
if (!file_exists("{$config['stylepath']}/$fstyle.css")) {
$fstyle = $theme['stylesheet'];
}



That should do the trick.

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Cool! Thanks!

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
I'm going to move this thread into the Modifications Suggestions. Not sure about adding this fix into the main distro just because for every page generated it would need to do a file check. Probably eventually need some type of admin tool to verify everyone's stylesheet settings after a stylesheet has been removed/renamed, so it updates all outdated ones.


UBB.threads Developer
Sally #218244 06/08/2002 12:11 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I was hesitant for the same reasons, being every page needing a file check (one more disk access).

Rick, perhaps a check during login? When a user logs in and their settings are being applied have a check and if the stylesheet isn't there have it set to default in the database.


Edit Note: On second thought, better off as an admin tool. Large sites will not want that many file checks running when users are logging in and out. Much better off as an admin tool when updating stylesheets.

Last edited by JustDave; 06/08/2002 12:20 PM.
Sponsored Links

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,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
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-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)