Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Template Chooser?
Rating 5 V
alex1985
post Jun 10 2008, 04:48 AM
Post #1


Super Member
*********

Group: [HOSTED]
Posts: 411
Joined: 9-February 08
Member No.: 57,615



Hi, do you know any tutorials that is somehow is dedicated to creating kind of templates for your web-site?!

Let's say when a user goes to his or her profile there will a button which is called "Choose Template", for instance, after that the templates of your web-site stored on your server, will become active. This is the first point.

The second thing, how can I make the templates generally? With respect to font, alignments, buttons, other graphics or even hide some buttons or functions of the web-site?
Go to the top of the page
 
+Quote Post
kobra500
post Jun 10 2008, 05:30 PM
Post #2


Super Member
*********

Group: [HOSTED]
Posts: 395
Joined: 8-January 08
From: UK - Kent
Member No.: 55,950



Well I would assume the PHP include funtion has something to do with it which I suppose would change the look of the site whilst keeping the text the same. I don't know of any tutorials but you will probably find some here [HERE]
Go to the top of the page
 
+Quote Post
alex1985
post Jun 10 2008, 05:54 PM
Post #3


Super Member
*********

Group: [HOSTED]
Posts: 411
Joined: 9-February 08
Member No.: 57,615



Thanks, but not really useful!!! I need only the good and trusted tutorials that I can rely on them and follow to expand my knowledge of PHP language.
Go to the top of the page
 
+Quote Post
Live-Dimension
post Jun 10 2008, 11:26 PM
Post #4


Advanced Member
*******

Group: [HOSTED]
Posts: 115
Joined: 23-May 08
From: Australia
Member No.: 62,543



This is an interesting prospect, and I played with it for quite some time. In the end, I realised that most people won't stay long enough to change themes so it wouldn't matter so much.

There's a few ways to do it. I went and made a page, then put php include tags everywhere. For example,
CODE
<?php include ("pages/news.php"); ?>
<?php include ("pages/home.php"); ?>

These contained the raw data for the pages. Using variables in the url, I was able to change theme and page according to what the user wanted.
Go to the top of the page
 
+Quote Post
gogoily
post Jun 11 2008, 02:54 AM
Post #5


Advanced Member
*******

Group: Members
Posts: 100
Joined: 30-October 05
Member No.: 13,571



Well, lots of forum codes got this function, you can read their PHP codes to figure out.
Go to the top of the page
 
+Quote Post
alex1985
post Jun 11 2008, 11:59 AM
Post #6


Super Member
*********

Group: [HOSTED]
Posts: 411
Joined: 9-February 08
Member No.: 57,615



Its not really the right one!!! Any more replies?
Go to the top of the page
 
+Quote Post
rvalkass
post Jun 11 2008, 07:13 PM
Post #7


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,102
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



QUOTE(alex1985 @ Jun 10 2008, 05:48 AM) *
Hi, do you know any tutorials that is somehow is dedicated to creating kind of templates for your web-site?!


There are loads of ways to make a template for your site, depending on what sort of template you are looking for. You can go from a simple HTML/CSS page with PHP just used to add dynamic content, to a full-blown template engine, such as Smarty or the one included in the Zend Framework. Or, you can go for something between the two, sort of writing your own mini template engine specifically for your site. Until you know which you want to do, it is very hard to recommend tutorials.

QUOTE(alex1985 @ Jun 10 2008, 05:48 AM) *
Let's say when a user goes to his or her profile there will a button which is called "Choose Template", for instance, after that the templates of your web-site stored on your server, will become active. This is the first point.


Store in the database a list of themes, along with the information that allows you to load each one (the path to a CSS file for example). Then, along with your user data, store the user's preference for a theme. Then, in your template, look up what theme the user wants, and load the relevant files.

QUOTE(alex1985 @ Jun 10 2008, 05:48 AM) *
The second thing, how can I make the templates generally? With respect to font, alignments, buttons, other graphics or even hide some buttons or functions of the web-site?


Font, alignment, images and all page layout factors are controlled by CSS.
Hiding buttons and features would use PHP and some sort of permissions system to determine who has access to which parts of the site.
Go to the top of the page
 
+Quote Post
alex1985
post Jun 11 2008, 08:46 PM
Post #8


Super Member
*********

Group: [HOSTED]
Posts: 411
Joined: 9-February 08
Member No.: 57,615



Wait, many templates are actually based on CCS. Do you know anything about this issue?
Go to the top of the page
 
+Quote Post
alex1985
post Jun 16 2008, 03:39 PM
Post #9


Super Member
*********

Group: [HOSTED]
Posts: 411
Joined: 9-February 08
Member No.: 57,615



Any thoughts so far?