Jump to content


Photo

Making a PHP forum and I'm not sure how to make the template?


  • Please log in to reply
8 replies to this topic

#1 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 20 August 2006 - 04:14 AM

I want to make templates for this forum but not sure how to do it. I was thinking like this...

CSS will define most of it. It will dictate the text size, color, font, ect, ect. Thats a no brainier...

Then, my problem is the PHP. I was thinking a PHP file that would contain a variety of links... For example. I could have the default theme have a photo of a space ship, whilst another theme may have a photo of a monkey. Then I could call up this file and withdraw the links for that template. Each template would be in its own file and then I could use PHP to automatic detect which theme they selected from cookies (which would be confirmed by the database to make sure the cookie is still there once they are logged in).

This is just my thoughts... I don't believe this is the best way, maybe a way, but not the best way, and even then, this may not be possible...

So my question? What do you recommend for making themes. I'm leaning to PHP mainly, after all, it is a PHP forum...

(Edit):
Maybe I typed it badly, let me clarify. I'm not looking for suggestions on what features to incorporate into the forum. Nor am I asking what your favorite forum themes are....

I just want to know a good way, using PHP, XHTML, and CSS, to create a system for themes. For instance, I know PHPBB uses .tpl and .cfg files. Both of which I never herd of.

So, I just want to know a good way, using PHP, XHTML, and CSS, to create a system for themes?

I hope this makes things more clear.
(/Edit)

Thanks!
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#2 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 21 August 2006 - 03:18 AM

So no ideas?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 21 August 2006 - 09:21 AM

There are a million and one ways to do something - the fact you used the words 'could do' speaks volumes.

If you are going to create a forum - make one that you would love to use - find the thing(s) you don't like about another forum and change it to you liking....
follow me on twitter @PHPsycho

#4 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 21 August 2006 - 02:35 PM

Maybe I typed it badly, but you miss understood. I'm not looking for suggestions on what features to incorporate into the forum. Nor am I asking what your favorite forum themes are....

I just want to know a good way, using PHP, XHTML, and CSS, to create a system for themes. For instance, I know PHPBB uses .tpl and .cfg files. Both of which I never herd of.

So, I just want to know a good way, using PHP, XHTML, and CSS, to create a system for themes?

I hope this makes things more clear.

Is there is a PHP method of using files in a subfolder to change the look of the forum on change?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#5 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 21 August 2006 - 04:06 PM

without reading all that the only thing I will say is that I personally oudl simply skin teh site using css....

Have just one script that generates the html and several themes that simply a set of css files to control the design.  You can then just let the users slect which theme the want to use as default, set it as a session var and use it in the <link rel tag to pic the correct css file.
follow me on twitter @PHPsycho

#6 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 21 August 2006 - 04:42 PM

Hmm.... I might be able to do it all with just CSS....

Thanks
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#7 robos99

robos99
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 21 August 2006 - 08:41 PM

Without reading all of what you posted, you could still use a template based setup to "skin" the forums. Simply use a placeholder in your HTML template for where the CSS should go, i.e. %css%, and then use strreplace to replace the placeholder with your actual style sheet stored in the DB (or from a file). This would be the easiest way to do any type of templating system. Using php variables within templates gets rather complicated.

Using this method you can let your users select from an assortment of themes, and just have the theme stored within their record in the user table. Have a themeid number correspond to the actual table row where the css is stored, don't store the css directly in the user table.

#8 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 21 August 2006 - 09:52 PM

Without reading all of what you posted, you could still use a template based setup to "skin" the forums. Simply use a placeholder in your HTML template for where the CSS should go, i.e. %css%, and then use strreplace to replace the placeholder with your actual style sheet stored in the DB (or from a file). This would be the easiest way to do any type of templating system. Using php variables within templates gets rather complicated.

Using this method you can let your users select from an assortment of themes, and just have the theme stored within their record in the user table. Have a themeid number correspond to the actual table row where the css is stored, don't store the css directly in the user table.


Hmm.... This interests me, Could you explain this a little more?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#9 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 21 August 2006 - 11:03 PM

its exactly what i said but in 2000 words.... ;)
follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users