UBB.Dev
Posted By: Lane Beta-[6.4] StyleBar 1.0 - 03/04/2004 8:39 PM
Mod Name / Version: StyleBar 1.0

Description: This mod will add an easy access bar to your forums where users can choose a stylesheet and have it take effect instantly. Opposed to having to edit your profile everytime you need a new look!

Working Under: UBB.Threads 6.4

Mod Status: Beta

Any pre-requisites:

Author(s): Lane

Date: 03/04/04

Credits: Paul Sowden (http://www.alistapart.com/articles/alternate/)

Files Altered: editdisplay.php
ubbt.inc.php
editdisplay.tmpl
ubbt_header.tmpl
ubbt_registerednav.tmpl
ubbt_unregisterednav.tmpl

New Files: styleswitcher.js

Database Altered: None

Info/Instructions: Thanks to Allen for letting me use his test board for this. Make sure you back everything up.

Demo: HERE!! (it's right below the menubar)

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attached File
109353-StyleBar.zip  (35 downloads)
Posted By: ericgtr Re: Beta-[6.4] StyleBar 1.0 - 03/04/2004 8:40 PM
Very neat mod, Lane. Thanks
Posted By: Zackary Re: Beta-[6.4] StyleBar 1.0 - 03/05/2004 3:18 AM
Trippy! Does it get stored in the user's profile or will it default to the default when they come back?
Posted By: Lane Re: Beta-[6.4] StyleBar 1.0 - 03/05/2004 7:12 PM
[]Zackary said:
Trippy! Does it get stored in the user's profile or will it default to the default when they come back? [/]

Thanks.

It's stored in a cookie created through javascript, so it isn't really in the profile -- but it does remember the users style preferences. I could have made it update the field in the database, but the page would have to refresh to run the update code... and i kinda like the instant thing. The user can still choose their style preference in their profile area too if they wish.
Posted By: Zackary Re: Beta-[6.4] StyleBar 1.0 - 03/05/2004 8:04 PM
Very cool, and works for anon users as well. I think I might add this one. Thanks Lane.
Posted By: Ellen Re: Beta-[6.4] StyleBar 1.0 - 03/06/2004 3:55 AM
Sounds great, but the code that you said to replace in editdisplay.tmpl wasn't in my version.

I have modified my file to put in the CSS display preview modifification. However, the files you told me to find were in neither the original version nor the modified one after the CSS preview.

I would really like to use this one! Sounds great!
Posted By: JoshPet Re: Beta-[6.4] StyleBar 1.0 - 03/06/2004 2:40 PM
Very nice.
Posted By: Lane Re: Beta-[6.4] StyleBar 1.0 - 03/06/2004 6:22 PM
Thanks Josh.

Ellen, if you can't find the code you have to replace:

Code
Find:<br />$stylesheets<br /></select><br /><br /><br />Add Below:<br /><br /><input type="button" name="setskin" value="Use Selected" onclick="setSkin()" class="buttons" /><br />


That should do it.
Posted By: Pilgrim Re: Beta-[6.4] StyleBar 1.0 - 03/06/2004 8:25 PM
Lane,

This looks like it might be a great hack. I do have a question though. In the DEMO you linked to there are 5 alternatives. What happens if you have 15 or 20 stylesheets that you are currently offering? Do all of them then get displayed? And wouldn't this create a huge array of links in that new table row?

Jeff
Posted By: AllenAyres Re: Beta-[6.4] StyleBar 1.0 - 03/07/2004 7:04 PM
It would, tho you could make a bit cleaner way to choose, much like zeldman does here: http://www.zeldman.com - tho you'd have a lot less hair-pulling if you were to trim that number down to 4-5 - that number will satisify 95% of your users, approx. the same number you satisfy with 15+ stylesheets
Posted By: AllenAyres Re: Beta-[6.4] StyleBar 1.0 - 03/07/2004 7:05 PM
bah, zeldman doesn't do it right now.. it'll come back once he gets his re-design finished
Posted By: ericgtr Re: Beta-[6.4] StyleBar 1.0 - 03/07/2004 7:18 PM
What about a pulldown menu instead of links across the top?
Posted By: Pasqualist Re: Beta-[6.4] StyleBar 1.0 - 09/29/2004 6:30 PM
Awesome mod! Will it work for 6.5 ?
Posted By: Rutto Re: Beta-[6.4] StyleBar 1.0 - 10/10/2004 8:44 PM
Thank you Lane, I really love this mod and I have to update this post telling everybody that it works perfectly with 6.5 too !
© UBB.Developers