boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Visitor selecting template?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Template help
View previous topic :: View next topic  
Author Message
Alvin



Joined: 01 Jul 2002
Posts: 30

PostPosted: Tue Oct 15, 2002 7:44 am    Post subject: Visitor selecting template? Reply with quote

I've some diff HTML design, could I let my visitor choose which template to see?
It's diff html files, not CSS.
maybe like.. my index.php be

if cookie is 1 than
<? include 1st design>
elseif cookie is 2 than.... blah blah?

any help? Smile
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Wed Oct 16, 2002 4:41 am    Post subject: Reply with quote

I don't think so. Since the default template, index.php, is set in b2config.php, every other functions will "call" that template name. So unless you make some modifications to b2config.php file, I don't think that's possible.

I believe you could use if-else statements within the configuration file where index.php is set.

Michael P
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Wed Oct 16, 2002 5:19 am    Post subject: Reply with quote

Do a search for "theme". There have been a couple of threads discussing this subject.

michael e
Back to top
View user's profile Send private message Send e-mail
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Wed Oct 16, 2002 5:24 am    Post subject: Reply with quote

But then, the "theme" solution would use CSS and the same index.php file. What he/she is asking is if it's possible to use different files for each theme, I believe.


Michael P
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Wed Oct 16, 2002 6:02 am    Post subject: Reply with quote

I believe you could try the following . . .

Code:

// in b2config.php
$blogfilename = 'index.php';
$theme = '';

// in your templates

// set by links by users
if ( $theme == 'blah' ) {
    $blogfilename = 'index2.php';
}
else if ( $theme == 'blahblah' ) {
    $blogfilename = 'index3.php';
}


And then in your templates, you would provide links that set the value $theme.
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Alvin



Joined: 01 Jul 2002
Posts: 30

PostPosted: Thu Oct 17, 2002 3:39 am    Post subject: Reply with quote

but how do visitor remember the settings? cookies? like those of the css changer?
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Thu Oct 17, 2002 3:49 am    Post subject: Reply with quote

Good question. I suppose you could use cookies. Can't help you there, though. I'm a beginner myself. However, in both ASP and ColdFusion, there are built-in cookies function. I'm sure someone else could help with that.


Michael P
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
allusion



Joined: 16 Jun 2002
Posts: 73
Location: Houston

PostPosted: Thu Oct 17, 2002 4:49 am    Post subject: Reply with quote

http://www.php.net/setcookie
Back to top
View user's profile Send private message Visit poster's website AIM Address
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Thu Oct 17, 2002 5:32 pm    Post subject: Reply with quote

Hi,

I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/

Is this what you were talking about?

Sara
Back to top
View user's profile Send private message
Alvin



Joined: 01 Jul 2002
Posts: 30

PostPosted: Fri Oct 18, 2002 8:48 am    Post subject: Reply with quote

Gadget Girl wrote:
Hi,

I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/

Is this what you were talking about?

Sara


what is on ur site i believe is a css-styler? that switch the css only? i was thinking of switching the whole index.php Smile
Back to top
View user's profile Send private message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Fri Oct 18, 2002 3:41 pm    Post subject: Reply with quote

Alvin wrote:
Gadget Girl wrote:
Hi,

I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/

Is this what you were talking about?

Sara


what is on ur site i believe is a css-styler? that switch the css only? i was thinking of switching the whole index.php Smile
is possible, i changed my site colour without changing the css, but got some cookie problem
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Fri Oct 18, 2002 6:11 pm    Post subject: Reply with quote

You just want to change where everything is right? That's just done with cookies and style sheets. I have been busy this week, but hope to have it finished next week totally skinned. Is this what you mean? http://www.domesticat.net/skins/howto.php

Smile Sara
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Fri Oct 18, 2002 6:20 pm    Post subject: Reply with quote

I believe Alvin is asking a way to change "index.php" to something different so that he can use several files for different themes. In this case, the entire structure or layout would be changed. CSS has its limitation, and you are restricted to changing only placements, colors, fonts, etc., but by using different files, one can use entirely different layout as well as contents.


Michael P
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Fri Oct 18, 2002 7:43 pm    Post subject: Reply with quote

Hm, I don't know about that Michael, I guess I'm reading his post differently. I have different includes for different themes. Maybe he could clarify what he's looking for, that would be nice!
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1019
Location: Oregon

PostPosted: Fri Oct 18, 2002 7:54 pm    Post subject: Reply with quote

Oh, you are using different includes for each of your theme. Then, you must be using if-else statements, right? E.g., if theme is equal to 1, include blah.php, else include blahblah.php.


Michael P
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Template help All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group