View Full Version : Coding Help!!!!


dsf552
11-12-2006, 06:38 AM
I currently have a website set up: kimberleylocke.ueuo.com The way it was coded when I had it made, was that it wasnt coded so I could update the sidebar without having to update it on every page. It's a real pain having to do that too! I also want to have the pages open up on the news window, add cutenews to the front page. Can anyone please recode this for me, so that it will work right? I can send you everything that I recieved when I had the layout made.
Any help would be greatly appreciated.
Tyson

therealscottx
11-12-2006, 06:42 AM
http://suta-raito.com/SSI.shtml

That is a good tutorial on SSI. I use SSI and I love it.
I think that will help you.

Just read it and see if it does.

dsf552
11-12-2006, 06:57 AM
tried that.. doesn't work..

bourdelson
11-12-2006, 03:42 PM
PHP includes are what you're going to need if you want to have Cutenews in your front page.

There's a tutorial here: http://www.lissaexplains.com/html6.shtml#php

And if that doesn't help you can search the forums (http://www.lissaexplains.com/forum/search.php?searchid=429932) or check Google's results (http://www.google.com/search?hl=en&lr=&safe=off&q=php+includes+tutorial&btnG=Search). :)

dsf552
11-12-2006, 05:57 PM
that still doesnt help! im dumb when it comes to coding

bourdelson
11-12-2006, 06:08 PM
Well, just saying that it doesn't help isn't too helpful to the people who are trying to help. :)

What exactly don't you understand? What exactly do you need help with? :)

dsf552
11-12-2006, 07:36 PM
i basically need help with putting it into php includes, and also so it could be fixed so i dont have to edit every page just to change the sidebar.
tyson

bourdelson
11-12-2006, 08:36 PM
Okay, create a new, blank document. In that document, copy and paste the portions of your code that will show up on every page, starting with the beginning html, head, and body tags [and your stuff header and navigation bar, et cetera]. Save that as "header.php" or whatever you want to call it. Remember: this is not a complete HTML document, which is why it has the beginning tags in it.

Then, create another new, blank document, and in it put all of the stuff that will appear at the bottom of your page. Even if you don't have anything, you can just put the closing body and html tags [I usually do this, as it helps me remember to include them] and save it as "footer.php" or whatever you want to call it. Remember: this as well is not a complete HTML document, which is why it has the ending tags in it.

Then, open up yet another new, blank document. In that document, put this:

<?php include("your beginning file.php"); ?>

<?php include("your ending flie.php"); ?>

In between those include tags is where you'll copy all of the stuff that is specific to each page. For example, one of the pages for my site looks like this in the file I have saved:


<?php include("header.php"); ?>
<div class="body">
<span class="headline">links</span>
All of my links and stuff appear right here
</div>
<?php include("footer.php") ?>


After you've done that, you just save it as whatever.php, of course changing "whatever" to the name of the page. When you upload the pages and view them, they will be complete HTML documents. Like, if you check the source of your pages, you won't see the include tags, but you'll see the complete coding.

For Cutenews, your blog page will consist of three includes, and will end up looking something like this:


<?php include("header.php"); ?>
<div class="body">
<?php
$number = "#";
include("cutenews/show_news.php");
?>
</div>
<?php include("footer.php") ?>


Of course, changing # to the number of entries you want shown on your page.

Hopefully, that makes a little more sense. :)

dsf552
11-12-2006, 08:44 PM
oh gosh, im even more confused! Would you mind doing it for me, if I emailed you the stuff? I would give you credit on my site. Thanks
tyson

bourdelson
11-12-2006, 09:13 PM
To be honest, I don't have the time to do it all for you.

But, if you post the code for one of your pages, I can show you how to break it all up and how your stuff should look. :)

dsf552
11-12-2006, 10:03 PM
<!-- Layout & Coding by Natalie - www.elements-inc.net-->


<html>

<head>
<title>THE OFFICIAL FAN CLUB OF KIMBERLEY LOCKE</title>
<link href=style.css rel=stylesheet type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">

</script>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.Stil5 {font-size: 9}
.Stil6 {font-size: Kein}
-->
</style>
</head>
<body>
<table width="100%" cellpadding="2" cellspacing="0" id="Layer2" style="position:absolute; left:355px; top:308px; width:516px; z-index:2" name="Layer2">
<tr>
<td width="203" class="title_main"><strong><strong> IN THE NEWS</strong></strong></td>
</tr>
<tr>
<td class="content_main">bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
<p align="left"><a href="http://www.elements-inc.net" target="_blank">TEST LINK TEST LINK TEST LINK</a><br>
</p>
</td>
</tr>
</table>
<div id="Layer1" style="position:absolute; left:133px; top:0px; width:312px; height:244px; z-index:1"><img src="locke-official-layout-001.jpg" width="770" height="337" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="521,193,606,210" href="http://www.kimberleylocke.ueuo.com/kimberley.html">
<area shape="rect" coords="624,228,685,246" href="http://www.kimberleylocke.ueuo.com/store.html">
<area shape="rect" coords="479,178,527,196" href="http://www.kimberleylocke.ueuo.com/index.html">
<area shape="rect" coords="604,172,652,191" href="http://www.kimberleylocke.ueuo.com/blog.html">
<area shape="rect" coords="527,172,571,187" href="http://www.kimberleylocke.ueuo.com/tour.html">
<area shape="rect" coords="485,226,578,242" href="http://www.aimoo.com/forum/freeboard.cfm?id=515456&NoCaches=Yes">
<area shape="rect" coords="436,6,579,20" href="http://www.kimberleylocke.ueuo.com" target="_blank">
<area shape="rect" coords="492,209,532,224" href="http://www.kimberleylocke.ueuo.com/music.html">
<area shape="rect" coords="615,195,676,212" href="http://www.kimberleylocke.ueuo.com/contact.html">
<area shape="rect" coords="588,211,635,228" href="http://www.kimberleylocke.ueuo.com/media.html">
</map>
</div>
<table width="100%" cellpadding="2" cellspacing="0" style="position:absolute; left:163px; top:308px; width:190px; z-index:4">
<tr>
<td width="203" class="title_main"><strong><strong> SITE STATS</strong></strong></td>
</tr>
<tr>
<td class="content_main">
<b><IMG src="/arrow.gif" border=0> Owners: <a href="mailto:brianna@kimberleylocke.org?subject=Kimberle yLocke.Org">Brianna</a> & <a href="mailto:muffy@kimberleylocke.org?subject=KimberleyL ocke.Org">Muffy</a><br></b>
<b><IMG src="/arrow.gif" border=0> Webmaster: <a href="mailto:webmaster@kimberleylocke.org?subject=Kimber leyLocke.Org">Tyson</a></b><br>
<b><IMG src="/arrow.gif" border=0> Host: <a href="http://www.godaddy.com" target="Site Host">GoDaddy</a><br>
<b><IMG src="/arrow.gif" border=0> Opened: Nov. 21, 2006<br>
<b><IMG src="/arrow.gif" border=0> Layout: <a href="http://www.elements-inc.net" target="Elements Inc.">Elements Inc.</a><br>

dsf552
11-12-2006, 10:03 PM
<b><IMG src="/arrow.gif" border=0> Online: <!-- Start FastOnlineUsers.com -->
<script type="text/javascript" src="http://fastonlineusers.com/on3.php?d=www.kimberleylocke.ueuo.com"></script> </a>
<!-- End FastOnlineUsers.com --></b><br>
<b><IMG src="/arrow.gif" border=0> Hits: <!-- Start FastWebCounter.com -->
<a href="http://www.fastwebcounter.com" title="Hits Counter"><script src="http://fastwebcounter.com/secure.php?s=www.kimberleylocke.ueuo.com"></script></a>
<!-- End FastWebCounter.com --></b><br>
</tr>
<tr>
<td width="203" class="title_main"><strong><strong> UPCOMING APPEARANCES</strong></strong></td>
</tr>
<tr>
<td class="content_main">
<b>Downtown Disney Pleasure Island<br>
December 31, 2006<br>
Orlando, FL<br>
<A href="http://disneyworld.disney.go.com/wdw/parks/specialEvents?id=PleasureIslandNewYearsEveSpecialE ventPage">More Info</a><br></b>
</td>
</tr>
<tr>
<td width="203" class="title_main"><strong><strong> TOP AFFILIATES</strong></strong></td>
</tr>
<tr>
<td class="content_main">
<center><A href="http://www.kimberleylocke.ueuo.com/affiliates.html">APPLY NOW</a><br></b></center>
</p>
</td>
</tr>
<tr>
<td width="203" class="title_main"><strong><strong> DONATE</strong></strong></td>
</tr>
<tr>
<td class="content_main">
<center><img src="http://kimberleylocke.ueuo.com/images/donate1.jpg"><br>
<b>Have any info/media/photo that KL.Org is missing and want to share? Please send them <A href="mailto:webmaster@kimberleylocke.org">HERE</A>. Don't forget to include your name/email so we can credit you. Thanks!</b></CENTER>
</tr>
<tr>
<td width="203" class="title_main"><strong><strong> DISCLAIMER</strong></strong></td>
</tr>
<tr>
<td class="content_main">
<center><b>KimberleyLocke.Org is the Official Fan Club of Kimberley Locke. All media/images are copyright to their original owners. No copyright infringement is intended.<br></b>
<b><P align=center><FONT face=Arial><STRONG><A href="http://www.copyrightauthority.com/copyright-symbol">Copyright</A>&nbsp;&nbsp2006 The Official Fan Club of Kimberley Locke - All Rights Reserved</STRONG></FONT></P></b>
</td>
</tr>
</table>
<div id="Layer3" style="position:absolute; left:520px; top:35px; width:327px; height:108px; z-index:3">
<p>BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA </p>
<p>WELCOME MESSAGE HERE </p>
</div>
</body>
</html>

bourdelson
11-12-2006, 11:46 PM
Okay, your header.php file [or whatever you choose to name it] will consist of everything from

<html>

to

</table> [it's too long to post]

Your footer.php file [or whatever you choose to name it] will just be

</body>
</html>

When you set up your files, each page will look like this:

<?php include("your beginning file.php"); ?>
<div id="Layer3" style="position:absolute; left:520px; top:35px; width:327px; height:108px; z-index:3">
<p>BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA </p>
<p>WELCOME MESSAGE HERE </p>
</div>
<?php include("your ending flie.php"); ?>

With the stuff in the div layer obviously being different for each page.

Hopefully, this helps a bit more. :)

dsf552
11-13-2006, 01:08 AM
ill try that.. but where does the info go on the the other pages? and do i need to keep the welcome message in every page?
thanks

dsf552
11-13-2006, 02:15 AM
what you gave me didnt work :( can anyone else help recode it? i reallly really need help!!

bourdelson
11-13-2006, 03:24 PM
The info goes in between the div tags for every page. And no, you don't need to leave the welcome message, that's just what happened to be in the div layer that I copied and pasted.

The code should work-- it's very similar to the code that I use on my own pages, and mine work perfectly.

Edit: I tested out the exact code that I gave you, with all of the stuff in the includes, and it works: http://indulgealunatic.org/stuff/page.php

If you need them, here's what the header and footer look like [right-click and view source for each of them]:

http://indulgealunatic.org/stuff/header.php
http://indulgealunatic.org/stuff/footer.php

Another edit: Okay, I see where the problem is. I was thinking that the div layer was where you positioned your actual content. Now I see that it's in your table.

The only way I could think of doing it was to break it up like this. So, check out these pages, copy and paste them and save them all as their own includes. Each page would look something like this:


<?php include("newheader.php"); ?>
<td class="content_main">bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
<p align="left"><a href="http://www.elements-inc.net" target="_blank">TEST LINK TEST LINK TEST LINK</a><br>
</p>
</td>
<?php include("newfooter.php"); ?>


With you changing the stuff inside of the <td class="content_main"> to whatever suits the page.

The links for the header and footer are here:

http://indulgealunatic.org/stuff/newheader.php
http://indulgealunatic.org/stuff/newfooter.php

Just right-click and view source for the coding for each.

If you want to see my new, working test page, it's here: http://indulgealunatic.org/stuff/newpage.php

dsf552
11-13-2006, 06:08 PM
you are amazing!!! so cutenews should work now?
tyson

bourdelson
11-13-2006, 08:17 PM
Yes, Cutenews should work. The page for it [the way you code it in Notepad or whatever] should look like this:


<?php include("newheader.php"); ?>
<td class="content_main">
<?php
$number = "#";
include("cutenews/show_news.php");
?>
</td>
<?php include("newfooter.php"); ?>


It's pretty much all includes. So long as you have the content inside of those td tags, it should all work smoothly. :)