PDA

View Full Version : changing your entire site's layout through one file



Weapon
July 22nd, 2001, 03:59
Is there some way I can change my sites entire layout through one file? eg. with ikonboard you can change you layout by going to board template which looks similar too

<html>
<head><title>Meow is freaky!!!</title></head>
<body>
sadghasgdasg
</body>
</html>

where sadghasgdasg is your content

but instead of changing just the site links colours and backgrounds, change the whole entire layout?

LastActionHero
July 22nd, 2001, 05:15
Yes that's possible.

You can use a standard php file as your template and dynamically include content in it. you just have to change the template and the whole thing changes.

Don't ask me how! I don't know how to code in PHP.

meow
July 22nd, 2001, 07:07
Hi! :)

What do you mean with layout? If it's only like text formatting, colors, sizes for boxes and such you can do it with Style Sheets.

gyrbo
July 22nd, 2001, 10:20
Some example code:


<html>
<head>
<title>BlabLA</title>
</head>
<body>
<table>
<tr>
<td>
Nav<br>
<a href="?">Main</a><br>
<a href="?help">Help</a><br>
</td><td>
<?php $inc="getenv("QUERY_STRING").php";
include($inc);
?>
</td></tr></table>
</body>
</html>

And you call pages like ?pagename
make sure you make a file named pagename.php in the same dir.

clearjade
July 22nd, 2001, 22:13
I used to use JavaScript, but now I use ASP which is ten times better. :) Doesn't really matter what language it's in. I think all the server languages support something to the effect of "include template.whatever". Whatever could be php, asp, cgi (?), etc.

niv
July 22nd, 2001, 22:25
ASP SUCKS!!! ;)

PHP is far better than ASP, most people will tell anyone. ASP is used in the business world because it is easier to find people that know Visual Basic over PHP or Perl. ASP loading times are slower if not equal to those of Perl

here, this is good enough:



<?php
if ($section && $topic) include ("$section/$topic.inc");
else if ($section && !$topic) include ("$section/index.inc");
else include ("main.inc");
?>


that should make it a bit more organized.
if index.php is in the /www directory and someone clicks on a link that says index.php?section=test&topic=test, it will require a file in the /www/test directory and the file test.inc will be included. if it is just index.php?section=test, it will take /www/test/index.inc. if neither of the variables are set or if $topic is the only set variable, it will take /www/main.inc

clearjade
July 22nd, 2001, 22:32
My server's owner said that PHP and CGI take up too much bandwidth. :P Besides it loads fast enough for me and it does the job.

niv
July 22nd, 2001, 22:37
the admin's lying (obviously :rolleyes: ). if you have the same layout with PHP and ASP, it will take up the exact same amount of bandwidth. in the ASP file, its length will be longer, compared to the same layout in PHP.

clearjade
July 22nd, 2001, 22:42
But my ASP file is just my header. Plain HTML.

clearjade
July 22nd, 2001, 22:44
Well I was reading over my first reply, and I think I may have led u to believe I meant something else. I meant that ASP was 10 times better than my previous JavaScript...not PHP. I have nothing against PHP. :)

niv
July 22nd, 2001, 22:48
Originally posted by clearjade
Well I was reading over my first reply, and I think I may have led u to believe I meant something else. I meant that ASP was 10 times better than my previous JavaScript...not PHP. I have nothing against PHP. :)

i know...i just hate Micro---- so much :mad::mad::mad:

clearjade
July 22nd, 2001, 22:57
Meh, everything that I use is Microsoft, my email, my server, my system, even my instant messenger. *shrug* It works, and until other platforms or whatever become more easy to handle by the likes of ppl like me, Microsoft will be successful. That's life. No one has time to use the other stuff. It takes too long to learn. And please don't take something out of what I just said and use it against me. Ppl on here have a habit of doing that lol. I'm just saying that windows and junk is popular and easy to use in a short amount of time.

Weapon
July 23rd, 2001, 01:40
*sigh* plz answer my question and not argue ...... :D :D j/k anyways can some one tell me how to do it in css?

meow
July 23rd, 2001, 05:03
If you are referring to what I said it's basically a matter if skipping all formatting attributes in HTML and use CSS in a separate style sheet instead. No <font face= color= size>, no bgcolor, align and so on. You did it with the link colors. The thing is you can have 1 Style Sheet that formats your whole site. If you want to or instance change the colors you do it in one place and it works throughout the whole site. Very simple example below. You have to read the book on this one I'm afraid. :D

------------------------------------
<html>
<head>
<title></title>

<STYLE type="text/css">
<!--

body { background: #EEEEEE }

.weeps { font-family: "Comic Sand MS"; color: #FF0000; background: transparent none }

.meow { margin-left: 10%; margin-right: 15%; text-indent: 5em; line-height: 0.9em; font-family: Verdana, sans-serif; font-size: 1.2em; font-weight: bold; font-style: italic; color: #3333FF; background: transparent none }

-->
</STYLE>
</head>

<body>

<p class="weeps">
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
</p>
<p class="meow">
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah </p>

</body>
</html>

Weapon
July 23rd, 2001, 05:07
know of a good site that teaches these kind of stuff? and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!

LastActionHero
July 23rd, 2001, 05:47
Originally posted by Weapon
know of a good site that teaches these kind of stuff? and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!

Sorry Weeps. :D

meow
July 23rd, 2001, 05:47
know of a good site that teaches these kind of stuff?
Not one that has it all. www.htmlhelp.com has a good CSS1 reference. Dl the one in .hlp format. Then there are lots of "easy introductions". I'll check my links.


and for the love of god stop calling me weep, weeps, weeper or other similar name!!! you are getting the whole forum to call me that, damn u meow!!!!!
Yeah. It's catchy. :)

Weapon
July 23rd, 2001, 05:53
Originally posted by lastactionhero


Sorry Weeps. :D
[kicks lastactionhero in the stomach] damn u, u too meow!!!!!:D

meow
July 23rd, 2001, 05:58
Such a brutal, brutal little darling you are, weeps! ;)

lucifer
July 23rd, 2001, 06:13
weeps is such a cute little name, makes you sound kind of cudd ly:)

LastActionHero
July 23rd, 2001, 06:19
Yeah!

Let's all petition Peo to change his nick to weeps from Weapon!.

meow
July 23rd, 2001, 06:24
I second that! I get all warm inside when I think on veiwing weeps' profile. :o

Weapon
July 23rd, 2001, 07:13
has all the board gone insane?:(

gyrbo
July 23rd, 2001, 07:45
Allready a long time ago!

Weapon
July 23rd, 2001, 07:49
not my fault if I get in trouble for spam by Peo, as u can see 7/8 of my replies are from u guys saying stupid stuff, so Peo if you are reading this...........it was meow's idea:D

meow
July 23rd, 2001, 07:52
HI! :)

lucifer
July 23rd, 2001, 08:09
Originally posted by Weapon
not my fault if I get in trouble for spam by Peothis thread is spam?

meow
July 23rd, 2001, 08:13
Spam Unsolicited e-mail sent in bulk to many different people

Wouldn't think so! weepon want's it alright! :D

lucifer
July 23rd, 2001, 08:19
Originally posted by meow
Spam Unsolicited e-mail sent in bulk to many different peoplereally :rolleyes: you are so clever pusscat :p

meow
July 23rd, 2001, 08:33
:rolleyes:
My point was:

weepon want's it

meow
July 23rd, 2001, 08:53
weeps - don't know, maybe these work or you.

http://www.w3.org/MarkUp/Guide/Style Read this first to get a hang if it.
http://www.richinstyle.com/ Maybe a good start (the CSS1 guide)
http://www.westciv.com/style_master/house/ More advanced guide

I'm out for ice cream. :p

And burn IntercoursePage! It can't handle this.