php forum
php mysql forum
php mysql smarty
 
Topic Options
#233071 - 01/13/03 12:43 AM User selectable templates
3DSHROOM_dup1 Offline
Journeyman

Registered: 04/17/02
Posts: 108
Loc: Texas

   User selectable templates to Del.icio.us Add to del.icio.us
  Digg User selectable templates Digg it
This would probably be quite a lot of work to create, but I would love to see users be able to select which template set they would like to use... i.e. the default ones, or Bookie's Blam templates. Any ideas, thoughts? <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
SacredShrooms.org

Top
#233072 - 01/13/03 09:31 AM Re: User selectable templates [Re: AleksejVL]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I'll put together the modification I had to do this and post it. It's not as indepth as it should be to make things easy to manage but it's a start. I know there's been a lot of input on how this needs to be handled and what to consider. <br /> <br />Should each template set have specific style sheets? <br />Should each template set have specific images/image directory? <br />Should each template set have specific includes? (headers/footers/javascript) <br /> <br />It's these to areas that make the templates more difficult to set up as user selectable. Well actually not so much that but the fact that there needs to be many changes to keep online management from the admin area working in them areas. <br /> <br />The key to switching templates is this variable: <br /> <br />$tempstyle = "default"; <br /> <br />This is located in your ubbt.inc.php file towards the top. <br /> <br /> <br />Some more thoughts... <br /> <br />The config.inc.php file sets the locations of the images and style sheets. <br />
Code:
 <br />  // Absolute Url containing the images <br />    $config['images']	=	"/images"; <br /> <br />  // Full URL to the images folder.  Necessary for users that want their email <br />  // in HTML format. <br />    $config['imageurl'] =	"http://www.somedomain.com/ubbthreads/images"; <br /> <br />  // Path to your images directory, needed for calculating image sizes <br />    $config['imagepath'] =	"/home/ubbthreads/images"; <br /> <br />  // Url to your stylesheets directory <br />    $config['styledir'] =       "http://www.somedomain.com/ubbthreads/stylesheets"; <br /> <br />  // Path to your stylesheets directory <br />    $config['stylepath'] =	"/home/ubbthreads/stylesheets"; <br />
<br /> <br />To make these template dependant we can tack the variable above onto the ends of specific configure variables as such: <br /> <br />$config['images'] .= "/$tempstyle"; <br />$config['imageurl'] .= "/$tempstyle"; <br />$config['imagepath'] .= "/$tempstyle"; <br />$config['styledir'] .= "/$tempstyle"; <br />$config['stylepath'] .= "/$tempstyle"; <br /> <br />Then create the related directories containing the stylesheets and images. <br /> <br />This would probably be best done during the authentication call or in send_header. Once again though this throws a wrench into the cogs as far as online editing goes. The editors would need to display a list of directorys from which to choose and then display a list of files to be edited. <br /> <br />The includes for header/footer/javascript can be manipulated in the send_header/send_footer functions by adding the $tempstyle directly. <br /> <br />Ok... done rambling... will add more when I think of it... <br /> <br /> <br />


Edited by JustDave (01/13/03 09:53 AM)
_________________________
~Dave
ChattersOnline.com

Top
#233073 - 01/13/03 11:02 AM Re: User selectable templates [Re: sjsaunders]
3DSHROOM_dup1 Offline
Journeyman

Registered: 04/17/02
Posts: 108
Loc: Texas
I'm not really worried about the admin side, being able to add new templates all the time, etc. I don't mind if it take a little work to setup...<br /><br />> Should each template set have specific style sheets?<br /><br />It would be nice, so that you could have different color styles without having one template for each color.<br /><br />> Should each template set have specific images/image directory?<br /><br />Yes, there is already a mod (http://www.threadsdev.com/threads/php/showflat.php?Cat=&Board=beta&Number=63767) for specific image directories for each stylesheet, and the directories are specified in the theme.inc.php in this format:<br /><br />
Code:
<br />$theme['imagedir'] = "stylesheet1:/imagedirectory, <br />			infopop:/Infopopimages";<br />
<br />You could use something similar.<br /><br />> Should each template set have specific includes? (headers/footers/javascript)<br /><br />That would be a good future improvement but I think for now it could use the default ones.<br /><br />Just put a warning on the mod that admin area editing of stylesheets, templates, etc could break things. I can't say I've ever used the admin area to edit the look of my site... It's all done in a text editor on my computer <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br /></opinions>
_________________________
SacredShrooms.org

Top
#233074 - 01/13/03 11:34 AM Re: User selectable templates [Re: AleksejVL]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
The stylesheets themselves don't need specific image directories since the images used in them are hard coded. The templates on the other hand may need specific images used in their layout. That's where these changes would be needed:<br /><br />$config['images'] .= "/$tempstyle"; <br />$config['imageurl'] .= "/$tempstyle"; <br />$config['imagepath'] .= "/$tempstyle";<br /><br />Just modifying these configure variables dynamicly will allow template specific images. This could be done with the stylesheets as well during the call to auth if you wanted stylesheet specific image directories.
_________________________
~Dave
ChattersOnline.com

Top
#233075 - 01/13/03 11:51 AM Re: User selectable templates [Re: AleksejVL]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
LoL it dawned on me where the stylesheet specific images would be handy. I was thinking of only the images used within the stylesheets. <img src="/forum/images/graemlins/crazy.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#233076 - 01/13/03 01:50 PM Re: User selectable templates [Re: AleksejVL]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
Hmmm... I currently have my site set up so that when a user changes their style sheet the graphics change, but the shape and style of the graphics are the same (just the color changes).<br /><br />I kinda see where what you are suggesting would be useful, but only if you are willing to settle for graphics that are created by someone else. After setting up seven different graphics sets for 10 style sheets I'm sure that I wouldn't want additional graphic sets per style sheet! <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#233077 - 01/13/03 03:00 PM Re: User selectable templates [Re: jacksonm99]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
LoL no doubt. Multiple templates would also need to work with any modifications to .threads that are added. There was some trouble here with that when I was trying them out. More templates = More work. LoL <img src="/forum/images/graemlins/crazy.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#233078 - 01/14/03 12:34 AM Re: User selectable templates [Re: sjsaunders]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
When I was setting up the table wrappers on my site I settled on a wrap around effect that was only 10 pixels "thick". My reasoning was that since every table was going to be wrapped in a graphic I didn't want the images to take up a lot of room. More pixels = more wasted space on the page per table. Right now I'm losing 20 pixels in every direction for each table that's being displayed.<br /><br />What I could see myself doing is setting up different graphic wrappers, but stick to the same thickness so I don't have to change any of the scripting in the tbopen and tbclose templates.<br /><br />Since path variables cannot be used in a CSS property I'd have to set up multiple style sheets that are exactly the same, with the exception of the graphic that's used for the table wrapper classes. So I could have "green day with graphic wrapper 1" and "green day with graphic wrapper 2" and so on.<br /><br />The other problem, and we've discussed this before, is the table layout of the tbopen and tbclose templates. I'm using a 3 x 3 grid, but like you said, someone might want a 3 x 5 table structure for there graphics. Even sticking to 3 x 3 causes problems: I don't have my graphics aligned like Bookie did for his template set. So even if I cropped his graphics down so that they fit in my 10 pixel thick table cells it still wouldn't display correctly.<br /><br />This may be one of those mods where all we can do is supply the basics and an example of how it's done...
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#233079 - 01/14/03 12:52 AM Re: User selectable templates [Re: jacksonm99]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
[]Since path variables cannot be used in a CSS property [/] <br /><br />You can create a php driven stylesheet and use the path variables in the stylesheet. Just rename .css to .php and insert small php snippets, where you need them.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#233080 - 01/14/03 01:52 AM Re: User selectable templates [Re: -Fusion-]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
What happens when you call that class from withing an html page? Is that technique CSS 2.0 compliant?
_________________________
Da LAN Tech

Threads Dev Moderator

Top
#233081 - 01/14/03 02:16 AM Re: User selectable templates [Re: jacksonm99]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
It should still validate as a file pulled in with a link. It should also work just as javascript does in a standard html page when created by php/cgi on the server from where it was pulled from.
_________________________
~Dave
ChattersOnline.com

Top
#233082 - 01/14/03 02:18 AM Re: User selectable templates [Re: jacksonm99]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
Sure, it's fully compilant as long as the css file (ending must be php!) is parsed before it's send to the client's browser.<br />Here<br />is an article about this topic. It shows the possiblities of the combination of php + css.<br />This would be a good why to apply several skins + stylesheets for them in ubb.threads, i think.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#233083 - 01/14/03 02:31 AM Re: User selectable templates [Re: -Fusion-]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Thanks for that link Astaran. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />I have been playing with the idea of creating a tool to allow users to generate and store their own personal stylesheet and wasn't quite sure how to server it up via php. I know it's a matter of setting the proper header but just hadn't never done it for css.
_________________________
~Dave
ChattersOnline.com

Top
#233084 - 01/14/03 03:17 AM Re: User selectable templates [Re: sjsaunders]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
The parsing into the css file should be easy, a user and newbie friendly GUI should be the harder part. <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />I'm not sure if i personal stylesheets are a good idea for unexperienced users. Most of them don't have any clue about "design" and probably a lot of them will send mails, cause they can't read anything... Black text on black background, you know... ;-)<br /><br />I implemented such a functionality into an cms, but even the customers/site owners werent't talented enough to use it probably. Personal stylesheets can mess up the corporate identity of the site/forum very easily, so many companies/bigger sites don't want to give the desing into the hands of their visitor.<br /><br />On the other hand, it would be a nice add-on for geeks. Maybe your generator can even be ported into the admin-area, since the editing features of the stylesheets aren't very comfortable at the moment.
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#233085 - 01/14/03 03:21 AM Re: User selectable templates [Re: -Fusion-]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I figured that since they are the only ones to see their design it wouldn't matter to anyone else. There will be a GUI preview of the various pages of .threads so they can see when they are making a big mistake.. LoL<br /><br />The only thing I can see is that if the site is using multiple templates/images/table wrappers that a user customizable stylesheet probably wont be of any use.
_________________________
~Dave
ChattersOnline.com

Top
#233086 - 01/14/03 05:10 AM Re: User selectable templates [Re: sjsaunders]
Astaran Offline
Addict

Registered: 12/21/00
Posts: 1545
Loc: Germany
[]The only thing I can see is that if the site is using multiple templates/images/table wrappers that a user customizable stylesheet probably wont be of any use.[/]<br /><br />You're probably right. I think most users will choose a style/template when the sign up and stick to it. They don't like big chances and want to have the interface, they are used to.<br /><br />It makes sence to me, to provide different template sets for unexperienced and advanced users. Some are minimalistic, others want to have 300 graemlins and 200 font colors right under the textbox. <br /><br />In my mind, it would be a bit too much, to provide them the ability to create their own stylesheets for each template set. I'm sure, some of them would like it, but the majority wouldn't even use it. On our boards, over 90% percent use de default style.<br /><br />In my opinion, maintaining all the templates/images/wrappers and styles makes (I prefer to call them template sets, since this covers all four aspects) .threads updates much more time intensive on the admin side.<br /><br />Ok, i think i'm getting a bit offtopic know, so i'd better stop. <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />I'd like to the that one in the admin panel, GUI preview sounds really nice. <img src="/forum/images/graemlins/smile.gif" alt="" /> But i don't think i would integrate it as an user option. That's my personal opinion, of course. <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Running a community? -> Keep informed and take it to the next level

Top
#233087 - 01/14/03 05:17 AM Re: User selectable templates [Re: -Fusion-]
Dalantech Offline
Junior Member

Registered: 02/11/01
Posts: 2392
Loc: Naples, Italy
Thanks for the info! <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Da LAN Tech

Threads Dev Moderator

Top


Top Posters Last 30 Days
AllenAyres 12
Gizmo 10
S7ARBVCK 2
Cambridge 1
Murphdog 1
MattUK 1
Kevin H 1
Who's Online
0 Registered (), 29 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
BeyondCompare v3.00
by blaaskaak
Yesterday at 02:46 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
[7.3.x] ubb.links
by AllenAyres
08/26/08 09:57 AM
New Mods
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks