|
|
![]() |
|
|
Skinning TutorialYou need to open Notepad FIVE times. Copy each block of text into each Notepad session, and save as noted. Save it all to the same folder. You should have the following:
SAVE AS "test.php", NO QUOTE MARKS <?php include ("home/public_html/skins/cookiecheck.php");?> // SEE NOTE BELOW OR ASK YOUR HOST <? include($headervar.$extension); ?> <? include($footervar.$extension); ?> SAVE AS "header.php", NO QUOTE MARKS <html> SAVE AS "footer.php", NO QUOTE MARKS </body> SAVE AS "cookiecheck.php", NO QUOTE MARKS <? $total_skins = 1; if (isset($_REQUEST['newskin'])) { $skin=$newskin; $headervar =
"/home/public_html/skins/$newskin/header"; ?> SAVE AS "main.php", NO QUOTE MARKS HI THERE KIDS. A NoteIf you own your own domain, open up FTP and trace the folders you have to go through to get to your public HTML folder. Here's the one I used when I was hosted at whenshewasbad.org: /home/alecia/public_html/x/skins Replace /home/public_html/skins/$newskin/header with your own address. NO TRAILING SLASH! UploadingLog into FTP and go to your main folder; if you're hosted, this should open automatically. If you're not hosted, you probably know how to get there.
Bust out your browser of choice and go to http://yourdomain.com/test.php. Everything looking fine and dandy? Excellent. If not, either your host doesn't support PHP and you should quit now, you reject, or you specified the wrong place for your cookiecheck.php. If it's the latter, you should get a 404 telling your where cookiecheck.php *should* be. Open test.php, change the link for cookiecheck.php, and reupload. Tada! You should see a plain page reading HI THERE KIDS. All that work for HI THERE KIDS. Yeah, I know. Skinning Your SiteMost tutorials stop before this. Thing is, unless you're really good with spatial intelligence or have experience in skinning, it's going to take a bit of trial and error before you get your site running. Open your current layout in Notepad. Make sure EVERYTHING in your site is defined by CSS. Everything. No font tags allowed. No tables, either, in most cases. And no <div style="blah blah">. EVERYTHING MUST BE IN YOUR CSS. Even if your site follows the same two-column layout every time, you must give each column an absolute location in CSS. Some sites can just leave tables in (see example below) but chances are you're using a two-column layout or something else entirely. P.S. everything must be in your CSS. Now, look at your coding. Where does your formatting end, and your content begin? Copy everything ABOVE your content into another Notepad session, including your CSS. Trust me, externally linked stylesheets are a headache here... Don't bother with them. Save this over your header.php. Remember to change your image locations (more on that later). Everything after your content should be saved to footer.php. Delete the header and footer sections from your layout when you have pasted them into other Notepad sessions. You should now be left with... Your content. Save this as main.php so you can test stuff out later. Now, we want to make a dynamic include for the blog. This way, we can target links to where the blog is. If this confuses you, type the words 'php dynamic inclusion' into google and you'll get more answers than you can shake a stick at. This replaces your iframe but NOT the div layer that the iframe was in. I hope you put your iframe in a div layer, anyway. If you want this to act like an iframe, give the div layer a fixed height and add a little something called overflow: auto; to your CSS. Again, change main.php to reflect the filename of your blog. <?php This is what you should have. Copy this into test.php. <?php include ("home/public_html/skins/cookiecheck.php");?> <? include($headervar.$extension); ?> <?php <? include($footervar.$extension); ?> Reupload everything again, including any images you may have (these go in /skins/1). Go to http://yourdomain.com/test.php again. Does it work? If not, make sure that you deleted all of your header and footer from your content, and that you defined everything in CSS, especially your blog's div layer if you were using an iframe before. If it's still not working, delete everything and start over again. Remember, when you make new content pages for a two-column layout, you can't save them so that they look like your test.php. They have to look like your blog file, because we're using dynamic inclusions. Important Note: Open your blog and remove the header and footer sections, just like you did with your 'content'. This way, your blog file will react to your different skins, and you can use your blog file as a guide for making new pages. Almost DoneRename your test.php to index.php. Upload it to your main folder, then open up another Notepad session. After this step, the whole world will be able to see your skinning attempts, so make sure your site works. DirectoryIndex index.php Save this as .htaccess and upload to your main folder. Now, go to your site, don't type in index.php, just the address of your site. Your skinned site will appear. Hurray! It's your old layout! Except now you can change looks on the fly and allow visitors to choose between layout. Rockin'. Adding SkinsWanna add a skin? Simple. Open up cookiecheck.php. $total_skins = 1; Change $total_skins to 2. Now, open FTP and go into /skins. See your /1 folder? Make another folder, call it 2. Go through the above process of skinning your site, but only make header and footer files. Upload the header and footer files to /2, along with all the images that the layout uses. Changing SkinsThis is easy. <a href="index.php?newskin=2">Skin #2</a></a> Linking Different Sections of Your SiteSo, you want things to open in the space that your blog is currently occupying, iframe stylee. <a href="index.php?id=about.php">about me!</a> Whatever you had saved in about.php will appear where your blog was. Make sure that your new file follows the same structure as your blog file did -- no header, no footer. ExtrasIf you want to change the navigation throughout each skin, then simply do your navigation in your header or footer files. Want to make a fancy "You've selected this skin" page? Open a content page (like the about.php file I mentioned), and change the text to "You've selected a new skin", even a redirect to the main page, and save it as skin.php, for example. Then, for your skin-change link, change index.php?newskin=number to skin.php?newskin=number. Submit your own skinning tips! kthxdi@hotmail.com. QUICK RECAPIn your main folder:
In /skins:
In /1:
Remember to update the links for your images. Instead of <img src="top.gif">, you'll have to put <img src="http://yourdomain.com/skins/1/top.gif">. Example - DeepILLUSION.netHEADER.PHP <html> <head> <style type="text/css"> a:link { color: #823D34; font-weight: bold; text-decoration: none } a:active { color: #823D34; font-weight: bold; text-decoration: none } a:visited { color: #823D34; font-weight: bold; text-decoration: none } a:hover { color: #823D34; font-weight: bold; text-decoration: underline } p, td, table, body, input, textarea { font-family: Verdana; font-size: 10pt; color: #000000; text-align: center } body { background-color: #000000; margin: 0px auto; text-align: center } .table_1 { border-style: 1px solid #000000; width: 300px; padding: 5px; margin: 0px auto} .table_2 { border-style: 1px solid #000000; width: 600px; padding: 5px; margin: 0px auto } .td_title { background-color: #823D34; color: #CCCCCC; font-weight: bold; text-align: center; padding: 5px } .td_body { background-color: #CCCCCC } li { color: #823D34 } .codes { width: 400px; margin:5px 0px 3px 30px; padding: 6px; background-color: #000000; border: 3px solid #823D34; } .codes2 { font-family: courier; font-size: 10pt; font-color: #823D34 } --> <title>DeepIllusion.net</title> <body> <img src="http://www.deepillusion.net/skins/1/newlaytop.jpg"> <!-- URL's used in the movie--> <br> MAIN.PHP <table class="table_1"> Link Me! </td> <img src="http://www.deepillusion.net/buttons/88x31.jpg"> </td> <br> <table class="table_2"> HTML Tutorials </td> <a href="http://www.deepillusion.net/hex.php">Hex Color
Table</a> <a href="javascript:history.back(-2)">Back</a> </td> FOOTER.PHP </body> CreditsI got my info from these pages. To be honest, I just needed a resource that covered everything-- for my own benefit--and that's why this tut exists. Some of them explain certain sections better than I do, so check them out. http://tutorials.fire-trap.net/
http://www.girl-syndrome.com/content/tutorials/php_skinning.php
http://wdt.silent-aurora.net/php03.php
|
|
|
|
|