Log in

No account? Create an account

Previous Entry | Next Entry

PHP layouts

So I've learned to use PHP includes to make a separate layout for my site.

There's only one problem.

The layout then behaves like frames do, and the reason I stopped using frames was that thanks to Google, I had people coming to the site through the icons page, for example, and they would miss the menu altogether and the rest of my site would remain in obscurity, while the teenies stole my icons and my bandwidth to their heart's content.

Now it'll be even worse, because if someone walks in through one of the HTML files (thanks, Google), not only will they miss the menu, they'll miss all the formatting.

I figured out that I can have each HTML file redirect to the index, but you know how much of a pain in the ass that is?

So I've scrapped this idea. I'm used to editing all pages one by one when I need to change a layout anyway. It's no biggie. But, I do like the site design I created, so once I figure out what to do about Blogger, I'll be using a reverse include like I have now.

Thing with Blogger, I'm kind of becoming less private on here, so the blog is kind of superfluous at this point, so I'm not using it as often as I did. It was kind of an experiment anyway, which turned out how I wanted on some respects, and in others didn't quite. It's time for a change, but I still want a way to update the site without having to reupload all kinds of shit, yanno? More of a 'new updates' sort of thing like I had on pitas. I liked the XML thing too, but again, that's mostly superfluous, unless Yahoo's deleted my group already. I stopped using it. *lol*

That said, WordPress scares me with all its uploadedness and codedness and file stuff. And then I don't know if I can use that as an include on the main page instead of having it dominate all. Like I wouldn't want all those links on the side and the archives stuff.

On the other hand, I'm thinking of merging the J site with the ElvenWolf site (at least until I can afford a domain for it), just to be difficult. It all started with the wallpapers debacle. I don't know where to put them and I'd have to redo the Fandom menu to put them on that site. Well, I seem to be in a reductionist phase as I also deleted the rpg characters site, and the Elysium site. I'd delete Toronto if I didn't think I could still use it. My muses have for the most part gone on vacation but they could come back.

Anyway, for the time being I'll work on that layout (reversing it, for starters), then see about the blog stuff. I might be able to use an include with Blogger anyhow, and I know enough about the layouts there to be able to simplify it, I think.




( 16 comments — Leave a comment )
Jun. 21st, 2005 06:13 pm (UTC)
1. Rather than using php or *shudders* updating every page individually for you lay out, have you considered using cascading style sheets (css)? They can be a bit tricky, but the key is to think abstractly with what you are given. Check out www.csszengarden.com if you need convincing as to the coolness that is css. :)
2. Word Press by far is one of the easiest install's I've ever done. Just double check to make sure that your host has wp's requirements. If they don't and you aren't attached to your host, I suggest switchin' to something like dreamhost, who I really cannot pimp enough. ;)
3. Any q's just drop me a line. I should be in IRC tonight after 9pm cst. :)

Jun. 21st, 2005 06:33 pm (UTC)
I've used CSS, I just wanted to get the hang of this PHP stuff because of the includes. And I was curious about databases but I might just forget about that for the time being.
Jun. 21st, 2005 06:14 pm (UTC)
Hmm.. I'm not sure what you mean about the PHP acting like a frame. You should have one or two function files that are basically your layout information. Then, the actual content pages refer to these function files to generate the entire page with layout. Which... sort of sounds the same as a frame, except that PHP actually generates a full HTML file so there's no way to skip around your layout like you do in frames. If someone views the source for the page, it would look just like a complete html file including layout formatting.

Does that make any sort of sense? If not, I'll just shut up and go away. I'm battling a broken space bar and the fact that the universe is out to get me...
Jun. 21st, 2005 06:30 pm (UTC)
The tutorial I got makes the index page a php, then it calls on the html 'content' page to place it in the layout. But I still have the html page freestanding.

Like this: http://www.jfemmer.com/test/about.html That's the content.
And the layout is at: http://www.jfemmer.com/test/index.php?id=about
At least I think it's still there if I haven't fucked it up too much since last night.
See how you can pull up the plain page without the layout?
Jun. 21st, 2005 06:37 pm (UTC)
Erm. That's a weird and backwards way of doing PHP layouts...

If you have a look at http://whitetrash.diebin.net - the site is set up with one functions file to control layout. The functions file is: http://whitetrash.diebin.net/functions.php (and the browser actually won't let you read it - you can try right-click save). Each page has a php extension and so you can't pull the content seperate from the layout (http://whitetrash.diebin.net/inspiration.php)

I can help you if you want when I get home from work in about 3 hours. Do you have AIM? It's *really* easy* and I might even still have the tutorial my friend gave me.
Jun. 21st, 2005 06:44 pm (UTC)
Thanks, I knew that seemed like an odd way to do it. Certainly had me wondering what was so great about PHP if that was the way everyone did it. But it was the only tutorial I found on the subject (I lose at Google).

I'll check out those links in the meantime. I've got AIM, I'm ElvenVVolf. That's two V's instead of the W.
Jun. 21st, 2005 06:51 pm (UTC)
Heh, nevermind. It won't let me save the functions file.
Jun. 21st, 2005 07:05 pm (UTC)
Heh. That's kinda cool to know, actually... XD Because sometimes passwords and stuff are stored in there. LOL I'll be home in a couple hours.

Your layout is basically tables, right?
Jun. 21st, 2005 07:07 pm (UTC)
Er.. nm.. I see it's divs, but that's fine. Basically you need to split the layout into three sections: the header (all the code that comes before the actually page content), content, and the footer (all the code that goes after the content.
Jun. 21st, 2005 07:19 pm (UTC)
Okay. I'm kind of braindead at the moment. If you can help me later on, doesn't have to be right away, that'd be great.
Jun. 21st, 2005 07:42 pm (UTC)
LOL No problem. :)
Jun. 21st, 2005 06:32 pm (UTC)
Erp, nevermind, I did fuck up the index. But just imagine all the stuff in 'about.html' shows up instead of the frame. That's the way I had it last night. It showed up black background, white text, and all the links with the right colours and effects for the layout.

What I don't want is people going to the about.html page and missing the layout.
Jun. 21st, 2005 06:34 pm (UTC)
Apparently the tutorial I found had it bassackwards.
Jun. 22nd, 2005 03:56 am (UTC)
I'm sorry...I don't understand. The way I use PHP Includes, that doesn't happen....
Jun. 22nd, 2005 03:57 am (UTC)
Oh. Someone's already said that.
Jun. 22nd, 2005 12:49 pm (UTC)
Yeah, the tutorial I found was backwards or something.
( 16 comments — Leave a comment )

Latest Month

August 2014


Powered by LiveJournal.com
Designed by Tiffany Chow